Finished RS-232 debug project
This commit is contained in:
17
Telem_Debug/Debug_RS-232/.ccsproject
Normal file
17
Telem_Debug/Debug_RS-232/.ccsproject
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<?ccsproject version="1.0"?>
|
||||||
|
<projectOptions>
|
||||||
|
<ccsVersion value="6.2.0"/>
|
||||||
|
<deviceVariant value="MSP430F5438A"/>
|
||||||
|
<deviceFamily value="MSP430"/>
|
||||||
|
<deviceEndianness value="little"/>
|
||||||
|
<codegenToolVersion value="15.12.3.LTS"/>
|
||||||
|
<isElfFormat value="true"/>
|
||||||
|
<connection value="common/targetdb/connections/TIMSP430-USB.xml"/>
|
||||||
|
<linkerCommandFile value="lnk_msp430f5438a.cmd"/>
|
||||||
|
<rts value="libc.a"/>
|
||||||
|
<createSlaveProjects value=""/>
|
||||||
|
<templateProperties value="id=com.ti.common.project.core.emptyProjectTemplate,"/>
|
||||||
|
<filesToOpen value=""/>
|
||||||
|
<isTargetManual value="false"/>
|
||||||
|
</projectOptions>
|
||||||
201
Telem_Debug/Debug_RS-232/.cproject
Normal file
201
Telem_Debug/Debug_RS-232/.cproject
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings">
|
||||||
|
<cconfiguration id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1979933467">
|
||||||
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1979933467" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||||
|
<externalSettings/>
|
||||||
|
<extensions>
|
||||||
|
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
|
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
</extensions>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1979933467" name="Debug" parent="com.ti.ccstudio.buildDefinitions.MSP430.Debug">
|
||||||
|
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1979933467." name="/" resourcePath="">
|
||||||
|
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.DebugToolchain.2099237352" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.linkerDebug.903402306">
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1358383689" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||||
|
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430F5438A"/>
|
||||||
|
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||||
|
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||||
|
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/>
|
||||||
|
<listOptionValue builtIn="false" value="PRODUCTS="/>
|
||||||
|
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430f5438a.cmd"/>
|
||||||
|
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||||
|
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||||
|
</option>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.218032790" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="15.12.3.LTS" valueType="string"/>
|
||||||
|
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.targetPlatformDebug.1033425674" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.targetPlatformDebug"/>
|
||||||
|
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.builderDebug.584126814" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.builderDebug"/>
|
||||||
|
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.compilerDebug.1213885795" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.compilerDebug">
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DEFINE.1568985632" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DEFINE" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="__MSP430F5438A__"/>
|
||||||
|
</option>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DATA_MODEL.128158540" name="Specify the data memory model. (--data_model)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DATA_MODEL" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DATA_MODEL.restricted" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.USE_HW_MPY.270825461" name="Inline hardware multiply version of RTS mpy routine (--use_hw_mpy)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.USE_HW_MPY" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.USE_HW_MPY.F5" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU21.1145858544" name="Workaround specified silicon errata (--silicon_errata) [CPU21]" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU21" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU22.1326195320" name="Workaround specified silicon errata (--silicon_errata) [CPU22]" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU22" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU23.1272727353" name="Workaround specified silicon errata (--silicon_errata) [CPU23]" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU23" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU40.1665504978" name="Workaround specified silicon errata (--silicon_errata) [CPU40]" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU40" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_VERSION.1983583302" name="Silicon version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_VERSION.mspx" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.PRINTF_SUPPORT.1714583381" name="Level of printf/scanf support required (--printf_support)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DEBUGGING_MODEL.732387903" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.ADVICE__POWER.1675799664" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.ADVICE__POWER" value=""all"" valueType="string"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WARNING.826896737" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WARNING" valueType="stringList">
|
||||||
|
<listOptionValue builtIn="false" value="225"/>
|
||||||
|
</option>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DISPLAY_ERROR_NUMBER.781435786" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WRAP.982580200" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.INCLUDE_PATH.123612000" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||||
|
</option>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.OPT_LEVEL.1329258172" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.OPT_LEVEL.0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__C_SRCS.1262038419" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__C_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__CPP_SRCS.1969362972" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__CPP_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__ASM_SRCS.2085742368" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__ASM_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__ASM2_SRCS.1801651410" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__ASM2_SRCS"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.linkerDebug.903402306" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.linkerDebug">
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.LIBRARY.2039349155" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.LIBRARY" valueType="libs">
|
||||||
|
<listOptionValue builtIn="false" value=""libmath.a""/>
|
||||||
|
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||||
|
</option>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.SEARCH_PATH.710060442" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||||
|
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/lib/5xx_6xx_FRxx""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||||
|
</option>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.USE_HW_MPY.98900268" name="Deprecated: Now a compiler option instead of linker option (--use_hw_mpy)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.USE_HW_MPY" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.USE_HW_MPY.F5" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.CINIT_HOLD_WDT.1305838102" name="Hold watchdog timer during cinit auto-initialization (--cinit_hold_wdt)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.CINIT_HOLD_WDT" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.CINIT_HOLD_WDT.on" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.HEAP_SIZE.1115594788" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.HEAP_SIZE" value="160" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.STACK_SIZE.398722725" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.STACK_SIZE" value="160" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.OUTPUT_FILE.1490202662" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.OUTPUT_FILE" useByScannerDiscovery="false" value="${ProjName}.out" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.MAP_FILE.1567690249" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.XML_LINK_INFO.1123932426" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DISPLAY_ERROR_NUMBER.1621450265" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DIAG_WRAP.484870698" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.PREFERRED_ORDER.944002310" name="Add <function> to preferred placement order list (--preferred_order)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.PREFERRED_ORDER" valueType="stringList"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__CMD_SRCS.1768504414" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__CMD_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__CMD2_SRCS.1179136448" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__CMD2_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__GEN_CMDS.1726708131" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__GEN_CMDS"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.1635543204" name="MSP430 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex">
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.ROMWIDTH.458055364" name="Specify rom width (--romwidth, -romwidth=width)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.ROMWIDTH" value="8" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.MEMWIDTH.1196438589" name="Specify memory width (--memwidth, -memwidth=width)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.MEMWIDTH" value="8" valueType="string"/>
|
||||||
|
</tool>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
|
</cconfiguration>
|
||||||
|
<cconfiguration id="com.ti.ccstudio.buildDefinitions.MSP430.Release.1700303872">
|
||||||
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.1700303872" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||||
|
<externalSettings/>
|
||||||
|
<extensions>
|
||||||
|
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
|
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
</extensions>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.1700303872" name="Release" parent="com.ti.ccstudio.buildDefinitions.MSP430.Release">
|
||||||
|
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Release.1700303872." name="/" resourcePath="">
|
||||||
|
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.ReleaseToolchain.404800592" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.linkerRelease.552910435">
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.314342700" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||||
|
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430F5438A"/>
|
||||||
|
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
|
||||||
|
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
|
||||||
|
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=6.1.3"/>
|
||||||
|
<listOptionValue builtIn="false" value="PRODUCTS="/>
|
||||||
|
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430f5438a.cmd"/>
|
||||||
|
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||||
|
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||||
|
</option>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.817606364" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="15.12.3.LTS" valueType="string"/>
|
||||||
|
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.targetPlatformRelease.1601809459" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.targetPlatformRelease"/>
|
||||||
|
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.builderRelease.774112901" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.builderRelease"/>
|
||||||
|
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.compilerRelease.500412336" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.compilerRelease">
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DEFINE.1421512181" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DEFINE" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="__MSP430F5438A__"/>
|
||||||
|
</option>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DATA_MODEL.859980379" name="Specify the data memory model. (--data_model)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DATA_MODEL" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DATA_MODEL.restricted" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.USE_HW_MPY.405207267" name="Inline hardware multiply version of RTS mpy routine (--use_hw_mpy)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.USE_HW_MPY" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.USE_HW_MPY.F5" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU21.2067992649" name="Workaround specified silicon errata (--silicon_errata) [CPU21]" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU21" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU22.2086166934" name="Workaround specified silicon errata (--silicon_errata) [CPU22]" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU22" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU23.1496965605" name="Workaround specified silicon errata (--silicon_errata) [CPU23]" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU23" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU40.651304265" name="Workaround specified silicon errata (--silicon_errata) [CPU40]" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_ERRATA.CPU40" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_VERSION.644782865" name="Silicon version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.SILICON_VERSION.mspx" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.PRINTF_SUPPORT.1862648913" name="Level of printf/scanf support required (--printf_support)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.ADVICE__POWER.634050816" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.ADVICE__POWER" value="all" valueType="string"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WARNING.757049951" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WARNING" valueType="stringList">
|
||||||
|
<listOptionValue builtIn="false" value="225"/>
|
||||||
|
</option>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DISPLAY_ERROR_NUMBER.1967284581" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WRAP.1552082730" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.INCLUDE_PATH.1887759790" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__C_SRCS.442377218" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__C_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__CPP_SRCS.66181740" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__CPP_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__ASM_SRCS.378236216" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__ASM_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__ASM2_SRCS.74333072" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.compiler.inputType__ASM2_SRCS"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.linkerRelease.552910435" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exe.linkerRelease">
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.LIBRARY.211610770" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.LIBRARY" valueType="libs">
|
||||||
|
<listOptionValue builtIn="false" value=""libmath.a""/>
|
||||||
|
<listOptionValue builtIn="false" value=""libc.a""/>
|
||||||
|
</option>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.SEARCH_PATH.303004004" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||||
|
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/lib/5xx_6xx_FRxx""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/>
|
||||||
|
</option>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.USE_HW_MPY.581713706" name="Deprecated: Now a compiler option instead of linker option (--use_hw_mpy)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.USE_HW_MPY" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.USE_HW_MPY.F5" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.CINIT_HOLD_WDT.1824974907" name="Hold watchdog timer during cinit auto-initialization (--cinit_hold_wdt)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.CINIT_HOLD_WDT" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.CINIT_HOLD_WDT.on" valueType="enumerated"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.HEAP_SIZE.503779212" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.HEAP_SIZE" value="160" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.STACK_SIZE.1024928966" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.STACK_SIZE" value="160" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.OUTPUT_FILE.866512210" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.OUTPUT_FILE" useByScannerDiscovery="false" value="${ProjName}.out" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.MAP_FILE.16242556" name="Link information (map) listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.XML_LINK_INFO.1262022594" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DISPLAY_ERROR_NUMBER.1055675308" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DIAG_WRAP.932430051" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_15.12.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__CMD_SRCS.1910978391" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__CMD_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__CMD2_SRCS.873637502" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__CMD2_SRCS"/>
|
||||||
|
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__GEN_CMDS.1463097099" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.exeLinker.inputType__GEN_CMDS"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.980106029" name="MSP430 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex">
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.ROMWIDTH.437648212" name="Specify rom width (--romwidth, -romwidth=width)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.ROMWIDTH" value="8" valueType="string"/>
|
||||||
|
<option id="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.MEMWIDTH.46410579" name="Specify memory width (--memwidth, -memwidth=width)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_15.12.hex.MEMWIDTH" value="8" valueType="string"/>
|
||||||
|
</tool>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
|
</cconfiguration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<project id="Debug3.com.ti.ccstudio.buildDefinitions.MSP430.ProjectType.591995758" name="MSP430" projectType="com.ti.ccstudio.buildDefinitions.MSP430.ProjectType"/>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="scannerConfiguration"/>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
|
||||||
|
<project-mappings>
|
||||||
|
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/>
|
||||||
|
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||||
|
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/>
|
||||||
|
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||||
|
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/>
|
||||||
|
</project-mappings>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||||
|
</cproject>
|
||||||
1
Telem_Debug/Debug_RS-232/.gitignore
vendored
Normal file
1
Telem_Debug/Debug_RS-232/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/Debug/
|
||||||
27
Telem_Debug/Debug_RS-232/.project
Normal file
27
Telem_Debug/Debug_RS-232/.project
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>Debug_RS-232</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||||
|
<triggers>full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>com.ti.ccstudio.core.ccsNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
inEditor=false
|
||||||
|
onBuild=false
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding//Debug/makefile=UTF-8
|
||||||
|
encoding//Debug/objects.mk=UTF-8
|
||||||
|
encoding//Debug/sources.mk=UTF-8
|
||||||
|
encoding//Debug/subdir_rules.mk=UTF-8
|
||||||
|
encoding//Debug/subdir_vars.mk=UTF-8
|
||||||
356
Telem_Debug/Debug_RS-232/SunseekerTelemetry2021.h
Normal file
356
Telem_Debug/Debug_RS-232/SunseekerTelemetry2021.h
Normal file
@@ -0,0 +1,356 @@
|
|||||||
|
/*
|
||||||
|
* Sunseeker Telemetry 2021
|
||||||
|
*
|
||||||
|
* Main CLK : MCLK = XT2 = 20 MHz
|
||||||
|
* Sub-Main CLK : SMCLK = XT2/2 = 10 MHz
|
||||||
|
* Aux CLK : ACLK = XT1 = 32.768 kHz
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SUNSEEKERTELEMETRY2021_H_
|
||||||
|
#define SUNSEEKERTELEMETRY2021_H_
|
||||||
|
|
||||||
|
#include <msp430.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
|
void clock_init(void);
|
||||||
|
|
||||||
|
static inline void delay(void){
|
||||||
|
volatile int jj;
|
||||||
|
volatile int ii;
|
||||||
|
// Using count-down since it uses one less instruction to compare (not really necessary here, but CCS recommends it anyway): Ultra-Low Power Advisor > Rule 13.1 (https://software-dl.ti.com/ccs/esd/documents/dmed/HTML/MSP430/1544.html)
|
||||||
|
for (ii = 4; ii > 0; ii--){
|
||||||
|
for (jj = 1000; jj > 0; jj--){
|
||||||
|
_NOP();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void delayMultiplied(int multiplier){
|
||||||
|
volatile int jj;
|
||||||
|
volatile int ii;
|
||||||
|
// Using count-down since it uses one less instruction to compare (not really necessary here, but CCS recommends it anyway): Ultra-Low Power Advisor > Rule 13.1 (https://software-dl.ti.com/ccs/esd/documents/dmed/HTML/MSP430/1544.html)
|
||||||
|
for (ii = 4 * multiplier; ii > 0; ii--){
|
||||||
|
for (jj = 1000; jj > 0; jj--){
|
||||||
|
_NOP();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event timing
|
||||||
|
#define SMCLK_RATE 10000000 // Hz
|
||||||
|
#define ACLK_RATE 32768 // Hz
|
||||||
|
#define TICK_RATE 16 // Hz
|
||||||
|
#define TELEM_STATUS_COUNT 16 // Number of ticks per event: 5 sec
|
||||||
|
#define HS_COMMS_SPEED 16*5 // Number of ticks per event: 5 sec
|
||||||
|
#define LS_COMMS_SPEED 16*10 // Number of ticks per event: 15 sec
|
||||||
|
#define ST_COMMS_SPEED 16*20 // Number of ticks per event: 60 sec
|
||||||
|
|
||||||
|
// Constant Definitions
|
||||||
|
#define TRUE 1
|
||||||
|
#define FALSE 0
|
||||||
|
|
||||||
|
/******************** Pin Definitions *************************/
|
||||||
|
|
||||||
|
// PORT 1
|
||||||
|
#define P10 0x01
|
||||||
|
#define P11 0x02
|
||||||
|
#define P12 0x04
|
||||||
|
#define P13 0x08
|
||||||
|
#define P14 0x10
|
||||||
|
#define P15 0x20
|
||||||
|
#define RTC_MFP 0x40
|
||||||
|
#define IMU_INTn 0x80
|
||||||
|
#define P1_UNUSED 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20
|
||||||
|
|
||||||
|
// PORT 2
|
||||||
|
#define CAN0_INTn 0x01
|
||||||
|
#define CAN0_RXB0n 0x02
|
||||||
|
#define CAN0_RXB1n 0x04
|
||||||
|
#define CAN1_INTn 0x08
|
||||||
|
#define CAN1_RXB0n 0x10
|
||||||
|
#define CAN1_RXB1n 0x20
|
||||||
|
#define GPS_INTn 0x40
|
||||||
|
#define P27 0x80
|
||||||
|
#define P2_UNUSED 0x80
|
||||||
|
|
||||||
|
// PORT 3
|
||||||
|
#define CAN0_SCLK 0x01
|
||||||
|
#define SDC_MOSI 0x02
|
||||||
|
#define SDC_MISO 0x04
|
||||||
|
#define SDC_SCLK 0x08
|
||||||
|
#define CAN0_MOSI 0x10
|
||||||
|
#define CAN0_MISO 0x20
|
||||||
|
#define CAN1_SCLK 0x40
|
||||||
|
#define IMU_SDA 0x80
|
||||||
|
#define P3_UNUSED 0x00
|
||||||
|
|
||||||
|
// PORT 4
|
||||||
|
#define CAN0_RSTn 0x01
|
||||||
|
#define CAN0_CSn 0x02
|
||||||
|
#define CAN1_RSTn 0x04
|
||||||
|
#define CAN1_CSn 0x08
|
||||||
|
#define SDC_WPn 0x10
|
||||||
|
#define SDC_CDn 0x20
|
||||||
|
#define P46 0x40
|
||||||
|
#define P47 0x80
|
||||||
|
#define P4_UNUSED 0x40 | 0x80
|
||||||
|
|
||||||
|
// PORT 5
|
||||||
|
#define P50 0x01
|
||||||
|
#define P51 0x02
|
||||||
|
#define XT2IN 0x04
|
||||||
|
#define XT2OUT 0x08
|
||||||
|
#define IMU_SCL 0x10
|
||||||
|
#define P55 0x20
|
||||||
|
#define CAN1_MOSI 0x40
|
||||||
|
#define CAN1_MISO 0x80
|
||||||
|
#define P5_UNUSED 0x01 | 0x02 | 0x20
|
||||||
|
|
||||||
|
// PORT 6
|
||||||
|
#define P60 0x01
|
||||||
|
#define P61 0x02
|
||||||
|
#define P62 0x04
|
||||||
|
#define P63 0x08
|
||||||
|
#define P64 0x10
|
||||||
|
#define P65 0x20
|
||||||
|
#define P66 0x40
|
||||||
|
#define P67 0x80
|
||||||
|
#define P6_UNUSED 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80
|
||||||
|
|
||||||
|
// PORT 7
|
||||||
|
#define XT1IN 0x01
|
||||||
|
#define XT1OUT 0x02
|
||||||
|
#define P72 0x04
|
||||||
|
#define P73 0x08
|
||||||
|
#define P74 0x10
|
||||||
|
#define P75 0x20
|
||||||
|
#define P76 0x40
|
||||||
|
#define P77 0x80
|
||||||
|
#define P7_UNUSED 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80
|
||||||
|
|
||||||
|
// PORT 8
|
||||||
|
#define P80 0x01
|
||||||
|
#define P81 0x02
|
||||||
|
#define P82 0x04
|
||||||
|
#define LEDG 0x08
|
||||||
|
#define LEDR 0x10
|
||||||
|
#define LEDY0 0x20
|
||||||
|
#define LEDY1 0x40
|
||||||
|
#define Button0 0x80
|
||||||
|
#define P8_UNUSED 0x01 | 0x02 | 0x04
|
||||||
|
|
||||||
|
// PORT 9
|
||||||
|
#define P90 0x01
|
||||||
|
#define RTC_SDA 0x02
|
||||||
|
#define RTC_SCL 0x04
|
||||||
|
#define P93 0x08
|
||||||
|
#define USB_TX 0x10
|
||||||
|
#define USB_RX 0x20
|
||||||
|
#define SDC_CSn 0x40
|
||||||
|
#define GPS_CSn 0x80
|
||||||
|
#define P9_UNUSED 0x01 | 0x08
|
||||||
|
|
||||||
|
// PORT 10
|
||||||
|
#define BT_CSn 0x01
|
||||||
|
#define BT_MOSI 0x02
|
||||||
|
#define BT_MISO 0x04
|
||||||
|
#define BT_SCLK 0x08
|
||||||
|
#define UART_TX 0x10
|
||||||
|
#define UART_RX 0x20
|
||||||
|
#define BT_EN 0x40
|
||||||
|
#define P107 0x80
|
||||||
|
#define P10_UNUSED 0x80
|
||||||
|
|
||||||
|
// PORT 11
|
||||||
|
#define ACLK_TEST 0x01
|
||||||
|
#define MCLK_TEST 0x02
|
||||||
|
#define SMCLK_TEST 0x04
|
||||||
|
|
||||||
|
// PORT J
|
||||||
|
#define JTAG_TDO 0x01
|
||||||
|
#define JTAG_TDI 0x02
|
||||||
|
#define JTAG_TMS 0x04
|
||||||
|
#define JTAG_TCK 0x08
|
||||||
|
|
||||||
|
// Transmit Packet Info
|
||||||
|
#define HF_MSG_PACKET 10 //number of messages per packet in high frequency
|
||||||
|
#define LF_MSG_PACKET 0 //number of messages per packet in low frequency
|
||||||
|
#define ST_MSG_PACKET 0 //number of messages that we receive and don't send out
|
||||||
|
#define No_MSG_PACKET 38 //number of messages that we receive and don't send out
|
||||||
|
#define LOOKUP_ROWS HF_MSG_PACKET+LF_MSG_PACKET+ST_MSG_PACKET+No_MSG_PACKET
|
||||||
|
#define NAME_LOOKUP_ROWS LOOKUP_ROWS
|
||||||
|
//#define TIME_SIZE 30 //number of characters in time
|
||||||
|
#define MSG_SIZE 30 //number of characters in single message
|
||||||
|
|
||||||
|
// Motor controller CAN base address and packet offsets
|
||||||
|
#define MC_CAN_BASE1 0x400 // High = CAN1_SERIAL Number Low = 0x00004003 P=1s
|
||||||
|
#define MC_CAN_BASE2 0x420 // High = CAN1_SERIAL Number Low = 0x00004003 P=1s
|
||||||
|
#define MC_LIMITS 0x01 // High = CAN_Err,Active Motor Low = Error & Limit flags P=200ms
|
||||||
|
#define MC_BUS 0x02 // High = Bus Current Low = Bus Voltage P=200ms
|
||||||
|
#define MC_VELOCITY 0x03 // High = Velocity (m/s) Low = Velocity (rpm) P=200ms
|
||||||
|
#define MC_PHASE 0x04 // High = Phase C Current Low = Phase B Current P=200ms
|
||||||
|
#define MC_V_VECTOR 0x05 // High = Vd vector Low = Vq vector P=200ms
|
||||||
|
#define MC_I_VECTOR 0x06 // High = Id vector Low = Iq vector P=200ms
|
||||||
|
#define MC_BEMF_VECTOR 0x07 // High = BEMFd vector Low = BEMFq vector P=200ms
|
||||||
|
#define MC_RAIL1 0x08 // High = 15V Low = Reserved P=1s
|
||||||
|
#define MC_RAIL2 0x09 // High = 3.3V Low = 1.9V P=1s
|
||||||
|
//#define MC_FAN 0x0A // High = Reserved Low = Reserved P=
|
||||||
|
#define MC_TEMP1 0x0B // High = Heatsink Temp (case) Low = Motor Temp (internal) P=1s
|
||||||
|
#define MC_TEMP2 0x0C // High = Reserved Low = DSP Temp P=1s
|
||||||
|
//#define MC_TEMP3 0x0D // High = Outlet Temp Low = Capacitor Temp P=
|
||||||
|
#define MC_CUMULATIVE 0x0E // High = DC Bus AmpHours (A-Hr) Low = Odometer (m) P=1s
|
||||||
|
#define MC_SLIPSPEED 0x17 // High = Slip Speed (Hz ) Low = Reserved P=200ms
|
||||||
|
|
||||||
|
// Driver controls CAN base address and packet offsets
|
||||||
|
#define DC_CAN_BASE 0x500 // High = CAN1_SERIAL Number Low = "TRIb" string P=1s
|
||||||
|
#define DC_DRIVE 0x01 // High = Motor Current Setpoint Low = Motor Velocity Setpoint P=100ms
|
||||||
|
#define DC_POWER 0x02 // High = Bus Current Setpoint Low = Unused P=100ms
|
||||||
|
#define DC_RESET 0x03 // High = Unused Low = Unused P=
|
||||||
|
#define DC_SWITCH 0x04 // High = Switch position Low = Switch state change P=100ms
|
||||||
|
|
||||||
|
//Battery Protection System base address and packet offsets
|
||||||
|
#define BP_CAN_BASE 0x580 // High = "BPV1" string or nulls Low = CAN1_SERIAL Number P=10s
|
||||||
|
#define BP_VMAX 0x01 // High = Max. Voltage Value Low = Max. Voltage Cell Num. P=10s
|
||||||
|
#define BP_VMIN 0x02 // High = Min. Voltage Value Low = Min. Voltage Cell Num. P=10s
|
||||||
|
#define BP_TMAX 0x03 // High = Max. Temperature Low = Max. Temperature Cell P=10s
|
||||||
|
#define BP_PCDONE 0x04 // High = "BPV2" or "0000" string Low = CAN1_SERIAL Number P=When Ready
|
||||||
|
#define BP_ISH 0x05 // High = Shunt Current Low = Battery Voltage P=1s
|
||||||
|
|
||||||
|
//Battery Protection System base address and packet offsets
|
||||||
|
#define AC_CAN_BASE 0x5C0 // High = "ACV1" string or nulls Low = CAN1_SERIAL Number P=10s
|
||||||
|
#define AC_M1 0x01 // High = Array Voltage Average Low = Array Current Average P=10s
|
||||||
|
#define AC_M2 0x02 // High = Array Voltage Average Low = Array Current Average P=10s
|
||||||
|
#define AC_M3 0x03 // High = Array Voltage Average Low = Array Current Average P=10s
|
||||||
|
#define AC_ISH 0x04 // High = Shunt Current Low = Battery Voltage P=1s
|
||||||
|
#define AC_TMAX 0x05 // High = Max. Temperature Low = Max. Temperature MPPT P=10s
|
||||||
|
#define AC_TVAL1 0x06 // High = Temp AC1 Low = Temp AC2 P=10s
|
||||||
|
#define AC_TVAL2 0x06 // High = Temp AC3 Low = Reserved P=10s
|
||||||
|
#define AC_BP_CHARGE 0x07 // High = "ACV1" or "0000" string Low = CAN1_SERIAL Number P=When Charge
|
||||||
|
|
||||||
|
static int addr_lookup[LOOKUP_ROWS][5] = {
|
||||||
|
//address ASCII Offset MSG_REC position Packet(0-HF:1-LF:2-Status) Filter Priority
|
||||||
|
{MC_CAN_BASE1, 0, 0x0001, 3, 29}, //0-0x400 High = CAN1_SERIAL Number Low = "TRIa" string
|
||||||
|
{MC_CAN_BASE1 + MC_LIMITS, 0, 0x0001, 3, 15}, //1-0x01 High = Active Motor Low = Error & Limit flags
|
||||||
|
{MC_CAN_BASE1 + MC_BUS, 0, 0x0002, 0, 1}, //2-0x02 High = Bus Current Low = Bus Voltage
|
||||||
|
{MC_CAN_BASE1 + MC_VELOCITY, 1, 0x0004, 0, 2}, //3-0x03 High = Velocity (m/s) Low = Velocity (rpm)
|
||||||
|
{MC_CAN_BASE1 + MC_PHASE, 1, 0x0001, 3, 30}, //4-0x04 High = Phase A Current Low = Phase B Current
|
||||||
|
{MC_CAN_BASE1 + MC_V_VECTOR, 2, 0x0002, 3, 31}, //5-0x05 High = Vd vector Low = Vq vector
|
||||||
|
{MC_CAN_BASE1 + MC_I_VECTOR, 3, 0x0004, 3, 32}, //6-0x06 High = Id vector Low = Iq vector
|
||||||
|
{MC_CAN_BASE1 + MC_BEMF_VECTOR, 4, 0x0008, 3, 33}, //7-0x07 High = BEMFd vector Low = BEMFq vector
|
||||||
|
{MC_CAN_BASE1 + MC_RAIL1, 1, 0x0002, 3, 16}, //8-0x08 High = 15V Low = Reserved
|
||||||
|
{MC_CAN_BASE1 + MC_RAIL2, 2, 0x0004, 3, 17}, //9-0x09 High = 3.3V Low = 1.9V
|
||||||
|
{MC_CAN_BASE1 + MC_TEMP1, 0, 0x0001, 3, 7}, //10-0x0B High = Heatsink Temp Low = Motor Temp
|
||||||
|
{MC_CAN_BASE1 + MC_TEMP2, 1, 0x0002, 3, 8}, //11-0x0C High = Inlet Temp Low = CPU Temp
|
||||||
|
{MC_CAN_BASE1 + MC_CUMULATIVE, 3, 0x0008, 3, 18}, //12-x0E High = DC Bus AmpHours Low = Odometer
|
||||||
|
{MC_CAN_BASE1 + MC_SLIPSPEED, 5, 0x0010, 3, 34}, //13-0x17 High =Slip Speed (Hz) Low = Reserved
|
||||||
|
{MC_CAN_BASE2, 6, 0x0020, 3, 35}, //14-0x420 High = CAN1_SERIAL Number Low = "TRIa" string
|
||||||
|
{MC_CAN_BASE2 + MC_LIMITS, 4, 0x0010, 3, 19}, //15-0x01 High = Active Motor Low = Error & Limit flags
|
||||||
|
{MC_CAN_BASE2 + MC_BUS, 2, 0x0010, 0, 3}, //16-0x02 High = Bus Current Low = Bus Voltage
|
||||||
|
{MC_CAN_BASE2 + MC_VELOCITY, 3, 0x0020, 0, 4}, //17-0x03 High = Velocity (m/s) Low = Velocity (rpm)
|
||||||
|
{MC_CAN_BASE2 + MC_PHASE, 7, 0x0040, 3, 36}, //18-0x04 High = Phase A Current Low = Phase B Current
|
||||||
|
{MC_CAN_BASE2 + MC_V_VECTOR, 8, 0x0080, 3, 37}, //19-0x05 High = Vd vector Low = Vq vector
|
||||||
|
{MC_CAN_BASE2 + MC_I_VECTOR, 9, 0x0100, 3, 38}, //20-0x06 High = Id vector Low = Iq vector
|
||||||
|
{MC_CAN_BASE2 + MC_BEMF_VECTOR, 10, 0x0200, 3, 39}, //21-0x07 High = BEMFd vector Low = BEMFq vector
|
||||||
|
{MC_CAN_BASE2 + MC_RAIL1, 5, 0x0020, 3, 20}, //22-0x08 High = 15V Low = Reserved
|
||||||
|
{MC_CAN_BASE2 + MC_RAIL2, 6, 0x0040, 3, 21}, //23-0x09 High = 3.3V Low = 1.9V
|
||||||
|
{MC_CAN_BASE2 + MC_TEMP1, 2, 0x0004, 3, 9}, //24-0x0B High = Heatsink Temp Low = Motor Temp
|
||||||
|
{MC_CAN_BASE2 + MC_TEMP2, 3, 0x0008, 3, 10}, //25-0x0C High = Inlet Temp Low = CPU Temp
|
||||||
|
{MC_CAN_BASE2 + MC_CUMULATIVE, 7, 0x0080, 3, 22}, //26-0x0E High = DC Bus AmpHours Low = Odometer
|
||||||
|
{MC_CAN_BASE2 + MC_SLIPSPEED, 11, 0x0400, 3, 40}, //27-0x17 High =Slip Speed (Hz) Low = Reserved
|
||||||
|
{DC_CAN_BASE, 12, 0x0800, 3, 41}, //28-0x500 High = CAN1_SERIAL Number Low = "TRIb" string
|
||||||
|
{DC_CAN_BASE + DC_DRIVE, 4, 0x0800, 0, 23}, //29-0x01 High = Motor Current Setpoint Low = Motor Velocity Setpoint
|
||||||
|
{DC_CAN_BASE + DC_POWER, 9, 0x0200, 3, 24}, //30-0x02 High = Bus Current Setpoint Low = Unused
|
||||||
|
{DC_CAN_BASE + DC_RESET, 13, 0x1000, 3, 42}, //31-0x03 High = Unused Low = Unused
|
||||||
|
{DC_CAN_BASE + DC_SWITCH, 5, 0x0080, 0, 25}, //32-0x04 High = Switch position Low = Switch state change
|
||||||
|
{BP_CAN_BASE, 14, 0x2000, 3, 43}, //33-0x580 High = BPV2" string or nulls Low = CAN1_SERIAL Number
|
||||||
|
{BP_CAN_BASE + BP_VMAX, 6, 0x0010, 0, 11}, //34-0x01 High = Max Voltage Low = Cell Number
|
||||||
|
{BP_CAN_BASE + BP_VMIN, 7, 0x0020, 0, 12}, //35-0x02 High = Min Voltage Low = Cell Number
|
||||||
|
{BP_CAN_BASE + BP_TMAX, 8, 0x0040, 0, 13}, //36-0x03 High = Temp Max Low = Cell Number
|
||||||
|
{BP_CAN_BASE + BP_PCDONE, 15, 0x0200, 3, 44}, //37-0x04 High = "BPV1" string Low = CAN1_SERIAL Number
|
||||||
|
{BP_CAN_BASE + BP_ISH, 9, 0x0010, 0, 5}, //38-0x05 High = Shunt Current Low = Battery Voltage
|
||||||
|
{AC_CAN_BASE, 16, 0x8000, 3, 45}, //39-0x5C0 High = ACV1" string or nulls Low = CAN1_SERIAL Number
|
||||||
|
{AC_CAN_BASE + AC_M1, 11, 0x0800, 3, 26}, //40-0x01 High = Array Voltage Average Low = Array Current Average
|
||||||
|
{AC_CAN_BASE + AC_M2, 12, 0x1000, 3, 27}, //41-0x02 High = Array Voltage Average Low = Array Current Average
|
||||||
|
{AC_CAN_BASE + AC_M3, 13, 0x2000, 3, 28}, //42-0x03 High = Array Voltage Average Low = Array Current Average
|
||||||
|
{AC_CAN_BASE + AC_ISH, 5, 0x0020, 3, 6}, //43-0x04 High = Shunt Current Low = Battery Voltage
|
||||||
|
{AC_CAN_BASE + AC_TMAX, 7, 0x0080, 3, 14}, //44-0x05 High = Max. Temperature Low = Max. Temperature MPPT
|
||||||
|
{AC_CAN_BASE + AC_TVAL1, 17, 0x1000, 3, 46}, //45-0x03 High = Temp AC1 Low = Temp AC2
|
||||||
|
{AC_CAN_BASE + AC_TVAL2, 18, 0x2000, 3, 47}, //46-0x04 High = Temp AC3 Low = Reserved
|
||||||
|
{AC_CAN_BASE + AC_BP_CHARGE, 19, 0x4000, 3, 48}, //47-0x05 High = "ACV1" or "0000" string Low = CAN1_SERIAL Number
|
||||||
|
};
|
||||||
|
// removed
|
||||||
|
//{MC_CAN_BASE1 + MC_FAN, -, 0x----, -, --}, //xx-0x0A High = Fan speed (rpm) Low = Fan drive (%)
|
||||||
|
//{MC_CAN_BASE1 + MC_TEMP3, -, 0x----, -, --}, //xx-0x0D High = Outlet Temp Low = Capacitor Temp
|
||||||
|
//{MC_CAN_BASE2 + MC_FAN, -, 0x----, -, --}, //xx-0x0A High = Fan speed (rpm) Low = Fan drive (%)
|
||||||
|
//{MC_CAN_BASE2 + MC_TEMP3, -, 0x----, -, --}, //xx-0x0D High = Outlet Temp Low = Capacitor Temp
|
||||||
|
|
||||||
|
|
||||||
|
//static char lut_blacklist[] = {32,11,4,5,11,12,13,14,15,23,24,25,3,26,27,28};
|
||||||
|
//static char lut_blacklist[] = {44};
|
||||||
|
static char lut_blacklist[] = {49};
|
||||||
|
|
||||||
|
static char *name_lookup[NAME_LOOKUP_ROWS] = {
|
||||||
|
//name
|
||||||
|
"MC1BAS", //MC_CAN_BASE1_
|
||||||
|
"MC1LIM", //MC_CAN_BASE1 + MC_LIMITS
|
||||||
|
"MC1BUS", //MC_CAN_BASE1 + MC_BUS
|
||||||
|
"MC1VEL", //MC_CAN_BASE1 + MC_VELOCITY
|
||||||
|
"MC1PHA", //MC_CAN_BASE1 + MC_PHASE
|
||||||
|
"MC1VVC", //MC_CAN_BASE1 + MC_V_VECTOR
|
||||||
|
"MC1IVC", //MC_CAN_BASE1 + MC_I_VECTOR
|
||||||
|
"MC1BEM", //MC_CAN_BASE1 + MC_BEMF_VECTOR
|
||||||
|
"MC1RL1", //MC_CAN_BASE1 + MC_RAIL1
|
||||||
|
"MC1RL2", //MC_CAN_BASE1 + MC_RAIL2
|
||||||
|
"MC1TP1", //MC_CAN_BASE1 + MC_TEMP1
|
||||||
|
"MC1TP2", //MC_CAN_BASE1 + MC_TEMP2
|
||||||
|
"MC1CUM", //MC_CAN_BASE1 + MC_CUMULATIVE
|
||||||
|
"MC1SLS", //MC_CAN_BASE1 + MC_SLIPSPEED
|
||||||
|
"MC2BAS", //MC_CAN_BASE2
|
||||||
|
"MC2LIM", //MC_CAN_BASE2 + MC_LIMITS
|
||||||
|
"MC2BUS", //MC_CAN_BASE2 + MC_BUS
|
||||||
|
"MC2VEL", //MC_CAN_BASE2 + MC_VELOCITY
|
||||||
|
"MC2PHA", //MC_CAN_BASE2 + MC_PHASE
|
||||||
|
"MC2VVC", //MC_CAN_BASE2 + MC_V_VECTOR
|
||||||
|
"MC2IVC", //MC_CAN_BASE2 + MC_I_VECTOR
|
||||||
|
"MC2BEM", //MC_CAN_BASE2 + MC_BEMF_VECTOR
|
||||||
|
"MC2RL1", //MC_CAN_BASE2 + MC_RAIL1
|
||||||
|
"MC2RL2", //MC_CAN_BASE2 + MC_RAIL2
|
||||||
|
"MC2TP1", //MC_CAN_BASE2 + MC_TEMP1
|
||||||
|
"MC2TP2", //MC_CAN_BASE2 + MC_TEMP2
|
||||||
|
"MC2CUM", //MC_CAN_BASE2 + MC_CUMULATIVE
|
||||||
|
"MC2SLS", //MC_CAN_BASE2 + MC_SLIPSPEED
|
||||||
|
"DC_BAS", //DC_CAN_BASE
|
||||||
|
"DC_DRV", //DC_CAN_BASE + DC_DRIVE
|
||||||
|
"DC_POW", //DC_CAN_BASE + DC_POWER
|
||||||
|
"DC_RST", //DC_CAN_BASE + DC_RESET
|
||||||
|
"DC_SWC", //DC_CAN_BASE + DC_SWITCH
|
||||||
|
"BP_BAS", //BP_CAN_BASE
|
||||||
|
"BP_VMX", //BP_CAN_BASE + BP_VMAX
|
||||||
|
"BP_VMN", //BP_CAN_BASE + BP_VMIN
|
||||||
|
"BP_TMX", //BP_CAN_BASE + BP_TMAX
|
||||||
|
"BP_PCD", //BP_CAN_BASE + BP_PCDONE
|
||||||
|
"BP_ISH", //BP_CAN_BASE + BP_ISH
|
||||||
|
"AC_BAS", //AC_CAN_BASE
|
||||||
|
"AC_MP1", //AC_CAN_BASE + AC_M1
|
||||||
|
"AC_MP2", //AC_CAN_BASE + AC_M2
|
||||||
|
"AC_MP3", //AC_CAN_BASE + AC_M3
|
||||||
|
"AC_ISH", //AC_CAN_BASE + AC_ISH
|
||||||
|
"AC_TMX", //AC_CAN_BASE + AC_TMAX
|
||||||
|
"AC_TV1", //AC_CAN_BASE + AC_TVAL1
|
||||||
|
"AC_TV2", //AC_CAN_BASE + AC_TVAL2
|
||||||
|
"AC_BPC", //AC_CAN_BASE + AC_BP_CHARGE
|
||||||
|
};
|
||||||
|
|
||||||
|
// removed
|
||||||
|
// "MC1FAN", //MC_CAN_BASE1 + MC_FAN
|
||||||
|
// "MC1TP3", //MC_CAN_BASE1 + MC_TEMP3
|
||||||
|
// "MC2FAN", //MC_CAN_BASE2 + MC_FAN
|
||||||
|
// "MC2TP3", //MC_CAN_BASE2 + MCSUNSEEKERTELEMETRY2021_H_* SUNSEEKERTELEMETRY2021_H_ */
|
||||||
|
|
||||||
|
#endif /* SUNSEEKERTELEMETRY2021_H_ */
|
||||||
100
Telem_Debug/Debug_RS-232/clock_init.c
Normal file
100
Telem_Debug/Debug_RS-232/clock_init.c
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
#include "clock_init.h"
|
||||||
|
|
||||||
|
void clock_init(void)
|
||||||
|
{
|
||||||
|
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer; `WDTPW` is the "WatchDog Timer PassWord", required for all `WDTCTL` operations
|
||||||
|
|
||||||
|
Port_Init(); //ensure clock pins are configured
|
||||||
|
|
||||||
|
SetVCoreUp(1); //Configure MCU core voltage for HF clock
|
||||||
|
SetVCoreUp(2); //
|
||||||
|
SetVCoreUp(3); //
|
||||||
|
|
||||||
|
Clock_XT1_Init(); //LF clock source init
|
||||||
|
Clock_XT2_Init(); //HF clock source init
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Port_Init(void)
|
||||||
|
{
|
||||||
|
//Clock Source TEST PINS ACLK/MCLK/SMCLK
|
||||||
|
P11DIR |= ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Set P11.0:P11.2 as output ACLK/MCLK/SMCLK
|
||||||
|
P11SEL |= ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Set P11.0:P11.2 as ACLK/MCLK/SMCLK function
|
||||||
|
|
||||||
|
//XT1 ALTERNATE PIN CONFIG
|
||||||
|
P7SEL |= XT1IN | XT1OUT; // Set P7.0 & P7.1 as XT1IN/XT1OUT peripheral
|
||||||
|
P7DIR |= XT1IN | XT1OUT;
|
||||||
|
|
||||||
|
//XT2 ALTERNATE PIN CONFIG
|
||||||
|
P5SEL |= XT2IN | XT2OUT; // Set P5.2 & P5.3 as XT2IN/XT2OUT peripheral
|
||||||
|
P5DIR |= XT2IN | XT2OUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Clock_XT1_Init(void)
|
||||||
|
{
|
||||||
|
char i;
|
||||||
|
|
||||||
|
//XT1 CLOCK CONFIG
|
||||||
|
UCSCTL6 &= ~(XT1OFF); // Enable XT1
|
||||||
|
UCSCTL6 &= ~(XT1DRIVE1 | XT1DRIVE0); // Lowest drive current LF 32KHz oscillator
|
||||||
|
|
||||||
|
do{
|
||||||
|
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG); // Clear XT2,XT1,DCO fault flags
|
||||||
|
SFRIFG1 &= ~OFIFG; // Clear fault flags
|
||||||
|
for(i=255;i>0;i--){ // Delay for oscillator to stabilize
|
||||||
|
_NOP(); // "No Operation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while((SFRIFG1 & OFIFG) != 0); // Test oscillator fault flag
|
||||||
|
|
||||||
|
UCSCTL4 |= SELA__XT1CLK; // Clock Source ACLK = XT1 = 32kHz
|
||||||
|
UCSCTL5 |= DIVA_0; // Divide ACLK/1 = 32kHz
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Clock_XT2_Init(void)
|
||||||
|
{
|
||||||
|
char i;
|
||||||
|
|
||||||
|
//XT2 CLOCK CONFIG
|
||||||
|
UCSCTL6 &= ~(XT2OFF); // Enable XT2
|
||||||
|
UCSCTL6 |= XT2DRIVE_3; // Drive current 16-24 MHz Clock
|
||||||
|
UCSCTL6 &= ~XT2BYPASS; // XT2 Sourced Externally from pin - 20MHz
|
||||||
|
|
||||||
|
do{
|
||||||
|
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG); // Clear XT2,XT1,DCO fault flags
|
||||||
|
SFRIFG1 &= ~OFIFG; // Clear fault flags
|
||||||
|
for(i=255;i>0;i--){ // Delay for oscillator to stabilize
|
||||||
|
_NOP(); // "No Operation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while((SFRIFG1 & OFIFG) != 0); // Test oscillator fault flag
|
||||||
|
|
||||||
|
UCSCTL4 |= (SELS__XT2CLK | SELM__XT2CLK); // Clock Source SMCLK=MCLK = XT2 = 20MHz
|
||||||
|
UCSCTL5 |= DIVM_0 | DIVS_1; // MCLK:XT2/1 = 20MHz SMCLK:XT2/2 = 10MHz
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************
|
||||||
|
/ Name: SetVCoreUp
|
||||||
|
/ IN: int Level
|
||||||
|
/ OUT: void
|
||||||
|
/ DESC: This function is used to set the voltage of the VCORE to
|
||||||
|
/ The level specified in input
|
||||||
|
/ Reference: Users Guide page 74
|
||||||
|
************************************************************/
|
||||||
|
void SetVCoreUp (unsigned int level)
|
||||||
|
{
|
||||||
|
PMMCTL0_H = 0xA5; // Open PMM registers for write access
|
||||||
|
SVSMHCTL = SVSHE + SVSHRVL0 * level + SVMHE + SVSMHRRL0 * level; // Set SVS/SVM high side new level
|
||||||
|
SVSMLCTL = SVSLE + SVMLE + SVSMLRRL0 * level; // Set SVM low side to new level
|
||||||
|
while((PMMIFG & SVSMLDLYIFG) == 0); // Wait till SVM is settled
|
||||||
|
PMMIFG &= ~(SVMLVLRIFG + SVMLIFG); // Clear already set flags
|
||||||
|
PMMCTL0_L = PMMCOREV0 * level; // Set VCore to new level
|
||||||
|
if(PMMIFG & SVMLIFG){
|
||||||
|
while((PMMIFG & SVMLVLRIFG) == 0); // Wait till new level reached
|
||||||
|
}
|
||||||
|
SVSMLCTL = SVSLE + SVSLRVL0 * level + SVMLE + SVSMLRRL0 * level; // Set SVS/SVM low side to new level
|
||||||
|
while((PMMIFG & SVSMLDLYIFG) == 0); // Wait till SVM is settled
|
||||||
|
PMMCTL0_H = 0x00; // Lock PMM registers for write access
|
||||||
|
}
|
||||||
27
Telem_Debug/Debug_RS-232/clock_init.h
Normal file
27
Telem_Debug/Debug_RS-232/clock_init.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Clock Initialization Code MSP430F5438A
|
||||||
|
* Initialize Clock Source XT1 @ 32768 Hz
|
||||||
|
* Initialize Clock Source XT2 @ 20MHz
|
||||||
|
*
|
||||||
|
* Sunseeker Telemetry 2021
|
||||||
|
*
|
||||||
|
* Last modified October 2015 by Scott Haver
|
||||||
|
* Last modified May 2021 by B. Bazuin
|
||||||
|
*
|
||||||
|
* Main CLK : MCLK = XT2 = 20 MHz
|
||||||
|
* Sub-Main CLK : SMCLK = XT2/2 = 10 MHz
|
||||||
|
* Aux CLK : ACLK = XT1 = 32.768 kHz
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CLOCK_INIT_H_
|
||||||
|
#define CLOCK_INIT_H_
|
||||||
|
|
||||||
|
#include "SunseekerTelemetry2021.h"
|
||||||
|
|
||||||
|
void Port_Init(void);
|
||||||
|
void Clock_XT1_Init(void);
|
||||||
|
void Clock_XT2_Init(void);
|
||||||
|
void SetVCoreUp(unsigned int level);
|
||||||
|
|
||||||
|
#endif /* CLOCK_INIT_H_ */
|
||||||
41
Telem_Debug/Debug_RS-232/interrupts.c
Normal file
41
Telem_Debug/Debug_RS-232/interrupts.c
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#include "interrupts.h"
|
||||||
|
|
||||||
|
extern volatile unsigned char status_flag;
|
||||||
|
extern char* pUSBReceiveString;
|
||||||
|
extern char* pRS232ReceiveString;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Timer B CCR0 Interrupt Service Routine
|
||||||
|
* - Interrupts on Timer B CCR0 match at 10Hz
|
||||||
|
* - Sets Time_Flag variable
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GNU interrupt semantics
|
||||||
|
* interrupt(TIMERB0_VECTOR) timer_b0(void)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma vector = TIMER0_B0_VECTOR
|
||||||
|
__interrupt void TIMER0_B0_ISR(void){
|
||||||
|
static unsigned int status_count = TELEM_STATUS_COUNT;
|
||||||
|
|
||||||
|
// Primary System Heart beat
|
||||||
|
status_count--;
|
||||||
|
if(status_count == 0){
|
||||||
|
status_count = TELEM_STATUS_COUNT;
|
||||||
|
status_flag = TRUE;
|
||||||
|
P8OUT |= LEDG; // Turn on the green LED
|
||||||
|
}else{
|
||||||
|
P8OUT &= ~LEDG; // Turn off the green LED
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma vector = USCI_A2_VECTOR
|
||||||
|
__interrupt void USCI_A2_ISR(void){
|
||||||
|
usci_A2_receiveString(pUSBReceiveString);
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma vector = USCI_A3_VECTOR
|
||||||
|
__interrupt void USCI_A3_ISR(void){
|
||||||
|
usci_A3_receiveString(pRS232ReceiveString);
|
||||||
|
}
|
||||||
7
Telem_Debug/Debug_RS-232/interrupts.h
Normal file
7
Telem_Debug/Debug_RS-232/interrupts.h
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#ifndef INTERRUPTS_H_
|
||||||
|
#define INTERRUPTS_H_
|
||||||
|
|
||||||
|
#include "SunseekerTelemetry2021.h"
|
||||||
|
#include "usci.h"
|
||||||
|
|
||||||
|
#endif /* INTERRUPTS_H_ */
|
||||||
91
Telem_Debug/Debug_RS-232/io_init.c
Normal file
91
Telem_Debug/Debug_RS-232/io_init.c
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
#include "io_init.h"
|
||||||
|
|
||||||
|
void io_init(void)
|
||||||
|
{
|
||||||
|
/****************************** PORT 1 **************************************/
|
||||||
|
P1OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P1DIR = P1_UNUSED; // Set all unused pins to output
|
||||||
|
P1DIR &= ~(RTC_MFP | IMU_INTn); // Set specific pins to input
|
||||||
|
/*Interrupts Enable*/
|
||||||
|
// P1SEL = RTC_MFP | IMU_INTn; // Peripheral module function selected for specific pins
|
||||||
|
// P1IE = RTC_MFP | IMU_INTn; // Enable Interrupts
|
||||||
|
P1IES = IMU_INTn; // High to low
|
||||||
|
P1IFG = 0x00; // Clear all interrupt flags on Port 1
|
||||||
|
delay();
|
||||||
|
|
||||||
|
/****************************** PORT 2 **************************************/
|
||||||
|
P2OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P2DIR = P2_UNUSED; // Set all unused pins to output
|
||||||
|
/*Interrupts Enable */
|
||||||
|
// P2SEL = CAN0_INTn | CAN1_INTn | GPS_INTn; // Peripheral module function selected for specific pins
|
||||||
|
// P2IES = CAN0_INTn | CAN1_INTn | GPS_INTn;
|
||||||
|
// P2IE = CAN0_INTn | CAN1_INTn | GPS_INTn; // Enable Interrupts
|
||||||
|
// P2SEL |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // Peripheral module function selected for specific pins
|
||||||
|
// P2IES |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n;
|
||||||
|
// P2IE |= CAN0_RXB0n | CAN0_RXB1n | CAN1_RXB0n | CAN1_RXB1n; // Enable Interrupts
|
||||||
|
P2IFG = 0x00; // Clear all interrupt flags on Port 2
|
||||||
|
delay();
|
||||||
|
|
||||||
|
/****************************** PORT 3 **************************************/
|
||||||
|
P3OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P3DIR = CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_MOSI | CAN1_SCLK | P3_UNUSED; // Set to output
|
||||||
|
P3OUT |= CAN0_SCLK | CAN0_MOSI | SDC_SCLK | SDC_MOSI | CAN1_SCLK; // Pull used output pins high
|
||||||
|
P3DIR &= ~(CAN0_MISO | SDC_MISO); // Set specific pins to input
|
||||||
|
P3SEL = CAN0_SCLK | CAN0_MOSI | CAN0_MISO | SDC_SCLK | SDC_MOSI | SDC_MISO | CAN1_SCLK | IMU_SDA;
|
||||||
|
|
||||||
|
/****************************** PORT 4 **************************************/
|
||||||
|
P4OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P4DIR = CAN0_RSTn | CAN0_CSn | CAN1_RSTn | CAN1_CSn | P4_UNUSED; // Set specific pins to output
|
||||||
|
P4OUT = CAN0_RSTn | CAN0_CSn | CAN1_RSTn | CAN1_CSn; // Pull used output pins high
|
||||||
|
delay();
|
||||||
|
P4OUT &= ~(CAN0_RSTn | CAN1_RSTn); // Set specific pins of output register to low
|
||||||
|
delay();
|
||||||
|
delay();
|
||||||
|
P4OUT |= (CAN0_RSTn | CAN1_RSTn); // Set specific pins of output register to high
|
||||||
|
|
||||||
|
/****************************** PORT 5 **************************************/
|
||||||
|
P5OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P5DIR = XT2OUT | CAN1_MOSI | P5_UNUSED; // Set specific pins to output
|
||||||
|
P5OUT = CAN1_MOSI; // Set specific pins of output register to high
|
||||||
|
P5DIR &= ~(CAN1_MISO); // Set specific pins to input
|
||||||
|
P5SEL = XT2IN | XT2OUT | IMU_SCL | CAN1_MOSI | CAN1_MISO; // Peripheral module function selected for specific pins
|
||||||
|
|
||||||
|
/****************************** PORT 6 **************************************/
|
||||||
|
P6OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P6DIR = P6_UNUSED; // Set all unused pins to output
|
||||||
|
P6SEL = 0x00; // I/O function selected for all pins
|
||||||
|
|
||||||
|
/****************************** PORT 7 **************************************/
|
||||||
|
P7OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P7DIR = XT1OUT | P7_UNUSED; // Set specific pins to output
|
||||||
|
P7SEL = XT1IN | XT1OUT; // Peripheral module function selected for specific pins
|
||||||
|
|
||||||
|
/****************************** PORT 8 **************************************/
|
||||||
|
P8OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P8DIR = LEDG | LEDR | LEDY0 | LEDY1 | P8_UNUSED; // Set specific pins to output
|
||||||
|
P8DIR &= ~(Button0); // Set to input
|
||||||
|
P8SEL = 0x00; // I/O function selected for all pins
|
||||||
|
|
||||||
|
/****************************** PORT 9 **************************************/
|
||||||
|
P9OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P9DIR = USB_TX | SDC_CSn | GPS_CSn | P9_UNUSED; // Set specific pins to output
|
||||||
|
P9OUT = SDC_CSn | GPS_CSn; // Set specific pins of output register to high
|
||||||
|
P9SEL = RTC_SDA | RTC_SCL | USB_TX | USB_RX; // Peripheral module function selected for specific pins
|
||||||
|
|
||||||
|
/****************************** PORT 10 **************************************/
|
||||||
|
P10OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P10DIR = BT_CSn | BT_MOSI | BT_SCLK | UART_TX | BT_EN |P10_UNUSED; // Set specific pins to output
|
||||||
|
P10OUT = BT_CSn | BT_MOSI | BT_SCLK; // Set specific pins of output register to high
|
||||||
|
P10SEL = BT_MOSI | BT_MISO | BT_SCLK | UART_TX | UART_RX; // Peripheral module function selected for specific pins
|
||||||
|
|
||||||
|
/****************************** PORT 11 **************************************/
|
||||||
|
P11OUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
P11DIR = ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Set specific pins to output
|
||||||
|
P11OUT = ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Set specific pins of output register to high
|
||||||
|
P11SEL = ACLK_TEST | MCLK_TEST | SMCLK_TEST; // Peripheral module function selected for specific pins
|
||||||
|
|
||||||
|
/****************************** PORT J **************************************/
|
||||||
|
PJOUT = 0x00; // Set output register to all low. Pulling enabled pins low, only affects ports set as output, no effect on inputs
|
||||||
|
PJDIR = 0x0F; // Set to output as per user's guide
|
||||||
|
|
||||||
|
}
|
||||||
18
Telem_Debug/Debug_RS-232/io_init.h
Normal file
18
Telem_Debug/Debug_RS-232/io_init.h
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* I/O Initialization
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initialize I/O port directions and states
|
||||||
|
* Drive unused pins as outputs to avoid floating inputs and wasting power
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef IO_INIT_H_
|
||||||
|
#define IO_INIT_H_
|
||||||
|
|
||||||
|
#include "SunseekerTelemetry2021.h"
|
||||||
|
|
||||||
|
void io_init(void);
|
||||||
|
|
||||||
|
#endif /* IO_INIT_H_ */
|
||||||
250
Telem_Debug/Debug_RS-232/lnk_msp430f5438a.cmd
Normal file
250
Telem_Debug/Debug_RS-232/lnk_msp430f5438a.cmd
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
/* ============================================================================ */
|
||||||
|
/* Copyright (c) 2016, Texas Instruments Incorporated */
|
||||||
|
/* All rights reserved. */
|
||||||
|
/* */
|
||||||
|
/* Redistribution and use in source and binary forms, with or without */
|
||||||
|
/* modification, are permitted provided that the following conditions */
|
||||||
|
/* are met: */
|
||||||
|
/* */
|
||||||
|
/* * Redistributions of source code must retain the above copyright */
|
||||||
|
/* notice, this list of conditions and the following disclaimer. */
|
||||||
|
/* */
|
||||||
|
/* * Redistributions in binary form must reproduce the above copyright */
|
||||||
|
/* notice, this list of conditions and the following disclaimer in the */
|
||||||
|
/* documentation and/or other materials provided with the distribution. */
|
||||||
|
/* */
|
||||||
|
/* * Neither the name of Texas Instruments Incorporated nor the names of */
|
||||||
|
/* its contributors may be used to endorse or promote products derived */
|
||||||
|
/* from this software without specific prior written permission. */
|
||||||
|
/* */
|
||||||
|
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" */
|
||||||
|
/* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, */
|
||||||
|
/* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
|
||||||
|
/* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
|
||||||
|
/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */
|
||||||
|
/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */
|
||||||
|
/* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */
|
||||||
|
/* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */
|
||||||
|
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
|
||||||
|
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
|
||||||
|
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||||
|
/* ============================================================================ */
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* lnk_msp430f5438a.cmd - LINKER COMMAND FILE FOR LINKING MSP430F5438A PROGRAMS */
|
||||||
|
/* */
|
||||||
|
/* Usage: lnk430 <obj files...> -o <out file> -m <map file> lnk.cmd */
|
||||||
|
/* cl430 <src files...> -z -o <out file> -m <map file> lnk.cmd */
|
||||||
|
/* */
|
||||||
|
/*----------------------------------------------------------------------------*/
|
||||||
|
/* These linker options are for command line linking only. For IDE linking, */
|
||||||
|
/* you should set your linker options in Project Properties */
|
||||||
|
/* -c LINK USING C CONVENTIONS */
|
||||||
|
/* -stack 0x0100 SOFTWARE STACK SIZE */
|
||||||
|
/* -heap 0x0100 HEAP AREA SIZE */
|
||||||
|
/* */
|
||||||
|
/*----------------------------------------------------------------------------*/
|
||||||
|
/* Version: 1.192 */
|
||||||
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
/* Specify the system memory map */
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
SFR : origin = 0x0000, length = 0x0010
|
||||||
|
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0
|
||||||
|
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100
|
||||||
|
RAM : origin = 0x1C00, length = 0x4000
|
||||||
|
INFOA : origin = 0x1980, length = 0x0080
|
||||||
|
INFOB : origin = 0x1900, length = 0x0080
|
||||||
|
INFOC : origin = 0x1880, length = 0x0080
|
||||||
|
INFOD : origin = 0x1800, length = 0x0080
|
||||||
|
FLASH : origin = 0x5C00, length = 0xA380
|
||||||
|
FLASH2 : origin = 0x10000,length = 0x35C00
|
||||||
|
INT00 : origin = 0xFF80, length = 0x0002
|
||||||
|
INT01 : origin = 0xFF82, length = 0x0002
|
||||||
|
INT02 : origin = 0xFF84, length = 0x0002
|
||||||
|
INT03 : origin = 0xFF86, length = 0x0002
|
||||||
|
INT04 : origin = 0xFF88, length = 0x0002
|
||||||
|
INT05 : origin = 0xFF8A, length = 0x0002
|
||||||
|
INT06 : origin = 0xFF8C, length = 0x0002
|
||||||
|
INT07 : origin = 0xFF8E, length = 0x0002
|
||||||
|
INT08 : origin = 0xFF90, length = 0x0002
|
||||||
|
INT09 : origin = 0xFF92, length = 0x0002
|
||||||
|
INT10 : origin = 0xFF94, length = 0x0002
|
||||||
|
INT11 : origin = 0xFF96, length = 0x0002
|
||||||
|
INT12 : origin = 0xFF98, length = 0x0002
|
||||||
|
INT13 : origin = 0xFF9A, length = 0x0002
|
||||||
|
INT14 : origin = 0xFF9C, length = 0x0002
|
||||||
|
INT15 : origin = 0xFF9E, length = 0x0002
|
||||||
|
INT16 : origin = 0xFFA0, length = 0x0002
|
||||||
|
INT17 : origin = 0xFFA2, length = 0x0002
|
||||||
|
INT18 : origin = 0xFFA4, length = 0x0002
|
||||||
|
INT19 : origin = 0xFFA6, length = 0x0002
|
||||||
|
INT20 : origin = 0xFFA8, length = 0x0002
|
||||||
|
INT21 : origin = 0xFFAA, length = 0x0002
|
||||||
|
INT22 : origin = 0xFFAC, length = 0x0002
|
||||||
|
INT23 : origin = 0xFFAE, length = 0x0002
|
||||||
|
INT24 : origin = 0xFFB0, length = 0x0002
|
||||||
|
INT25 : origin = 0xFFB2, length = 0x0002
|
||||||
|
INT26 : origin = 0xFFB4, length = 0x0002
|
||||||
|
INT27 : origin = 0xFFB6, length = 0x0002
|
||||||
|
INT28 : origin = 0xFFB8, length = 0x0002
|
||||||
|
INT29 : origin = 0xFFBA, length = 0x0002
|
||||||
|
INT30 : origin = 0xFFBC, length = 0x0002
|
||||||
|
INT31 : origin = 0xFFBE, length = 0x0002
|
||||||
|
INT32 : origin = 0xFFC0, length = 0x0002
|
||||||
|
INT33 : origin = 0xFFC2, length = 0x0002
|
||||||
|
INT34 : origin = 0xFFC4, length = 0x0002
|
||||||
|
INT35 : origin = 0xFFC6, length = 0x0002
|
||||||
|
INT36 : origin = 0xFFC8, length = 0x0002
|
||||||
|
INT37 : origin = 0xFFCA, length = 0x0002
|
||||||
|
INT38 : origin = 0xFFCC, length = 0x0002
|
||||||
|
INT39 : origin = 0xFFCE, length = 0x0002
|
||||||
|
INT40 : origin = 0xFFD0, length = 0x0002
|
||||||
|
INT41 : origin = 0xFFD2, length = 0x0002
|
||||||
|
INT42 : origin = 0xFFD4, length = 0x0002
|
||||||
|
INT43 : origin = 0xFFD6, length = 0x0002
|
||||||
|
INT44 : origin = 0xFFD8, length = 0x0002
|
||||||
|
INT45 : origin = 0xFFDA, length = 0x0002
|
||||||
|
INT46 : origin = 0xFFDC, length = 0x0002
|
||||||
|
INT47 : origin = 0xFFDE, length = 0x0002
|
||||||
|
INT48 : origin = 0xFFE0, length = 0x0002
|
||||||
|
INT49 : origin = 0xFFE2, length = 0x0002
|
||||||
|
INT50 : origin = 0xFFE4, length = 0x0002
|
||||||
|
INT51 : origin = 0xFFE6, length = 0x0002
|
||||||
|
INT52 : origin = 0xFFE8, length = 0x0002
|
||||||
|
INT53 : origin = 0xFFEA, length = 0x0002
|
||||||
|
INT54 : origin = 0xFFEC, length = 0x0002
|
||||||
|
INT55 : origin = 0xFFEE, length = 0x0002
|
||||||
|
INT56 : origin = 0xFFF0, length = 0x0002
|
||||||
|
INT57 : origin = 0xFFF2, length = 0x0002
|
||||||
|
INT58 : origin = 0xFFF4, length = 0x0002
|
||||||
|
INT59 : origin = 0xFFF6, length = 0x0002
|
||||||
|
INT60 : origin = 0xFFF8, length = 0x0002
|
||||||
|
INT61 : origin = 0xFFFA, length = 0x0002
|
||||||
|
INT62 : origin = 0xFFFC, length = 0x0002
|
||||||
|
RESET : origin = 0xFFFE, length = 0x0002
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
/* Specify the sections allocation into memory */
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.bss : {} > RAM /* Global & static vars */
|
||||||
|
.data : {} > RAM /* Global & static vars */
|
||||||
|
.TI.noinit : {} > RAM /* For #pragma noinit */
|
||||||
|
.sysmem : {} > RAM /* Dynamic memory allocation area */
|
||||||
|
.stack : {} > RAM (HIGH) /* Software system stack */
|
||||||
|
|
||||||
|
#ifndef __LARGE_DATA_MODEL__
|
||||||
|
.text : {} > FLASH /* Code */
|
||||||
|
#else
|
||||||
|
.text : {} >> FLASH2 | FLASH /* Code */
|
||||||
|
#endif
|
||||||
|
.text:_isr : {} > FLASH /* ISR Code space */
|
||||||
|
.cinit : {} > FLASH /* Initialization tables */
|
||||||
|
#ifndef __LARGE_DATA_MODEL__
|
||||||
|
.const : {} > FLASH /* Constant data */
|
||||||
|
#else
|
||||||
|
.const : {} >> FLASH | FLASH2 /* Constant data */
|
||||||
|
#endif
|
||||||
|
.cio : {} > RAM /* C I/O Buffer */
|
||||||
|
|
||||||
|
.pinit : {} > FLASH /* C++ Constructor tables */
|
||||||
|
.binit : {} > FLASH /* Boot-time Initialization tables */
|
||||||
|
.init_array : {} > FLASH /* C++ Constructor tables */
|
||||||
|
.mspabi.exidx : {} > FLASH /* C++ Constructor tables */
|
||||||
|
.mspabi.extab : {} > FLASH /* C++ Constructor tables */
|
||||||
|
#ifdef __TI_COMPILER_VERSION__
|
||||||
|
#if __TI_COMPILER_VERSION__ >= 15009000
|
||||||
|
#ifndef __LARGE_DATA_MODEL__
|
||||||
|
.TI.ramfunc : {} load=FLASH, run=RAM, table(BINIT)
|
||||||
|
#else
|
||||||
|
.TI.ramfunc : {} load=FLASH | FLASH2, run=RAM, table(BINIT)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
.infoA : {} > INFOA /* MSP430 INFO FLASH Memory segments */
|
||||||
|
.infoB : {} > INFOB
|
||||||
|
.infoC : {} > INFOC
|
||||||
|
.infoD : {} > INFOD
|
||||||
|
|
||||||
|
/* MSP430 Interrupt vectors */
|
||||||
|
.int00 : {} > INT00
|
||||||
|
.int01 : {} > INT01
|
||||||
|
.int02 : {} > INT02
|
||||||
|
.int03 : {} > INT03
|
||||||
|
.int04 : {} > INT04
|
||||||
|
.int05 : {} > INT05
|
||||||
|
.int06 : {} > INT06
|
||||||
|
.int07 : {} > INT07
|
||||||
|
.int08 : {} > INT08
|
||||||
|
.int09 : {} > INT09
|
||||||
|
.int10 : {} > INT10
|
||||||
|
.int11 : {} > INT11
|
||||||
|
.int12 : {} > INT12
|
||||||
|
.int13 : {} > INT13
|
||||||
|
.int14 : {} > INT14
|
||||||
|
.int15 : {} > INT15
|
||||||
|
.int16 : {} > INT16
|
||||||
|
.int17 : {} > INT17
|
||||||
|
.int18 : {} > INT18
|
||||||
|
.int19 : {} > INT19
|
||||||
|
.int20 : {} > INT20
|
||||||
|
.int21 : {} > INT21
|
||||||
|
.int22 : {} > INT22
|
||||||
|
.int23 : {} > INT23
|
||||||
|
.int24 : {} > INT24
|
||||||
|
.int25 : {} > INT25
|
||||||
|
.int26 : {} > INT26
|
||||||
|
.int27 : {} > INT27
|
||||||
|
.int28 : {} > INT28
|
||||||
|
.int29 : {} > INT29
|
||||||
|
.int30 : {} > INT30
|
||||||
|
.int31 : {} > INT31
|
||||||
|
.int32 : {} > INT32
|
||||||
|
.int33 : {} > INT33
|
||||||
|
.int34 : {} > INT34
|
||||||
|
.int35 : {} > INT35
|
||||||
|
.int36 : {} > INT36
|
||||||
|
.int37 : {} > INT37
|
||||||
|
.int38 : {} > INT38
|
||||||
|
.int39 : {} > INT39
|
||||||
|
.int40 : {} > INT40
|
||||||
|
RTC : { * ( .int41 ) } > INT41 type = VECT_INIT
|
||||||
|
PORT2 : { * ( .int42 ) } > INT42 type = VECT_INIT
|
||||||
|
USCI_B3 : { * ( .int43 ) } > INT43 type = VECT_INIT
|
||||||
|
USCI_A3 : { * ( .int44 ) } > INT44 type = VECT_INIT
|
||||||
|
USCI_B1 : { * ( .int45 ) } > INT45 type = VECT_INIT
|
||||||
|
USCI_A1 : { * ( .int46 ) } > INT46 type = VECT_INIT
|
||||||
|
PORT1 : { * ( .int47 ) } > INT47 type = VECT_INIT
|
||||||
|
TIMER1_A1 : { * ( .int48 ) } > INT48 type = VECT_INIT
|
||||||
|
TIMER1_A0 : { * ( .int49 ) } > INT49 type = VECT_INIT
|
||||||
|
DMA : { * ( .int50 ) } > INT50 type = VECT_INIT
|
||||||
|
USCI_B2 : { * ( .int51 ) } > INT51 type = VECT_INIT
|
||||||
|
USCI_A2 : { * ( .int52 ) } > INT52 type = VECT_INIT
|
||||||
|
TIMER0_A1 : { * ( .int53 ) } > INT53 type = VECT_INIT
|
||||||
|
TIMER0_A0 : { * ( .int54 ) } > INT54 type = VECT_INIT
|
||||||
|
ADC12 : { * ( .int55 ) } > INT55 type = VECT_INIT
|
||||||
|
USCI_B0 : { * ( .int56 ) } > INT56 type = VECT_INIT
|
||||||
|
USCI_A0 : { * ( .int57 ) } > INT57 type = VECT_INIT
|
||||||
|
WDT : { * ( .int58 ) } > INT58 type = VECT_INIT
|
||||||
|
TIMER0_B1 : { * ( .int59 ) } > INT59 type = VECT_INIT
|
||||||
|
TIMER0_B0 : { * ( .int60 ) } > INT60 type = VECT_INIT
|
||||||
|
UNMI : { * ( .int61 ) } > INT61 type = VECT_INIT
|
||||||
|
SYSNMI : { * ( .int62 ) } > INT62 type = VECT_INIT
|
||||||
|
.reset : {} > RESET /* MSP430 Reset vector */
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************/
|
||||||
|
/* Include peripherals memory map */
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
-l msp430f5438a.cmd
|
||||||
|
|
||||||
64
Telem_Debug/Debug_RS-232/main.c
Normal file
64
Telem_Debug/Debug_RS-232/main.c
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#include "SunseekerTelemetry2021.h"
|
||||||
|
#include "clock_init.h"
|
||||||
|
#include "interrupts.h"
|
||||||
|
#include "io_init.h"
|
||||||
|
#include "timers.h"
|
||||||
|
#include "usci.h"
|
||||||
|
|
||||||
|
long delayCounter = 0;
|
||||||
|
volatile unsigned char status_flag = FALSE;
|
||||||
|
char USBTransmitString[256];
|
||||||
|
char RS232TransmitString[] = "[DEBUG] Test Transmission String";
|
||||||
|
char RS232RelayString[256];
|
||||||
|
char* pUSBReceiveString;
|
||||||
|
char* pRS232ReceiveString;
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer; `WDTPW` is the "WatchDog Timer PassWord", required for all `WDTCTL` operations
|
||||||
|
_DINT(); // Disable interrupts
|
||||||
|
|
||||||
|
clock_init(); // Configure HF and LF clocks
|
||||||
|
delay();
|
||||||
|
|
||||||
|
timerB_init(); // Initialize timer B
|
||||||
|
delay();
|
||||||
|
|
||||||
|
io_init(); // Initialize all input/output pins
|
||||||
|
delay();
|
||||||
|
|
||||||
|
usci_init(); // Initialize USCI modules
|
||||||
|
delay();
|
||||||
|
|
||||||
|
_EINT(); // Enable global interrupts
|
||||||
|
|
||||||
|
P8OUT |= LEDY0; // Initially set LEDY0 to High
|
||||||
|
|
||||||
|
sprintf(USBTransmitString, "Transmitted over RS-232: \"%s\"", RS232TransmitString);
|
||||||
|
pUSBReceiveString = calloc(1, 256 * sizeof(*pUSBReceiveString) + 1);
|
||||||
|
pRS232ReceiveString = calloc(1, 256 * sizeof(*pUSBReceiveString) + 1);
|
||||||
|
|
||||||
|
usci_A2_enable(); // Enable the USB interface
|
||||||
|
usci_A2_enableInterrupt(); // Enable interrupts for the USB interface
|
||||||
|
usci_A3_enable(); // Enable the RS-232 interface
|
||||||
|
usci_A3_enableInterrupt(); // Enable interrupts for the RS-232 interface
|
||||||
|
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
// Repeating debug transmission string
|
||||||
|
if(delayCounter == 0){
|
||||||
|
usci_A3_transmitString(&RS232TransmitString[0]);
|
||||||
|
usci_A2_transmitString(&USBTransmitString[0]);
|
||||||
|
}else{
|
||||||
|
++delayCounter;
|
||||||
|
delayCounter %= 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
// String received, to be transmitted back
|
||||||
|
if(pRS232ReceiveString[0] != '\0'){
|
||||||
|
sprintf(RS232RelayString, "Received and Re-Transmitted over RS-232: \"%s\"", pRS232ReceiveString);
|
||||||
|
usci_A2_transmitString(&RS232RelayString[0]);
|
||||||
|
usci_A3_transmitString(pRS232ReceiveString);
|
||||||
|
pRS232ReceiveString[0] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Telem_Debug/Debug_RS-232/targetConfigs/MSP430F5438A.ccxml
Normal file
12
Telem_Debug/Debug_RS-232/targetConfigs/MSP430F5438A.ccxml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<configurations XML_version="1.2" id="configurations_0">
|
||||||
|
<configuration XML_version="1.2" id="configuration_0">
|
||||||
|
<instance XML_version="1.2" desc="TI MSP430 USB1" href="connections/TIMSP430-USB.xml" id="TI MSP430 USB1" xml="TIMSP430-USB.xml" xmlpath="connections"/>
|
||||||
|
<connection XML_version="1.2" id="TI MSP430 USB1">
|
||||||
|
<instance XML_version="1.2" href="drivers/msp430_emu.xml" id="drivers" xml="msp430_emu.xml" xmlpath="drivers"/>
|
||||||
|
<platform XML_version="1.2" id="platform_0">
|
||||||
|
<instance XML_version="1.2" desc="MSP430F5438A" href="devices/MSP430F5438A.xml" id="MSP430F5438A" xml="MSP430F5438A.xml" xmlpath="devices"/>
|
||||||
|
</platform>
|
||||||
|
</connection>
|
||||||
|
</configuration>
|
||||||
|
</configurations>
|
||||||
9
Telem_Debug/Debug_RS-232/targetConfigs/readme.txt
Normal file
9
Telem_Debug/Debug_RS-232/targetConfigs/readme.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
|
||||||
|
on the device and connection settings specified in your project on the Properties > General page.
|
||||||
|
|
||||||
|
Please note that in automatic target-configuration management, changes to the project's device and/or
|
||||||
|
connection settings will either modify an existing or generate a new target-configuration file. Thus,
|
||||||
|
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
|
||||||
|
you may create your own target-configuration file for this project and manage it manually. You can
|
||||||
|
always switch back to automatic target-configuration management by checking the "Manage the project's
|
||||||
|
target-configuration automatically" checkbox on the project's Properties > General page.
|
||||||
9
Telem_Debug/Debug_RS-232/timers.c
Normal file
9
Telem_Debug/Debug_RS-232/timers.c
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include "timers.h"
|
||||||
|
|
||||||
|
void timerB_init(void)
|
||||||
|
{
|
||||||
|
TBCTL = CNTL_0 | TBSSEL_1 | ID_3 | TBCLR; // ACLK/8, clear TBR
|
||||||
|
TBCCR0 = (ACLK_RATE/8/TICK_RATE); // Set timer to count to this value = TICK_RATE overflow
|
||||||
|
TBCCTL0 = CCIE; // Enable CCR0 interrupt
|
||||||
|
TBCTL |= MC_1; // Set timer to 'up' count mode
|
||||||
|
}
|
||||||
12
Telem_Debug/Debug_RS-232/timers.h
Normal file
12
Telem_Debug/Debug_RS-232/timers.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef TIMERS_H_
|
||||||
|
#define TIMERS_H_
|
||||||
|
|
||||||
|
#include "SunseekerTelemetry2021.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initialize Timer B
|
||||||
|
* - Provides timer tick timebase at 100 Hz
|
||||||
|
*/
|
||||||
|
void timerB_init(void);
|
||||||
|
|
||||||
|
#endif /* TIMERS_H_ */
|
||||||
243
Telem_Debug/Debug_RS-232/usci.c
Normal file
243
Telem_Debug/Debug_RS-232/usci.c
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
#include "usci.h"
|
||||||
|
|
||||||
|
void usci_init(void){
|
||||||
|
usci_A0_init();
|
||||||
|
usci_A1_init();
|
||||||
|
usci_A2_init();
|
||||||
|
usci_A3_init();
|
||||||
|
usci_B0_init();
|
||||||
|
usci_B1_init();
|
||||||
|
usci_B2_init();
|
||||||
|
usci_B3_init();
|
||||||
|
}
|
||||||
|
/*************************************************************************/
|
||||||
|
/******************************** USCI A0 ********************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
void usci_A0_init(void){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/******************************** USCI A1 ********************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
void usci_A1_init(void){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/******************************** USCI A2 ********************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
void usci_A2_init(void){
|
||||||
|
UCA2CTL1 |= UCSWRST; // Software Reset Enable - Set high, disabling the USCI module; Changes to USCI configuration registers can only be made when the UCSWRST bit = 1
|
||||||
|
UCA2CTL1 &= ~0b11000000; // Reset both UCSSELx bits so the USCI Clock Source Select bits are more predictable
|
||||||
|
UCA2CTL1 |= UCSSEL__SMCLK; // USCI Clock Source Select - SMCLK
|
||||||
|
UCA2CTL1 &= ~UCRXEIE; // Receive Erroneous-Character Interrupt Enable - Disabled
|
||||||
|
UCA2CTL1 &= ~UCBRKIE; // Receive Break Character Interrupt Enable - Disabled
|
||||||
|
UCA2CTL1 &= ~UCDORM; // Dormant - Disabled; USCI module will not be put into sleep mode
|
||||||
|
UCA2CTL1 &= ~UCTXADDR; // Transmit Address - Next frame transmitted is data
|
||||||
|
UCA2CTL1 &= ~UCTXBRK; // Transmit Break - Do not transmit a Break/Synch as the next frame
|
||||||
|
UCA2CTL0 &= ~UCPEN; // Parity Enable - Disabled
|
||||||
|
UCA2CTL0 &= ~UCMSB; // MSB First Select - Set low; Least Significant Bit will be sent first
|
||||||
|
UCA2CTL0 &= ~UC7BIT; // Character Length - 8-bit data selected
|
||||||
|
UCA2CTL0 &= ~UCSPB; // Stop Bit Select - One stop bit selected
|
||||||
|
UCA2CTL0 &= ~UCMODE1; // USCI Mode [2 Bits Required] - UART mode selected
|
||||||
|
UCA2CTL0 &= ~UCMODE0; // USCI Mode [2 Bits Required] - UART mode selected
|
||||||
|
UCA2CTL0 &= ~UCSYNC; // Synchronous Mode Enable - Asynchronous mode selected
|
||||||
|
UCA2BRW = 10; // Clock Prescalar
|
||||||
|
UCA2MCTL &= ~0b11111111; // Reset entire register
|
||||||
|
UCA2MCTL |= 0x0 << 4; // First Modulation Stage Select
|
||||||
|
UCA2MCTL |= 0x0 << 1; // Second Modulation Stage Select
|
||||||
|
UCA2MCTL |= 0x0; // Oversampling Mode Enable - Disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A2_enable(void){
|
||||||
|
UCA2CTL1 &= ~UCSWRST; // Software Reset Enable - Set low, enabling the USCI module
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A2_disable(void){
|
||||||
|
UCA2CTL1 |= UCSWRST; // Software Reset Enable - Set high, disabling the USCI module
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A2_enableInterrupt(void){
|
||||||
|
UCA2IE |= (UCTXIE | UCRXIE); // Enable transmit and receive interrupts
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A2_disableInterrupt(void){
|
||||||
|
UCA2IE &= ~(UCTXIE | UCRXIE); // Disable transmit and receive interrupts
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A2_transmitChar(char charToTransmit){
|
||||||
|
while((UCA2IFG & UCTXIFG) == 0){ // If the USCI module is not yet ready for the next value to transmit, wait indefinitely
|
||||||
|
_NOP(); // Processor will do nothing until loop exits
|
||||||
|
}
|
||||||
|
UCA2TXBUF = charToTransmit; // When USCI module signals that it is ready, the next character value is moved into the transmit buffer
|
||||||
|
}
|
||||||
|
|
||||||
|
char usci_A2_receiveChar(void){
|
||||||
|
short i = 100; // Initialize a countdown
|
||||||
|
|
||||||
|
while (((UCA2IFG & UCRXIFG) == 0) && (i > 0)){ // Wait until either the end of the countdown or when the UCA2IFG register signals that the receive buffer is ready
|
||||||
|
--i;
|
||||||
|
}
|
||||||
|
return(UCA2RXBUF); // Return the receive buffer regardless of whether it is ready or not
|
||||||
|
}
|
||||||
|
|
||||||
|
int usci_A2_transmitString(char* pString){
|
||||||
|
short i = 0; // Initialize a counter of how many characters were transmitted
|
||||||
|
char nextChar = *pString; // Load the first character in the string array from the pointer
|
||||||
|
|
||||||
|
while(nextChar != '\0'){ // Unless the next character in the string array is a null terminator, continue sending more characters
|
||||||
|
usci_A2_transmitChar(nextChar); // Transmit the next character, as it is not a null terminator
|
||||||
|
++i; // Increment the counter
|
||||||
|
++pString; // Move the pointer to the next memory location, which is storing the next character in the string array
|
||||||
|
nextChar = *pString; // Load the next character from memory
|
||||||
|
}
|
||||||
|
|
||||||
|
usci_A2_transmitChar('\n'); // Transmit a "New Line" character
|
||||||
|
usci_A2_transmitChar('\r'); // Transmit a "Carriage Return" character
|
||||||
|
|
||||||
|
return(i); // Return the counter of how many characters were transmitted, not including the "New Line" and "Carriage Return" characters
|
||||||
|
}
|
||||||
|
|
||||||
|
int usci_A2_receiveString(char* pString){
|
||||||
|
short i = 0; // Initialize a counter of how many characters were received
|
||||||
|
|
||||||
|
while(1){ // Continue looping until a "Carriage Return" character is received
|
||||||
|
*pString = usci_A2_receiveChar(); // Store the received character in the designated memory location
|
||||||
|
|
||||||
|
if(*pString == '\r'){ // If a "Carriage Return" character is found:
|
||||||
|
*pString = '\0'; // Overwrite it with a null terminator
|
||||||
|
return(i); // End receiving new characters and return the count of characters received
|
||||||
|
}else{ // Else:
|
||||||
|
++pString; // Increment the pointer to the next memory location for the next character
|
||||||
|
++i; // Increment the counter of received characters
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/******************************** USCI A3 ********************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
void usci_A3_init(void){
|
||||||
|
UCA3CTL1 |= UCSWRST; // Software Reset Enable - Set high, disabling the USCI module; Changes to USCI configuration registers can only be made when the UCSWRST bit = 1
|
||||||
|
UCA3CTL1 &= ~0b11000000; // Reset both UCSSELx bits so the USCI Clock Source Select bits are more predictable
|
||||||
|
UCA3CTL1 |= UCSSEL__SMCLK; // USCI Clock Source Select - SMCLK
|
||||||
|
UCA3CTL1 &= ~UCRXEIE; // Receive Erroneous-Character Interrupt Enable - Disabled
|
||||||
|
UCA3CTL1 &= ~UCBRKIE; // Receive Break Character Interrupt Enable - Disabled
|
||||||
|
UCA3CTL1 &= ~UCDORM; // Dormant - Disabled; USCI module will not be put into sleep mode
|
||||||
|
UCA3CTL1 &= ~UCTXADDR; // Transmit Address - Next frame transmitted is data
|
||||||
|
UCA3CTL1 &= ~UCTXBRK; // Transmit Break - Do not transmit a Break/Synch as the next frame
|
||||||
|
UCA3CTL0 &= ~UCPEN; // Parity Enable - Disabled
|
||||||
|
UCA3CTL0 &= ~UCMSB; // MSB First Select - Set low; Least Significant Bit will be sent first
|
||||||
|
UCA3CTL0 &= ~UC7BIT; // Character Length - 8-bit data selected
|
||||||
|
UCA3CTL0 &= ~UCSPB; // Stop Bit Select - One stop bit selected
|
||||||
|
UCA3CTL0 &= ~UCMODE1; // USCI Mode [2 Bits Required] - UART mode selected
|
||||||
|
UCA3CTL0 &= ~UCMODE0; // USCI Mode [2 Bits Required] - UART mode selected
|
||||||
|
UCA3CTL0 &= ~UCSYNC; // Synchronous Mode Enable - Asynchronous mode selected
|
||||||
|
UCA3BRW = 65; // Clock Prescalar
|
||||||
|
UCA3MCTL &= ~0b11111111; // Reset entire register
|
||||||
|
UCA3MCTL |= 0x2 << 4; // First Modulation Stage Select
|
||||||
|
UCA3MCTL |= 0x0 << 1; // Second Modulation Stage Select
|
||||||
|
UCA3MCTL |= 0x1; // Oversampling Mode Enable - Enabled
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A3_enable(void){
|
||||||
|
UCA3CTL1 &= ~UCSWRST; // Software Reset Enable - Set low, enabling the USCI module
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A3_disable(void){
|
||||||
|
UCA3CTL1 |= UCSWRST; // Software Reset Enable - Set high, disabling the USCI module
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A3_enableInterrupt(void){
|
||||||
|
UCA3IE |= (UCTXIE | UCRXIE); // Enable transmit and receive interrupts
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A3_disableInterrupt(void){
|
||||||
|
UCA3IE &= ~(UCTXIE | UCRXIE); // Disable transmit and receive interrupts
|
||||||
|
}
|
||||||
|
|
||||||
|
void usci_A3_transmitChar(char charToTransmit){
|
||||||
|
while((UCA3IFG & UCTXIFG) == 0){ // If the USCI module is not yet ready for the next value to transmit, wait indefinitely
|
||||||
|
_NOP(); // Processor will do nothing until loop exits
|
||||||
|
}
|
||||||
|
UCA3TXBUF = charToTransmit; // When USCI module signals that it is ready, the next character value is moved into the transmit buffer
|
||||||
|
}
|
||||||
|
|
||||||
|
char usci_A3_receiveChar(void){
|
||||||
|
short i = 100; // Initialize a countdown
|
||||||
|
|
||||||
|
while (((UCA3IFG & UCRXIFG) == 0) && (i > 0)){ // Wait until either the end of the countdown or when the UCA3IFG register signals that the receive buffer is ready
|
||||||
|
--i;
|
||||||
|
}
|
||||||
|
return(UCA3RXBUF); // Return the receive buffer regardless of whether it is ready or not
|
||||||
|
}
|
||||||
|
|
||||||
|
int usci_A3_transmitString(char* pString){
|
||||||
|
short i = 0; // Initialize a counter of how many characters were transmitted
|
||||||
|
char nextChar = *pString; // Load the first character in the string array from the pointer
|
||||||
|
|
||||||
|
while(nextChar != '\0'){ // Unless the next character in the string array is a null terminator, continue sending more characters
|
||||||
|
usci_A3_transmitChar(nextChar); // Transmit the next character, as it is not a null terminator
|
||||||
|
++i; // Increment the counter
|
||||||
|
++pString; // Move the pointer to the next memory location, which is storing the next character in the string array
|
||||||
|
nextChar = *pString; // Load the next character from memory
|
||||||
|
}
|
||||||
|
|
||||||
|
usci_A3_transmitChar('\n'); // Transmit a "New Line" character
|
||||||
|
usci_A3_transmitChar('\r'); // Transmit a "Carriage Return" character
|
||||||
|
|
||||||
|
return(i); // Return the counter of how many characters were transmitted, not including the "New Line" and "Carriage Return" characters
|
||||||
|
}
|
||||||
|
|
||||||
|
int usci_A3_receiveString(char* pString){
|
||||||
|
short i = 0; // Initialize a counter of how many characters were received
|
||||||
|
|
||||||
|
while(1){ // Continue looping until a "Carriage Return" character is received
|
||||||
|
*pString = usci_A3_receiveChar(); // Store the received character in the designated memory location
|
||||||
|
|
||||||
|
if(*pString == '\r'){ // If a "Carriage Return" character is found:
|
||||||
|
*pString = '\0'; // Overwrite it with a null terminator
|
||||||
|
return(i); // End receiving new characters and return the count of characters received
|
||||||
|
}else{ // Else:
|
||||||
|
++pString; // Increment the pointer to the next memory location for the next character
|
||||||
|
++i; // Increment the counter of received characters
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/******************************** USCI B0 ********************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
void usci_B0_init(void){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/******************************** USCI B1 ********************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
void usci_B1_init(void){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/******************************** USCI B2 ********************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
void usci_B2_init(void){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/******************************** USCI B3 ********************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
void usci_B3_init(void){
|
||||||
|
|
||||||
|
}
|
||||||
91
Telem_Debug/Debug_RS-232/usci.h
Normal file
91
Telem_Debug/Debug_RS-232/usci.h
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
* USCI Functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef USCI_H_
|
||||||
|
#define USCI_H_
|
||||||
|
|
||||||
|
#include <msp430.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initializes all USCI modules using their own respective `usci_xx_init()` functions
|
||||||
|
*/
|
||||||
|
void usci_init(void);
|
||||||
|
|
||||||
|
void usci_A0_init(void);
|
||||||
|
|
||||||
|
void usci_A1_init(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* USCI A2 Initialization [UART Mode]
|
||||||
|
*
|
||||||
|
* The FTDI FT230XS-R that was selected can handle up to 3 Mbaud, so we'll target 1 Mbaud
|
||||||
|
* The SMCLK is currently at 10 MHz
|
||||||
|
*
|
||||||
|
* Using the "MSP430 USCI/EUSCI UART Baud Rate Calculation" tool at:
|
||||||
|
* http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html
|
||||||
|
* The following values were found:
|
||||||
|
* clock Prescalar: 10
|
||||||
|
* firstModReg: 0
|
||||||
|
* secondModReg: 0
|
||||||
|
* overSampling: 0
|
||||||
|
*/
|
||||||
|
void usci_A2_init(void);
|
||||||
|
|
||||||
|
void usci_A2_enable(void);
|
||||||
|
|
||||||
|
void usci_A2_disable(void);
|
||||||
|
|
||||||
|
void usci_A2_enableInterrupt(void);
|
||||||
|
|
||||||
|
void usci_A2_disableInterrupt(void);
|
||||||
|
|
||||||
|
void usci_A2_transmitChar(char charToTransmit);
|
||||||
|
|
||||||
|
char usci_A2_receiveChar(void);
|
||||||
|
|
||||||
|
int usci_A2_transmitString(char* pString);
|
||||||
|
|
||||||
|
int usci_A2_receiveString(char* pString);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* USCI A3 Initialization [UART Mode]
|
||||||
|
*
|
||||||
|
* We will use a default baud rate of 9600 bps
|
||||||
|
* The SMCLK is currently at 10 MHz
|
||||||
|
*
|
||||||
|
* Using the "MSP430 USCI/EUSCI UART Baud Rate Calculation" tool at:
|
||||||
|
* http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html
|
||||||
|
* The following values were found:
|
||||||
|
* clock Prescalar: 65
|
||||||
|
* firstModReg: 2
|
||||||
|
* secondModReg: 0
|
||||||
|
* overSampling: 1
|
||||||
|
*/
|
||||||
|
void usci_A3_init(void);
|
||||||
|
|
||||||
|
void usci_A3_enable(void);
|
||||||
|
|
||||||
|
void usci_A3_disable(void);
|
||||||
|
|
||||||
|
void usci_A3_enableInterrupt(void);
|
||||||
|
|
||||||
|
void usci_A3_disableInterrupt(void);
|
||||||
|
|
||||||
|
void usci_A3_transmitChar(char charToTransmit);
|
||||||
|
|
||||||
|
char usci_A3_receiveChar(void);
|
||||||
|
|
||||||
|
int usci_A3_transmitString(char* pString);
|
||||||
|
|
||||||
|
int usci_A3_receiveString(char* pString);
|
||||||
|
|
||||||
|
void usci_B0_init(void);
|
||||||
|
|
||||||
|
void usci_B1_init(void);
|
||||||
|
|
||||||
|
void usci_B2_init(void);
|
||||||
|
|
||||||
|
void usci_B3_init(void);
|
||||||
|
|
||||||
|
#endif /* USCI_H_ */
|
||||||
Reference in New Issue
Block a user