3.5 Data Transfer from Internal Memory to DAC
Data stored in the internal Program Flash Memory (PFM) can be seamlessly transferred to DAC using DMA. The DMA setup configurations are listed in Table 3-5.
DMA6 Setup | ||
---|---|---|
SSA | Source Address | Beginning of space allocated for audio storage |
SSZ | Source Size | 256 (1 page data from PFM) |
SMR | Source Memory Region | PFM |
SMODE | Source Address Mode | SPTR is incremented |
DSA | Destination Address | &DAC1DATL |
DSZ | Destination Size | 1 |
DMODE | Destination Address Mode | DPTR remains unchanged |
SIRQEN | Start Trigger Enable | Yes |
SIRQ | Start Trigger | TMR0 (sampling timer) |
SSTP | Source Counter Reload Stop | Yes - SIRQEN is cleared when source counter reloads |
DSTP | Destination Counter Reload Stop | No - SIRQEN not cleared |
AIRQEN | Abort Trigger Enable | No (stops when DCNT reloads) |
AIRQ | Abort Trigger | N/A |
How It Works:
- Enable SIRQEN to kick off DMA at the next timer overflow. This allows the DMA data transfer rate to match the sampling timer rate.
- The DMA stops when an entire page of audio data has been read.
- To read the next PFM page, SSA can be updated with the new address.
- Repeat to read as many pages of stored audio data.