6.3 Playback Subroutine

The playback subroutine is shown in Figure 6-4. The flowchart on the left indicates the functionality in software while the one on the right indicates hardware functionality. The playback subroutine consists of the following steps:

  1. As soon as the program enters Playback mode, the audio metadata is read from the EEPROM.
  2. The target memory is prepared to perform read operation. The DAC is turned on. The DMAs used to playback audio are reset. The sampling timer is turned on.
  3. Once the sampling timer is turned on, with every tick a DMA is triggered to transfer data from the memory to DAC. This data transfer takes place one page at a time. Refer to Data Transfer from External Memory to DAC and Data Transfer from Internal Memory to DAC for details on memory operations.
  4. The playback is stopped when the button is pressed again or the entire allocated memory is read. To close the playback session, the sampling timer is stopped and the DAC is disabled.
Figure 6-4. Playback Subroutine