Skip to content

Commit f3ec630

Browse files
jasminefranciscaharishagari
authored andcommitted
Pull request #21: Develop to Master
Merge in MCU16CE/dspic33e-code-examples from develop to master * commit 'f2b250336090444b2892a126c0eedabc98c6d0c6': (30 commits) Updated README Updated the description Updated Readme file Updated Readme file Updated Readme file Updated review comments Updated review comments Updated review comments Updated review comments Updated review comments Updated review comments Addressed review comments Addressed review comments Addressed review comments Addressed review comments Addressed review comments Addressed review comments CITD-425:Updated content version CITD-425:Updated content version CITD-425:Updated content version ...
2 parents a051b0f + f2b2503 commit f3ec630

File tree

536 files changed

+107058
-61
lines changed

Some content is hidden

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

536 files changed

+107058
-61
lines changed

.main-meta/main.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
"content":{
55
"metaDataVersion":"1.3.0",
66
"name":"com.microchip.mplabx.project.dspic33e-code-examples",
7-
"version":"0.1.0",
8-
"displayName":"DSPIC33E Code Examples",
7+
"version":"1.0.0",
8+
"displayName":"dsPIC33E Code Examples",
99
"projectName":"dspic33e-code-examples",
10-
"shortDescription":"DSPIC33E Code Examples",
10+
"shortDescription":"dsPIC33E Code Examples",
1111
"ide":{
1212
"name":"MPLABX",
13-
"semverRange":">=5.50.0"
13+
"semverRange":">=6.00"
1414
},
1515
"compiler":{
1616
"name":"XC16",
17-
"semverRange":"^1.50.0"
17+
"semverRange":"^2.00"
1818
},
1919
"dfp":{
2020
"name":"dsPIC33E-GM-GP-MC-GU-MU_DFP",
@@ -26,7 +26,7 @@
2626
"content":{
2727
"metaDataVersion":"1.0.0",
2828
"category":"com.microchip.device",
29-
"name":"DSPIC33EP512GM710",
29+
"name":"dsPIC33EP512GM710",
3030
"versionRange":"*"
3131
}
3232
},

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
![image](images/microchip.jpg)
22

3-
## DSPIC33E CODE EXAMPLES
3+
## dsPIC33E Code Examples
44

5-
This repository contains the code examples for DSPIC33E Device Families.
5+
This repository contains the code examples for dsPIC33E device families.
66

77

88

changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# DSPIC33E Code Examples v0.1.0
1+
# dsPIC33E Code Examples v0.1.0
22
### Release Highlights
33

4-
Initial Release of DSPIC33E code examples on GitHub.
4+
Initial Release of dsPIC33E code examples on GitHub.
55

66

77

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
"content":{
55
"metaDataVersion":"1.3.0",
66
"name":"com.microchip.mplabx.project.dspic33e-adc-1msps",
7-
"version":"0.1.0",
7+
"version":"1.0.0",
88
"displayName":"ADC Sampling at 1.1MSPS",
99
"projectName":"dspic33e-adc-1msps",
1010
"shortDescription":"ADC Sampling at 1.1MSPS",
1111
"ide":{
1212
"name":"MPLABX",
13-
"semverRange":">=5.50.0"
13+
"semverRange":">=6.00"
1414
},
1515
"compiler":{
1616
"name":"XC16",
17-
"semverRange":"^1.70.0"
17+
"semverRange":"^2.00"
1818
},
1919
"dfp":{
2020
"name":"dsPIC33E-GM-GP-MC-GU-MU_DFP",
@@ -26,7 +26,7 @@
2626
"content":{
2727
"metaDataVersion":"1.0.0",
2828
"category":"com.microchip.device",
29-
"name":"DSPIC33EP512GM710",
29+
"name":"dsPIC33EP512GM710",
3030
"versionRange":"*"
3131
}
3232
},

dspic33e-adc-1msps/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ In this example, ADC is set up to convert AIN0 using CH0 and CH1 sample/hold in
88
at 1.1MHz throughput rate. ADC clock is configured at 13.3Mhz or Tad=75ns
99
ADC Conversion Time for 10-bit conversion is Tc=12 * Tab = 900ns (1.1MHz).
1010

11-
void initAdc1(void);
11+
void initAdc1(void);
1212
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.
1313
So, ADC keeps conversion data through CH0/CH1 S/H alternatively. Effective conversion rate is 1.1Mhz
1414

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

19-
void \__attribute\__((\__interrupt\__)) _DMA0Interrupt(void);
19+
void \_\_attribute\_\_((\_\_interrupt\_\_)) _DMA0Interrupt(void);
2020
DMA interrupt service routine, moves the data from DMA buffer to ADC signal buffer and collects 256 samples.
2121

2222
The Toggle frequency of one pulse should be around 240us(micro second), if the operating clock frequency at 40Mhz.
@@ -31,6 +31,6 @@ Short AN0/AN1 with +3.3v to get analog signal for sampling. These values should
3131

3232
## Software Used
3333

34-
- MPLAB® X IDE v5.50 or newer (https://www.microchip.com/mplabx)
35-
- MPLAB® XC16 v1.70 or newer (https://www.microchip.com/xc)
34+
- MPLAB® X IDE v6.00 or newer (https://www.microchip.com/mplabx)
35+
- MPLAB® XC16 v2.00 or newer (https://www.microchip.com/xc)
3636

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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.dspic33e-adc-altsamp",
7+
"version":"1.0.0",
8+
"displayName":"ADC Alternate Sampling",
9+
"projectName":"dspic33e-adc-altsamp",
10+
"shortDescription":"ADC Alternate Sampling",
11+
"ide":{
12+
"name":"MPLABX",
13+
"semverRange":">=6.00"
14+
},
15+
"compiler":{
16+
"name":"XC16",
17+
"semverRange":"^2.00"
18+
},
19+
"dfp":{
20+
"name":"dsPIC33E-GM-GP-MC-GU-MU_DFP",
21+
"semverRange":"^1.3.85"
22+
},
23+
"device":{
24+
"metaDataVersion":"1.0.0",
25+
"category":"com.microchip.portal.contentRef",
26+
"content":{
27+
"metaDataVersion":"1.0.0",
28+
"category":"com.microchip.device",
29+
"name":"dsPIC33EP512MU810",
30+
"versionRange":"*"
31+
}
32+
},
33+
"peripherals":[
34+
"TMR",
35+
"DMA",
36+
"ADC"
37+
],
38+
"keywords":[
39+
"TMR",
40+
"DMA",
41+
"ADC"
42+
]
43+
}
44+
}

dspic33e-adc-altsamp/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
![image](../images/microchip.jpg)
2+
3+
## ADC Alternate Sampling
4+
5+
## Description:
6+
7+
In this example, Timer 3 is setup to time-out every 125 microseconds (8Khz Rate).
8+
As a result, the module will stop sampling and trigger a A/D conversion on every Timer3 time-out, i.e., Ts=125us.
9+
10+
ADC is configured in 10bit mode to alternatively sample AN4/AN5 analog input on Timer 3 interrupt.
11+
It will take TWO Timer3 Timeout period to sample AN4 first and then AN5.
12+
13+
ADC module clock time period is configured as Tad=Tcy*(ADCS+1)= (1/60M)*64 = 1.06us (625Khz).
14+
Hence the conversion time for 10-bit A/D Conversion Time Tc=12*Tad = 12.72us
15+
16+
DMA is used to sort and transfer the converted data to DMA RAM. DMA is configured in ping-pong mode
17+
and it transfers 16samples of each of the TWO analog inputs and generates interrupt.
18+
19+
20+
DMA channel 0 is configured in ping-pong mode to move the converted data from ADC to DMA RAM
21+
on every sample/convert sequence.
22+
First, DMA uses DMA0STA base address to store the ADC samples and it generates interrupt
23+
after transfering (TWO x 16 samples = 32 samples).
24+
Next, DMA uses DMA0STB base address to store the ADC samples and it generates interrupt
25+
after transfer (TWO x 16 samples = 32 samples).
26+
Above process repeats continuously.
27+
28+
void \_\_attribute\_\_((\_\_interrupt\_\_)) _DMA0Interrupt(void);
29+
DMA interrupt service routine, moves the data from DMA buffer to ADC signal buffer
30+
31+
Timer time outs at 60M/(4999+1) = 12000 Hz.
32+
DMA interrupt @ 12K/32= 375 Hz.
33+
I/O pin toggles at 375/2= 187 Hz.
34+
35+
RA4 pin is toggled in ISR, hence it will be toggling at ~ 187Hz
36+
37+
38+
39+
## Hardware Used
40+
41+
- Explorer 16/32 Development Board (https://www.microchip.com/DM240001-2)
42+
- dsPIC33EP512GM710 PIM (https://www.microchip.com/ma330035) or dsPIC33EP512MU810 PIM (https://www.microchip.com/MA330025-1) or dsPIC33EP256GP506 PIM (https://www.microchip.com/MA330030)
43+
44+
45+
## Software Used
46+
47+
- MPLAB® X IDE v6.00 or newer (https://www.microchip.com/mplabx)
48+
- MPLAB® XC16 v2.00 or newer (https://www.microchip.com/xc)
49+
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#
2+
# There exist several targets which are by default empty and which can be
3+
# used for execution of your targets. These targets are usually executed
4+
# before and after some main targets. They are:
5+
#
6+
# .build-pre: called before 'build' target
7+
# .build-post: called after 'build' target
8+
# .clean-pre: called before 'clean' target
9+
# .clean-post: called after 'clean' target
10+
# .clobber-pre: called before 'clobber' target
11+
# .clobber-post: called after 'clobber' target
12+
# .all-pre: called before 'all' target
13+
# .all-post: called after 'all' target
14+
# .help-pre: called before 'help' target
15+
# .help-post: called after 'help' target
16+
#
17+
# Targets beginning with '.' are not intended to be called on their own.
18+
#
19+
# Main targets can be executed directly, and they are:
20+
#
21+
# build build a specific configuration
22+
# clean remove built files from a configuration
23+
# clobber remove all built files
24+
# all build all configurations
25+
# help print help mesage
26+
#
27+
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
28+
# .help-impl are implemented in nbproject/makefile-impl.mk.
29+
#
30+
# Available make variables:
31+
#
32+
# CND_BASEDIR base directory for relative paths
33+
# CND_DISTDIR default top distribution directory (build artifacts)
34+
# CND_BUILDDIR default top build directory (object files, ...)
35+
# CONF name of current configuration
36+
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
37+
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
38+
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
39+
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
40+
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
41+
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
42+
#
43+
# NOCDDL
44+
45+
46+
# Environment
47+
MKDIR=mkdir
48+
CP=cp
49+
CCADMIN=CCadmin
50+
RANLIB=ranlib
51+
52+
53+
# build
54+
build: .build-post
55+
56+
.build-pre:
57+
# Add your pre 'build' code here...
58+
59+
.build-post: .build-impl
60+
# Add your post 'build' code here...
61+
62+
63+
# clean
64+
clean: .clean-post
65+
66+
.clean-pre:
67+
# Add your pre 'clean' code here...
68+
# WARNING: the IDE does not call this target since it takes a long time to
69+
# simply run make. Instead, the IDE removes the configuration directories
70+
# under build and dist directly without calling make.
71+
# This target is left here so people can do a clean when running a clean
72+
# outside the IDE.
73+
74+
.clean-post: .clean-impl
75+
# Add your post 'clean' code here...
76+
77+
78+
# clobber
79+
clobber: .clobber-post
80+
81+
.clobber-pre:
82+
# Add your pre 'clobber' code here...
83+
84+
.clobber-post: .clobber-impl
85+
# Add your post 'clobber' code here...
86+
87+
88+
# all
89+
all: .all-post
90+
91+
.all-pre:
92+
# Add your pre 'all' code here...
93+
94+
.all-post: .all-impl
95+
# Add your post 'all' code here...
96+
97+
98+
# help
99+
help: .help-post
100+
101+
.help-pre:
102+
# Add your pre 'help' code here...
103+
104+
.help-post: .help-impl
105+
# Add your post 'help' code here...
106+
107+
108+
109+
# include project implementation makefile
110+
include nbproject/Makefile-impl.mk
111+
112+
# include project make variables
113+
include nbproject/Makefile-variables.mk

0 commit comments

Comments
 (0)