2013-04-04 03: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-control2013-04-04 04: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.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
...?2013-04-04 09:47 PM
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?
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.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.2013-04-05 01: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.2013-04-05 03: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?2013-04-05 04: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.