aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Software/MyConfig.mc3183
-rw-r--r--Software/main.c75
-rw-r--r--Software/mcc_generated_files/mcc.c124
-rw-r--r--Software/mcc_generated_files/mcc.h111
-rw-r--r--Software/mcc_generated_files/pin_manager.c92
-rw-r--r--Software/mcc_generated_files/pin_manager.h151
-rw-r--r--Software/mcc_generated_files/pwm5.c81
-rw-r--r--Software/mcc_generated_files/pwm5.h140
-rw-r--r--Software/nbproject/Makefile-default.mk94
-rw-r--r--Software/nbproject/Makefile-genesis.properties11
-rw-r--r--Software/nbproject/Makefile-impl.mk2
-rw-r--r--Software/nbproject/Makefile-local-default.mk21
-rw-r--r--Software/nbproject/Makefile-variables.mk8
-rw-r--r--Software/nbproject/Package-default.bash12
-rw-r--r--Software/nbproject/configurations.xml17
-rw-r--r--Software/nbproject/private/configurations.xml2
-rw-r--r--Software/nbproject/private/private.xml5
-rw-r--r--Software/nbproject/project.xml2
-rw-r--r--Software/newmain.c4
-rw-r--r--mcc-user-guide.pdfbin0 -> 1150280 bytes
20 files changed, 1061 insertions, 74 deletions
diff --git a/Software/MyConfig.mc3 b/Software/MyConfig.mc3
index b5e0973..e825fe4 100644
--- a/Software/MyConfig.mc3
+++ b/Software/MyConfig.mc3
@@ -21,6 +21,10 @@
<string>class com.microchip.mcc.mcu8.pinManager.PinManager</string>
</entry>
<entry>
+ <string>PWM5</string>
+ <string>class com.microchip.mcc.mcu8.modules.pwm.PWM</string>
+ </entry>
+ <entry>
<string>RESET</string>
<string>class com.microchip.mcc.mcu8.systemManager.reset.RESET</string>
</entry>
@@ -71,7 +75,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCCON1"/>
- <value>98</value>
+ <value>64</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="PMD" registerAlias="PMD1" settingAlias="TMR1MD" alias="TMR1 disabled"/>
@@ -95,7 +99,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="System Module" registerAlias="CONFIG1" settingAlias="RSTOSC"/>
- <value>HFINT1</value>
+ <value>LFINT</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="IOCAP" settingAlias="IOCAP0" alias="disabled"/>
@@ -127,7 +131,11 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="INTERNAL OSCILLATOR" name="CustomFOSC"/>
- <value>HFINTOSC (1MHz)</value>
+ <value>LFINTOSC (31kHz)</value>
+ </entry>
+ <entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="ccpr"/>
+ <value>0</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="IOCAF" settingAlias="IOCAF3" alias="disabled"/>
@@ -323,7 +331,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="TRISA"/>
- <value>55</value>
+ <value>51</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="ANSELA" settingAlias="ANSA1" alias="digital"/>
@@ -382,6 +390,10 @@
<value>1</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="PWM5" registerAlias="PWMCON"/>
+ <value>128</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="RA0PPS" settingAlias="RA0PPS"/>
<value>0</value>
</entry>
@@ -470,6 +482,10 @@
<value>1</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="pwmFreq"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="T1GPPS"/>
<value>4</value>
</entry>
@@ -691,7 +707,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="INTERNAL OSCILLATOR" name="CurrentPllString"/>
- <value/>
+ <value></value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="IOCAF" settingAlias="IOCAF2" alias="enabled"/>
@@ -710,6 +726,10 @@
<value>0</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="pwmPeriod"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="IOCAP" settingAlias="IOCAP3"/>
<value>disabled</value>
</entry>
@@ -911,7 +931,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCFRQ" settingAlias="HFFRQ"/>
- <value>4_MHz</value>
+ <value>16_MHz</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="ANSELA" settingAlias="ANSA4" alias="analog"/>
@@ -919,7 +939,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="INTERNAL OSCILLATOR" name="CurrentSystemClockInHz"/>
- <value>1000000</value>
+ <value>31000</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="IOCAP" settingAlias="IOCAP1" alias="enabled"/>
@@ -1006,6 +1026,10 @@
<value>1</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="PWM5" registerAlias="PWMDCL" settingAlias="PWMDCL"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="ANSELA" settingAlias="ANSA4" alias="digital"/>
<value>0</value>
</entry>
@@ -1090,6 +1114,10 @@
<value>8</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="pwmdc"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="WDT" registerAlias="WDTCON0" settingAlias="WDTPS" alias="1:8192"/>
<value>8</value>
</entry>
@@ -1135,7 +1163,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCFRQ"/>
- <value>3</value>
+ <value>6</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="IOCAF" settingAlias="IOCAF5" alias="enabled"/>
@@ -1143,7 +1171,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="System Module" registerAlias="CONFIG1"/>
- <value>10596</value>
+ <value>10564</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="LATA" settingAlias="LATA4" alias="set"/>
@@ -1279,7 +1307,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCCON1" settingAlias="NDIV"/>
- <value>4</value>
+ <value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG1" settingAlias="FEXTOSC" alias="XT"/>
@@ -1298,6 +1326,10 @@
<value>2</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="tmr2present"/>
+ <value>disabled</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Interrupt Module" name="MULTI_VECTOR_ENABLE"/>
<value>disabled</value>
</entry>
@@ -1331,7 +1363,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="INTERNAL OSCILLATOR" name="HFIntOscClockInHz"/>
- <value>4000000</value>
+ <value>16000000</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="PMD" registerAlias="PMD3" settingAlias="CCP2MD"/>
@@ -1339,7 +1371,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="INTERNAL OSCILLATOR" name="CustomIRFC"/>
- <value>4_MHz</value>
+ <value>16_MHz</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="T1CKIPPS" settingAlias="T1CKIPPS"/>
@@ -1350,6 +1382,10 @@
<value>CWG1 enabled</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="PWM5" registerAlias="PWMDCH" settingAlias="PWMDCH"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCCON3" settingAlias="SOSCBE" alias="crystal oscillator"/>
<value>0</value>
</entry>
@@ -1402,6 +1438,10 @@
<value>0</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="dutyCycle"/>
+ <value>50.0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="T0CKIPPS" settingAlias="T0CKIPPS"/>
<value>2</value>
</entry>
@@ -1443,7 +1483,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="System Module" registerAlias="CONFIG3" settingAlias="LVP"/>
- <value>ON</value>
+ <value>OFF</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="IOCAP" settingAlias="IOCAP4" alias="disabled"/>
@@ -1458,6 +1498,10 @@
<value>64</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="PWM5" registerAlias="PWMCON" settingAlias="PWMOUT"/>
+ <value>disabled</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="ODCONA" settingAlias="ODCA4" alias="enabled"/>
<value>1</value>
</entry>
@@ -1495,7 +1539,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="TRISA" settingAlias="TRISA2"/>
- <value>input</value>
+ <value>output</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="IOCAN" settingAlias="IOCAN3"/>
@@ -1506,6 +1550,10 @@
<value>1</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="pwmTmrSelect"/>
+ <value>Timer2</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="Pin Module" registerAlias="TRISA" settingAlias="TRISA5" alias="output"/>
<value>0</value>
</entry>
@@ -1518,6 +1566,10 @@
<value>1</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="PWM5" registerAlias="PWMDCH"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="SLRCONA" settingAlias="SLRA5"/>
<value>limited</value>
</entry>
@@ -1558,6 +1610,10 @@
<value>1</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="PWM5" registerAlias="PWMCON" settingAlias="PWMOUT" alias="disabled"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG2" settingAlias="BORV" alias="LOW"/>
<value>512</value>
</entry>
@@ -1610,6 +1666,10 @@
<value/>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="PWM5" registerAlias="PWMCON" settingAlias="PWMEN" alias="enabled"/>
+ <value>1</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="MDCIN1PPS"/>
<value>0</value>
</entry>
@@ -1671,7 +1731,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="Custom Name RA5"/>
- <value/>
+ <value>IO_RA5</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG2" settingAlias="MCLRE" alias="OFF"/>
@@ -1683,7 +1743,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="Custom Name RA2"/>
- <value/>
+ <value>IO_RA2</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="Custom Name RA3"/>
@@ -1695,7 +1755,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="Custom Name RA4"/>
- <value/>
+ <value>IO_RA4</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="CLCIN0PPS"/>
@@ -1723,7 +1783,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="ANSELA" settingAlias="ANSA5"/>
- <value>analog</value>
+ <value>digital</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCFRQ" settingAlias="HFFRQ" alias="16_MHz"/>
@@ -1738,20 +1798,32 @@
<value>0</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="CCPTMRS"/>
+ <value>CCPTMRS</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="WDT" registerAlias="WDTCON0" settingAlias="WDTPS"/>
<value>1:65536</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="PWM5" registerAlias="PWMCON" settingAlias="PWMOUT" alias="enabled"/>
+ <value>1</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCCON3" settingAlias="ORDY"/>
<value>clock switching</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="PWM5" registerAlias="PWMDCL"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="RA0"/>
<value>disabled</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="RA2"/>
- <value>disabled</value>
+ <value>output</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="RA1"/>
@@ -1783,7 +1855,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="RA4"/>
- <value>disabled</value>
+ <value>input</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="RA3"/>
@@ -1799,11 +1871,11 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="RA5"/>
- <value>disabled</value>
+ <value>input</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="ANSELA" settingAlias="ANSA4"/>
- <value>analog</value>
+ <value>digital</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="INTERNAL OSCILLATOR" name="USB_LOADED"/>
@@ -1814,6 +1886,10 @@
<value>1</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="timerselpresence"/>
+ <value>timerselabsent</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCCON1" settingAlias="NDIV" alias="1"/>
<value>0</value>
</entry>
@@ -1846,8 +1922,16 @@
<value>clear</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="PWM5" registerAlias="PWMCON" settingAlias="PWMEN"/>
+ <value>enabled</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="INTERNAL OSCILLATOR" name="FOSCClockValue"/>
- <value>1000000</value>
+ <value>31000</value>
+ </entry>
+ <entry>
+ <key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="PWM5" registerAlias="PWMCON" settingAlias="PWMPOL" alias="active_lo"/>
+ <value>1</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="iocUserSet RA3"/>
@@ -1886,6 +1970,10 @@
<value>disabled</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="PWM5" registerAlias="PWMCON" settingAlias="PWMPOL"/>
+ <value>active_hi</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="TXPPS"/>
<value>0</value>
</entry>
@@ -1911,7 +1999,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="INTERNAL OSCILLATOR" registerAlias="OSCCON1" settingAlias="NOSC"/>
- <value>HFINTOSC</value>
+ <value>LFINTOSC</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="System Module" registerAlias="CONFIG2" settingAlias="DEBUG"/>
@@ -2054,6 +2142,10 @@
<value>CLC1 enabled</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="intermoduleEnable"/>
+ <value>enabled</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="RA4PPS"/>
<value>0</value>
</entry>
@@ -2078,6 +2170,10 @@
<value>analog</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="PWM5" registerAlias="PWMCON" settingAlias="PWMPOL" alias="active_hi"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="Pin Module" name="trisUserSetRA2"/>
<value>disabled</value>
</entry>
@@ -2090,6 +2186,14 @@
<value>6</value>
</entry>
<entry>
+ <key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="PWM5" registerAlias="PWMCON" settingAlias="PWMEN" alias="disabled"/>
+ <value>0</value>
+ </entry>
+ <entry>
+ <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="PWM5" name="pwmResolution"/>
+ <value>0</value>
+ </entry>
+ <entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="MDMINPPS"/>
<value>1</value>
</entry>
@@ -2115,7 +2219,7 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="System Module" registerAlias="CONFIG3"/>
- <value>8195</value>
+ <value>3</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.SettingKey" moduleName="Pin Module" registerAlias="SLRCONA" settingAlias="SLRA1"/>
@@ -2135,8 +2239,33 @@
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.RegisterKey" moduleName="Pin Module" registerAlias="ANSELA"/>
- <value>55</value>
+ <value>7</value>
</entry>
</tokenMap>
- <generatedFileHashHistoryMap class="java.util.HashMap"/>
+ <generatedFileHashHistoryMap class="java.util.HashMap">
+ <entry>
+ <file>mcc_generated_files/pin_manager.h</file>
+ <hash>d2c6bfc0afd4d7aa67e7ef8ad8ac51ea6fc26c15e65457000e87f742625e695c</hash>
+ </entry>
+ <entry>
+ <file>mcc_generated_files/pwm5.c</file>
+ <hash>021861c394d555a75378f46ac66845cac793ab4418acdb717371cad1661622cf</hash>
+ </entry>
+ <entry>
+ <file>mcc_generated_files/mcc.h</file>
+ <hash>1e34250a77d9548f79fff316d58398cd34952f456418527ac9dd2eaaaf2cd307</hash>
+ </entry>
+ <entry>
+ <file>mcc_generated_files/mcc.c</file>
+ <hash>b88a9e3662dd6a956abdfd0337bdb41aa8b6f9b8c9e82d6c7eb99ce1f0691f89</hash>
+ </entry>
+ <entry>
+ <file>mcc_generated_files/pin_manager.c</file>
+ <hash>c1b0a5385798098681a22ce86eb07a7971d76d8b39ff59f799ab3acbb8b62c33</hash>
+ </entry>
+ <entry>
+ <file>mcc_generated_files/pwm5.h</file>
+ <hash>63f3419981f91d0c8a96476df16d3ff6fe320588e901d97fa1d3db59c1bd55d0</hash>
+ </entry>
+ </generatedFileHashHistoryMap>
</config> \ No newline at end of file
diff --git a/Software/main.c b/Software/main.c
new file mode 100644
index 0000000..075c37e
--- /dev/null
+++ b/Software/main.c
@@ -0,0 +1,75 @@
+/**
+ Generated Main Source File
+
+ Company:
+ Microchip Technology Inc.
+
+ File Name:
+ main.c
+
+ Summary:
+ This is the main file generated using PIC10 / PIC12 / PIC16 / PIC18 MCUs
+
+ Description:
+ This header file provides implementations for driver APIs for all modules selected in the GUI.
+ Generation Information :
+ Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65
+ Device : PIC16F18313
+ Driver Version : 2.00
+*/
+
+/*
+ (c) 2016 Microchip Technology Inc. and its subsidiaries. You may use this
+ software and any derivatives exclusively with Microchip products.
+
+ THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
+ EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
+ PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
+ WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
+
+ IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
+ INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
+ WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
+ BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
+ FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
+ ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+
+ MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
+ TERMS.
+*/
+
+#include "mcc_generated_files/mcc.h"
+
+/*
+ Main application
+ */
+void main(void)
+{
+ // initialize the device
+ SYSTEM_Initialize();
+
+ // When using interrupts, you need to set the Global and Peripheral Interrupt Enable bits
+ // Use the following macros to:
+
+ // Enable the Global Interrupts
+ //INTERRUPT_GlobalInterruptEnable();
+
+ // Enable the Peripheral Interrupts
+ //INTERRUPT_PeripheralInterruptEnable();
+
+ // Disable the Global Interrupts
+ //INTERRUPT_GlobalInterruptDisable();
+
+ // Disable the Peripheral Interrupts
+ //INTERRUPT_PeripheralInterruptDisable();
+
+ while (1)
+ {
+ // Add your application code
+ }
+}
+/**
+ End of File
+*/ \ No newline at end of file
diff --git a/Software/mcc_generated_files/mcc.c b/Software/mcc_generated_files/mcc.c
new file mode 100644
index 0000000..c8d8339
--- /dev/null
+++ b/Software/mcc_generated_files/mcc.c
@@ -0,0 +1,124 @@
+/**
+ @Generated PIC10 / PIC12 / PIC16 / PIC18 MCUs Source File
+
+ @Company:
+ Microchip Technology Inc.
+
+ @File Name:
+ mcc.c
+
+ @Summary:
+ This is the mcc.c file generated using PIC10 / PIC12 / PIC16 / PIC18 MCUs
+
+ @Description:
+ This header file provides implementations for driver APIs for all modules selected in the GUI.
+ Generation Information :
+ Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65
+ Device : PIC16F18313
+ Driver Version : 2.00
+ The generated drivers are tested against the following:
+ Compiler : XC8 1.45 or later
+ MPLAB : MPLAB X 4.10
+*/
+
+/*
+ (c) 2016 Microchip Technology Inc. and its subsidiaries. You may use this
+ software and any derivatives exclusively with Microchip products.
+
+ THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
+ EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
+ PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
+ WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
+
+ IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
+ INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
+ WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
+ BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
+ FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
+ ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+
+ MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
+ TERMS.
+*/
+
+// Configuration bits: selected in the GUI
+
+// CONFIG1
+#pragma config FEXTOSC = OFF // FEXTOSC External Oscillator mode Selection bits->Oscillator not enabled
+#pragma config RSTOSC = LFINT // Power-up default value for COSC bits->LFINTOSC (31kHz)
+#pragma config CLKOUTEN = OFF // Clock Out Enable bit->CLKOUT function is disabled; I/O or oscillator function on OSC2
+#pragma config CSWEN = ON // Clock Switch Enable bit->Writing to NOSC and NDIV is allowed
+#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable->Fail-Safe Clock Monitor is enabled
+
+// CONFIG2
+#pragma config MCLRE = ON // Master Clear Enable bit->MCLR/VPP pin function is MCLR; Weak pull-up enabled
+#pragma config PWRTE = OFF // Power-up Timer Enable bit->PWRT disabled
+#pragma config WDTE = OFF // Watchdog Timer Enable bits->WDT disabled; SWDTEN is ignored
+#pragma config LPBOREN = OFF // Low-power BOR enable bit->ULPBOR disabled
+#pragma config BOREN = ON // Brown-out Reset Enable bits->Brown-out Reset enabled, SBOREN bit ignored
+#pragma config BORV = LOW // Brown-out Reset Voltage selection bit->Brown-out voltage (Vbor) set to 2.45V
+#pragma config PPS1WAY = ON // PPSLOCK bit One-Way Set Enable bit->The PPSLOCK bit can be cleared and set only once; PPS registers remain locked after one clear/set cycle
+#pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable bit->Stack Overflow or Underflow will cause a Reset
+#pragma config DEBUG = OFF // Debugger enable bit->Background debugger disabled
+
+// CONFIG3
+#pragma config WRT = OFF // User NVM self-write protection bits->Write protection off
+#pragma config LVP = OFF // Low Voltage Programming Enable bit->HV on MCLR/VPP must be used for programming.
+
+// CONFIG4
+#pragma config CP = OFF // User NVM Program Memory Code Protection bit->User NVM code protection disabled
+#pragma config CPD = OFF // Data NVM Memory Code Protection bit->Data NVM code protection disabled
+
+#include "mcc.h"
+
+
+void SYSTEM_Initialize(void)
+{
+
+ PMD_Initialize();
+ PIN_MANAGER_Initialize();
+ OSCILLATOR_Initialize();
+ WDT_Initialize();
+ PWM5_Initialize();
+}
+
+void OSCILLATOR_Initialize(void)
+{
+ // NOSC LFINTOSC; NDIV 1;
+ OSCCON1 = 0x40;
+ // CSWHOLD may proceed; SOSCPWR Low power; SOSCBE crystal oscillator;
+ OSCCON3 = 0x00;
+ // LFOEN disabled; ADOEN disabled; SOSCEN disabled; EXTOEN disabled; HFOEN disabled;
+ OSCEN = 0x00;
+ // HFFRQ 16_MHz;
+ OSCFRQ = 0x06;
+ // HFTUN 32;
+ OSCTUNE = 0x20;
+}
+
+void WDT_Initialize(void)
+{
+ // WDTPS 1:65536; SWDTEN OFF;
+ WDTCON = 0x16;
+}
+
+void PMD_Initialize(void)
+{
+ // CLKRMD CLKR enabled; SYSCMD SYSCLK enabled; FVRMD FVR enabled; IOCMD IOC enabled; NVMMD NVM enabled;
+ PMD0 = 0x00;
+ // TMR0MD TMR0 enabled; TMR1MD TMR1 enabled; TMR2MD TMR2 enabled; NCOMD DDS(NCO) enabled;
+ PMD1 = 0x00;
+ // DACMD DAC enabled; CMP1MD CMP1 enabled; ADCMD ADC enabled;
+ PMD2 = 0x00;
+ // CCP2MD CCP2 enabled; CCP1MD CCP1 enabled; PWM6MD PWM6 enabled; PWM5MD PWM5 enabled; CWG1MD CWG1 enabled;
+ PMD3 = 0x00;
+ // MSSP1MD MSSP1 enabled; UART1MD EUSART enabled;
+ PMD4 = 0x00;
+ // DSMMD DSM enabled; CLC1MD CLC1 enabled; CLC2MD CLC2 enabled;
+ PMD5 = 0x00;
+}
+/**
+ End of File
+*/
diff --git a/Software/mcc_generated_files/mcc.h b/Software/mcc_generated_files/mcc.h
new file mode 100644
index 0000000..773539a
--- /dev/null
+++ b/Software/mcc_generated_files/mcc.h
@@ -0,0 +1,111 @@
+/**
+ @Generated PIC10 / PIC12 / PIC16 / PIC18 MCUs Header File
+
+ @Company:
+ Microchip Technology Inc.
+
+ @File Name:
+ mcc.h
+
+ @Summary:
+ This is the mcc.h file generated using PIC10 / PIC12 / PIC16 / PIC18 MCUs
+
+ @Description:
+ This header file provides implementations for driver APIs for all modules selected in the GUI.
+ Generation Information :
+ Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65
+ Device : PIC16F18313
+ Driver Version : 2.00
+ The generated drivers are tested against the following:
+ Compiler : XC8 1.45 or later
+ MPLAB : MPLAB X 4.10
+*/
+
+/*
+ (c) 2016 Microchip Technology Inc. and its subsidiaries. You may use this
+ software and any derivatives exclusively with Microchip products.
+
+ THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
+ EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
+ PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
+ WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
+
+ IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
+ INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
+ WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
+ BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
+ FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
+ ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+
+ MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
+ TERMS.
+*/
+
+#ifndef MCC_H
+#define MCC_H
+#include <xc.h>
+#include "pin_manager.h"
+#include <stdint.h>
+#include <stdbool.h>
+#include "pwm5.h"
+
+#define _XTAL_FREQ 31000
+
+
+/**
+ * @Param
+ none
+ * @Returns
+ none
+ * @Description
+ Initializes the device to the default states configured in the
+ * MCC GUI
+ * @Example
+ SYSTEM_Initialize(void);
+ */
+void SYSTEM_Initialize(void);
+
+/**
+ * @Param
+ none
+ * @Returns
+ none
+ * @Description
+ Initializes the oscillator to the default states configured in the
+ * MCC GUI
+ * @Example
+ OSCILLATOR_Initialize(void);
+ */
+void OSCILLATOR_Initialize(void);
+
+/**
+ * @Param
+ none
+ * @Returns
+ none
+ * @Description
+ Initializes the WDT module to the default states configured in the
+ * MCC GUI
+ * @Example
+ WDT_Initialize(void);
+ */
+void WDT_Initialize(void);
+/**
+ * @Param
+ none
+ * @Returns
+ none
+ * @Description
+ Initializes the PMD module to the default states configured in the
+ * MCC GUI
+ * @Example
+ PMD_Initialize(void);
+ */
+void PMD_Initialize(void);
+
+#endif /* MCC_H */
+/**
+ End of File
+*/ \ No newline at end of file
diff --git a/Software/mcc_generated_files/pin_manager.c b/Software/mcc_generated_files/pin_manager.c
new file mode 100644
index 0000000..e3526d8
--- /dev/null
+++ b/Software/mcc_generated_files/pin_manager.c
@@ -0,0 +1,92 @@
+/**
+ Generated Pin Manager File
+
+ Company:
+ Microchip Technology Inc.
+
+ File Name:
+ pin_manager.c
+
+ Summary:
+ This is the Pin Manager file generated using MPLAB(c) Code Configurator
+
+ Description:
+ This header file provides implementations for pin APIs for all pins selected in the GUI.
+ Generation Information :
+ Product Revision : MPLAB(c) Code Configurator - 4.35
+ Device : PIC16F18313
+ Driver Version : 1.02
+ The generated drivers are tested against the following:
+ Compiler : XC8 1.35
+ MPLAB : MPLAB X 3.40
+
+ Copyright (c) 2013 - 2015 released Microchip Technology Inc. All rights reserved.
+
+ Microchip licenses to you the right to use, modify, copy and distribute
+ Software only when embedded on a Microchip microcontroller or digital signal
+ controller that is integrated into your product or third party product
+ (pursuant to the sublicense terms in the accompanying license agreement).
+
+ You should refer to the license agreement accompanying this Software for
+ additional information regarding your rights and obligations.
+
+ SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+ MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+ IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+ CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+ OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+ INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+ CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+ (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+
+*/
+
+#include <xc.h>
+#include "pin_manager.h"
+#include "stdbool.h"
+
+
+
+void PIN_MANAGER_Initialize(void)
+{
+ /**
+ LATx registers
+ */
+ LATA = 0x00;
+
+ /**
+ TRISx registers
+ */
+ TRISA = 0x33;
+
+ /**
+ ANSELx registers
+ */
+ ANSELA = 0x07;
+
+ /**
+ WPUx registers
+ */
+ WPUA = 0x00;
+
+ /**
+ ODx registers
+ */
+ ODCONA = 0x00;
+
+
+
+
+
+}
+
+void PIN_MANAGER_IOC(void)
+{
+
+}
+
+/**
+ End of File
+*/ \ No newline at end of file
diff --git a/Software/mcc_generated_files/pin_manager.h b/Software/mcc_generated_files/pin_manager.h
new file mode 100644
index 0000000..0111e7b
--- /dev/null
+++ b/Software/mcc_generated_files/pin_manager.h
@@ -0,0 +1,151 @@
+/**
+ @Generated Pin Manager Header File
+
+ @Company:
+ Microchip Technology Inc.
+
+ @File Name:
+ pin_manager.h
+
+ @Summary:
+ This is the Pin Manager file generated using MPLAB(c) Code Configurator
+
+ @Description:
+ This header file provides implementations for pin APIs for all pins selected in the GUI.
+ Generation Information :
+ Product Revision : MPLAB(c) Code Configurator - 4.35
+ Device : PIC16F18313
+ Version : 1.01
+ The generated drivers are tested against the following:
+ Compiler : XC8 1.35
+ MPLAB : MPLAB X 3.40
+
+ Copyright (c) 2013 - 2015 released Microchip Technology Inc. All rights reserved.
+
+ Microchip licenses to you the right to use, modify, copy and distribute
+ Software only when embedded on a Microchip microcontroller or digital signal
+ controller that is integrated into your product or third party product
+ (pursuant to the sublicense terms in the accompanying license agreement).
+
+ You should refer to the license agreement accompanying this Software for
+ additional information regarding your rights and obligations.
+
+ SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
+ EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+ MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+ IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+ CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+ OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+ INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+ CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+ (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+
+*/
+
+
+#ifndef PIN_MANAGER_H
+#define PIN_MANAGER_H
+
+#define INPUT 1
+#define OUTPUT 0
+
+#define HIGH 1
+#define LOW 0
+
+#define ANALOG 1
+#define DIGITAL 0
+
+#define PULL_UP_ENABLED 1
+#define PULL_UP_DISABLED 0
+
+// get/set IO_RA2 aliases
+#define IO_RA2_TRIS TRISAbits.TRISA2
+#define IO_RA2_LAT LATAbits.LATA2
+#define IO_RA2_PORT PORTAbits.RA2
+#define IO_RA2_WPU WPUAbits.WPUA2
+#define IO_RA2_OD ODCONAbits.ODCA2
+#define IO_RA2_ANS ANSELAbits.ANSA2
+#define IO_RA2_SetHigh() do { LATAbits.LATA2 = 1; } while(0)
+#define IO_RA2_SetLow() do { LATAbits.LATA2 = 0; } while(0)
+#define IO_RA2_Toggle() do { LATAbits.LATA2 = ~LATAbits.LATA2; } while(0)
+#define IO_RA2_GetValue() PORTAbits.RA2
+#define IO_RA2_SetDigitalInput() do { TRISAbits.TRISA2 = 1; } while(0)
+#define IO_RA2_SetDigitalOutput() do { TRISAbits.TRISA2 = 0; } while(0)
+#define IO_RA2_SetPullup() do { WPUAbits.WPUA2 = 1; } while(0)
+#define IO_RA2_ResetPullup() do { WPUAbits.WPUA2 = 0; } while(0)
+#define IO_RA2_SetPushPull() do { ODCONAbits.ODCA2 = 0; } while(0)
+#define IO_RA2_SetOpenDrain() do { ODCONAbits.ODCA2 = 1; } while(0)
+#define IO_RA2_SetAnalogMode() do { ANSELAbits.ANSA2 = 1; } while(0)
+#define IO_RA2_SetDigitalMode() do { ANSELAbits.ANSA2 = 0; } while(0)
+
+// get/set IO_RA4 aliases
+#define IO_RA4_TRIS TRISAbits.TRISA4
+#define IO_RA4_LAT LATAbits.LATA4
+#define IO_RA4_PORT PORTAbits.RA4
+#define IO_RA4_WPU WPUAbits.WPUA4
+#define IO_RA4_OD ODCONAbits.ODCA4
+#define IO_RA4_ANS ANSELAbits.ANSA4
+#define IO_RA4_SetHigh() do { LATAbits.LATA4 = 1; } while(0)
+#define IO_RA4_SetLow() do { LATAbits.LATA4 = 0; } while(0)
+#define IO_RA4_Toggle() do { LATAbits.LATA4 = ~LATAbits.LATA4; } while(0)
+#define IO_RA4_GetValue() PORTAbits.RA4
+#define IO_RA4_SetDigitalInput() do { TRISAbits.TRISA4 = 1; } while(0)
+#define IO_RA4_SetDigitalOutput() do { TRISAbits.TRISA4 = 0; } while(0)
+#define IO_RA4_SetPullup() do { WPUAbits.WPUA4 = 1; } while(0)
+#define IO_RA4_ResetPullup() do { WPUAbits.WPUA4 = 0; } while(0)
+#define IO_RA4_SetPushPull() do { ODCONAbits.ODCA4 = 0; } while(0)
+#define IO_RA4_SetOpenDrain() do { ODCONAbits.ODCA4 = 1; } while(0)
+#define IO_RA4_SetAnalogMode() do { ANSELAbits.ANSA4 = 1; } while(0)
+#define IO_RA4_SetDigitalMode() do { ANSELAbits.ANSA4 = 0; } while(0)
+
+// get/set IO_RA5 aliases
+#define IO_RA5_TRIS TRISAbits.TRISA5
+#define IO_RA5_LAT LATAbits.LATA5
+#define IO_RA5_PORT PORTAbits.RA5
+#define IO_RA5_WPU WPUAbits.WPUA5
+#define IO_RA5_OD ODCONAbits.ODCA5
+#define IO_RA5_ANS ANSELAbits.ANSA5
+#define IO_RA5_SetHigh() do { LATAbits.LATA5 = 1; } while(0)
+#define IO_RA5_SetLow() do { LATAbits.LATA5 = 0; } while(0)
+#define IO_RA5_Toggle() do { LATAbits.LATA5 = ~LATAbits.LATA5; } while(0)
+#define IO_RA5_GetValue() PORTAbits.RA5
+#define IO_RA5_SetDigitalInput() do { TRISAbits.TRISA5 = 1; } while(0)
+#define IO_RA5_SetDigitalOutput() do { TRISAbits.TRISA5 = 0; } while(0)
+#define IO_RA5_SetPullup() do { WPUAbits.WPUA5 = 1; } while(0)
+#define IO_RA5_ResetPullup() do { WPUAbits.WPUA5 = 0; } while(0)
+#define IO_RA5_SetPushPull() do { ODCONAbits.ODCA5 = 0; } while(0)
+#define IO_RA5_SetOpenDrain() do { ODCONAbits.ODCA5 = 1; } while(0)
+#define IO_RA5_SetAnalogMode() do { ANSELAbits.ANSA5 = 1; } while(0)
+#define IO_RA5_SetDigitalMode() do { ANSELAbits.ANSA5 = 0; } while(0)
+
+/**
+ @Param
+ none
+ @Returns
+ none
+ @Description
+ GPIO and peripheral I/O initialization
+ @Example
+ PIN_MANAGER_Initialize();
+ */
+void PIN_MANAGER_Initialize (void);
+
+/**
+ * @Param
+ none
+ * @Returns
+ none
+ * @Description
+ Interrupt on Change Handling routine
+ * @Example
+ PIN_MANAGER_IOC();
+ */
+void PIN_MANAGER_IOC(void);
+
+
+
+#endif // PIN_MANAGER_H
+/**
+ End of File
+*/ \ No newline at end of file
diff --git a/Software/mcc_generated_files/pwm5.c b/Software/mcc_generated_files/pwm5.c
new file mode 100644
index 0000000..acd9701
--- /dev/null
+++ b/Software/mcc_generated_files/pwm5.c
@@ -0,0 +1,81 @@
+ /**
+ PWM5 Generated Driver File
+
+ @Company
+ Microchip Technology Inc.
+
+ @File Name
+ pwm5.c
+
+ @Summary
+ This is the generated driver implementation file for the PWM5 driver using PIC10 / PIC12 / PIC16 / PIC18 MCUs
+
+ @Description
+ This source file provides implementations for driver APIs for PWM5.
+ Generation Information :
+ Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65
+ Device : PIC16F18313
+ Driver Version : 2.00
+ The generated drivers are tested against the following:
+ Compiler : XC8 1.45 or later
+ MPLAB : MPLAB X 4.10
+ */
+
+ /*
+ (c) 2016 Microchip Technology Inc. and its subsidiaries. You may use this
+ software and any derivatives exclusively with Microchip products.
+
+ THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
+ EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
+ PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
+ WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
+
+ IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
+ INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
+ WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
+ BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
+ FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
+ ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+
+ MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
+ TERMS.
+*/
+
+ /**
+ Section: Included Files
+ */
+
+ #include <xc.h>
+ #include "pwm5.h"
+
+ /**
+ Section: PWM Module APIs
+ */
+
+ void PWM5_Initialize(void)
+ {
+ // Set the PWM to the options selected in the PIC10 / PIC12 / PIC16 / PIC18 MCUs.
+ // PWM5POL active_hi; PWM5EN enabled;
+ PWM5CON = 0x80;
+
+ // PWM5DCH 0;
+ PWM5DCH = 0x00;
+
+ // PWM5DCL 0;
+ PWM5DCL = 0x00;
+
+ }
+
+ void PWM5_LoadDutyValue(uint16_t dutyValue)
+ {
+ // Writing to 8 MSBs of PWM duty cycle in PWMDCH register
+ PWM5DCH = (dutyValue & 0x03FC)>>2;
+
+ // Writing to 2 LSBs of PWM duty cycle in PWMDCL register
+ PWM5DCL = (dutyValue & 0x0003)<<6;
+ }
+ /**
+ End of File
+ */
diff --git a/Software/mcc_generated_files/pwm5.h b/Software/mcc_generated_files/pwm5.h
new file mode 100644
index 0000000..afd4622
--- /dev/null
+++ b/Software/mcc_generated_files/pwm5.h
@@ -0,0 +1,140 @@
+ /**
+ PWM5 Generated Driver API Header File
+
+ @Company
+ Microchip Technology Inc.
+
+ @File Name
+ pwm5.h
+
+ @Summary
+ This is the generated header file for the PWM5 driver using PIC10 / PIC12 / PIC16 / PIC18 MCUs
+
+ @Description
+ This header file provides APIs for driver for PWM5.
+ Generation Information :
+ Product Revision : PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65
+ Device : PIC16F18313
+ Driver Version : 2.00
+ The generated drivers are tested against the following:
+ Compiler : XC8 1.45 or later
+ MPLAB : MPLAB X 4.10
+ */
+
+/*
+ (c) 2016 Microchip Technology Inc. and its subsidiaries. You may use this
+ software and any derivatives exclusively with Microchip products.
+
+ THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
+ EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
+ PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
+ WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
+
+ IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
+ INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
+ WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
+ BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
+ FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
+ ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+
+ MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
+ TERMS.
+*/
+
+ #ifndef _PWM5_H
+ #define _PWM5_H
+
+ /**
+ Section: Included Files
+ */
+
+ #include <xc.h>
+ #include <stdint.h>
+
+ #ifdef __cplusplus // Provide C++ Compatibility
+
+ extern "C" {
+
+ #endif
+
+ /**
+ Section: Macro Declarations
+ */
+
+ #define PWM5_INITIALIZE_DUTY_VALUE 0
+
+ /**
+ Section: PWM Module APIs
+ */
+
+ /**
+ @Summary
+ Initializes the PWM5
+
+ @Description
+ This routine initializes the EPWM5_Initialize
+ This routine must be called before any other PWM5 routine is called.
+ This routine should only be called once during system initialization.
+
+ @Preconditions
+ None
+
+ @Param
+ None
+
+ @Returns
+ None
+
+ @Comment
+
+
+ @Example
+ <code>
+ uint16_t dutycycle;
+
+ PWM5_Initialize();
+ PWM5_LoadDutyValue(dutycycle);
+ </code>
+ */
+ void PWM5_Initialize(void);
+
+ /**
+ @Summary
+ Loads 16-bit duty cycle.
+
+ @Description
+ This routine loads the 16 bit duty cycle value.
+
+ @Preconditions
+ PWM5_Initialize() function should have been called
+ before calling this function.
+
+ @Param
+ Pass 16bit duty cycle value.
+
+ @Returns
+ None
+
+ @Example
+ <code>
+ uint16_t dutycycle;
+
+ PWM5_Initialize();
+ PWM5_LoadDutyValue(dutycycle);
+ </code>
+ */
+ void PWM5_LoadDutyValue(uint16_t dutyValue);
+
+
+ #ifdef __cplusplus // Provide C++ Compatibility
+
+ }
+
+ #endif
+
+ #endif //PWM5_H
+ /**
+ End of File
+ */ \ No newline at end of file
diff --git a/Software/nbproject/Makefile-default.mk b/Software/nbproject/Makefile-default.mk
index f4a0655..c471da1 100644
--- a/Software/nbproject/Makefile-default.mk
+++ b/Software/nbproject/Makefile-default.mk
@@ -19,7 +19,7 @@ endif
endif
# Environment
-MKDIR=gnumkdir -p
+MKDIR=mkdir -p
RM=rm -f
MV=mv
CP=cp
@@ -30,12 +30,12 @@ ifeq ($(TYPE_IMAGE), DEBUG_RUN)
IMAGE_TYPE=debug
OUTPUT_SUFFIX=elf
DEBUGGABLE_SUFFIX=elf
-FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
+FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
else
IMAGE_TYPE=production
OUTPUT_SUFFIX=hex
DEBUGGABLE_SUFFIX=elf
-FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
+FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
endif
ifeq ($(COMPARE_BUILD), true)
@@ -57,17 +57,17 @@ OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
# Source Files Quoted if spaced
-SOURCEFILES_QUOTED_IF_SPACED=newmain.c
+SOURCEFILES_QUOTED_IF_SPACED=mcc_generated_files/pin_manager.c mcc_generated_files/mcc.c mcc_generated_files/pwm5.c newmain.c main.c
# Object Files Quoted if spaced
-OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/newmain.p1
-POSSIBLE_DEPFILES=${OBJECTDIR}/newmain.p1.d
+OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/mcc_generated_files/pin_manager.p1 ${OBJECTDIR}/mcc_generated_files/mcc.p1 ${OBJECTDIR}/mcc_generated_files/pwm5.p1 ${OBJECTDIR}/newmain.p1 ${OBJECTDIR}/main.p1
+POSSIBLE_DEPFILES=${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d ${OBJECTDIR}/mcc_generated_files/mcc.p1.d ${OBJECTDIR}/mcc_generated_files/pwm5.p1.d ${OBJECTDIR}/newmain.p1.d ${OBJECTDIR}/main.p1.d
# Object Files
-OBJECTFILES=${OBJECTDIR}/newmain.p1
+OBJECTFILES=${OBJECTDIR}/mcc_generated_files/pin_manager.p1 ${OBJECTDIR}/mcc_generated_files/mcc.p1 ${OBJECTDIR}/mcc_generated_files/pwm5.p1 ${OBJECTDIR}/newmain.p1 ${OBJECTDIR}/main.p1
# Source Files
-SOURCEFILES=newmain.c
+SOURCEFILES=mcc_generated_files/pin_manager.c mcc_generated_files/mcc.c mcc_generated_files/pwm5.c newmain.c main.c
CFLAGS=
@@ -87,12 +87,36 @@ FIXDEPS=fixDeps
ifneq ($(INFORMATION_MESSAGE), )
@echo $(INFORMATION_MESSAGE)
endif
- ${MAKE} -f nbproject/Makefile-default.mk dist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
+ ${MAKE} -f nbproject/Makefile-default.mk dist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
MP_PROCESSOR_OPTION=16F18313
# ------------------------------------------------------------------------------------
# Rules for buildStep: compile
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
+${OBJECTDIR}/mcc_generated_files/pin_manager.p1: mcc_generated_files/pin_manager.c nbproject/Makefile-${CND_CONF}.mk
+ @${MKDIR} "${OBJECTDIR}/mcc_generated_files"
+ @${RM} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d
+ @${RM} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1
+ ${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G -D__DEBUG=1 --debugger=pickit3 --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib $(COMPARISON_BUILD) --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -o${OBJECTDIR}/mcc_generated_files/pin_manager.p1 mcc_generated_files/pin_manager.c
+ @-${MV} ${OBJECTDIR}/mcc_generated_files/pin_manager.d ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d
+ @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+
+${OBJECTDIR}/mcc_generated_files/mcc.p1: mcc_generated_files/mcc.c nbproject/Makefile-${CND_CONF}.mk
+ @${MKDIR} "${OBJECTDIR}/mcc_generated_files"
+ @${RM} ${OBJECTDIR}/mcc_generated_files/mcc.p1.d
+ @${RM} ${OBJECTDIR}/mcc_generated_files/mcc.p1
+ ${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G -D__DEBUG=1 --debugger=pickit3 --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib $(COMPARISON_BUILD) --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -o${OBJECTDIR}/mcc_generated_files/mcc.p1 mcc_generated_files/mcc.c
+ @-${MV} ${OBJECTDIR}/mcc_generated_files/mcc.d ${OBJECTDIR}/mcc_generated_files/mcc.p1.d
+ @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/mcc.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+
+${OBJECTDIR}/mcc_generated_files/pwm5.p1: mcc_generated_files/pwm5.c nbproject/Makefile-${CND_CONF}.mk
+ @${MKDIR} "${OBJECTDIR}/mcc_generated_files"
+ @${RM} ${OBJECTDIR}/mcc_generated_files/pwm5.p1.d
+ @${RM} ${OBJECTDIR}/mcc_generated_files/pwm5.p1
+ ${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G -D__DEBUG=1 --debugger=pickit3 --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib $(COMPARISON_BUILD) --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -o${OBJECTDIR}/mcc_generated_files/pwm5.p1 mcc_generated_files/pwm5.c
+ @-${MV} ${OBJECTDIR}/mcc_generated_files/pwm5.d ${OBJECTDIR}/mcc_generated_files/pwm5.p1.d
+ @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/pwm5.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+
${OBJECTDIR}/newmain.p1: newmain.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/newmain.p1.d
@@ -101,7 +125,39 @@ ${OBJECTDIR}/newmain.p1: newmain.c nbproject/Makefile-${CND_CONF}.mk
@-${MV} ${OBJECTDIR}/newmain.d ${OBJECTDIR}/newmain.p1.d
@${FIXDEPS} ${OBJECTDIR}/newmain.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+${OBJECTDIR}/main.p1: main.c nbproject/Makefile-${CND_CONF}.mk
+ @${MKDIR} "${OBJECTDIR}"
+ @${RM} ${OBJECTDIR}/main.p1.d
+ @${RM} ${OBJECTDIR}/main.p1
+ ${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G -D__DEBUG=1 --debugger=pickit3 --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib $(COMPARISON_BUILD) --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -o${OBJECTDIR}/main.p1 main.c
+ @-${MV} ${OBJECTDIR}/main.d ${OBJECTDIR}/main.p1.d
+ @${FIXDEPS} ${OBJECTDIR}/main.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+
else
+${OBJECTDIR}/mcc_generated_files/pin_manager.p1: mcc_generated_files/pin_manager.c nbproject/Makefile-${CND_CONF}.mk
+ @${MKDIR} "${OBJECTDIR}/mcc_generated_files"
+ @${RM} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d
+ @${RM} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1
+ ${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib $(COMPARISON_BUILD) --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -o${OBJECTDIR}/mcc_generated_files/pin_manager.p1 mcc_generated_files/pin_manager.c
+ @-${MV} ${OBJECTDIR}/mcc_generated_files/pin_manager.d ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d
+ @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/pin_manager.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+
+${OBJECTDIR}/mcc_generated_files/mcc.p1: mcc_generated_files/mcc.c nbproject/Makefile-${CND_CONF}.mk
+ @${MKDIR} "${OBJECTDIR}/mcc_generated_files"
+ @${RM} ${OBJECTDIR}/mcc_generated_files/mcc.p1.d
+ @${RM} ${OBJECTDIR}/mcc_generated_files/mcc.p1
+ ${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib $(COMPARISON_BUILD) --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -o${OBJECTDIR}/mcc_generated_files/mcc.p1 mcc_generated_files/mcc.c
+ @-${MV} ${OBJECTDIR}/mcc_generated_files/mcc.d ${OBJECTDIR}/mcc_generated_files/mcc.p1.d
+ @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/mcc.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+
+${OBJECTDIR}/mcc_generated_files/pwm5.p1: mcc_generated_files/pwm5.c nbproject/Makefile-${CND_CONF}.mk
+ @${MKDIR} "${OBJECTDIR}/mcc_generated_files"
+ @${RM} ${OBJECTDIR}/mcc_generated_files/pwm5.p1.d
+ @${RM} ${OBJECTDIR}/mcc_generated_files/pwm5.p1
+ ${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib $(COMPARISON_BUILD) --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -o${OBJECTDIR}/mcc_generated_files/pwm5.p1 mcc_generated_files/pwm5.c
+ @-${MV} ${OBJECTDIR}/mcc_generated_files/pwm5.d ${OBJECTDIR}/mcc_generated_files/pwm5.p1.d
+ @${FIXDEPS} ${OBJECTDIR}/mcc_generated_files/pwm5.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+
${OBJECTDIR}/newmain.p1: newmain.c nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} "${OBJECTDIR}"
@${RM} ${OBJECTDIR}/newmain.p1.d
@@ -110,6 +166,14 @@ ${OBJECTDIR}/newmain.p1: newmain.c nbproject/Makefile-${CND_CONF}.mk
@-${MV} ${OBJECTDIR}/newmain.d ${OBJECTDIR}/newmain.p1.d
@${FIXDEPS} ${OBJECTDIR}/newmain.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+${OBJECTDIR}/main.p1: main.c nbproject/Makefile-${CND_CONF}.mk
+ @${MKDIR} "${OBJECTDIR}"
+ @${RM} ${OBJECTDIR}/main.p1.d
+ @${RM} ${OBJECTDIR}/main.p1
+ ${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib $(COMPARISON_BUILD) --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -o${OBJECTDIR}/main.p1 main.c
+ @-${MV} ${OBJECTDIR}/main.d ${OBJECTDIR}/main.p1.d
+ @${FIXDEPS} ${OBJECTDIR}/main.p1.d $(SILENT) -rsi ${MP_CC_DIR}../
+
endif
# ------------------------------------------------------------------------------------
@@ -121,15 +185,15 @@ endif
# ------------------------------------------------------------------------------------
# Rules for buildStep: link
ifeq ($(TYPE_IMAGE), DEBUG_RUN)
-dist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
+dist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE}
- ${MP_CC} $(MP_EXTRA_LD_PRE) --chip=$(MP_PROCESSOR_OPTION) -G -mdist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.map -D__DEBUG=1 --debugger=pickit3 --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" $(COMPARISON_BUILD) --memorysummary dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml -odist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED}
- @${RM} dist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.hex
+ ${MP_CC} $(MP_EXTRA_LD_PRE) --chip=$(MP_PROCESSOR_OPTION) -G -mdist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.map -D__DEBUG=1 --debugger=pickit3 --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" $(COMPARISON_BUILD) --memorysummary dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml -odist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED}
+ @${RM} dist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.hex
else
-dist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
+dist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE}
- ${MP_CC} $(MP_EXTRA_LD_PRE) --chip=$(MP_PROCESSOR_OPTION) -G -mdist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.map --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" $(COMPARISON_BUILD) --memorysummary dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml -odist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED}
+ ${MP_CC} $(MP_EXTRA_LD_PRE) --chip=$(MP_PROCESSOR_OPTION) -G -mdist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.map --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=$(CND_CONF) --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" $(COMPARISON_BUILD) --memorysummary dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml -odist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED}
endif
@@ -149,7 +213,7 @@ endif
# Enable dependency checking
.dep.inc: .depcheck-impl
-DEPFILES=$(shell mplabwildcard ${POSSIBLE_DEPFILES})
+DEPFILES=$(shell "${PATH_TO_IDE_BIN}"mplabwildcard ${POSSIBLE_DEPFILES})
ifneq (${DEPFILES},)
include ${DEPFILES}
endif
diff --git a/Software/nbproject/Makefile-genesis.properties b/Software/nbproject/Makefile-genesis.properties
index 8965162..1a78c60 100644
--- a/Software/nbproject/Makefile-genesis.properties
+++ b/Software/nbproject/Makefile-genesis.properties
@@ -1,6 +1,9 @@
#
-#Wed Feb 28 00:10:40 GMT 2018
-configurations-xml=9f19f3d27104cd7e1edc2b53b5671882
-com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=24107a0c2bb6fb23e8f1a7c080ca8f8d
+#Wed Mar 14 02:03:53 GMT 2018
+default.languagetoolchain.dir=/opt/microchip/xc8/v1.43/bin
+configurations-xml=ffc3df47ab4e3dea9295a339d2726b6b
+com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=c8c2915d32f5d7e4be49831bc9827ab0
+default.languagetoolchain.version=1.43
host.platform=linux
-conf.ids=
+conf.ids=default
+default.com-microchip-mplab-nbide-toolchainXC8-XC8LanguageToolchain.md5=77bc274daef1c9f921a0d1f4a82b91db
diff --git a/Software/nbproject/Makefile-impl.mk b/Software/nbproject/Makefile-impl.mk
index c3eb2f5..39f8146 100644
--- a/Software/nbproject/Makefile-impl.mk
+++ b/Software/nbproject/Makefile-impl.mk
@@ -24,7 +24,7 @@ CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
-PROJECTNAME=CUEC_P01.X
+PROJECTNAME=Software
# Active Configuration
DEFAULTCONF=default
diff --git a/Software/nbproject/Makefile-local-default.mk b/Software/nbproject/Makefile-local-default.mk
index b73c1b8..1577de1 100644
--- a/Software/nbproject/Makefile-local-default.mk
+++ b/Software/nbproject/Makefile-local-default.mk
@@ -14,24 +14,23 @@
# You can invoke make with the values of the macros:
# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ...
#
-SHELL=cmd.exe
-PATH_TO_IDE_BIN=F:/MPLAB/mplab_ide/platform/../mplab_ide/modules/../../bin/
+PATH_TO_IDE_BIN=/opt/microchip/mplabx/v4.15/mplab_ide/platform/../mplab_ide/modules/../../bin/
# Adding MPLAB X bin directory to path.
-PATH:=F:/MPLAB/mplab_ide/platform/../mplab_ide/modules/../../bin/:$(PATH)
+PATH:=/opt/microchip/mplabx/v4.15/mplab_ide/platform/../mplab_ide/modules/../../bin/:$(PATH)
# Path to java used to run MPLAB X when this makefile was created
-MP_JAVA_PATH="C:\Program Files\Java\jre1.8.0_111/bin/"
+MP_JAVA_PATH="/usr/lib/jvm/java-8-openjdk/jre/bin/"
OS_CURRENT="$(shell uname -s)"
-MP_CC="F:\MPLAB\compiler\bin\xc8.exe"
+MP_CC="/opt/microchip/xc8/v1.43/bin/xc8"
# MP_CPPC is not defined
# MP_BC is not defined
-MP_AS="F:\MPLAB\compiler\bin\xc8.exe"
-MP_LD="F:\MPLAB\compiler\bin\xc8.exe"
+MP_AS="/opt/microchip/xc8/v1.43/bin/xc8"
+MP_LD="/opt/microchip/xc8/v1.43/bin/xc8"
# MP_AR is not defined
-DEP_GEN=${MP_JAVA_PATH}java -jar "F:/MPLAB/mplab_ide/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
-MP_CC_DIR="F:\MPLAB\compiler\bin"
+DEP_GEN=${MP_JAVA_PATH}java -jar "/opt/microchip/mplabx/v4.15/mplab_ide/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
+MP_CC_DIR="/opt/microchip/xc8/v1.43/bin"
# MP_CPPC_DIR is not defined
# MP_BC_DIR is not defined
-MP_AS_DIR="F:\MPLAB\compiler\bin"
-MP_LD_DIR="F:\MPLAB\compiler\bin"
+MP_AS_DIR="/opt/microchip/xc8/v1.43/bin"
+MP_LD_DIR="/opt/microchip/xc8/v1.43/bin"
# MP_AR_DIR is not defined
# MP_BC_DIR is not defined
diff --git a/Software/nbproject/Makefile-variables.mk b/Software/nbproject/Makefile-variables.mk
index 8f4d4dc..f87192f 100644
--- a/Software/nbproject/Makefile-variables.mk
+++ b/Software/nbproject/Makefile-variables.mk
@@ -6,8 +6,8 @@
CND_BASEDIR=`pwd`
# default configuration
CND_ARTIFACT_DIR_default=dist/default/production
-CND_ARTIFACT_NAME_default=CUEC_P01.X.production.hex
-CND_ARTIFACT_PATH_default=dist/default/production/CUEC_P01.X.production.hex
+CND_ARTIFACT_NAME_default=Software.production.hex
+CND_ARTIFACT_PATH_default=dist/default/production/Software.production.hex
CND_PACKAGE_DIR_default=${CND_DISTDIR}/default/package
-CND_PACKAGE_NAME_default=cuecp01.x.tar
-CND_PACKAGE_PATH_default=${CND_DISTDIR}/default/package/cuecp01.x.tar
+CND_PACKAGE_NAME_default=software.tar
+CND_PACKAGE_PATH_default=${CND_DISTDIR}/default/package/software.tar
diff --git a/Software/nbproject/Package-default.bash b/Software/nbproject/Package-default.bash
index fac2ff3..cb7a39c 100644
--- a/Software/nbproject/Package-default.bash
+++ b/Software/nbproject/Package-default.bash
@@ -10,9 +10,9 @@ CND_CONF=default
CND_DISTDIR=dist
TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging
TMPDIRNAME=tmp-packaging
-OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/CUEC_P01.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
-OUTPUT_BASENAME=CUEC_P01.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
-PACKAGE_TOP_DIR=cuecp01.x/
+OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/Software.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
+OUTPUT_BASENAME=Software.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
+PACKAGE_TOP_DIR=software/
# Functions
function checkReturnCode
@@ -57,15 +57,15 @@ mkdir -p ${TMPDIR}
# Copy files and create directories and links
cd "${TOP}"
-makeDirectory ${TMPDIR}/cuecp01.x/bin
+makeDirectory ${TMPDIR}/software/bin
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
# Generate tar file
cd "${TOP}"
-rm -f ${CND_DISTDIR}/${CND_CONF}/package/cuecp01.x.tar
+rm -f ${CND_DISTDIR}/${CND_CONF}/package/software.tar
cd ${TMPDIR}
-tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/cuecp01.x.tar *
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/software.tar *
checkReturnCode
# Cleanup
diff --git a/Software/nbproject/configurations.xml b/Software/nbproject/configurations.xml
index 3b34136..9a62443 100644
--- a/Software/nbproject/configurations.xml
+++ b/Software/nbproject/configurations.xml
@@ -4,6 +4,13 @@
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
+ <logicalFolder name="MCC Generated Files"
+ displayName="MCC Generated Files"
+ projectFiles="true">
+ <itemPath>mcc_generated_files/pin_manager.h</itemPath>
+ <itemPath>mcc_generated_files/mcc.h</itemPath>
+ <itemPath>mcc_generated_files/pwm5.h</itemPath>
+ </logicalFolder>
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
@@ -12,7 +19,15 @@
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
+ <logicalFolder name="MCC Generated Files"
+ displayName="MCC Generated Files"
+ projectFiles="true">
+ <itemPath>mcc_generated_files/pin_manager.c</itemPath>
+ <itemPath>mcc_generated_files/mcc.c</itemPath>
+ <itemPath>mcc_generated_files/pwm5.c</itemPath>
+ </logicalFolder>
<itemPath>newmain.c</itemPath>
+ <itemPath>main.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
@@ -31,7 +46,7 @@
<targetPluginBoard></targetPluginBoard>
<platformTool>PICkit3PlatformTool</platformTool>
<languageToolchain>XC8</languageToolchain>
- <languageToolchainVersion>1.45</languageToolchainVersion>
+ <languageToolchainVersion>1.43</languageToolchainVersion>
<platform>3</platform>
</toolsSet>
<compileType>
diff --git a/Software/nbproject/private/configurations.xml b/Software/nbproject/private/configurations.xml
index f68be67..ae58060 100644
--- a/Software/nbproject/private/configurations.xml
+++ b/Software/nbproject/private/configurations.xml
@@ -5,7 +5,7 @@
<confs>
<conf name="default" type="2">
<platformToolSN>:=MPLABComm-USB-Microchip:=&lt;vid>04D8:=&lt;pid>900A:=&lt;rev>0002:=&lt;man>Microchip Technology Inc.:=&lt;prod>PICkit 3:=&lt;sn>BUR164522656:=&lt;drv>x:=&lt;xpt>h:=end</platformToolSN>
- <languageToolchainDir>F:\MPLAB\compiler\bin</languageToolchainDir>
+ <languageToolchainDir>/opt/microchip/xc8/v1.43/bin</languageToolchainDir>
<mdbdebugger version="1">
<placeholder1>place holder 1</placeholder1>
<placeholder2>place holder 2</placeholder2>
diff --git a/Software/nbproject/private/private.xml b/Software/nbproject/private/private.xml
index e85f2b1..82424d3 100644
--- a/Software/nbproject/private/private.xml
+++ b/Software/nbproject/private/private.xml
@@ -3,7 +3,10 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
- <file>file:/home/timo/documents/cambridge/electronics-club/CUEC_P01.X/newmain.c</file>
+ <file>file:/home/timo/documents/cambridge/electronics-club/light-switch/Software/mcc_generated_files/mcc.c</file>
+ <file>file:/home/timo/documents/cambridge/electronics-club/light-switch/Software/mcc_generated_files/pin_manager.c</file>
+ <file>file:/home/timo/documents/cambridge/electronics-club/light-switch/Software/newmain.c</file>
+ <file>file:/home/timo/documents/cambridge/electronics-club/light-switch/Software/main.c</file>
</group>
</open-files>
</project-private>
diff --git a/Software/nbproject/project.xml b/Software/nbproject/project.xml
index 3ce1f56..f7e89ae 100644
--- a/Software/nbproject/project.xml
+++ b/Software/nbproject/project.xml
@@ -8,7 +8,7 @@
<make-project-type>0</make-project-type>
<c-extensions>c</c-extensions>
<cpp-extensions/>
- <header-extensions/>
+ <header-extensions>h</header-extensions>
<asminc-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<make-dep-projects/>
diff --git a/Software/newmain.c b/Software/newmain.c
index fb28a81..e9aa6b9 100644
--- a/Software/newmain.c
+++ b/Software/newmain.c
@@ -21,7 +21,7 @@
#define PWM_DUTY_CYCLE_MS_OFF 2.0
void set_duty_cycle(float length_ms) {
- int duty_cycle_out = _XTAL_FREQ * length_ms / 1000 / PRESCALE;
+ int duty_cycle_out = (int)(_XTAL_FREQ * length_ms / 1000 / PRESCALE);
CCPR1L = duty_cycle_out >> 2;
CCP1CON = 0b1111 | (duty_cycle_out & 0b11) << 4;
}
@@ -29,7 +29,7 @@ void set_duty_cycle(float length_ms) {
/*
*
*/
-int main(int argc, char** argv) {
+int newmain(int argc, char** argv) {
// inputs: bit = 1
TRISA |= IN_ADC1;
diff --git a/mcc-user-guide.pdf b/mcc-user-guide.pdf
new file mode 100644
index 0000000..d6f15b0
--- /dev/null
+++ b/mcc-user-guide.pdf
Binary files differ