cancel
Showing results for 
Search instead for 
Did you mean: 

SCI Communication Problems.

a00178074
Associate II
Posted on August 18, 2005 at 04:21

SCI Communication Problems.

9 REPLIES 9
a00178074
Associate II
Posted on July 22, 2005 at 04:25

Hello!http://mcu.st.com/mcu/modules/Splatt_Forums/images/subject/splatt_blue/icon55.gif

I want to get communication from my PC to de ST72324. I got the software from AN969 and i'am using the hyperterminal of windows. I transmit 4 bytes (ABCD for example) but I receive from the microcontroller something diferent (xxxx) I don't know what is happen. Do I need to use another configuration in the hyperterminal or in the MCU?. Please, help me if someone know what is happening. Thaks a lot. :D

luter
Associate II
Posted on July 22, 2005 at 05:36

probably your mcu and hp have different baudrates. recalculate baudrate taking into account mcu freq, and don#t forget about divider by 2 for mcu freq. don#t believe to st7 lib documentation, it is valid only for a certain mcu freq.

wolfgang2399
Associate II
Posted on July 22, 2005 at 07:08

Hi SSAM,

if you are using standard configuration of the hyperterm (9600baud, 8bits, no parity, 1stopbit) and you select the same with the µC I can't recognize any reason for your problem.

However for a better diagnostic let us know the values of your SCI-registers:

- SCICR1 (Control Register 1)

- SCIBRR (Baud Rate Register) - I suppose you will leave the Extended Receive/Transmit Prescaler Division Registers at 00 -

And what is your CPU frequency.

Please check if you are setting the baudrate before enabling the transmitter/receiver because of the notice on page 91:

Caution: The baud rate register (SCIBRR) MUST

 

NOT be written to (changed or refreshed) while the

 

transmitter or the receiver is enabled.

Regards

WoRo

wolfgang2399
Associate II
Posted on July 22, 2005 at 07:31

- correction -

Sorry I took the wrong datasheet. With the ST72324 please refer to the note on page 96:

Note: the baud rate registers MUST NOT be

 

changed while the transmitter or the receiver is enabled.
a00178074
Associate II
Posted on July 22, 2005 at 13:15

Hi!

Thaks for your worthy help.

In the registers i have the next:

SCIBRR=$D2, 9600 bps

SCICR1=$00, 8 data bits

SCICR2 =$04 for RX and $08 for TX

SCIERPR=00, DEFAULT VALUE

SCIETPR=00, DEFAULT TOO

Hyper Terminal COM1 PROPERTIES

9600 bps, 8 data bits, none paryty, 1 stop bit, Flow control none

Emulation = auto detect

8 MHz Crystal.

Regard.

SSAM

a00178074
Associate II
Posted on July 22, 2005 at 14:09

I'm sorry, is the first time using the ST MCUs. Acccording to the Luter message and of the ST72324 DS pg.23 i understand that if on OSC1 and OSC2 I have a 8 MHz Cryztal this 8 Mhz are converted to 4MHz if the PLL is disabled, then my fcpu is 4 Mhz?

Then to have a fcpu=8Mz I need a 4MHz source and enable de PLL o recalculate for the 4MHz that actually i have?.

luter
Associate II
Posted on August 01, 2005 at 05:27

Hello. I am using st7mc mcu. it differs from your mcu. but my suggestion to you: read carefully about multypl and dividers. and one more thing. if you can#t calculete yours Fcpu, try different baudrates of hyperterminal with your mcu configuration. and u will see when u get a right message, then u will get baudrate of your mcu and using baudrate calculate Fcpu.

Good luck

jatin
Associate II
Posted on August 09, 2005 at 06:23

Your register setting for 9600 Baud is correct with fcpu = 8MHz. So make sure your fcpu is 8Mhz. You can see it on MCO pin by enabling it first in the MCCSR register. If its Ok (8 Mhz) then check for your connections.

a00178074
Associate II
Posted on August 18, 2005 at 04:21

Hi

Thanks for your help. I was using a 8Mhz crystal but I forgot the divider by two inside the MCU. I had to calculate again the parameters TR and RR for the 4MHz frecuency. Now the

communication is working well.

I'm glad with you.