English
Language : 

PXR40RM Datasheet, PDF (1074/1434 Pages) Freescale Semiconductor, Inc – PXR40 Microcontroller
Enhanced Queued Analog-to-Digital Converter (EQADC)
The Receive Next Data Pointer points to the next available RFIFO location for storing the next incoming
message from the on-chip ADCs. The RFIFO Counter Logic counts the number of entries in RFIFO and
generates interrupt or DMA requests to drain the RFIFO.
POPNXTPTR in Section 27.6.2.7, EQADC FIFO and Interrupt Status Registers (EQADC_FISR),
indicates which entry is currently being addressed by the Pop Next Data Pointer, and RFCTR, in the same
register, provides the number of entries stored in the RFIFO. Using POPNXTPTR and RFCTR, the
absolute addresses for Pop Next Data Pointer and Receive Next Data Pointer can be calculated using the
following formulas:
Pop Next Data Pointer Address= RFIFOx_BASE_ADDRESS + POPNXTPTRx*4
Receive Next Data Pointer Address = RFIFOx_BASE_ADDRESS +
[(POPNXTPTRx+RFCTRx) mod RFIFO_DEPTH] * 4
where
• a mod b returns the remainder of the division of a by b.
• RFIFOx_BASE_ADDRESS is the smallest memory mapped address allocated to an RFIFOx
entry.
• RFIFO_DEPTH is the number of entries contained in a RFIFO - four in this implementation.
When a new message arrives and RFIFOx is not full, the EQADC copies its contents into the entry pointed
by the Receive Next Data Pointer. The RFIFO counter RFCTRx in Section 27.6.2.7, EQADC FIFO and
Interrupt Status Registers (EQADC_FISR), is incremented by one, and the Receive Next Data Pointer x is
also incremented by one (or wrapped around) to point to the next empty entry in RFIFOx. However, if the
RFIFOx is full, the EQADC sets the RFOF in Section 27.6.2.7, EQADC FIFO and Interrupt Status
Registers (EQADC_FISR). The RFIFOx will not overwrite the older data in the RFIFO, the new data will
be ignored, and the Receive Next Data Pointer x is not incremented or wrapped around. RFIFOx is full
when the Receive Next Data Pointer x equals the Pop Next Data Pointer x and RFCTRx is not zero.
RFIFOx is empty when the Receive Next Data Pointer x equals the Pop Next Data Pointer x and RFCTRx
is zero.
When the EQADC RFIFO Pop Register x is read and the RFIFOx is not empty, the RFIFO counter
RFCTRx is decremented by one, and the POP Next Data Pointer is incremented by one (or wrapped
around) to point to the next RFIFO entry.
When the EQADC RFIFO Pop Register x is read and RFIFOx is empty, EQADC will not decrement the
counter value and the POP Next Data Pointer x will not be updated. The read value will be undefined.
27-92
PXR40 Microcontroller Reference Manual, Rev. 1
Freescale Semiconductor