Microchip | The Embedded Control Solutions Company Register Login
Browse All
Microchip Technology
 369 Code Snippets

CE101 - ADC Sampling at 1.1MSPS

Microchip Technology

In this example, ADC is set up to convert AIN0 using CH0 and CH1 sample/hold in 10-bit sequencial 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).

About this Code Example

In this example, ADC is set up to convert AIN0 using CH0 and CH1 sample/hold in 10-bit sequencial 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 convertion data throgh CH0/CH1 S/H alternatively. Effective conversion rate is 1.1Mhz

void initDma0(void);
DMA channel 0 is confiured 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.

Categories

Release History

  • Jun 15, 2012

    Version: 1.0.0

    First Release to ECS

Download Contact the Developer

*Required Fields


  • Current Version:1.0.0
  • Created:Jun 16, 2012
  • Updated:Feb 26, 2015
  • Downloads:3301
  • MPLAB Version:V8.xx or above
  • C Compiler:MCC18 v3.30 or above
  • Development Tools:Explorer16 board
  • Supported Devices:dsPIC33FJ256GP710

Corporate News

Resources

Stay Connected

Stay up to date with the latest news from Microchip Technology.