From f7dddf06297f415413760f3bedf00f7297e60cf7 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Wed, 8 Apr 2020 11:17:47 -0500 Subject: Forget to add a bunch of things oops --- Lab4.X/Lab4 Report.pdf | Bin 0 -> 64013 bytes Lab4.X/Makefile | 113 + Lab4.X/MyConfig.mc3 | 3859 +++++++++++++++++++++++++ Lab4.X/dist/default/debug/memoryfile.xml | 18 + Lab4.X/dist/default/production/memoryfile.xml | 18 + Lab4.X/lab4_button.c | 68 +- Lab4.X/lab4_button.h | 18 + Lab4.X/lab4_main.c | 51 + Lab4.X/lab4_servo.c | 23 + Lab4.X/lab4_servo.h | 17 + Lab4.X/nbproject/Makefile-default.mk | 189 ++ Lab4.X/nbproject/Makefile-genesis.properties | 10 + Lab4.X/nbproject/Makefile-impl.mk | 69 + Lab4.X/nbproject/Makefile-local-default.mk | 38 + Lab4.X/nbproject/Makefile-variables.mk | 13 + Lab4.X/nbproject/Package-default.bash | 73 + Lab4.X/nbproject/configurations.xml | 656 +++++ Lab4.X/nbproject/private/configurations.xml | 25 + Lab4.X/nbproject/private/private.xml | 7 + Lab4.X/nbproject/project.xml | 27 + Lab4.X/strap012_lab4.zip | Bin 0 -> 66083 bytes Lab4.X/strap012_lab4_I_Guess.zip | Bin 0 -> 2955 bytes 22 files changed, 5272 insertions(+), 20 deletions(-) create mode 100644 Lab4.X/Lab4 Report.pdf create mode 100644 Lab4.X/Makefile create mode 100644 Lab4.X/MyConfig.mc3 create mode 100644 Lab4.X/dist/default/debug/memoryfile.xml create mode 100644 Lab4.X/dist/default/production/memoryfile.xml create mode 100644 Lab4.X/lab4_button.h create mode 100644 Lab4.X/lab4_main.c create mode 100644 Lab4.X/lab4_servo.c create mode 100644 Lab4.X/lab4_servo.h create mode 100644 Lab4.X/nbproject/Makefile-default.mk create mode 100644 Lab4.X/nbproject/Makefile-genesis.properties create mode 100644 Lab4.X/nbproject/Makefile-impl.mk create mode 100644 Lab4.X/nbproject/Makefile-local-default.mk create mode 100644 Lab4.X/nbproject/Makefile-variables.mk create mode 100644 Lab4.X/nbproject/Package-default.bash create mode 100644 Lab4.X/nbproject/configurations.xml create mode 100644 Lab4.X/nbproject/private/configurations.xml create mode 100644 Lab4.X/nbproject/private/private.xml create mode 100644 Lab4.X/nbproject/project.xml create mode 100644 Lab4.X/strap012_lab4.zip create mode 100644 Lab4.X/strap012_lab4_I_Guess.zip (limited to 'Lab4.X') diff --git a/Lab4.X/Lab4 Report.pdf b/Lab4.X/Lab4 Report.pdf new file mode 100644 index 0000000..1dec1eb Binary files /dev/null and b/Lab4.X/Lab4 Report.pdf differ diff --git a/Lab4.X/Makefile b/Lab4.X/Makefile new file mode 100644 index 0000000..fca8e2c --- /dev/null +++ b/Lab4.X/Makefile @@ -0,0 +1,113 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin +RANLIB=ranlib + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... +# WARNING: the IDE does not call this target since it takes a long time to +# simply run make. Instead, the IDE removes the configuration directories +# under build and dist directly without calling make. +# This target is left here so people can do a clean when running a clean +# outside the IDE. + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/Lab4.X/MyConfig.mc3 b/Lab4.X/MyConfig.mc3 new file mode 100644 index 0000000..be6f5cf --- /dev/null +++ b/Lab4.X/MyConfig.mc3 @@ -0,0 +1,3859 @@ + + + + System Module + class com.microchip.mcc.mcu16.systemManager.DefaultSystemManagerMcu16 + + + Main Manager + class com.microchip.mcc.mcu16.mainManager.MainManager + + + JTAG + class com.microchip.mcc.mcu16.systemManager.jtag.JTAG + + + INTERNAL OSCILLATOR + class com.microchip.mcc.mcu16.systemManager.clk.Clock + + + WATCHDOG + class com.microchip.mcc.mcu16.systemManager.wdt.Wdt + + + Pin Module + class com.microchip.mcc.mcu16.pinManager.PinManager + + + RESET + class com.microchip.mcc.mcu16.systemManager.reset.RESET + + + ICD + class com.microchip.mcc.mcu16.systemManager.icd.Icd + + + Interrupt Module + class com.microchip.mcc.mcu16.interruptManager.InterruptManager + + + com.microchip.mcc.mcu16.Mcu16PeripheralLibraryLibraryModule + class com.microchip.mcc.protocolServices.base.modules.librarymodule.LibraryModule + + + + + + + + + clear + + + + analog + + + + 1 + + + + UNSUPPORTED + + + + input + + + + 0 + + + + 0 + + + + disabled + + + + 1 + + + + enabled + + + + 2 + + + + disabled + + + + 135.300s + + + + 0 + + + + 0 + + + + 65535 + + + + 1 + + + + clear + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 7 + + + + disabled + + + + 31 + + + + 3 + + + + input + + + + analog + + + + 1 + + + + OFF + + + + 32768 + + + + disabled + + + + analog + + + + 1 + + + + disabled + + + + 31 + + + + disabled + + + + disabled + + + + disabled + + + + OFF + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + clear + + + + disabled + + + + disabled + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 1 + + + + PR128 + + + + disabled + + + + 0 + + + + 21 + + + + out of lock + + + + 20 + + + + 52 + + + + 51 + + + + 31 + + + + 7967 + + + + 1 + + + + enabled + + + + 31 + + + + clear + + + + 1 + + + + 0 + + + + 47 + + + + 48 + + + + 1 + + + + 0 + + + + 0 + + + + 128 + + + + disabled + + + + 1792 + + + + disabled + + + + 1 + + + + 62 + + + + 0 + + + + 0 + + + + OFF + + + + 23 + + + + clear + + + + analog + + + + 0 + + + + 0 + + + + 1 + + + + + + + + + + + + + + + + + + + + disabled + + + + disabled + + + + + + + + + + + + 16 + + + + 0 + + + + ON + + + + 1 + + + + OFF + + + + UNSUPPORTED + + + + disabled + + + + disabled + + + + 31 + + + + FRCDIV + + + + disabled + + + + + + + + 0 + + + + 0 + + + + enabled + + + + FRC/2 + + + + UNSUPPORTED + + + + 2000000 + + + + 1 + + + + 0 + + + + 0 + + + + 4 + + + + clear + + + + none + + + + clear + + + + disabled + + + + 0 + + + + none + + + + none + + + + input + + + + none + + + + none + + + + 0 + + + + none + + + + analog + + + + disabled + + + + 16 + + + + 0 + + + + 4000000 + + + + 46 + + + + 0 + + + + none + + + + Switch is Complete + + + + none + + + + 0 + + + + none + + + + none + + + + 7 + + + + none + + + + none + + + + + + + + none + + + + 0 + + + + none + + + + none + + + + 1 + + + + none + + + + 1 + + + + UNSUPPORTED + + + + 7 + + + + disabled + + + + disabled + + + + 42 + + + + 0 + + + + clear + + + + 0 + + + + 24576 + + + + 1 + + + + 0 + + + + 0 + + + + input + + + + disabled + + + + disabled + + + + 1 + + + + UNSUPPORTED + + + + disabled + + + + 1 + + + + 6 + + + + 26 + + + + none + + + + 8000000 + + + + 1024 + + + + 0 + + + + 1 + + + + disabled + + + + FRCDIV + + + + + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + disabled + + + + input + + + + disabled + + + + 0 + + + + 2048 + + + + enabled + + + + 7 + + + + clear + + + + clear + + + + AVAILABLE + + + + no clock failure + + + + 61 + + + + + + + + 0 + + + + 7967 + + + + clear + + + + 0 + + + + 31000 + + + + 14 + + + + 31 + + + + 1 + + + + 2048 + + + + disabled + + + + disabled + + + + CLOCK_LPRC + + + + 7967 + + + + 0 + + + + disabled + + + + enabled + + + + disabled + + + + input + + + + 9 + + + + clear + + + + 0 + + + + disabled + + + + 31 + + + + disabled + + + + 31 + + + + disabled + + + + 0 + + + + clear + + + + disabled + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1280 + + + + 7967 + + + + 0 + + + + 0 + + + + AVAILABLE + + + + 0 + + + + 0 + + + + disabled + + + + UNSUPPORTED + + + + 31 + + + + 53 + + + + 0 + + + + clear + + + + 1 + + + + PS32768 + + + + 1 + + + + 0 + + + + disabled + + + + enabled + + + + enabled + + + + 31 + + + + enabled + + + + 31 + + + + 31 + + + + 1 + + + + 0 + + + + 0 + + + + 1 + + + + + + + + disabled + + + + disabled + + + + 0 + + + + 0 + + + + 1 + + + + 3 + + + + 4 + + + + 0 + + + + 0 + + + + 0 + + + + disabled + + + + 7967 + + + + 0 + + + + 1 + + + + 20000000 + + + + NONE + + + + 0 + + + + ON + + + + 0 + + + + 1 + + + + 0 + + + + 5 + + + + 1 + + + + 1 + + + + UNSUPPORTED + + + + 1 + + + + 1 + + + + 0 + + + + input + + + + 5 + + + + enabled + + + + AVAILABLE + + + + clear + + + + 31 + + + + 0 + + + + 16384 + + + + UNSUPPORTED + + + + 31 + + + + 16 + + + + 17 + + + + 13 + + + + UNSUPPORTED + + + + 31 + + + + 31 + + + + 15 + + + + disabled + + + + 7967 + + + + 1 + + + + clear + + + + 1 + + + + 11 + + + + 1 + + + + 0 + + + + 4 + + + + 7967 + + + + disabled + + + + + + + + 1:8 + + + + enabled + + + + UNSUPPORTED + + + + 1 + + + + UNSUPPORTED + + + + 6144 + + + + 0 + + + + UNSUPPORTED + + + + 0 + + + + 3 + + + + 1 + + + + 1 + + + + + + + + + + + + 1 + + + + 45 + + + + clear + + + + 2 + + + + 6 + + + + + + + + + + + + + + + + 1 + + + + + + + + 0 + + + + FRC Oscillator + + + + 0 + + + + 1 + + + + 7936 + + + + disabled + + + + disabled + + + + disabled + + + + 1 + + + + 1 + + + + disabled + + + + 0 + + + + disabled + + + + UNSUPPORTED + + + + 0 + + + + unlocked + + + + 0 + + + + 31 + + + + 6 + + + + 1 + + + + 1 + + + + enabled + + + + 7 + + + + 0 + + + + CSDCMD + + + + clear + + + + 1 + + + + 2 + + + + 24 + + + + ISR_Pin Module_CNI + + + + PRI + + + + 0 + + + + disabled + + + + 31 + + + + 25 + + + + 1792 + + + + 3 + + + + 5 + + + + 1 + + + + none + + + + none + + + + 1 + + + + none + + + + AVAILABLE + + + + none + + + + disabled + + + + none + + + + none + + + + 41 + + + + 0 + + + + 0 + + + + 11 + + + + 1 + + + + 1 + + + + 0 + + + + 12 + + + + disabled + + + + AVAILABLE + + + + disabled + + + + 0 + + + + AVAILABLE + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 1 + + + + 14 + + + + disabled + + + + disabled + + + + 1 + + + + 4 + + + + disabled + + + + 0 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 19 + + + + disabled + + + + disabled + + + + 23 + + + + 12544 + + + + 31 + + + + 128 + + + + 5 + + + + 1 + + + + 0 + + + + UNSUPPORTED + + + + 0 + + + + 8000000 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + 8192 + + + + 0 + + + + disabled + + + + 1 + + + + 1 + + + + 5 + + + + PGx1 + + + + 50 + + + + 1 + + + + enabled + + + + 8 + + + + 31 + + + + 1 + + + + enabled + + + + 0 + + + + 0 + + + + 31 + + + + 1 + + + + 1 + + + + 0 + + + + UNSUPPORTED + + + + 54 + + + + 768 + + + + 7967 + + + + input + + + + 22 + + + + 0 + + + + 1 + + + + disabled + + + + disabled + + + + 0 + + + + 0 + + + + 0 + + + + 44 + + + + 0 + + + + enabled + + + + 43 + + + + enabled + + + + 39 + + + + 40 + + + + 0 + + + + 1 + + + + 0 + + + + 32 + + + + 1 + + + + disabled + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 18 + + + + 0 + + + + 1 + + + + 1 + + + + 28 + + + + 29 + + + + input + + + + 64 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + OFF + + + + input + + + + FRCDIV + + + + 0 + + + + 0 + + + + 1 + + + + disabled + + + + 7 + + + + UNSUPPORTED + + + + 1 + + + + UNSUPPORTED + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 4 + + + + 1 + + + + 0 + + + + disabled + + + + 1 + + + + 1 + + + + 0 + + + + 0 + + + + enabled + + + + 0 + + + + 0 + + + + 64 + + + + disabled + + + + 0 + + + + 1 + + + + disabled + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + Center frequency + + + + + + + + 31 + + + + + + + + 0 + + + + + + + + 0 + + + + 0 + + + + DIP28 + + + + 1 + + + + 0 + + + + LEG + + + + input + + + + 0 + + + + 7967 + + + + 0 + + + + 0 + + + + 1 + + + + 1 + + + + disabled + + + + 31 + + + + 1 + + + + 0 + + + + 12 + + + + disabled + + + + 1 + + + + 1 + + + + disabled + + + + 1 + + + + disabled + + + + 0 + + + + enabled + + + + 1 + + + + 1 + + + + input + + + + 1 + + + + 0 + + + + UNSUPPORTED + + + + 256 + + + + 0 + + + + disabled + + + + disabled + + + + disabled + + + + 0 + + + + disabled + + + + 0 + + + + 1 + + + + 12 + + + + 13 + + + + 1 + + + + UNSUPPORTED + + + + 0 + + + + input + + + + UNSUPPORTED + + + + 31 + + + + 55 + + + + 0 + + + + enabled + + + + enabled + + + + enabled + + + + 0 + + + + 56 + + + + 3 + + + + 1 + + + + 2 + + + + 49 + + + + 0 + + + + 1 + + + + input + + + + 0 + + + + 0 + + + + disabled + + + + UNSUPPORTED + + + + disabled + + + + 1 + + + + enabled + + + + 0 + + + + UNSUPPORTED + + + + 0 + + + + UNSUPPORTED + + + + disabled + + + + 1 + + + + 0 + + + + 1 + + + + 1:2 + + + + 0 + + + + 0 + + + + 1 + + + + 1 + + + + 0 + + + + AVAILABLE + + + + disabled + + + + disabled + + + + 38 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + input + + + + disabled + + + + 0 + + + + enabled + + + + disabled + + + + 1 + + + + 27 + + + + 0 + + + + 0 + + + + 0 + + + + 0 + + + + UNSUPPORTED + + + + 1 + + + + 1 + + + + 0 + + + + input + + + + 0 + + + + disabled + + + + disabled + + + + 0 + + + + 1 + + + + 3 + + + + disabled + + + + 0 + + + + disabled + + + + enabled + + + + disabled + + + + disabled + + + + 1 + + + + disabled + + + + disabled + + + + 0 + + + + AVAILABLE + + + + 0 + + + + 31000 + + + + 8 + + + + 5 + + + + 9 + + + + 1 + + + + 0 + + + + 32695 + + + + 4 + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + UNSUPPORTED + + + + 512 + + + + input + + + + 1 + + + + 63 + + + + disabled + + + + 0 + + + + 1 + + + + 0 + + + + 15199 + + + + enabled + + + + 1 + + + + 0 + + + + 0 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 1 + + + + disabled + + + + clear + + + + 2 + + + + disabled + + + + 0 + + + + 0 + + + + disabled + + + + 1 + + + + disabled + + + + input + + + + disabled + + + + 57 + + + + 1 + + + + clear + + + + enabled + + + + 0 + + + + 0 + + + + 0 + + + + 8192 + + + + disabled + + + + 0 + + + + 1 + + + + analog + + + + Center frequency + + + + 31 + + + + enabled + + + + 0 + + + + 1 + + + + UNSUPPORTED + + + + disabled + + + + 0 + + + + 1 + + + + disabled + + + + 1 + + + + disabled + + + + SOSC + + + + 0 + + + + 0 + + + + input + + + + 1 + + + + 1 + + + + 1 + + + + analog + + + + disabled + + + + disabled + + + + disabled + + + + 1 + + + + 0 + + + + 6 + + + + 0 + + + + 1 + + + + UNSUPPORTED + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + disabled + + + + input + + + + disabled + + + + disabled + + + + 1 + + + + 256 + + + + 512 + + + + 768 + + + + 0 + + + + disabled + + + + 0 + + + + 0 + + + + output + + + + digital + + + + 35 + + + + 36 + + + + 4 + + + + 1 + + + + 1 + + + + OFF + + + + disabled + + + + clear + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 0 + + + + disabled + + + + disabled + + + + disabled + + + + 10 + + + + disabled + + + + 1 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 0 + + + + analog + + + + enabled + + + + digital + + + + 1 + + + + 0 + + + + disabled + + + + 0 + + + + 1 + + + + 1 + + + + 15 + + + + 0 + + + + 0 + + + + disabled + + + + 1 + + + + 1 + + + + 0 + + + + 1 + + + + 60 + + + + 0 + + + + enabled + + + + 0 + + + + 58 + + + + disabled + + + + 37 + + + + 1 + + + + 1 + + + + 59 + + + + 31 + + + + enabled + + + + 0 + + + + 1 + + + + analog + + + + enabled + + + + disabled + + + + disabled + + + + 1 + + + + disabled + + + + disabled + + + + 2 + + + + 10 + + + + 0 + + + + 30 + + + + disabled + + + + disabled + + + + 0 + + + + disabled + + + + 0 + + + + 1 + + + + 0 + + + + 1 + + + + 1 + + + + 1 + + + + UNSUPPORTED + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 31 + + + + 0 + + + + 0 + + + + enabled + + + + 0 + + + + 1 + + + + 1 + + + + 31 + + + + 0 + + + + disabled + + + + disabled + + + + disabled + + + + 0 + + + + 34 + + + + 0 + + + + 0 + + + + 0 + + + + disabled + + + + 0 + + + + 0 + + + + 1 + + + + UNSUPPORTED + + + + 33 + + + + 0 + + + + disabled + + + + 0 + + + + 32 + + + + disabled + + + + 0 + + + + OFF + + + + 0 + + + + 0 + + + + 1 + + + + 0 + + + + 0 + + + + disabled + + + + 1 + + + + disabled + + + + disabled + + + + disabled + + + + 1 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 0 + + + + 4000000 + + + + enabled + + + + disabled + + + + 3 + + + + disabled + + + + 4096 + + + + enabled + + + + 0 + + + + 1 + + + + 2 + + + + 1 + + + + 0 + + + + 1 + + + + disabled + + + + disabled + + + + 1 + + + + 1 + + + + disabled + + + + disabled + + + + 1 + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + disabled + + + + 0 + + + + + \ No newline at end of file diff --git a/Lab4.X/dist/default/debug/memoryfile.xml b/Lab4.X/dist/default/debug/memoryfile.xml new file mode 100644 index 0000000..6e2c200 --- /dev/null +++ b/Lab4.X/dist/default/debug/memoryfile.xml @@ -0,0 +1,18 @@ + + + + + + bytes + 8192 + 110 + 8082 + + + bytes + 65274 + 1893 + 63381 + + + diff --git a/Lab4.X/dist/default/production/memoryfile.xml b/Lab4.X/dist/default/production/memoryfile.xml new file mode 100644 index 0000000..d174a92 --- /dev/null +++ b/Lab4.X/dist/default/production/memoryfile.xml @@ -0,0 +1,18 @@ + + + + + + bytes + 8192 + 30 + 8162 + + + bytes + 65274 + 1851 + 63423 + + + diff --git a/Lab4.X/lab4_button.c b/Lab4.X/lab4_button.c index 611cf03..f889502 100644 --- a/Lab4.X/lab4_button.c +++ b/Lab4.X/lab4_button.c @@ -1,5 +1,6 @@ #include "xc.h" #include "lab4_button.h" +#define circBuffSize 2 void initPushButton(){ //Configure Timer 2 (500ns / count, 25ms max). @@ -9,22 +10,21 @@ void initPushButton(){ T2CONbits.TCS = 0b0; T2CONbits.TGATE = 0b0; TMR2 = 0; - PR2 = 0xf424; // Set period to be larger than max external sig duration + PR2 = 62500; // Set period to be larger than max external sig duration T2CONbits.TON = 1; // Start 16-bit Timer2 // Initialize the Input Capture Module - IC1CONbits.ICTMR = 1; // Select Timer2 as the IC1 Time base - IC1CONbits.ICI = 0b00; // Interrupt on every capture event - IC1CONbits.ICM = 0b011; // Generate capture event on every Rising edge - // Enable Capture Interrupt And Timer2 - - IPC0bits.IC1IP = 1; // Setup IC1 interrupt priority level - IFS0bits.IC1IF = 0; // Clear IC1 Interrupt Status Flag - IEC0bits.IC1IE = 1; // Enable IC1 interrupt + IC1CON = 0; // Turn off and reset internal state of IC1 + IC1CONbits.ICTMR = 1; // Use Timer 2 for capture source + IC1CONbits.ICM = 0b011; // Turn on and capture every rising edge + IC1CON = 1; + + _IC1IF = 0; // Clear IC1 Interrupt Status Flag + _IC1IE = 1; // Enable IC1 interrupt - IFS0bits.T2IF = 1; - IEC0bits.T2IE = 1; -} + _T2IF = 1; + _T2IE = 1; +} volatile unsigned long overflow = 0; //Timer 2 overflow interrupt @@ -34,14 +34,42 @@ void __attribute__((__interrupt__,__auto_psv__)) _T2Interrupt(void) { overflow++; } -volatile long int curPeriod=0; +//Buffer functions +volatile unsigned long buffer[circBuffSize]; +int buffSize = 0, write = 0, read = 0; +void addBuffer(unsigned long x) { + if (buffSize < circBuffSize) { + buffer[write++] = x; + write %= circBuffSize; + ++buffSize; + } + //Otherwise get rid of the data. +} +unsigned long getBuffer() { + unsigned long returnValue = buffer[read++]; + read %= circBuffSize; + --buffSize; + return returnValue; +} +int emptyBuffer(void) { + if (buffSize <= 0) { + buffSize=0; + return 1; + } else { + return 0; + } +} + +volatile unsigned long curPeriod = 0, prevPress = 0, currPress = 0; //IC1 interrupt void __attribute__((__interrupt__,__auto_psv__)) _IC1Interrupt(void) { - static unsigned int prevEdge=0; - int curEdge; - _IC1IF = 0; - curEdge = IC1BUF + 62500L * overflow; - curPeriod = curEdge - prevEdge; - prevEdge = curEdge; -} + unsigned int time; + currPress = (IC1BUF + 62500 * (long) overflow); + curPeriod = currPress - prevPress; + time = curPeriod / 62.5; + if (time > 10) { + addBuffer(time); + } + prevPress = currPress; +} \ No newline at end of file diff --git a/Lab4.X/lab4_button.h b/Lab4.X/lab4_button.h new file mode 100644 index 0000000..1001954 --- /dev/null +++ b/Lab4.X/lab4_button.h @@ -0,0 +1,18 @@ +#ifndef LAB4_BUTTON_H +#define LAB4_BUTTON_H + +#include // include processor files - each processor file is guarded. + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + void initPushButton(void); + void addBuffer(unsigned long x); + unsigned long getBuffer(); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LAB4_BUTTON_H */ + diff --git a/Lab4.X/lab4_main.c b/Lab4.X/lab4_main.c new file mode 100644 index 0000000..f9f626c --- /dev/null +++ b/Lab4.X/lab4_main.c @@ -0,0 +1,51 @@ +#include "xc.h" +#include "lab4_servo.h" +#include "lab4_button.h" + +// CW1: FLASH CONFIGURATION WORD 1 (see PIC24 Family Reference Manual 24.1) +#pragma config ICS = PGx1 // Comm Channel Select (Emulator EMUC1/EMUD1 pins are shared with PGC1/PGD1) +#pragma config FWDTEN = OFF // Watchdog Timer Enable (Watchdog Timer is disabled) +#pragma config GWRP = OFF // General Code Segment Write Protect (Writes to program memory are allowed) +#pragma config GCP = OFF // General Code Segment Code Protect (Code protection is disabled) +#pragma config JTAGEN = OFF // JTAG Port Enable (JTAG port is disabled) + + +// CW2: FLASH CONFIGURATION WORD 2 (see PIC24 Family Reference Manual 24.1) +#pragma config I2C1SEL = PRI // I2C1 Pin Location Select (Use default SCL1/SDA1 pins) +#pragma config IOL1WAY = OFF // IOLOCK Protection (IOLOCK may be changed via unlocking seq) +#pragma config OSCIOFNC = ON // Primary Oscillator I/O Function (CLKO/RC15 functions as I/O pin) +#pragma config FCKSM = CSECME // Clock Switching and Monitor (Clock switching is enabled, + // Fail-Safe Clock Monitor is enabled) +#pragma config FNOSC = FRCPLL // Oscillator Select (Fast RC Oscillator with PLL module (FRCPLL)) + +void setup(void) { + //SET IC/OC + __builtin_write_OSCCONL(OSCCON & 0xbf); // unlock PPS + RPINR7bits.IC1R = 8; // Use Pin RP8 = "8", for Input Capture 1 (Table 10-2) + RPOR3bits.RP6R = 18; // Use Pin RP6 for Output Compare 1 = "18" (Table 10-3) + __builtin_write_OSCCONL(OSCCON | 0x40); // lock PPS + //END IC/OC + CLKDIVbits.RCDIV = 0; //Set RCDIV=1:1 (default 2:1) 32MHz or FCY/2=16M + AD1PCFG = 0x9fff; + _CN22PUE = 1; + TRISB |= 100000000; + initServo(); + initPushButton(); +} + +int main(void) { + setup(); + unsigned long first = 0, second = 0; + while (1) { + if (emptyBuffer() == 1) + continue; + //Buffer is not empty, keep going + first = getBuffer(); + second = getBuffer(); + if (first < 500 && second < 500) { + setServo(2500); + } else { + setServo(1000); + } + } +} diff --git a/Lab4.X/lab4_servo.c b/Lab4.X/lab4_servo.c new file mode 100644 index 0000000..9ff5b42 --- /dev/null +++ b/Lab4.X/lab4_servo.c @@ -0,0 +1,23 @@ +#include "xc.h" +#include "lab4_servo.h" +void setServo(int Val) +{ + OC1RS=Val; +} +void initServo() { + TRISB &= 1111111111011111; + //TIMER 3 + T3CON = 0x0010; //Stop Timer, Tcy clk source, PRE 1:8 + T3CONbits.TCKPS = 0b01; + T3CONbits.TCS=0; + TMR3 = 0; // Initialize to zero + PR3 = 39999; // Set period in order to make 20ms cycle + T3CONbits.TON = 1; + + //OC1 + OC1CON = 0; + OC1R = 1234; // servo start position. We won?t touch OC1R again + OC1RS = 1234; // We will only change this once PWM is turned on + OC1CONbits.OCM = 0b110; + OC1CONbits.OCTSEL = 1; +} diff --git a/Lab4.X/lab4_servo.h b/Lab4.X/lab4_servo.h new file mode 100644 index 0000000..c96cbf3 --- /dev/null +++ b/Lab4.X/lab4_servo.h @@ -0,0 +1,17 @@ +#ifndef LAB4_SERVO_H +#define LAB4_SERVO_H + +#include // include processor files - each processor file is guarded. + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + void delay(long n); + void initServo(void); + void setServo(int Val); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* XC_HEADER_TEMPLATE_H */ + diff --git a/Lab4.X/nbproject/Makefile-default.mk b/Lab4.X/nbproject/Makefile-default.mk new file mode 100644 index 0000000..f3ee77d --- /dev/null +++ b/Lab4.X/nbproject/Makefile-default.mk @@ -0,0 +1,189 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Include project Makefile +ifeq "${IGNORE_LOCAL}" "TRUE" +# do not include local makefile. User is passing all local related variables already +else +include Makefile +# Include makefile containing local settings +ifeq "$(wildcard nbproject/Makefile-local-default.mk)" "nbproject/Makefile-local-default.mk" +include nbproject/Makefile-local-default.mk +endif +endif + +# Environment +MKDIR=gnumkdir -p +RM=rm -f +MV=mv +CP=cp + +# Macros +CND_CONF=default +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +IMAGE_TYPE=debug +OUTPUT_SUFFIX=elf +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/Lab4.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +else +IMAGE_TYPE=production +OUTPUT_SUFFIX=hex +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/Lab4.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +endif + +ifeq ($(COMPARE_BUILD), true) +COMPARISON_BUILD=-mafrlcsj +else +COMPARISON_BUILD= +endif + +ifdef SUB_IMAGE_ADDRESS +SUB_IMAGE_ADDRESS_COMMAND=--image-address $(SUB_IMAGE_ADDRESS) +else +SUB_IMAGE_ADDRESS_COMMAND= +endif + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} + +# Distribution Directory +DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} + +# Source Files Quoted if spaced +SOURCEFILES_QUOTED_IF_SPACED=lab4_main.c lab4_button.c lab4_servo.c + +# Object Files Quoted if spaced +OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/lab4_main.o ${OBJECTDIR}/lab4_button.o ${OBJECTDIR}/lab4_servo.o +POSSIBLE_DEPFILES=${OBJECTDIR}/lab4_main.o.d ${OBJECTDIR}/lab4_button.o.d ${OBJECTDIR}/lab4_servo.o.d + +# Object Files +OBJECTFILES=${OBJECTDIR}/lab4_main.o ${OBJECTDIR}/lab4_button.o ${OBJECTDIR}/lab4_servo.o + +# Source Files +SOURCEFILES=lab4_main.c lab4_button.c lab4_servo.c + + + +CFLAGS= +ASFLAGS= +LDLIBSOPTIONS= + +############# Tool locations ########################################## +# If you copy a project from one host to another, the path where the # +# compiler is installed may be different. # +# If you open this project with MPLAB X in the new host, this # +# makefile will be regenerated and the paths will be corrected. # +####################################################################### +# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build +FIXDEPS=fixDeps + +.build-conf: ${BUILD_SUBPROJECTS} +ifneq ($(INFORMATION_MESSAGE), ) + @echo $(INFORMATION_MESSAGE) +endif + ${MAKE} -f nbproject/Makefile-default.mk dist/${CND_CONF}/${IMAGE_TYPE}/Lab4.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} + +MP_PROCESSOR_OPTION=24FJ64GA002 +MP_LINKER_FILE_OPTION=,--script=p24FJ64GA002.gld +# ------------------------------------------------------------------------------------ +# Rules for buildStep: compile +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${OBJECTDIR}/lab4_main.o: lab4_main.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/lab4_main.o.d + @${RM} ${OBJECTDIR}/lab4_main.o + ${MP_CC} $(MP_EXTRA_CC_PRE) lab4_main.c -o ${OBJECTDIR}/lab4_main.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/lab4_main.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -omf=elf -DXPRJ_default=$(CND_CONF) -legacy-libc $(COMPARISON_BUILD) -O0 -msmart-io=1 -Wall -msfr-warn=off -mdfp=${DFP_DIR}/xc16 + @${FIXDEPS} "${OBJECTDIR}/lab4_main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/lab4_button.o: lab4_button.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/lab4_button.o.d + @${RM} ${OBJECTDIR}/lab4_button.o + ${MP_CC} $(MP_EXTRA_CC_PRE) lab4_button.c -o ${OBJECTDIR}/lab4_button.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/lab4_button.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -omf=elf -DXPRJ_default=$(CND_CONF) -legacy-libc $(COMPARISON_BUILD) -O0 -msmart-io=1 -Wall -msfr-warn=off -mdfp=${DFP_DIR}/xc16 + @${FIXDEPS} "${OBJECTDIR}/lab4_button.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/lab4_servo.o: lab4_servo.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/lab4_servo.o.d + @${RM} ${OBJECTDIR}/lab4_servo.o + ${MP_CC} $(MP_EXTRA_CC_PRE) lab4_servo.c -o ${OBJECTDIR}/lab4_servo.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/lab4_servo.o.d" -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -omf=elf -DXPRJ_default=$(CND_CONF) -legacy-libc $(COMPARISON_BUILD) -O0 -msmart-io=1 -Wall -msfr-warn=off -mdfp=${DFP_DIR}/xc16 + @${FIXDEPS} "${OBJECTDIR}/lab4_servo.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +else +${OBJECTDIR}/lab4_main.o: lab4_main.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/lab4_main.o.d + @${RM} ${OBJECTDIR}/lab4_main.o + ${MP_CC} $(MP_EXTRA_CC_PRE) lab4_main.c -o ${OBJECTDIR}/lab4_main.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/lab4_main.o.d" -g -omf=elf -DXPRJ_default=$(CND_CONF) -legacy-libc $(COMPARISON_BUILD) -O0 -msmart-io=1 -Wall -msfr-warn=off -mdfp=${DFP_DIR}/xc16 + @${FIXDEPS} "${OBJECTDIR}/lab4_main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/lab4_button.o: lab4_button.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/lab4_button.o.d + @${RM} ${OBJECTDIR}/lab4_button.o + ${MP_CC} $(MP_EXTRA_CC_PRE) lab4_button.c -o ${OBJECTDIR}/lab4_button.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/lab4_button.o.d" -g -omf=elf -DXPRJ_default=$(CND_CONF) -legacy-libc $(COMPARISON_BUILD) -O0 -msmart-io=1 -Wall -msfr-warn=off -mdfp=${DFP_DIR}/xc16 + @${FIXDEPS} "${OBJECTDIR}/lab4_button.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +${OBJECTDIR}/lab4_servo.o: lab4_servo.c nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/lab4_servo.o.d + @${RM} ${OBJECTDIR}/lab4_servo.o + ${MP_CC} $(MP_EXTRA_CC_PRE) lab4_servo.c -o ${OBJECTDIR}/lab4_servo.o -c -mcpu=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/lab4_servo.o.d" -g -omf=elf -DXPRJ_default=$(CND_CONF) -legacy-libc $(COMPARISON_BUILD) -O0 -msmart-io=1 -Wall -msfr-warn=off -mdfp=${DFP_DIR}/xc16 + @${FIXDEPS} "${OBJECTDIR}/lab4_servo.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ + +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assemble +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +else +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assemblePreproc +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +else +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: link +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +dist/${CND_CONF}/${IMAGE_TYPE}/Lab4.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} + ${MP_CC} $(MP_EXTRA_LD_PRE) -o dist/${CND_CONF}/${IMAGE_TYPE}/Lab4.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -mcpu=$(MP_PROCESSOR_OPTION) -D__DEBUG=__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -omf=elf -DXPRJ_default=$(CND_CONF) -legacy-libc $(COMPARISON_BUILD) -mreserve=data@0x800:0x81F -mreserve=data@0x820:0x821 -mreserve=data@0x822:0x823 -mreserve=data@0x824:0x825 -mreserve=data@0x826:0x84F -Wl,,,--defsym=__MPLAB_BUILD=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1,-D__DEBUG=__DEBUG,--defsym=__MPLAB_DEBUGGER_PK3=1,$(MP_LINKER_FILE_OPTION),--stack=16,--check-sections,--data-init,--pack-data,--handles,--isr,--no-gc-sections,--fill-upper=0,--stackguard=16,--no-force-link,--smart-io,-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map",--report-mem,--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml$(MP_EXTRA_LD_POST) -mdfp=${DFP_DIR}/xc16 + +else +dist/${CND_CONF}/${IMAGE_TYPE}/Lab4.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} + ${MP_CC} $(MP_EXTRA_LD_PRE) -o dist/${CND_CONF}/${IMAGE_TYPE}/Lab4.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -mcpu=$(MP_PROCESSOR_OPTION) -omf=elf -DXPRJ_default=$(CND_CONF) -legacy-libc $(COMPARISON_BUILD) -Wl,,,--defsym=__MPLAB_BUILD=1,$(MP_LINKER_FILE_OPTION),--stack=16,--check-sections,--data-init,--pack-data,--handles,--isr,--no-gc-sections,--fill-upper=0,--stackguard=16,--no-force-link,--smart-io,-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map",--report-mem,--memorysummary,dist/${CND_CONF}/${IMAGE_TYPE}/memoryfile.xml$(MP_EXTRA_LD_POST) -mdfp=${DFP_DIR}/xc16 + ${MP_CC_DIR}\\xc16-bin2hex dist/${CND_CONF}/${IMAGE_TYPE}/Lab4.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -a -omf=elf -mdfp=${DFP_DIR}/xc16 + +endif + + +# Subprojects +.build-subprojects: + + +# Subprojects +.clean-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r build/default + ${RM} -r dist/default + +# Enable dependency checking +.dep.inc: .depcheck-impl + +DEPFILES=$(shell mplabwildcard ${POSSIBLE_DEPFILES}) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/Lab4.X/nbproject/Makefile-genesis.properties b/Lab4.X/nbproject/Makefile-genesis.properties new file mode 100644 index 0000000..b0b44d9 --- /dev/null +++ b/Lab4.X/nbproject/Makefile-genesis.properties @@ -0,0 +1,10 @@ +# +#Tue Mar 31 12:13:08 CDT 2020 +default.Pack.dfplocation=C\:\\Program Files (x86)\\Microchip\\MPLABX\\v5.35\\packs\\Microchip\\PIC24F-GA-GB_DFP\\1.2.101 +default.com-microchip-mplab-nbide-toolchainXC16-XC16LanguageToolchain.md5=859fc649e7017fd01769e2187e1537a7 +default.languagetoolchain.dir=C\:\\Program Files\\Microchip\\xc16\\v1.50\\bin +configurations-xml=e0ae3ab3ff8165701c8f81eaf22a66fc +com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=5db0f4d6bbe0ec2a1f1096ccfb9d7ad3 +default.languagetoolchain.version=1.50 +host.platform=windows +conf.ids=default diff --git a/Lab4.X/nbproject/Makefile-impl.mk b/Lab4.X/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..564f468 --- /dev/null +++ b/Lab4.X/nbproject/Makefile-impl.mk @@ -0,0 +1,69 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=Lab4.X + +# Active Configuration +DEFAULTCONF=default +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=default + + +# build +.build-impl: .build-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default clean + + + +# all +.all-impl: .all-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default build + + + +# dependency checking support +.depcheck-impl: +# @echo "# This code depends on make tool being used" >.dep.inc +# @if [ -n "${MAKE_VERSION}" ]; then \ +# echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ +# echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ +# echo "include \$${DEPFILES}" >>.dep.inc; \ +# echo "endif" >>.dep.inc; \ +# else \ +# echo ".KEEP_STATE:" >>.dep.inc; \ +# echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ +# fi diff --git a/Lab4.X/nbproject/Makefile-local-default.mk b/Lab4.X/nbproject/Makefile-local-default.mk new file mode 100644 index 0000000..c75d9df --- /dev/null +++ b/Lab4.X/nbproject/Makefile-local-default.mk @@ -0,0 +1,38 @@ +# +# Generated Makefile - do not edit! +# +# +# This file contains information about the location of compilers and other tools. +# If you commmit this file into your revision control server, you will be able to +# to checkout the project and build it from the command line with make. However, +# if more than one person works on the same project, then this file might show +# conflicts since different users are bound to have compilers in different places. +# In that case you might choose to not commit this file and let MPLAB X recreate this file +# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at +# least once so the file gets created and the project can be built. Finally, you can also +# avoid using this file at all if you are only building from the command line with make. +# 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=C:/Program Files (x86)/Microchip/MPLABX/v5.35/mplab_platform/platform/../mplab_ide/modules/../../bin/ +# Adding MPLAB X bin directory to path. +PATH:=C:/Program Files (x86)/Microchip/MPLABX/v5.35/mplab_platform/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 (x86)\Microchip\MPLABX\v5.35\sys\java\jre1.8.0_181/bin/" +OS_CURRENT="$(shell uname -s)" +MP_CC="C:\Program Files\Microchip\xc16\v1.50\bin\xc16-gcc.exe" +# MP_CPPC is not defined +# MP_BC is not defined +MP_AS="C:\Program Files\Microchip\xc16\v1.50\bin\xc16-as.exe" +MP_LD="C:\Program Files\Microchip\xc16\v1.50\bin\xc16-ld.exe" +MP_AR="C:\Program Files\Microchip\xc16\v1.50\bin\xc16-ar.exe" +DEP_GEN=${MP_JAVA_PATH}java -jar "C:/Program Files (x86)/Microchip/MPLABX/v5.35/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar" +MP_CC_DIR="C:\Program Files\Microchip\xc16\v1.50\bin" +# MP_CPPC_DIR is not defined +# MP_BC_DIR is not defined +MP_AS_DIR="C:\Program Files\Microchip\xc16\v1.50\bin" +MP_LD_DIR="C:\Program Files\Microchip\xc16\v1.50\bin" +MP_AR_DIR="C:\Program Files\Microchip\xc16\v1.50\bin" +# MP_BC_DIR is not defined +DFP_DIR="C:/Program Files (x86)/Microchip/MPLABX/v5.35/packs/Microchip/PIC24F-GA-GB_DFP/1.2.101" diff --git a/Lab4.X/nbproject/Makefile-variables.mk b/Lab4.X/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..99eafb9 --- /dev/null +++ b/Lab4.X/nbproject/Makefile-variables.mk @@ -0,0 +1,13 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +# default configuration +CND_ARTIFACT_DIR_default=dist/default/production +CND_ARTIFACT_NAME_default=Lab4.X.production.hex +CND_ARTIFACT_PATH_default=dist/default/production/Lab4.X.production.hex +CND_PACKAGE_DIR_default=${CND_DISTDIR}/default/package +CND_PACKAGE_NAME_default=lab4.x.tar +CND_PACKAGE_PATH_default=${CND_DISTDIR}/default/package/lab4.x.tar diff --git a/Lab4.X/nbproject/Package-default.bash b/Lab4.X/nbproject/Package-default.bash new file mode 100644 index 0000000..ec5f254 --- /dev/null +++ b/Lab4.X/nbproject/Package-default.bash @@ -0,0 +1,73 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_CONF=default +CND_DISTDIR=dist +TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/Lab4.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +OUTPUT_BASENAME=Lab4.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +PACKAGE_TOP_DIR=lab4.x/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/package +rm -rf ${TMPDIR} +mkdir -p ${TMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory ${TMPDIR}/lab4.x/bin +copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/package/lab4.x.tar +cd ${TMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/lab4.x.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${TMPDIR} diff --git a/Lab4.X/nbproject/configurations.xml b/Lab4.X/nbproject/configurations.xml new file mode 100644 index 0000000..c062cde --- /dev/null +++ b/Lab4.X/nbproject/configurations.xml @@ -0,0 +1,656 @@ + + + + + lab4_button.h + lab4_servo.h + + + + + lab4_main.c + lab4_button.c + lab4_servo.c + + + Makefile + MyConfig.mc3 + + + Makefile + + + + localhost + PIC24FJ64GA002 + + + PK3OBPlatformTool + XC16 + 1.50 + 3 + + + + + + + + + + + + + false + false + + + + + + + false + + false + + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Lab4.X/nbproject/private/configurations.xml b/Lab4.X/nbproject/private/configurations.xml new file mode 100644 index 0000000..099de7b --- /dev/null +++ b/Lab4.X/nbproject/private/configurations.xml @@ -0,0 +1,25 @@ + + + Makefile + 0 + + + :=MPLABComm-USB-Microchip:=<vid>04D8:=<pid>8108:=<rev>0002:=<man>Digilent:=<prod>chipKitProgrammer:=<sn>DA63CA1:=<drv>x:=<xpt>h:=end + C:\Program Files\Microchip\xc16\v1.50\bin + + place holder 1 + place holder 2 + + + + + true + 0 + 0 + 0 + + + + + + diff --git a/Lab4.X/nbproject/private/private.xml b/Lab4.X/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/Lab4.X/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Lab4.X/nbproject/project.xml b/Lab4.X/nbproject/project.xml new file mode 100644 index 0000000..37597b1 --- /dev/null +++ b/Lab4.X/nbproject/project.xml @@ -0,0 +1,27 @@ + + + com.microchip.mplab.nbide.embedded.makeproject + + + Lab4 + 3910cf97-50cc-48f2-b0f8-cdd6c77563b8 + 0 + c + + h + + ISO-8859-1 + + + + + default + 2 + + + + false + + + + diff --git a/Lab4.X/strap012_lab4.zip b/Lab4.X/strap012_lab4.zip new file mode 100644 index 0000000..4641308 Binary files /dev/null and b/Lab4.X/strap012_lab4.zip differ diff --git a/Lab4.X/strap012_lab4_I_Guess.zip b/Lab4.X/strap012_lab4_I_Guess.zip new file mode 100644 index 0000000..ad7adf1 Binary files /dev/null and b/Lab4.X/strap012_lab4_I_Guess.zip differ -- cgit v1.2.3