AnsweredAssumed Answered

UART Problem - Garbage characters in UART Example/Demo

Question asked by Thomas Jespersen on Apr 24, 2011
Latest reply on May 10, 2011 by John Flood
Hi.
Today I started playing with the STM8-DISCOVERY board, and I tried the RS232/UART example from your website: http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/um0884.zip
After having installed your STVD suite, I got the application programmed into the chip and started debugging. I had the TX and RX pins connected to a USB to UART module, which I have confirmed as working fine.
The text the board should write properly looks like this garbage:
Š====================== ÓTÍ8ÓÄésãïvåòy ===================
ŠThés Áppìéãaôéïn és baséã åøampìå ïæ ÕÁRT énôåòæaãå ÷éôh
ŠWéndï÷s Èypåò Tåòménaì® 
Š
Š==========================================================
Š                          ÁÐÐLICÁTIOÎ ÍEÎÕ º
Š
Š==========================================================
ŠŠ 1 Óåô LÄ1 ïn 
Š 2 Óåô LÄ1 ïææ 
Š ³ Óåô LÄ1 bìénk 
Š 4 ÂEEÐER OΠ
Š µ ÂEEÐER OFF 
ŠŠEnôåò yïuò ãhïéãå º 

As you can see some letters are okey, while most of them aren't. Though the boards recieves serial data fine, and I can turn on and off the led, and make it blink.
So the problem seems to be in the sending?!

I've tried making the board send every byte from 1 to 128, and this is the result of that count in hexadecimal:
01 02 83 04 85 86 07 08 89 8A 0B 8C 0D 0E 8F 10 
91 92 13 94 15 16 97 98 19 1A 9B 1C 9D 9E 1F 20
A1 A2 23 A4 25 26 A7 A8 29 2A AB 2C AD AE 2F B0
31 32 B3 34 B5 B6 37 38 B9 BA 3B BC 3D 3E BF 40 
C1 C2 43 C4 45 46 C7 C8 49 4A CB 4C CD CE 4F D0
51 52 D3 54 D5 D6 57 58 D9 DA 5B DC 5D 5E DF E0
61 62 E3 64 E5 E6 67 68 E9 EA 6B EC 6D 6E EF 70
F1 F2 73 F4 75 76 F7 F8 79 7A FB 7C FD FE 7F

Again, this isn't a correct count. As you might notice, 0x3 = 0x83, 0x5 = 0x85, 0x6 = 0x86 - like it adds 0x80? And it's the same pattern that happens all the time, so the garbaged characters is always the same!

Do you have an idea?
Thanks

Best Regards
Thomas Jespersen

Outcomes