This recent thread "Emic2 & PICAXE" made me realize that I need to understand how the 2 byte FIFO buffer on the M2 works. I don't want to mess-up the other thread so I'm starting this one.
If 2 data bytes have been received in the M2 background FIFO buffer; what happens to the next byte that comes along? Is it ignored, or does it go into the buffer and kick-out the oldest byte? Which bytes stay in the buffer? Only the first 2; or does the new byte push out the oldest byte? I believe that a single hserin command will return only the oldest byte in the buffer: while 2 consecutive hserin commands will return both the oldest byte and the newest byte. Does the hsersetup command reset the buffer? In my mind I picture a length of pipe that will hold two ping pong balls. If a third ball is stuffed into the pipe, the ball that's been there the longest is pushed out. Is this how it works?
I'll appreciate comments to help me so that I can program my Emic2 when it arrives in a week or two.
Also, does anyone know if there is anyplace in "code explorer" (or wherever) to observe the contents of the 2 deep M2 FIFO buffer for background received data?
Thank you, Jims
If 2 data bytes have been received in the M2 background FIFO buffer; what happens to the next byte that comes along? Is it ignored, or does it go into the buffer and kick-out the oldest byte? Which bytes stay in the buffer? Only the first 2; or does the new byte push out the oldest byte? I believe that a single hserin command will return only the oldest byte in the buffer: while 2 consecutive hserin commands will return both the oldest byte and the newest byte. Does the hsersetup command reset the buffer? In my mind I picture a length of pipe that will hold two ping pong balls. If a third ball is stuffed into the pipe, the ball that's been there the longest is pushed out. Is this how it works?
I'll appreciate comments to help me so that I can program my Emic2 when it arrives in a week or two.
Also, does anyone know if there is anyplace in "code explorer" (or wherever) to observe the contents of the 2 deep M2 FIFO buffer for background received data?
Thank you, Jims
Last edited: