USART, 115200 not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-09 08:11 AM
Hello
I am using STM32RBT6 with my board and all is good except serial with 115200 baud rate, 57600 and lower is working correctly. I just see weird characters when receiving data. I can't get it work either with USART1 or USART2. I don't use any pull up resistor, just direct connection. I tried 50mhz gpio and different gpio input type, but nothing helped. My board contain 8mhz external crystal, cpu is running 72mhz. Even with my other board, LC Studio brand with same processor I getting same results, same with usb ttl converter and rs232. I am using ST's std library V3.4.0 with interrupts for receiving. Thanks #serial-baud-rate-speed- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-09 08:38 AM
just direct connection. to WHAT
Whenever you have UART issues, set it up to constantly transmit 'U'' (capital U) and put a scope on tx, you should have a square wave with a frequency of exactlly half the baudrate. Erik- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-09 10:22 AM
No problem achieving 115200 on an 8 MHz STM32 here.
And have demonstrated full duplex 115200 baud forwarding between two USARTS on an 72 MHz STM32.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-09 10:29 AM
The ''transmit 'U''' has saved me many times, last, about 10 months ago, I found out that a certainn configurattion of the ST32f1x setup code gives 1/2 the clock rate it claims while doing all calculations (e.g. setup for baudrate) based on the claimed rate.
I would never do anything to a UART case before scoping 'U's Erik- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-09 10:54 AM
U (0x55) is nice because it's ASCII and transitions at every bit.
Which works till you have two stop bits, or 7 bit. Not discounting your method, but sending any repetitive bit pattern where you can see bit transitions is probably sufficient to trigger the scope and measure a bit time, or two.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-09 01:03 PM
For chuckles I cranked some of my XModem-1K code up in baud rate, and dropped the CPU to the floor.
Error/Retry free transfer of 256KB, at 460800 8N1, on a STM32 VL Discovery running at 8 MHz. >= 115200 not possible, I think I can say this myth is totally busted. You need to check out your connectivity, and choice in interface hardware. Writing to the STM32's flash memory concurrently will definitely not work at these line speeds, you'd have to do that before ACK'ing each packet. This would make YModem-G unattractive. Serial data transmission at high rate is not assured, there is no intrinsic error checking (beyond parity), and no correction, protocols need to be chosen to permit the detection of errors, and retries or correction used if appropriate.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-09 02:18 PM
Thanks for help
Here is my code: http://pastebin.com/P6qu5rKK With direct connection I mean USART_RX/TX + GND to USB TTL converter or max232 (rs232), only cca 30cm wires. Tommorow I'll try 'U' test.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-09 02:38 PM
There is a race condition in the buffering, and the possibility it will reverse/shuffle blocks of characters. ie looks to be a LIFO not a FIFO
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-10 12:57 AM
Thanks again
I found where is a problem and succesfully resolved :)This made me laugh ..Just check out:static void usart_conf (unsigned short baudrate)..Sorry, thats my fault- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-02-10 09:19 AM
not uncommon to try to put a quart into a pint container, usually your feet get wet :)
Erik