Hi,
I did not have much time, so I try now to answer it quickly.
> async event void RXFIFO.readDone
> //what is the checking of FIFO and FIFOP pin for here?
> if ( !call FIFO.get() && !call FIFOP.get() ) {
> m_bytes_left -= rxFrameLength + 1;
> }
First, it's important to know that FIFOP is active low as configured in
CC2420ControlP, the FIFO pin is active high. So, the condition means
that FIFO is inactive and FIFOP is active. There is only one possibility
where this can happen, see Section 14.3 RXFIFO overflow: "If an overflow
occurs in the RXFIFO, this is signalled to the microcontroller by making
the FIFO pin go inactive while the FIFOP pin is active. Data already in
the RXFIFO will not be affected by the
overflow, i.e. frames already received may be read out."
Then, the data sheet only says "A SFLUSHRX command strobe is required
after an RXFIFO overflow to enable reception of new data." It doesn't
specify that the FIFO/FIFOP pins are reset only then, but I guess it's
working like that.
So, with each packet which is still in the RXFIFO m_bytes_left gets
decreased until the last incomplete packet. For this packet, the first
condition "rxFrameLength + 1 > m_bytes_left" is true and the fifo is
flushed (and m_bytes_left is reset).
> // CSn flippage cuts off our FIFO; SACK and begin reading again
> //Why is CSn flippage necessary here? why cannot SACK strobe be
> sent directly without CSn flippage?
> call CSN.set();
> call CSN.clr();
> call SACK.strobe();
> call CSN.set();
> call CSN.clr();
The answer can be found in the data sheet in section 13.6 FIFO access:
"FIFO access can only be terminated by setting the CSn pin high once it
has been started." Since we have started FIFO access before (we are in
RXFIFO.readDone which means we have received some bytes) we need to end
the FIFO access before we can send an SACK command strobe.
Best,
Daniel
--
Daniel Minder
University of Duisburg-Essen, Networked Embedded Systems
Bismarckstr. 90, 47057 Duisburg, Germany
Skype: d.minder
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help