Re: Interrupt driven UART



In article <12je2k41hk5or80@xxxxxxxxxxxxxxxxxx>,
ms@xxxxxxxxxxxxxxxxxxxxxxxxx says...
"galapogos" <goister@xxxxxxxxx> wrote in message
news:1161222525.036456.8350@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

James Beck wrote:
Don't confuse a FIFO with a circular queue.
Most UART drivers/ISR use a circular queue and just move pointers around
the like a loop. There will be times when the tail may point to a lower
memory location and also the other way around.

Jim

Yes I do realize it's a circular queue, I named the array fifo because
circular_queue was too long, but I've implemented it as a circular
queue in the code as you can see, by handling the wraparounds.

I maybe have missed something, but what exactly is the difference between a
FIFO and a circular queue?

Meindert


When I think of FIFO I think of a linear system, possibly hardware
based, that may or may not have "wrap around" in the memory pointer
sense. Like a stack that pushes on one end and pops at the other that
you may not be able manipulate the data pointer directly. I know I'm
splitting hairs and may not even be exactly correct in my thinking, but
when I mean a circular queue I say it.
In the end I was really just trying to point out that there will be
times when the pointers into the queue can wrap around at different
times and make doing simple math like
num_in_queue = queue_head - queue_tail
might not work right unless you take into account that when the head
pointer rolls back around before the tail pointer the answer is going to
wrap also. Not that it is a show stopper it just needs to be accounted
for.

Jim
.



Relevant Pages

  • Re: Asynchronous FIFO with depth that is not a power of 2
    ... When a whistle blows, one or more of those against each wall must race to the other side and wait until the next whistle just like bits changing state in a counter. ... synchronizer output may be erroneous. ... if the write pointer increments and causes the FIFO to ...
    (comp.lang.verilog)
  • Re: Asynchronous FIFO with depth that is not a power of 2
    ... of the FIFO is 688, which is not a power of 2. ... use the Gray pointer technique. ... timing across an asynchronous interface). ...
    (comp.lang.verilog)
  • Re: Asynchronous FIFO with depth that is not a power of 2
    ... of the FIFO is 688, which is not a power of 2. ... use the Gray pointer technique. ... then even in case of gray pointer the ... synchronizer output may be erroneous. ...
    (comp.lang.verilog)
  • async fifo design
    ... I'm designing an "On Chip Network" System consisting of one network ... But I'm not sure how to implement such a fifo exactly. ... how to implement a gray code to binary code converter to address the ... or write pointer depending on which fifo is addressed. ...
    (comp.arch.fpga)
  • Asynchronous FIFO with depth that is not a power of 2
    ... I am trying to design an asynchronous FIFO that works with two clock ... use the Gray pointer technique. ...
    (comp.lang.verilog)