Skip to content

Commit f9cd872

Browse files
MPAE-12074 Update main.json file. Update Readme.md file. Add MPLAB code to bitbucket
1 parent 16dc29a commit f9cd872

Some content is hidden

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

55 files changed

+6076
-27
lines changed

.main-meta/main.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"content": {
55
"metaDataVersion": "1.1.0",
66
"name": "com.microchip.mcu8.mplabx.project.pic18f57q43-analog-read-serial-write-mplab-mcc",
7-
"version": " ",
7+
"version": "1.0.0",
88
"displayName": "Analog Read Serial Write",
99
"projectName": "pic18f57q43-analog-read-serial-write-mplab-mcc",
1010
"shortDescription": "This code example uses the ADC module to do an analog read and display it using the Data Visualizer.",
@@ -19,12 +19,12 @@
1919
}
2020
],
2121
"dfp": {
22-
"name": "",
23-
"semverRange": ""
22+
"name": "PIC18F-Q_DFP",
23+
"semverRange": "^1.11.185"
2424
},
2525
"configurator": {
26-
"name": "",
27-
"semverRange": ""
26+
"name": "MCC",
27+
"semverRange": ">=4.1.0"
2828
},
2929
"device": {
3030
"metaDataVersion": "1.0.0",
@@ -37,9 +37,9 @@
3737
}
3838
},
3939
"author": "Jamus Griego",
40-
"subcategories": [],
41-
"peripherals": [],
42-
"keywords": [],
40+
"subcategories": ["MCC"],
41+
"peripherals": ["ADCC", "UART", "TMR1"],
42+
"keywords": ["Data Visualizer", "Data Streamer"],
4343
"additionalData": {
4444
"longDescription": {
4545
"metaDataVersion": "1.0.0",
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

PIC18F57Q43-analog-read-serial-write-mplab-mcc.X/PIC18F57Q43-adcc-serial-mplab-mcc.mc3

Lines changed: 183 additions & 0 deletions
Large diffs are not rendered by default.

PIC18F57Q43-analog-read-serial-write-mplab-mcc.X/PIC18F57Q43-adcc-serial-mplab-mcc.mc3.bak

Lines changed: 183 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
Copyright (c) [2012-2020] Microchip Technology Inc.
3+
4+
All rights reserved.
5+
6+
You are permitted to use the accompanying software and its derivatives
7+
with Microchip products. See the Microchip license agreement accompanying
8+
this software, if any, for additional info regarding your rights and
9+
obligations.
10+
11+
MICROCHIP SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
12+
WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
13+
LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT
14+
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP OR ITS
15+
LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT
16+
LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE
17+
THEORY FOR ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT
18+
LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES,
19+
OR OTHER SIMILAR COSTS.
20+
21+
To the fullest extend allowed by law, Microchip and its licensors
22+
liability will not exceed the amount of fees, if any, that you paid
23+
directly to Microchip to use this software.
24+
25+
THIRD PARTY SOFTWARE: Notwithstanding anything to the contrary, any
26+
third party software accompanying this software is subject to the terms
27+
and conditions of the third party's license agreement. To the extent
28+
required by third party licenses covering such third party software,
29+
the terms of such license will apply in lieu of the terms provided in
30+
this notice or applicable license. To the extent the terms of such
31+
third party licenses prohibit any of the restrictions described here,
32+
such restrictions will not apply to such third party software.
33+
*/
34+
#include "mcc_generated_files/system/system.h"
35+
#include "mcc_generated_files/data_streamer/data_streamer.h" // Issue #2 - header file eaither needs to be incldued here or within the system.h file for you to be able to call function in main.c
36+
37+
/*
38+
Main application
39+
*/
40+
41+
int main(void) {
42+
SYSTEM_Initialize();
43+
ADPCH = POT; // Set ADC Positive Channel to POT (RA0);
44+
Timer1_Start(); // Start Timer1 (ADC AutoConversion Trigger);
45+
uint16_t measurement;
46+
47+
while (1) {
48+
49+
// Timer1 Overflow will trigger ADC conversion by setting ADGO in hardware;
50+
51+
while (ADCON0bits.ADGO); // Wait here while ADC conversion and calculation is in progress;
52+
//printf("ADC Result %d \r\n", ADCC_GetFilterValue());
53+
54+
variableWrite_sendFrame(ADCC_GetFilterValue());
55+
while (!ADCON0bits.ADGO); // Wait here until Timer1 triggers ADGO again;
56+
}
57+
}

0 commit comments

Comments
 (0)