3.6 Data Transfer from ADC to DAC (Passthrough)

The left-aligned 8-bit ADC result in ADRESH register can be transferred directly to the DAC using DMA, creating an audio passthrough channel(1). The DMA setup configurations are listed in Table 3-6.

Table 3-6. DMA Setup Configuration (DMA1)
DMA1 Setup
SSASource Address&ADRESH
SSZSource Size1
SMRSource Memory RegionSFR
SMODESource Address ModeSPTR remains unchanged
DSADestination Address&DAC1DATL
DSZDestination Size1
DMODEDestination Address ModeDPTR remains unchanged
SIRQENStart Trigger EnableYes
SIRQStart TriggerAD (ADC conversion)
SSTPSource Counter Reload StopNo - SIRQEN not cleared
DSTPDestination Counter Reload StopNo - SIRQEN not cleared
AIRQENAbort Trigger EnableNo (stops when SCNT/DCNT reloads)
AIRQAbort TriggerN/A
How It Works:
  1. The DMA is triggered as soon as an ADC conversion is complete (ADIF trigger) and the content of ADRESH register is transferred to the DAC1DATL register directly. Because SSZ = 1, the DMA stops after the first transfer and waits for the next trigger.
  2. This process continues as long as the ADC and the DMA are in operation.
Important:
  1. While most of the newer PIC18 devices have a 10-bit or 12-bit ADC, only 8-bit ADC values are used to keep the application simple. This is because the DAC used to playback the audio signal has a resolution of 8 bits.