Skip to content

Latest commit

 

History

History

dspic33e-adc-1msps

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

image

ADC Sampling at 1.1MSPS

Description:

In this example, ADC is set up to convert AIN0 using CH0 and CH1 sample/hold in 10-bit sequential mode at 1.1MHz throughput rate. ADC clock is configured at 13.3Mhz or Tad=75ns ADC Conversion Time for 10-bit conversion is Tc=12 * Tab = 900ns (1.1MHz).

void initAdc1(void);
ADC CH0 and CH1 S/H is set-up to covert AIN0 in 10-bit mode. ADC is configured to next sample data immediately after the conversion. So, ADC keeps conversion data through CH0/CH1 S/H alternatively. Effective conversion rate is 1.1Mhz

void initDma0(void);
DMA channel 0 is configured in ping-pong mode to move the converted data from ADC to DMA RAM on every sample/convert sequence. It generates interrupt after every 16 sample transfer.

void __attribute__((__interrupt__)) _DMA0Interrupt(void);
DMA interrupt service routine, moves the data from DMA buffer to ADC signal buffer and collects 256 samples.

The Toggle frequency of one pulse should be around 240us(micro second), if the operating clock frequency at 40Mhz. Short AN0/AN1 with +3.3v to get analog signal for sampling. These values should be approximately around 0x7FXXX when checked in the bufferA/bufferB in the code.

Hardware Used

Software Used