first push
This commit is contained in:
commit
84c0376a1a
16
.ccsproject
Normal file
16
.ccsproject
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?ccsproject version="1.0"?>
|
||||
<projectOptions>
|
||||
<ccsVersion value="10.0.0"/>
|
||||
<deviceVariant value="MSP430G2553"/>
|
||||
<deviceFamily value="MSP430"/>
|
||||
<deviceEndianness value="little"/>
|
||||
<codegenToolVersion value="20.2.0.LTS"/>
|
||||
<isElfFormat value="true"/>
|
||||
<connection value="common/targetdb/connections/TIMSP430-USB.xml"/>
|
||||
<linkerCommandFile value="lnk_msp430g2553.cmd"/>
|
||||
<rts value="libc.a"/>
|
||||
<createSlaveProjects value=""/>
|
||||
<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate_msp430"/>
|
||||
<filesToOpen value="main.c"/>
|
||||
</projectOptions>
|
||||
177
.cproject
Normal file
177
.cproject
Normal file
@ -0,0 +1,177 @@
|
||||
<?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.689546395">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.689546395" 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="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" 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.689546395" name="Debug" parent="com.ti.ccstudio.buildDefinitions.MSP430.Debug">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.689546395." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.DebugToolchain.1915355416" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.linkerDebug.912529898">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.832511341" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2553"/>
|
||||
<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="LINKER_COMMAND_FILE=lnk_msp430g2553.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
<listOptionValue builtIn="false" value="PRODUCTS="/>
|
||||
<listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1087848061" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="20.2.0.LTS" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.targetPlatformDebug.1431824004" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.targetPlatformDebug"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.builderDebug.305423476" name="GNU Make.Debug" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.builderDebug"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.compilerDebug.755923190" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.compilerDebug">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DEFINE.219944304" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__MSP430G2553__"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.USE_HW_MPY.442021215" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.USE_HW_MPY" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.USE_HW_MPY.none" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.SILICON_VERSION.132893857" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.SILICON_VERSION.msp" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.PRINTF_SUPPORT.1747691655" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.PRINTF_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DEBUGGING_MODEL.1129462397" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DEBUGGING_MODEL" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WARNING.198512775" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DISPLAY_ERROR_NUMBER.682242603" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WRAP.1906011300" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.INCLUDE_PATH.1206976934" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="${CCS_BASE_ROOT}/msp430/include"/>
|
||||
<listOptionValue builtIn="false" value="${PROJECT_ROOT}"/>
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.ADVICE__POWER.573035127" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.ADVICE__POWER" useByScannerDiscovery="false" value="all" valueType="string"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__C_SRCS.2129479397" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__CPP_SRCS.874526572" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__ASM_SRCS.2082472386" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__ASM2_SRCS.1228547528" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.linkerDebug.912529898" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.linkerDebug">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.USE_HW_MPY.1076118764" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.USE_HW_MPY" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.USE_HW_MPY.none" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.HEAP_SIZE.1507939680" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.HEAP_SIZE" useByScannerDiscovery="false" value="80" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.STACK_SIZE.1409185929" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.STACK_SIZE" useByScannerDiscovery="false" value="80" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.OUTPUT_FILE.2116998675" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.OUTPUT_FILE" useByScannerDiscovery="false" value="${ProjName}.out" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.MAP_FILE.307510076" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.MAP_FILE" useByScannerDiscovery="false" value="${ProjName}.map" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.XML_LINK_INFO.722730231" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.XML_LINK_INFO" useByScannerDiscovery="false" value="${ProjName}_linkInfo.xml" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DISPLAY_ERROR_NUMBER.56962517" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DIAG_WRAP.1140035558" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.SEARCH_PATH.1923823476" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value="${CCS_BASE_ROOT}/msp430/include"/>
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/>
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.LIBRARY.30010063" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.LIBRARY" useByScannerDiscovery="false" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="libc.a"/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__CMD_SRCS.1100874676" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__CMD2_SRCS.818562252" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__GEN_CMDS.1929950269" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.1720170885" name="MSP430 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.ROMWIDTH.1940691408" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.ROMWIDTH" useByScannerDiscovery="false" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.MEMWIDTH.1760252335" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.MEMWIDTH" useByScannerDiscovery="false" 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.820372749">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.820372749" 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="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" 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.820372749" name="Release" parent="com.ti.ccstudio.buildDefinitions.MSP430.Release">
|
||||
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Release.820372749." name="/" resourcePath="">
|
||||
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.ReleaseToolchain.1621297444" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.linkerRelease.171900761">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1289820478" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2553"/>
|
||||
<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="LINKER_COMMAND_FILE=lnk_msp430g2553.cmd"/>
|
||||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
|
||||
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
|
||||
<listOptionValue builtIn="false" value="PRODUCTS="/>
|
||||
<listOptionValue builtIn="false" value="PRODUCT_MACRO_IMPORTS={}"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1470837228" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="20.2.0.LTS" valueType="string"/>
|
||||
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.targetPlatformRelease.750773727" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.targetPlatformRelease"/>
|
||||
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.builderRelease.1744337247" name="GNU Make.Release" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.builderRelease"/>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.compilerRelease.2003428190" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.compilerRelease">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DEFINE.1031731252" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DEFINE" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__MSP430G2553__"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.USE_HW_MPY.983991990" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.USE_HW_MPY" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.USE_HW_MPY.none" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.SILICON_VERSION.376580785" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.SILICON_VERSION" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.SILICON_VERSION.msp" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.PRINTF_SUPPORT.941017775" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.PRINTF_SUPPORT" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WARNING.837292960" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WARNING" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="225"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DISPLAY_ERROR_NUMBER.401082724" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WRAP.275881430" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.INCLUDE_PATH.1468251618" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="${CCS_BASE_ROOT}/msp430/include"/>
|
||||
<listOptionValue builtIn="false" value="${PROJECT_ROOT}"/>
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
|
||||
</option>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.ADVICE__POWER.1040076344" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compilerID.ADVICE__POWER" useByScannerDiscovery="false" value="all" valueType="string"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__C_SRCS.677651698" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__C_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__CPP_SRCS.1170728754" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__CPP_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__ASM_SRCS.2042067414" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__ASM_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__ASM2_SRCS.904009203" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.compiler.inputType__ASM2_SRCS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.linkerRelease.171900761" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exe.linkerRelease">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.USE_HW_MPY.2076005061" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.USE_HW_MPY" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.USE_HW_MPY.none" valueType="enumerated"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.HEAP_SIZE.2017847186" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.HEAP_SIZE" useByScannerDiscovery="false" value="80" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.STACK_SIZE.1844319674" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.STACK_SIZE" useByScannerDiscovery="false" value="80" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.OUTPUT_FILE.674831049" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.OUTPUT_FILE" useByScannerDiscovery="false" value="${ProjName}.out" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.MAP_FILE.254057989" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.MAP_FILE" useByScannerDiscovery="false" value="${ProjName}.map" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.XML_LINK_INFO.2042459337" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.XML_LINK_INFO" useByScannerDiscovery="false" value="${ProjName}_linkInfo.xml" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DISPLAY_ERROR_NUMBER.2106602227" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DISPLAY_ERROR_NUMBER" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DIAG_WRAP.750521088" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DIAG_WRAP" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.SEARCH_PATH.1030112398" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.SEARCH_PATH" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value="${CCS_BASE_ROOT}/msp430/include"/>
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/>
|
||||
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.LIBRARY.31458307" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.linkerID.LIBRARY" useByScannerDiscovery="false" valueType="libs">
|
||||
<listOptionValue builtIn="false" value="libc.a"/>
|
||||
</option>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__CMD_SRCS.1155855896" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__CMD_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__CMD2_SRCS.406535322" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__CMD2_SRCS"/>
|
||||
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__GEN_CMDS.450955867" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.exeLinker.inputType__GEN_CMDS"/>
|
||||
</tool>
|
||||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.1354592237" name="MSP430 Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex">
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.ROMWIDTH.547412053" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.ROMWIDTH" useByScannerDiscovery="false" value="8" valueType="string"/>
|
||||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.MEMWIDTH.519841356" superClass="com.ti.ccstudio.buildDefinitions.MSP430_20.2.hex.MEMWIDTH" useByScannerDiscovery="false" 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="MotionController.com.ti.ccstudio.buildDefinitions.MSP430.ProjectType.401198847" name="MSP430" projectType="com.ti.ccstudio.buildDefinitions.MSP430.ProjectType"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration"/>
|
||||
</cproject>
|
||||
27
.project
Normal file
27
.project
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>MotionController</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>
|
||||
65
SPI.c
Normal file
65
SPI.c
Normal file
@ -0,0 +1,65 @@
|
||||
#include <msp430.h>
|
||||
#include "SPI.h"
|
||||
|
||||
uchar SPI_CS;
|
||||
|
||||
int SPIInit(){
|
||||
|
||||
UCA0CTL1 = UCSWRST;
|
||||
|
||||
// setup A0 for SPI
|
||||
UCA0CTL0 = SPI_Mode3 | UCMSB | UCMST | (0x10 << 1) | UCSYNC;
|
||||
UCA0CTL1 |= UCSSEL_2;
|
||||
UCA0BR1 = 0; //TODO: set corect frequency
|
||||
UCA0BR0 = 4;
|
||||
|
||||
|
||||
// config port
|
||||
//set SEL to USCI (0b01); MOSI (pin 1), MISO (pin 2), CLK (pin 4)
|
||||
P1SEL |= BIT1 | BIT2 | BIT4;
|
||||
P1SEL2 |= BIT1 | BIT2 | BIT4;
|
||||
|
||||
|
||||
UCA0CTL1 &= ~UCSWRST;
|
||||
|
||||
// enable interrupts
|
||||
IE2 |= UCA0TXIE;
|
||||
IFG2 &= ~UCA0TXIFG;
|
||||
|
||||
// set initial values for vars
|
||||
SPI_packetC = 0;
|
||||
SPI_CS = 0;
|
||||
|
||||
__enable_interrupt();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SPISend(){
|
||||
P1OUT &= ~SPI_CS;
|
||||
UCA0TXBUF = SPI_packet[SPI_packetC];
|
||||
}
|
||||
|
||||
void SPIInitSend(uchar cs, enum SPI_Mode mode){
|
||||
while(SPI_CS != 0)
|
||||
//TODO: search for a more power effient way for a delay
|
||||
__delay_cycles (16000);
|
||||
|
||||
UCA0CTL0 |= mode;
|
||||
UCA0CTL0 &= ~mode ^ 0xC0;
|
||||
SPI_CS = cs;
|
||||
}
|
||||
|
||||
#pragma vector = USCIAB0TX_VECTOR
|
||||
__interrupt void ISR_EUSCI_A0(){
|
||||
SPI_packet[SPI_packetC] = UCA0RXIFG;
|
||||
if(SPI_packetC == 4){
|
||||
P1OUT |= SPI_CS;
|
||||
SPI_packetC = 0;
|
||||
IFG2 &= ~UCA0TXIFG;
|
||||
SPI_CS = 0;
|
||||
}else{
|
||||
SPI_packetC++;
|
||||
UCA0TXBUF = SPI_packet[SPI_packetC];
|
||||
}
|
||||
}
|
||||
22
SPI.h
Normal file
22
SPI.h
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* SPI.c
|
||||
*
|
||||
* Created on: 4 mei 2020
|
||||
* Author: mreenen
|
||||
*/
|
||||
|
||||
#ifndef SPI_C_
|
||||
#define SPI_C_
|
||||
|
||||
#include "typedefExtention.h"
|
||||
|
||||
enum SPI_Mode {SPI_Mode0=0b00<<6, SPI_Mode1=0b01<<6, SPI_Mode2=0b11<<6, SPI_Mode3=0b10<<6};
|
||||
|
||||
uchar SPI_packet[5];
|
||||
char SPI_packetC;
|
||||
|
||||
int SPIInit();
|
||||
void SPISend();
|
||||
void SPIInitSend(uchar cs, enum SPI_Mode mode);
|
||||
|
||||
#endif /* SPI_C_ */
|
||||
146
lnk_msp430g2553.cmd
Normal file
146
lnk_msp430g2553.cmd
Normal file
@ -0,0 +1,146 @@
|
||||
/* ============================================================================ */
|
||||
/* Copyright (c) 2020, 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_msp430g2553.cmd - LINKER COMMAND FILE FOR LINKING MSP430G2553 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.209 */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/****************************************************************************/
|
||||
/* 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 = 0x0200, length = 0x0200
|
||||
INFOA : origin = 0x10C0, length = 0x0040
|
||||
INFOB : origin = 0x1080, length = 0x0040
|
||||
INFOC : origin = 0x1040, length = 0x0040
|
||||
INFOD : origin = 0x1000, length = 0x0040
|
||||
FLASH : origin = 0xC000, length = 0x3FDE
|
||||
BSLSIGNATURE : origin = 0xFFDE, length = 0x0002, fill = 0xFFFF
|
||||
INT00 : origin = 0xFFE0, length = 0x0002
|
||||
INT01 : origin = 0xFFE2, length = 0x0002
|
||||
INT02 : origin = 0xFFE4, length = 0x0002
|
||||
INT03 : origin = 0xFFE6, length = 0x0002
|
||||
INT04 : origin = 0xFFE8, length = 0x0002
|
||||
INT05 : origin = 0xFFEA, length = 0x0002
|
||||
INT06 : origin = 0xFFEC, length = 0x0002
|
||||
INT07 : origin = 0xFFEE, length = 0x0002
|
||||
INT08 : origin = 0xFFF0, length = 0x0002
|
||||
INT09 : origin = 0xFFF2, length = 0x0002
|
||||
INT10 : origin = 0xFFF4, length = 0x0002
|
||||
INT11 : origin = 0xFFF6, length = 0x0002
|
||||
INT12 : origin = 0xFFF8, length = 0x0002
|
||||
INT13 : origin = 0xFFFA, length = 0x0002
|
||||
INT14 : 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 */
|
||||
|
||||
.text : {} > FLASH /* Code */
|
||||
.cinit : {} > FLASH /* Initialization tables */
|
||||
.const : {} > FLASH /* Constant data */
|
||||
.bslsignature : {} > BSLSIGNATURE /* BSL Signature */
|
||||
.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_CODE_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 */
|
||||
TRAPINT : { * ( .int00 ) } > INT00 type = VECT_INIT
|
||||
.int01 : {} > INT01
|
||||
PORT1 : { * ( .int02 ) } > INT02 type = VECT_INIT
|
||||
PORT2 : { * ( .int03 ) } > INT03 type = VECT_INIT
|
||||
.int04 : {} > INT04
|
||||
ADC10 : { * ( .int05 ) } > INT05 type = VECT_INIT
|
||||
USCIAB0TX : { * ( .int06 ) } > INT06 type = VECT_INIT
|
||||
USCIAB0RX : { * ( .int07 ) } > INT07 type = VECT_INIT
|
||||
TIMER0_A1 : { * ( .int08 ) } > INT08 type = VECT_INIT
|
||||
TIMER0_A0 : { * ( .int09 ) } > INT09 type = VECT_INIT
|
||||
WDT : { * ( .int10 ) } > INT10 type = VECT_INIT
|
||||
COMPARATORA : { * ( .int11 ) } > INT11 type = VECT_INIT
|
||||
TIMER1_A1 : { * ( .int12 ) } > INT12 type = VECT_INIT
|
||||
TIMER1_A0 : { * ( .int13 ) } > INT13 type = VECT_INIT
|
||||
NMI : { * ( .int14 ) } > INT14 type = VECT_INIT
|
||||
.reset : {} > RESET /* MSP430 Reset vector */
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* Include peripherals memory map */
|
||||
/****************************************************************************/
|
||||
|
||||
-l msp430g2553.cmd
|
||||
|
||||
39
main.c
Normal file
39
main.c
Normal file
@ -0,0 +1,39 @@
|
||||
#include <msp430.h>
|
||||
#include "typedefExtention.h"
|
||||
#include "SPI.h"
|
||||
#include "motorDriver.h"
|
||||
#include "motionController.h"
|
||||
|
||||
/**
|
||||
* main.c
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
int v;
|
||||
|
||||
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
|
||||
|
||||
// set cpu op 16MHz
|
||||
BCSCTL1 = CALBC1_16MHZ;
|
||||
DCOCTL = CALDCO_16MHZ;
|
||||
|
||||
|
||||
SPIInit();
|
||||
|
||||
// wait some time so the other ic have some time to start
|
||||
__delay_cycles (1000000);
|
||||
|
||||
MDInit(); // initilize motor driver
|
||||
MCInit(); // initilize motion controller
|
||||
|
||||
// set snelheid van motor op 50 (ongeveer 1.7 mm/s of 6 meter/uur)
|
||||
v = 50;
|
||||
MCSetV(1, v);
|
||||
|
||||
// start een oneinige loop dit elke seconde de senlhied veranderd naar een (pseudo) random waarde
|
||||
while(1){
|
||||
__delay_cycles (15500000);
|
||||
v = 2047.0 * sin((double) v);
|
||||
MCSetV(1, v);
|
||||
}
|
||||
}
|
||||
176
motionController.c
Normal file
176
motionController.c
Normal file
@ -0,0 +1,176 @@
|
||||
/*
|
||||
* motionController.c
|
||||
*
|
||||
* TMC429
|
||||
*
|
||||
* Created on: 5 mei 2020
|
||||
* Author: mreenen
|
||||
*/
|
||||
|
||||
#include <msp430.h>
|
||||
#include "typedefExtention.h"
|
||||
#include "SPI.h"
|
||||
#include "motionController.h"
|
||||
|
||||
const uchar MC_CS = BIT0;
|
||||
|
||||
// target position 24RW
|
||||
#define MC_XTar1 0x00
|
||||
#define MC_XTar2 0x20
|
||||
#define MC_XTar3 0x40
|
||||
// actual position 24R (RW if in velocity or hold mode)
|
||||
#define MC_XAtu1 0x02
|
||||
#define MC_XAtu2 0x22
|
||||
#define MC_XAtu3 0x42
|
||||
// velocity minimum (can be stopt emidetly) 11uRW
|
||||
#define MC_VMin1 0x04
|
||||
#define MC_VMin2 0x24
|
||||
#define MC_VMin3 0x44
|
||||
// velocity maximum 11uRW
|
||||
#define MC_VMax1 0x06
|
||||
#define MC_VMax2 0x26
|
||||
#define MC_VMax3 0x46
|
||||
// velocity target 12sRW
|
||||
#define MC_VTar1 0x08
|
||||
#define MC_VTar2 0x28
|
||||
#define MC_VTar3 0x48
|
||||
// velocity actual 12sR
|
||||
#define MC_VAtu1 0x0A
|
||||
#define MC_VAtu2 0x2A
|
||||
#define MC_VAtu3 0x4A
|
||||
// acceleration maximum 11uRW
|
||||
#define MC_AMax1 0x0C
|
||||
#define MC_AMax2 0x2C
|
||||
#define MC_AMax3 0x4C
|
||||
// acceleration actual 12sRW
|
||||
#define MC_AAtu1 0x0E
|
||||
#define MC_AAtu2 0x2E
|
||||
#define MC_AAtu3 0x4E
|
||||
// acceleration threshold 11uRW
|
||||
#define MC_AAtu1 0x0E
|
||||
#define MC_AAtu2 0x2E
|
||||
#define MC_AAtu3 0x4E
|
||||
// P value for ramp mode
|
||||
#define MC_P1 0x12
|
||||
#define MC_P2 0x32
|
||||
#define MC_P3 0x52
|
||||
// ramp_mode, ref conf and lp
|
||||
#define MC_Rmcl1 0x14
|
||||
#define MC_Rmcl2 0x34
|
||||
#define MC_Rmcl3 0x54
|
||||
#define MC_lp 0x010000
|
||||
#define MC_REF_CONF 8
|
||||
#define MC_RAMP_MODE 0b00
|
||||
#define MC_SOFT_MODE 0b01
|
||||
#define MC_VELOCITY_MODE 0b10
|
||||
#define MC_HOLD_MODE 0b11
|
||||
// deviders
|
||||
#define MD_Div1 0x18
|
||||
#define MD_Div2 0x38
|
||||
#define MD_Div3 0x58
|
||||
#define MD_PULSE_DIV 12
|
||||
#define MD_RAMP_DIV 8
|
||||
|
||||
|
||||
//TODO: make function to calculate and write P
|
||||
|
||||
void MC_write(uchar addr, ulong data) {
|
||||
char i;
|
||||
|
||||
// wait for SPI bus to be available
|
||||
SPIInitSend(MC_CS, SPI_Mode3);
|
||||
|
||||
// set write bit to write
|
||||
addr &= ~0x01;
|
||||
SPI_packet[1] = addr;
|
||||
|
||||
// save data to SPI packet buffer
|
||||
for(i=4; i>1; i--){
|
||||
SPI_packet[i] = data;
|
||||
data >>= 8;
|
||||
}
|
||||
|
||||
SPI_packetC = 1; // set counter to one so it skips byte 0 and sends 4 bytes
|
||||
SPISend();
|
||||
}
|
||||
|
||||
ulong MC_read(unsigned char addr) {
|
||||
char i;
|
||||
ulong data;
|
||||
|
||||
// wait for SPI bus to be available
|
||||
SPIInitSend(MC_CS, SPI_Mode3);
|
||||
|
||||
// set write bit to read
|
||||
addr |= 0x01;
|
||||
SPI_packet[1] = addr;
|
||||
|
||||
SPI_packetC = 1; // set counter to one so it skips byte 0 and sends 4 bytes
|
||||
SPISend();
|
||||
|
||||
// wait for SPI bus to be available
|
||||
SPIInitSend(MC_CS, SPI_Mode3);
|
||||
|
||||
// set write bit to read
|
||||
addr |= 0x01;
|
||||
SPI_packet[1] = addr;
|
||||
|
||||
SPI_packetC = 1; // set counter to one so it skips byte 0 and sends 4 bytes
|
||||
SPISend();
|
||||
|
||||
// read data
|
||||
for(i=2; i<5; i++){
|
||||
data |= (ulong) SPI_packet[i];
|
||||
data <<= 8;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void MCInit(){
|
||||
P1DIR |= MC_CS; // set MC_CS (pin 5) as output
|
||||
P1OUT |= MC_CS; // set MC_CS high
|
||||
|
||||
|
||||
// set min and max velocity
|
||||
MC_write(MC_VMin1, 0);
|
||||
MC_write(MC_VMin2, 0);
|
||||
MC_write(MC_VMax1, 2047);
|
||||
MC_write(MC_VMax2, 2047);
|
||||
|
||||
// set clock dividers
|
||||
MC_write(MD_Div1, (9 << MD_PULSE_DIV) | (3 << MD_RAMP_DIV));
|
||||
MC_write(MD_Div2, (9 << MD_PULSE_DIV) | (3 << MD_RAMP_DIV));
|
||||
|
||||
// max acceleration
|
||||
MC_write(MC_AMax1, 1);
|
||||
MC_write(MC_AMax2, 1);
|
||||
|
||||
// set ramp mode and reference switch configuration
|
||||
MC_write(MC_Rmcl1, (0b0111 << MC_REF_CONF) | MC_VELOCITY_MODE);
|
||||
MC_write(MC_Rmcl2, (0b0111 << MC_REF_CONF) | MC_VELOCITY_MODE);
|
||||
|
||||
//DEBUG
|
||||
MC_read(MC_VMax1);
|
||||
MC_read(MC_Rmcl2);
|
||||
MC_read(MC_AMax1);
|
||||
}
|
||||
|
||||
void MCSetV(uchar m, int v){
|
||||
if(v < 0)
|
||||
v |= 0x0800; // set signed bit
|
||||
else
|
||||
v &= ~0x0800; // remove signed bit
|
||||
v &= 0x0FFF; // contraint to 12 bits
|
||||
switch (m){
|
||||
case 1:
|
||||
MC_write(MC_VTar1, v);
|
||||
break;
|
||||
case 2:
|
||||
MC_write(MC_VTar2, v);
|
||||
break;
|
||||
case 3:
|
||||
MC_write(MC_VTar3, v);
|
||||
break;
|
||||
}
|
||||
}
|
||||
14
motionController.h
Normal file
14
motionController.h
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* modtionController.h
|
||||
*
|
||||
* Created on: 5 mei 2020
|
||||
* Author: mreenen
|
||||
*/
|
||||
|
||||
#ifndef MOTIONCONTROLLER_H_
|
||||
#define MOTIONCONTROLLER_H_
|
||||
|
||||
void MCInit();
|
||||
void MCSetV(uchar m, int v);
|
||||
|
||||
#endif /* MOTIONCONTROLLER_H_ */
|
||||
124
motorDriver.c
Normal file
124
motorDriver.c
Normal file
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* motorDriver.c
|
||||
*
|
||||
* Created on: 4 mei 2020
|
||||
* Author: mreenen
|
||||
*/
|
||||
|
||||
#include <msp430.h>
|
||||
#include "typedefExtention.h"
|
||||
#include "SPI.h"
|
||||
#include "motorDriver.h"
|
||||
|
||||
const uchar MD_CS = BIT3;
|
||||
|
||||
// register 0x00 GCINF
|
||||
#define MD_GCONF 0X00
|
||||
#define MD_GCONF_singgelMotor 0x00000001
|
||||
#define MD_GCONF_stepdir1Enable 0x00000002
|
||||
#define MD_GCONF_stepdir2Enable 0x00000004
|
||||
#define MD_GCONF_motor1Revers 0x00000010
|
||||
#define MD_GCONF_motor1Revers 0x00000010
|
||||
#define MD_GCONF_lockGCONF 0x00000020
|
||||
|
||||
// register 0x01 GSTAT
|
||||
#define MD_GSTAT 0X01
|
||||
|
||||
// register 0x30, 0x50 IHOLD_IRUN
|
||||
#define MD_IHIR1 0x30
|
||||
#define MD_IHIR2 0x50
|
||||
#define MD_IHIR_iHold 0
|
||||
#define MD_IHIR_iRun 8
|
||||
#define md_IHIR_iHoldDelay 16ul
|
||||
|
||||
// register 0x6C, 7C CHOPCONF
|
||||
#define MD_CC1 0X6C
|
||||
#define MD_CC2 0X7C
|
||||
#define MD_CC_shortProtection 0x40000000
|
||||
#define MD_CC_doubbleEdge 0x20000000
|
||||
#define MD_CC_16ustapI 0x10000000
|
||||
#define MD_CC_mres 24 // 4 bits; 1/(2^x / 2^8) microstappen
|
||||
#define MD_CC_vsens 0x00020000
|
||||
#define MD_CC_tbl 15 // 3 bits?
|
||||
#define MD_CC_cmh BIT14
|
||||
#define MD_CC_rndtf 0x00002000
|
||||
#define MD_CC_disfdcc 0x00001000
|
||||
#define MD_CC_fd3 BTI11
|
||||
#define MD_CC_hend 7 // 4 bits
|
||||
#define MD_CC_hstrt 4 // 3 bits
|
||||
#define MD_CC_toff 0 // 4 bits
|
||||
|
||||
// bool md_checkError(){
|
||||
// unsigned long stat = md_read(MD_GSTAT);
|
||||
// if(stat != 0){
|
||||
// if(stat == 0x1){ // only a recet has occert
|
||||
// // restart the motor driver
|
||||
// md_setup();
|
||||
// }else{ // one of the motorst stopt due to short or overheated or a undervoltage in chargepump
|
||||
// // wait a while for checking again
|
||||
// delay(1000);
|
||||
// md_checkError();
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
void MD_write(uchar addr, ulong data) {
|
||||
char i;
|
||||
|
||||
// wait for SPI bus to be available
|
||||
SPIInitSend(MD_CS, SPI_Mode3);
|
||||
|
||||
// set write bit to write
|
||||
addr |= 0x80;
|
||||
SPI_packet[0] = addr;
|
||||
|
||||
// save data to packet buffer
|
||||
for(i=4; i>0; i--){
|
||||
SPI_packet[i] = data;
|
||||
data >>= 8;
|
||||
}
|
||||
|
||||
SPISend(SPI_Mode3);
|
||||
}
|
||||
|
||||
|
||||
unsigned long MD_read(uchar addr) {
|
||||
char i;
|
||||
ulong data;
|
||||
|
||||
// wait for SPI bus to be available
|
||||
SPIInitSend(MD_CS, SPI_Mode3);
|
||||
|
||||
// set write bit to read
|
||||
addr &= ~0x80;
|
||||
SPI_packet[0] = addr;
|
||||
|
||||
SPISend(SPI_Mode3);
|
||||
|
||||
// wait for SPI bus to be available
|
||||
SPIInitSend(MD_CS, SPI_Mode3);
|
||||
|
||||
SPI_packet[0] = addr;
|
||||
SPISend(SPI_Mode3);
|
||||
|
||||
// read data
|
||||
for(i=2; i<5; i++){
|
||||
data |= (ulong) SPI_packet[i];
|
||||
data <<= 8;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void MDInit(){
|
||||
P1DIR |= MD_CS; // set MD_CS (pin 3) as output
|
||||
P1OUT |= MD_CS; // set MD_CS high
|
||||
|
||||
MD_write(MD_GCONF, MD_GCONF_stepdir2Enable | MD_GCONF_stepdir1Enable);
|
||||
MD_write(MD_CC1, 3ul<<MD_CC_toff | (4ul<<MD_CC_hstrt) | (1ul<<MD_CC_hend) | (2ul<<MD_CC_tbl) | (4ul<<MD_CC_mres) | MD_CC_16ustapI);
|
||||
MD_write(MD_CC2, 3ul<<MD_CC_toff | (4ul<<MD_CC_hstrt) | (1ul<<MD_CC_hend) | (2ul<<MD_CC_tbl) | (4ul<<MD_CC_mres) | MD_CC_16ustapI);
|
||||
MD_write(MD_IHIR1, 10ul<<MD_IHIR_iHold | 31ul<<MD_IHIR_iRun | 6ul<<md_IHIR_iHoldDelay);
|
||||
MD_write(MD_IHIR2, 10ul<<MD_IHIR_iHold | 31ul<<MD_IHIR_iRun | 6ul<<md_IHIR_iHoldDelay);
|
||||
}
|
||||
13
motorDriver.h
Normal file
13
motorDriver.h
Normal file
@ -0,0 +1,13 @@
|
||||
/*
|
||||
* motorDriver.h
|
||||
*
|
||||
* Created on: 4 mei 2020
|
||||
* Author: mreenen
|
||||
*/
|
||||
|
||||
#ifndef MOTORDRIVER_H_
|
||||
#define MOTORDRIVER_H_
|
||||
|
||||
void MDInit();
|
||||
|
||||
#endif /* MOTORDRIVER_H_ */
|
||||
17
typedefExtention.h
Normal file
17
typedefExtention.h
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* typedefExtiontion.h
|
||||
*
|
||||
* Created on: 4 May 2020
|
||||
* Author: mreenen
|
||||
*/
|
||||
|
||||
#ifndef TYPEDEFEXTENTION_H_
|
||||
#define TYPEDEFEXTENTION_H_
|
||||
|
||||
|
||||
typedef unsigned char uchar;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned long ulong;
|
||||
|
||||
|
||||
#endif /* TYPEDEFEXTENTION_H_ */
|
||||
Loading…
x
Reference in New Issue
Block a user