I'm am porting an application from a cc1110 to a cc430 based system. In this app, we use large packets (64-255 bytes), and make extensive use of DMA to transfer packet data to/from the radio. I have been unable to find any example code, or information on how to use DMA with the RF1A peripheral on the cc430.
Is the following pseudo code correct?
To receive a 200 byte packet from the radio:
- Set DMA destination to the packet buffer with address increment
- Set DMA source to RF1ADOUT1B (autoread 1 byte register) with no address increment
- Set DMA size to 200
- Set DMA trigger to RFRXIFG
- Flush Rx FIFO
- Write SRX instruction to RF1AINSTRB
- Enable DMA
- Write RXFIFORD to RF1AINSTR1B
- Wait for DMA to complete
- Process packet
What happens on the final DMA read from the auto-read register? Will the auto-read cause an underflow? The non-DMA example code for reading N bytes of data from the Rx FIFO reads RF1ADOUT1B N-1 times (i.e. 199 in this example), followed by a single read from RF1ADOUTB. When using DMA, should the DMA transfer size be set to N-1 (199 here), and use an ISR to handle reading the the final byte?
Another concern that I have with DMA is how it might be affected by Rx FIFO pointer bug described in section 22.3.3.8 Data FIFO of the cc430 User Guide (SLAU259b.pdf). If the DMA transfer is keeping up the the radio (as expected), it will be emptying the FIFO on every read. The recommeneded method is to not empty the FIFO until the packet has been completely received. Do we need to worry about this when using DMA?