cancel
Showing results for 
Search instead for 
Did you mean: 

Problem on my USART

fabricepeden
Associate II
Posted on April 19, 2013 at 10:13

Hi everybody,

I got a strange problem on my USART3 of my STM32F205VE.

The UART is working perfectly up to 19200 bauds. With a terminal, I can see my sentences, with the oscilloscope my bit period is OK.

I would like to work @ 115200 bauds, and when I did it, I receive wrong characters on my terminal, and with my oscilloscope, the frequency is not exactly the good one (I measure 113600 bauds).

So have you already notice this drift, and if yes, have you an easy solution ?

Thank you in advance,

#uart-115200-stm32
6 REPLIES 6
fabricepeden
Associate II
Posted on April 19, 2013 at 10:30

Just to complete my previous post, I have also measured my crystal with the oscilloscope, and it is @ 25Mhz, no problem on this point.

Posted on April 19, 2013 at 13:00

What is the respective APB rate and baudrate divisor?

JW

fabricepeden
Associate II
Posted on April 19, 2013 at 14:20

My fraction is : 0x10

My mantissa is : 0x4

so, 16 + 4/16 = 16.25 (exactly the same that in the data sheet).

My Fpclk = 30MHz

Posted on April 19, 2013 at 19:35

And what is the measured baudrate when you use an integer (non-fractional) baudrate divider, e.g. 16.0000?

JW

PS. The strange thing is, that even with 113600 bauds the receiver should work properly, as the mismatch is around 1.4% which is well below the cca 3% where errors should start to show up.

How did you measure that baudrate? Did you measure only one bit's time, or a whole byte's time?

What is the hardware arrangement? Couldn't be the error introduced by inadequate RS232 level shifter used?

sdim2
Associate II
Posted on April 20, 2013 at 12:05

Do you use current limiting resistors on your USART line?

Try using resistors with lower values.

If you have an oscilloscope,  monitor the USART signal with the oscilloscope and make a loop on your code to continuously transmit an upper-case U character (0x55 hex, 01010101 binary).

Ideally you should see a square waveform. However, due to the IC and PCB capacitance and the current limiting resistors (if you use current limiting resistors) the signal will be a bit curvy. If the curve is large enough and the constant segment is less than 80%, then you should use lower values resistors.

fabricepeden
Associate II
Posted on April 22, 2013 at 15:47

Hi everybody,

I finally found my answer (after a few weeks...).

My circuit is made like this :

µc --> RS485 transceiver --> EMI filter (made with one common inductor and two 1nF capacitors).

When I short-circuit my inductor, it's working perfectly. Then I try with changing my RS485 transceiver (from MAX3430 to LTC2862), and now it's working perfectly with the inductor. 

So the trouble was given by the transceiver (for I didn't looking for the exact reason).

Thank fot you help.