uart communication in stm32
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-04-04 3:50 AM
Hi,
I am getting problem while using uart of controller with my wireless module. Actually what is happening is my wireless module receiving data very fast and consumption of that data from controller side is slower than wireless module. So how can i manage this to synchronize receiving and transmitting part? Since controller consumption of data is slower than wireless module so i am missing some data and because of that i am not able perform further task. Suggest me the solution on this. #flow-control- Labels:
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-04-04 4:12 AM
Exactly how fast?
In bound data can be placed in a reasonably large ring buffer under interrupt, or a constant stream could utilize DMA.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
‎2013-04-04 10:46 AM
''controller consumption of data is slower than wireless module so i am missing some data''
Ever heard of
Flow Control
...?A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-04-04 9:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-04-04 11:26 PM
''Hardware flow control
none
'' So how about using hardware flow control, then?''wireless module''
What ''wireless module'', exactly, are you using?
Are you using any protocol for your data transfer?
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-04-05 12:08 AM
Hi neil,
I am using wifi module. This wifi module having two modes one is command mode and another one is auto work mode. In command mode i can connect my wireless module to any access point and at the same time it provides me hardware flow control none. In case of auto work mode my wireless module can connect to the only one network which i have to mention using command though it provide me hardware flow control with RTS and CTS. But i am using command mode in my case. For this wireless module i am not using protocol like SPI or I2C. It is just simple transmission and reception using UART.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-04-05 12:51 AM
There is one more thing you should be thinking - how do you know it is transmitting faster than controller is receiving? Is data corrupted or missing? Does it work if you set speed to lower?
If you set both (module and stm32) to 115200 (which I am using as well without hardware flow control), then there is no way something is too slowexcept
if you are having a huge interrupt routine.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-04-05 1:24 AM
Hi crt,
''how do you know it is transmitting faster than controller is receiving?'' I am just putting break point in my program in the interrupt of receiving part in which i am using read, write pointer which is getting incrementing when in receive the data. But reading from controller side is incomplete. That mean module in writing in receive buffer immediately just before finishing read part by controller of that received data. And causes to missing data.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-04-05 3:54 AM
Uh, can you rewrite what are you doing?
So you are basically interrupting receiving and checking memory with debugger if ok data is in receive buffer? How long are you letting it ''read'' before you do that? Breakpoint makes me wonder that it breaks at every receive?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-04-05 4:10 AM
Hi crt,
Yes you are right i am checking my receive buffer whether i am getting ok or not. And not exactly breakpoint sorry for that, i am watching all the parameter like write and read pointer as i mentioned before in live watch window. So i can watch those parameters while program is running.