Introduction

Author: Max Prasad, Microchip Technology Inc.

This application note describes how to record, store and playback a mono audio sound using Direct Memory Access (DMA) and various Core Independent Peripherals (CIP) present on the newer PIC18 devices.

One of the key challenges today is to ensure there is a fast and reliable method of data transfer between memories, both on-chip and external, that does not affect the throughput of the system CPU. In this application, multiple DMA channels are used to transfer data between RAM and Flash memory. This allows for higher data transfer speed and ease of use while freeing the CPU to perform other tasks. The typical applications for use are data loggers, answering machines, voice recorders and toys.

This application note is based on the PIC18F57Q43 Curiosity Nano platform. It details the usage of ADC for sound recording, SPI for interfacing with the external memory module, DAC for playback, DMA for data transfers, and the use of timers to define sampling frequency. The application also demonstrates the use of Timer2 HLT and CLC for switch debouncing and the Comparator and PWM for Class D power amplifier drive.