Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/13/07 02:53
Read: times


 
#137094 - Other approach
Responding to: ???'s previous message
Mike Stegmaier said:
When my 8051 micro receives data from the PC, I have it store data in external RAM in sequential order.

If I wait for a particular string to come, and it comes after the RAM is full of data, then I could end up in trouble, because then I have to clear the ram, and by the time I try to clear the first byte, I might run out of machine cycles before the serial interrupt is called.


There's no need to clear it. Just use a pointer to the next position in memory. When the pointer gets to the maximum buffer size, just wrap around. Thus you never clear memory but rather just keep wrapping around within the memory you've allocated as your buffer.

Regards,
Craig Steiner


List of 12 messages in thread
TopicAuthorDate
refreshing serial data            01/01/70 00:00      
   Other approach            01/01/70 00:00      
      Circular or Ring Buffer            01/01/70 00:00      
   A Yet More Clever Approach            01/01/70 00:00      
      the data isn't always consistent            01/01/70 00:00      
         PPP has maximum packet size            01/01/70 00:00      
         I know            01/01/70 00:00      
            here is why            01/01/70 00:00      
               not serious I hope            01/01/70 00:00      
         Doesn't PPP have a defined packet format?            01/01/70 00:00      
            mtu sizes            01/01/70 00:00      
   what do you mean????            01/01/70 00:00      

Back to Subject List