cancel
Showing results for 
Search instead for 
Did you mean: 

uart0 example

ongth60
Associate II
Posted on June 07, 2005 at 11:24

uart0 example

9 REPLIES 9
ongth60
Associate II
Posted on June 02, 2005 at 07:56

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6Xf&d=%2Fa%2F0X0000000bqF%2FZGV_ciO95N4jBwH_4CGPA2AufwZt_isVMY06ED06h9s&asPdf=false
yu-jun
Associate II
Posted on June 03, 2005 at 00:28

I think that you should disable the UART0''s recieve ( UART_RxConfig(UART0, DISABLE); ) before you send data using UART0, after sending data you enabel recieve.

Try it.

weigelt
Associate II
Posted on June 03, 2005 at 05:42

Hello Ongth,

First thing, the following line in your posted code is wrong for 115k:

UART_Config(UART0,9600,UART_NO_PARITY,UART_1_StopBits,UARTM_8D);

I guess that´s just a mistake while posting.

The other thing is, which hardware do you use? The STR710-EVAL or own design? On the STR710-EVAL the main oscillator is 16MHz, so you can´t generate a baudrate of 115k without an frequency error of about 15% or something, so the UART of the ARM won´t regognize any start- or stop bits. Try using 14.7456MHz instead as main oscillator. Thereofre have to change the following line in rccu.h then:

#define RCCU_Main_Osc 16000000

to

#define RCCU_Main_Osc 14745600

Regards,

Marcus

hichem2
Associate II
Posted on June 03, 2005 at 06:27

Hi all,

Thank to all for yours investigation,

ongth60,

You have just to change the following line in your posted code UART_Config(UART0,115200,UART_NO_PARITY,UART_1_StopBits,UARTM_8D);

And ensure that you Configure the UART0 as following:

- Baudrate = 115200Bps

- No parity

- 8 data bits

- 1 stop bit

- No flow control

And your program will work perfectly on the demo board using an external 16MHz oscillator.

I hope that this can help you

With best regards,

Hich :p

ongth60
Associate II
Posted on June 06, 2005 at 07:09

Hi,

Thanks all for trying. Actually the above program can be used for 9600bps as well as 115200bps by changing the baudrate in the following function:

(UART0,115200,UART_NO_PARITY,UART_1_StopBits,UARTM_8D);

or

(UART0,9600,UART_NO_PARITY,UART_1_StopBits,UARTM_8D);

The problem that I'm facing is that I can transmit my ''Hello World'' in the hyperterminal but I cant echo back the characters that I typed in the hyperterminal. From the program, it is suppose to interrupt at UART0 interrupt routine, read the characters typed and transmit the characters to the hyperterminal.

Also, I can detect the ascii character signals typed in the hyperterminal at the RS-232 chip.

So, I would like all to verify if the program can receive the characters type at the hyperterminal to the CPU and CPU transmit them back to the hyperterminal. Then, I will be able to know if the eval board is working or not. Thanks for all the advice.

Rgrds.

hichem2
Associate II
Posted on June 06, 2005 at 08:25

Hi ongth60,

I try the example and it work perfecly on my eval board (MB393)

I can send you a complete project files if you need it.

Best regards,

Hich :p :-]

ongth60
Associate II
Posted on June 07, 2005 at 10:34

Pls send me the complete project for 115200bps. I will surely need it. Thanks.

Rgrds.

hichem2
Associate II
Posted on June 07, 2005 at 11:20

Hi ongth60,

Attached you find the asked project,

I hope that this can help you.

with best regards,

Hich 😉

________________

Attachments :

STR71xUART0.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1Ie&d=%2Fa%2F0X0000000bm4%2F7Zbpg78KB0soM46rLWoqcS.NPvRxuS2rtx8YnqQekVM&asPdf=false
hichem2
Associate II
Posted on June 07, 2005 at 11:24

Hi,

the previous project is performed on MB393 demo board.

Cheers,

Hich :o