Skip to content

Commit 92ba09e

Browse files
author
Microchip Technology
committed
Added ADC Sampling at 1.1MSPS project
1 parent dfcad57 commit 92ba09e

File tree

50 files changed

+2628
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2628
-4
lines changed

adc-1msps/.main-meta/main.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"metaDataVersion":"1.0.0",
3+
"category":"com.microchip.ide.project",
4+
"content":{
5+
"metaDataVersion":"1.3.0",
6+
"name":"com.microchip.mplabx.project.adc-1msps",
7+
"version":"1.0.0",
8+
"displayName":"ADC Sampling at 1.1MSPS",
9+
"projectName":"adc-1msps",
10+
"shortDescription":"ADC Sampling at 1.1MSPS",
11+
"ide":{
12+
"name":"MPLABX",
13+
"semverRange":">=5.50.0"
14+
},
15+
"compiler":{
16+
"name":"XC16",
17+
"semverRange":"^1.70.0"
18+
},
19+
"dfp":{
20+
"name":"dsPIC33E-GM-GP-MC-GU-MU_DFP",
21+
"semverRange":">=1.3.85"
22+
},
23+
"configurator": {
24+
"name": "MCC",
25+
"semverRange": ">=4.0.1"
26+
},
27+
"device":{
28+
"metaDataVersion":"1.0.0",
29+
"category":"com.microchip.portal.contentRef",
30+
"content":{
31+
"metaDataVersion":"1.0.0",
32+
"category":"com.microchip.device",
33+
"name":"DSPIC33EP512GM710,DSPIC33EP512MU810,DSPIC33EP256GP506",
34+
"versionRange":"*"
35+
}
36+
},
37+
"peripherals":[
38+
"ADC",
39+
],
40+
"keywords":[
41+
"ADC",
42+
"Filter",
43+
"Signal Sampling",
44+
"Algorithm"
45+
]
46+
}
47+
}

adc-1msps/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
![image](../images/microchip.jpg)
2+
3+
## ADC Sampling at 1.1MSPS
4+
5+
This file contains the following sections:
6+
- Code Example Description
7+
- Suggested Development Resources
8+
- Reconfiguring the project for a different dsPIC33E device
9+
- Revision History
10+
11+
12+
## Code Example Description:
13+
14+
In this example, ADC is set up to convert AIN0 using CH0 and CH1 sample/hold in 10-bit sequential mode
15+
at 1.1MHz throughput rate. ADC clock is configured at 13.3Mhz or Tad=75ns
16+
ADC Conversion Time for 10-bit conversion is Tc=12 * Tab = 900ns (1.1MHz).
17+
18+
void initAdc1(void);
19+
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.
20+
So, ADC keeps conversion data through CH0/CH1 S/H alternatively. Effective conversion rate is 1.1Mhz
21+
22+
void initDma0(void);
23+
DMA channel 0 is configured in ping-pong mode to move the converted data from ADC to DMA RAM on every sample/convert sequence.
24+
It generates interrupt after every 16 sample transfer.
25+
26+
void __attribute__((__interrupt__)) _DMA0Interrupt(void);
27+
DMA interrupt service routine, moves the data from DMA buffer to ADC signal buffer and collects 256 samples.
28+
29+
The Toggle frequency of one pulse should be around 240us(micro second), if the operating clock frequency at 40Mhz.
30+
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.
31+
32+
33+
## Hardware Used
34+
35+
- Explorer 16/32 Development Board (https://www.microchip.com/DM240001-2)
36+
- dspic33ep512gm710(https://www.microchip.com/ma330035) /dspic33ep512mu810 (https://www.microchip.com/MA330025-1)/ dspic33ep256gp506 (https://www.microchip.com/MA330030) PIM
37+
38+
39+
## Software Used
40+
41+
- MPLAB® X IDE v5.50 or newer (https://www.microchip.com/mplabx)
42+
- MPLAB® XC16 v1.70 or newer (https://www.microchip.com/xc)
43+
44+
## Reconfiguring the project for a different dsPIC33E device:
45+
46+
The Project/Workspace can be easily reconfigured for dspic33ep512gm710/dspic33ep512mu810/dspic33ep256gp506 device.
47+
Please use the following general guidelines:
48+
49+
a. Change device selection within MPLAB® IDE to dspic33ep512gm710/dspic33ep512mu810/dspic33ep256gp506 device of
50+
your choice by using the following menu option:
51+
MPLAB X>>Configuration drop-down option>><Listed Device Configuration>
52+
53+
b. Re-build the MPLAB® project using the menu option:
54+
MPLAB X>>Build Main Project
55+
56+
c. Download the hex file into the device and run.
57+
58+
59+
## Revision History :
60+
04/01/2006 - Initial Release of the Code Example
61+
7/01/2010 - Code Example updated for dsPIC33E
62+
02/13/2014 - Code Example updated to new format for dspic33ep512gm710/dspic33ep512mu810/dspic33ep256gp506
63+
11/13/2014 - TEST_MODE code added for test automation
File renamed without changes.

0 commit comments

Comments
 (0)