Serial issue

23 Oct 2010

Hello, could I please get help understanding serial?

 

I have a device that completes a calc cycle every 10ms.  Each cycle, it checks its serial buffer, makes a calculation based on the next command byte in the buffer, then sends out 31 bytes of information.

My code simply sends a byte to the device's serial buffer, waits (say for 10ms), and reads the device's output from the mbed's buffer to retreive the calculated data.

The issue is this: if I wait too long between sending the command and reading the mbed's rx buffer (say 1ms), the buffer is empty.  I'm doing absolutely nothing during this wait, and I know the device did, in fact, write the data to mbed's rx buffer.  So where have the buffered bytes gone?

Did mbed erase them?

23 Oct 2010

Can you post your code, it's not possible to determine what's going on without at least seeing what it is you are doing code wise.