I am attaching 2 example codes, one for single scan, second for continuous scan.
Regarding streaming mode, I don’t have prepared example at this moment.
Some info to STREAMING MODE:
Streaming mode is new feature of eQADC that wasn’t present in preceding devices (MCP55xx) and its intention is just to reduce a need of DMA data transfers when short sequences is needed to convert repeatedly. The key point is that streaming mode cause lock of commands in CFIFO between REP and PAUSE, in normal mode commands are invalidated after its execution and so must by fed by DMA (or core) again and again.
For this there are 3 new fields in CFCR[0]:
CFEEE0 - enlarges CFIFO0 to 8 entries
STRME0 - enables streaming mode
AMODE0 - operation mode for advance mode
If streaming mode is enabled, PAUSE exiting causes returning to REPEAT pointer in case advance trigger haven’t occurred, or continuance to next entry in case advance trigger have occurred.
Let’s have following command queue -
uint32_t CQueue_0[] =
{
( CHANNEL(1) | B0 | MESSAGE_TAG(RFIFO0) ),
( CHANNEL(2) | B1 | MESSAGE_TAG(RFIFO0) ),
( CHANNEL(3) | B0 | MESSAGE_TAG(RFIFO0) | REP ),
( CHANNEL(4) | B1 | MESSAGE_TAG(RFIFO0) ),
( CHANNEL(5) | B0 | MESSAGE_TAG(RFIFO0) ),
( CHANNEL(6) | B1 | MESSAGE_TAG(RFIFO0) | PAUSE ),
( CHANNEL(7) | B0 | MESSAGE_TAG(RFIFO0) ),
( CHANNEL(8) | B1 | MESSAGE_TAG(RFIFO0) ),
( CHANNEL(9) | B0 | MESSAGE_TAG(RFIFO0) | EOQ )
};
Red marked commands will be executed in loop until advance trigger occurs. Blue marked command will be executed after advance trigger.
Important note: Streaming mode is only available on eQADC_B on MPC5674F device.