Update repo
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex10_chopper"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex10_chopper.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex10_chopper.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex11_configure_signal"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex11_configure_signal.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex11_configure_signal.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex12_monoshot_mode"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex12_monoshot_mode.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex12_monoshot_mode.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex13_up_aq"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex13_up_aq.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex13_up_aq.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex14_global_load_use_case"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex14_global_load_use_case.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex14_global_load_use_case.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex1_trip_zone"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex1_trip_zone.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex1_trip_zone.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex2_updown_aq"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex2_updown_aq.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex2_updown_aq.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex3_synchronization"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex3_synchronization.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex3_synchronization.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex4_digital_compare"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex4_digital_compare.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex4_digital_compare.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex5_digital_compare_event_filter"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex5_digital_compare_event_filter.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex5_digital_compare_event_filter.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex6_valley_switching"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex6_valley_switching.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex6_valley_switching.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex7_edge_filter"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex7_edge_filter.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex7_edge_filter.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex8_deadband"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex8_deadband.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex8_deadband.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,40 @@
|
||||
<projectSpec>
|
||||
<project
|
||||
name="epwm_ex9_dma"
|
||||
device="TMS320F28388D"
|
||||
cgtVersion="22.6.1.LTS"
|
||||
products="sysconfig;C2000WARE"
|
||||
outputFormat="ELF"
|
||||
launchWizard="False"
|
||||
linkerCommandFile=""
|
||||
enableSysConfigTool="true"
|
||||
sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2838x --package 337bga --part F2838x_337bga"
|
||||
postBuildStep="
|
||||
echo "========= Build of the CLB simulation has moved to the CLB Tool. Click the '?' icon by the _Generate CLB Simulation File_ enable for more details (located in the Global Parameters of the Tile Design SysConfig module) ============="
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/dot_file_libraries/clbDotUtility.js" "${C2000WARE_ROOT}/utilities/clb_tool/clb_syscfg/" "${BuildDirectory}/syscfg" "${BuildDirectory}/syscfg/clb.dot"
|
||||
;if ${GENERATE_DIAGRAM} == 1 mkdir "${BuildDirectory}/diagrams"
|
||||
;if ${GENERATE_DIAGRAM} == 1 ${NODE_TOOL} "${C2000WARE_ROOT}/driverlib/.meta/generate_diagrams.js" "${C2000WARE_ROOT}" "${BuildDirectory}/diagrams" "${BuildDirectory}/syscfg"
|
||||
"
|
||||
>
|
||||
<configuration name="CPU1_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=RAM -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
<configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH -i${C2000WARE_ROOT} -i${PROJECT_BUILD_DIR}/syscfg -lc2000ware_libraries.cmd.genlibs " />
|
||||
|
||||
<pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f2838x/driverlib/" scope="project" />
|
||||
<pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" />
|
||||
<pathVariable name="CLB_SYSCFG_ROOT" path="../../../../../../utilities/clb_tool/clb_syscfg/" scope="project" />
|
||||
<pathVariable name="SYSTEMC_INSTALL" path="../../../../../../utilities/clb_tool/clb_syscfg/systemc-2.3.3" scope="project" />
|
||||
<pathVariable name="CLB_SIM_COMPILER" path="C:/TDM-GCC-64/bin" scope="project" />
|
||||
<buildVariable name="GENERATE_DIAGRAM" value="0" scope="project" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/driverlib.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/include/device.h" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/device.c" targetDirectory="device" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/targetConfigs/TMS320F28388D.ccxml" targetDirectory="targetConfigs" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/cmd/2838x_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
|
||||
<file action="copy" path="../../../../../../device_support/f2838x/common/source/f2838x_codestartbranch.asm" targetDirectory="device" />
|
||||
<file action="link" path="../../../../../../driverlib/f2838x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" />
|
||||
<file action="copy" path="../../../../../../driverlib/f2838x/driverlib/" targetDirectory="device" excludeFromBuild="True" />
|
||||
<file action="copy" path="../epwm_ex9_dma.c" targetDirectory="" />
|
||||
<file action="copy" path="../epwm_ex9_dma.syscfg" targetDirectory="" />
|
||||
</project>
|
||||
</projectSpec>
|
||||
@@ -0,0 +1,136 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex10_chopper.c
|
||||
//
|
||||
// TITLE: ePWM Using Chopper Submodule.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>ePWM Chopper</h1>
|
||||
//!
|
||||
//! This example configures ePWM1, ePWM2, ePWM3 and ePWM4 as follows
|
||||
//! - ePWM1 with Chopper disabled (Reference)
|
||||
//! - ePWM2 with chopper enabled at 1/8 duty cycle
|
||||
//! - ePWM3 with chopper enabled at 6/8 duty cycle
|
||||
//! - ePWM4 with chopper enabled at 1/2 duty cycle with
|
||||
//! One-Shot Pulse enabled
|
||||
//!
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - GPIO0 EPWM1A
|
||||
//! - GPIO1 EPWM1B
|
||||
//! - GPIO2 EPWM2A
|
||||
//! - GPIO3 EPWM2B
|
||||
//! - GPIO4 EPWM3A
|
||||
//! - GPIO5 EPWM3B
|
||||
//! - GPIO6 EPWM4A
|
||||
//! - GPIO7 EPWM4B
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - None.
|
||||
//
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well). GTBCLKSYNC is applicable
|
||||
// only for multiple core devices. Uncomment the below statement if
|
||||
// applicable.
|
||||
//
|
||||
// SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_GTBCLKSYNC);
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure ePWM GPIOs and Modules
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const epwm2 = epwm.addInstance();
|
||||
const epwm3 = epwm.addInstance();
|
||||
const epwm4 = epwm.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_period = 500;
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm1.epwmCounterCompare_cmpA = 125;
|
||||
epwm1.epwmCounterCompare_cmpB = 375;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
|
||||
epwm2.$name = "myEPWM2";
|
||||
epwm2.epwm.$assign = "EPWM2";
|
||||
epwm2.epwm.epwmaPin.$assign = "GPIO2";
|
||||
epwm2.epwm.epwmbPin.$assign = "GPIO3";
|
||||
epwm2.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm2.epwmTimebase_period = 500;
|
||||
epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm2.epwmCounterCompare_cmpA = 125;
|
||||
epwm2.epwmCounterCompare_cmpB = 375;
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmChopper_useChopper = true;
|
||||
epwm2.epwmChopper_chopperFreq = "3";
|
||||
|
||||
epwm3.$name = "myEPWM3";
|
||||
epwm3.epwm.$assign = "EPWM3";
|
||||
epwm3.epwm.epwmaPin.$assign = "GPIO4";
|
||||
epwm3.epwm.epwmbPin.$assign = "GPIO5";
|
||||
epwm3.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm3.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm3.epwmTimebase_period = 500;
|
||||
epwm3.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm3.epwmCounterCompare_cmpA = 125;
|
||||
epwm3.epwmCounterCompare_cmpB = 375;
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmChopper_useChopper = true;
|
||||
epwm3.epwmChopper_chopperDuty = "5";
|
||||
epwm3.epwmChopper_chopperFreq = "3";
|
||||
|
||||
epwm4.$name = "myEPWM4";
|
||||
epwm4.epwm.$assign = "EPWM4";
|
||||
epwm4.epwm.epwmaPin.$assign = "GPIO6";
|
||||
epwm4.epwm.epwmbPin.$assign = "GPIO7";
|
||||
epwm4.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm4.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm4.epwmTimebase_period = 500;
|
||||
epwm4.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm4.epwmCounterCompare_cmpA = 125;
|
||||
epwm4.epwmCounterCompare_cmpB = 375;
|
||||
epwm4.epwmChopper_useChopper = true;
|
||||
epwm4.epwmChopper_chopperDuty = "3";
|
||||
epwm4.epwmChopper_chopperFreq = "3";
|
||||
epwm4.epwmChopper_chopperFirstPulseWidth = "10";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
@@ -0,0 +1,210 @@
|
||||
//###########################################################################
|
||||
//
|
||||
// FILE: epwm_ex11_configure_signal.c
|
||||
//
|
||||
// TITLE: Configure desired EPWM frequency & duty
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1> EPWM Configure Signal </h1>
|
||||
//!
|
||||
//! This example configures ePWM1, ePWM2, ePWM3 to produce signal of desired
|
||||
//! frequency and duty. It also configures phase between the configured
|
||||
//! modules.
|
||||
//!
|
||||
//! Signal of 10kHz with duty of 0.5 is configured on ePWMxA & ePWMxB
|
||||
//! with ePWMxB inverted. Also, phase of 120 degree is configured between
|
||||
//! ePWM1 to ePWM3 signals.
|
||||
//!
|
||||
//! During the test, monitor ePWM1, ePWM2, and/or ePWM3 outputs
|
||||
//! on an oscilloscope.
|
||||
//!
|
||||
//! - ePWM1A is on GPIO0
|
||||
//! - ePWM1B is on GPIO1
|
||||
//! - ePWM2A is on GPIO2
|
||||
//! - ePWM2B is on GPIO3
|
||||
//! - ePWM3A is on GPIO4
|
||||
//! - ePWM3B is on GPIO5
|
||||
//!
|
||||
//
|
||||
//###########################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//###########################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
EPWM_SignalParams pwmSignal =
|
||||
{10000, 0.5f, 0.5f, true, DEVICE_SYSCLK_FREQ, SYSCTL_EPWMCLK_DIV_2,
|
||||
EPWM_COUNTER_MODE_UP_DOWN, EPWM_CLOCK_DIVIDER_1,
|
||||
EPWM_HSCLOCK_DIVIDER_1};
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
void configurePhase(uint32_t base, uint32_t masterBase, uint16_t phaseVal);
|
||||
|
||||
//
|
||||
// Main
|
||||
//
|
||||
void main(void)
|
||||
{
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// For this case just init GPIO pins for ePWM1, ePWM2, ePWM3
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well)
|
||||
//
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configuring ePWM module for desired frequency and duty
|
||||
//
|
||||
EPWM_configureSignal(myEPWM1_BASE, &pwmSignal);
|
||||
EPWM_configureSignal(myEPWM2_BASE, &pwmSignal);
|
||||
EPWM_configureSignal(myEPWM3_BASE, &pwmSignal);
|
||||
|
||||
//
|
||||
// Configure phase between PWM1, PWM2 & PWM3.
|
||||
// PWM1 is configured as master and ePWM2 & 3
|
||||
// are configured as slaves.
|
||||
//
|
||||
EPWM_disablePhaseShiftLoad(myEPWM1_BASE);
|
||||
EPWM_setPhaseShift(myEPWM1_BASE, 0U);
|
||||
|
||||
//
|
||||
// ePWM1 SYNCO is generated on CTR=0
|
||||
//
|
||||
|
||||
EPWM_enableSyncOutPulseSource(myEPWM1_BASE, EPWM_SYNC_OUT_PULSE_ON_CNTR_ZERO);
|
||||
//
|
||||
// Configure phase shift for EPWM2 & 3
|
||||
//
|
||||
configurePhase(myEPWM2_BASE, myEPWM1_BASE, 120);
|
||||
configurePhase(myEPWM3_BASE, myEPWM1_BASE, 240);
|
||||
|
||||
EPWM_setSyncInPulseSource(myEPWM2_BASE, EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1);
|
||||
EPWM_setSyncInPulseSource(myEPWM3_BASE, EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1);
|
||||
|
||||
EPWM_enablePhaseShiftLoad(myEPWM2_BASE);
|
||||
EPWM_enablePhaseShiftLoad(myEPWM3_BASE);
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable interrupts required for this example
|
||||
//
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
|
||||
//
|
||||
// Enable global Interrupts and higher priority real-time debug events:
|
||||
//
|
||||
EINT; // Enable Global interrupt INTM
|
||||
ERTM; // Enable Global realtime interrupt DBGM
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
asm (" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// configurePhase - Configure ePWMx Phase
|
||||
//
|
||||
void configurePhase(uint32_t base, uint32_t masterBase, uint16_t phaseVal)
|
||||
{
|
||||
uint32_t readPrdVal, phaseRegVal;
|
||||
|
||||
//
|
||||
// Read Period value to calculate value for Phase Register
|
||||
//
|
||||
readPrdVal = EPWM_getTimeBasePeriod(masterBase);
|
||||
|
||||
//
|
||||
// Caluclate phase register values based on Time Base counter mode
|
||||
//
|
||||
if((HWREGH(base + EPWM_O_TBCTL) & 0x3U) == EPWM_COUNTER_MODE_UP_DOWN)
|
||||
{
|
||||
phaseRegVal = (2U * readPrdVal * phaseVal) / 360U;
|
||||
}
|
||||
else if((HWREGH(base + EPWM_O_TBCTL) & 0x3U) < EPWM_COUNTER_MODE_UP_DOWN)
|
||||
{
|
||||
phaseRegVal = (readPrdVal * phaseVal) / 360U;
|
||||
}
|
||||
|
||||
EPWM_selectPeriodLoadEvent(base, EPWM_SHADOW_LOAD_MODE_SYNC);
|
||||
EPWM_setPhaseShift(base, phaseRegVal);
|
||||
EPWM_setTimeBaseCounter(base, phaseRegVal);
|
||||
}
|
||||
|
||||
//
|
||||
// End of file
|
||||
//
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const epwm2 = epwm.addInstance();
|
||||
const epwm3 = epwm.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
|
||||
epwm2.$name = "myEPWM2";
|
||||
epwm2.epwm.$assign = "EPWM2";
|
||||
epwm2.epwm.epwmaPin.$assign = "GPIO2";
|
||||
epwm2.epwm.epwmbPin.$assign = "GPIO3";
|
||||
|
||||
epwm3.$name = "myEPWM3";
|
||||
epwm3.epwm.$assign = "EPWM3";
|
||||
epwm3.epwm.epwmaPin.$assign = "GPIO4";
|
||||
epwm3.epwm.epwmbPin.$assign = "GPIO5";
|
||||
@@ -0,0 +1,138 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex12_monoshot_mode.c
|
||||
//
|
||||
// TITLE: Realization of Monoshot mode
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>Realization of Monoshot mode</h1>
|
||||
//!
|
||||
//! This example showcases how to generate monoshot PWM output based on external
|
||||
//! trigger i.e. generating just a single pulse output on receipt of an external
|
||||
//! trigger. And the next pulse will be generated only when the next trigger
|
||||
//! comes. The example utilizes external synchronization and T1 action qualifier
|
||||
//! event features to achieve the desired output.
|
||||
//!
|
||||
//! ePWM1 is used to generate the monoshot output and ePWM2 is used an external
|
||||
//! trigger for that. No external connections are required as ePWM2A is fed
|
||||
//! as the trigger using Input X-BAR automatically.
|
||||
//!
|
||||
//! ePWM1 is configured to generated a single pulse of 0.5us when received
|
||||
//! an external trigger. This is achieved by enabling the phase synchronization
|
||||
//! feature and configuring EPWMxSYNCI as EXTSYNCIN1. And this EPWMxSYNCI
|
||||
//! is also configured as T1 event of action qualifier to set output HIGH while
|
||||
//! "CTR = PRD" action is used to set output LOW.
|
||||
//!
|
||||
//! ePWM2 is configured to generate a 100 KHz signal with a duty of 1% (to
|
||||
//! simulate a rising edge trigger) which is routed to EXTSYNCIN1 using Input XBAR.
|
||||
//!
|
||||
//! Observe GPIO0 (EPWM1A : Monoshot Output) and GPIO2(EPWM2 : External Trigger)
|
||||
//! on oscilloscope.
|
||||
//!
|
||||
//!
|
||||
//! \b NOTE : In the following example, the ePWM timer is still running in a
|
||||
//! continuous mode rather than a one-shot mode thus for more reliable
|
||||
//! implementation, refer to CLB based one shot PWM implementation
|
||||
//! demonstrated in "clb_ex17_one_shot_pwm" example
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well)
|
||||
//
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure ePWM1, ePWM2 GPIOs and Modules
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
NOP;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const epwm2 = epwm.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
const sync = scripting.addModule("/driverlib/sync.js");
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.useCase = "CUSTOM";
|
||||
epwm1.useInterfacePins = ["EPWM#A"];
|
||||
epwm1.epwmTimebase_period = 49;
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP";
|
||||
epwm1.epwmTimebase_phaseEnable = true;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_PERIOD = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_T1_COUNT_UP = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_t1Source = "EPWM_AQ_TRIGGER_EVENT_TRIG_EPWM_SYNCIN";
|
||||
epwm1.epwmTimebase_syncInPulseSource = "EPWM_SYNC_IN_PULSE_SRC_INPUTXBAR_OUT5";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
|
||||
epwm2.$name = "myEPWM2";
|
||||
epwm2.useCase = "CUSTOM";
|
||||
epwm2.useInterfacePins = ["EPWM#A"];
|
||||
epwm2.epwmTimebase_period = 999;
|
||||
epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP";
|
||||
epwm2.epwmCounterCompare_cmpA = 10;
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwm.$assign = "EPWM2";
|
||||
epwm2.epwm.epwmaPin.$assign = "GPIO2";
|
||||
|
||||
inputxbar1.$name = "myINPUTXBAR1";
|
||||
inputxbar1.inputsUsed = ["inputxbar5Gpio"];
|
||||
inputxbar1.inputxbar5Gpio = "GPIO2";
|
||||
@@ -0,0 +1,458 @@
|
||||
//###########################################################################
|
||||
//
|
||||
// FILE: epwm_ex13_up_aq.c
|
||||
//
|
||||
// TITLE: Action Qualifier Module - Using up count.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1> EPWM Action Qualifier (epwm_up_aq)</h1>
|
||||
//!
|
||||
//! This example configures ePWM1, ePWM2, ePWM3 to produce an
|
||||
//! waveform with independent modulation on EPWMxA and
|
||||
//! EPWMxB.
|
||||
//!
|
||||
//! The compare values CMPA and CMPB are modified within the ePWM's ISR.
|
||||
//!
|
||||
//! The TB counter is in up count mode for this example.
|
||||
//!
|
||||
//! View the EPWM1A/B(GPIO0 & GPIO1), EPWM2A/B(GPIO2 & GPIO3)
|
||||
//! and EPWM3A/B(GPIO4 & GPIO5) waveforms via an oscilloscope.
|
||||
//!
|
||||
//
|
||||
//###########################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//###########################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
#define EPWM1_TIMER_TBPRD 2000 // Period register
|
||||
#define EPWM1_MAX_CMPA 1950
|
||||
#define EPWM1_MIN_CMPA 50
|
||||
#define EPWM1_MAX_CMPB 1950
|
||||
#define EPWM1_MIN_CMPB 50
|
||||
|
||||
#define EPWM2_TIMER_TBPRD 2000 // Period register
|
||||
#define EPWM2_MAX_CMPA 1950
|
||||
#define EPWM2_MIN_CMPA 50
|
||||
#define EPWM2_MAX_CMPB 1950
|
||||
#define EPWM2_MIN_CMPB 50
|
||||
|
||||
#define EPWM3_TIMER_TBPRD 2000 // Period register
|
||||
#define EPWM3_MAX_CMPA 950
|
||||
#define EPWM3_MIN_CMPA 50
|
||||
#define EPWM3_MAX_CMPB 1950
|
||||
#define EPWM3_MIN_CMPB 1050
|
||||
|
||||
#define EPWM_CMP_UP 1
|
||||
#define EPWM_CMP_DOWN 0
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
uint32_t epwmModule;
|
||||
uint16_t epwmCompADirection;
|
||||
uint16_t epwmCompBDirection;
|
||||
uint16_t epwmTimerIntCount;
|
||||
uint16_t epwmMaxCompA;
|
||||
uint16_t epwmMinCompA;
|
||||
uint16_t epwmMaxCompB;
|
||||
uint16_t epwmMinCompB;
|
||||
} epwmInfo;
|
||||
|
||||
epwmInfo epwm1Info;
|
||||
epwmInfo epwm2Info;
|
||||
epwmInfo epwm3Info;
|
||||
|
||||
volatile uint16_t compAVal, compBVal;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
void initEPWM1(void);
|
||||
void initEPWM2(void);
|
||||
void initEPWM3(void);
|
||||
__interrupt void epwm1ISR(void);
|
||||
__interrupt void epwm2ISR(void);
|
||||
__interrupt void epwm3ISR(void);
|
||||
void updateCompare(epwmInfo*);
|
||||
|
||||
//
|
||||
// Main
|
||||
//
|
||||
void main(void)
|
||||
{
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Interrupts that are used in this example are re-mapped to
|
||||
// ISR functions found within this file.
|
||||
//
|
||||
Interrupt_register(INT_EPWM1, &epwm1ISR);
|
||||
Interrupt_register(INT_EPWM2, &epwm2ISR);
|
||||
Interrupt_register(INT_EPWM3, &epwm3ISR);
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well)
|
||||
//
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure GPIO pins and EPWM Modules
|
||||
//
|
||||
Board_init();
|
||||
|
||||
initEPWM1();
|
||||
initEPWM2();
|
||||
initEPWM3();
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable interrupts required for this example
|
||||
//
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
Interrupt_enable(INT_EPWM2);
|
||||
Interrupt_enable(INT_EPWM3);
|
||||
|
||||
//
|
||||
// Enable global Interrupts and higher priority real-time debug events:
|
||||
//
|
||||
EINT; // Enable Global interrupt INTM
|
||||
ERTM; // Enable Global realtime interrupt DBGM
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
asm (" NOP");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// epwm1ISR - EPWM1 ISR to update compare values
|
||||
//
|
||||
__interrupt void epwm1ISR(void)
|
||||
{
|
||||
//
|
||||
// Update the CMPA and CMPB values
|
||||
//
|
||||
updateCompare(&epwm1Info);
|
||||
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM1_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 3
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
//
|
||||
// epwm2ISR - EPWM2 ISR to update compare values
|
||||
//
|
||||
__interrupt void epwm2ISR(void)
|
||||
{
|
||||
//
|
||||
// Update the CMPA and CMPB values
|
||||
//
|
||||
updateCompare(&epwm2Info);
|
||||
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM2_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 3
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
//
|
||||
// epwm3ISR - EPWM3 ISR to update compare values
|
||||
//
|
||||
__interrupt void epwm3ISR(void)
|
||||
{
|
||||
//
|
||||
// Update the CMPA and CMPB values
|
||||
//
|
||||
updateCompare(&epwm3Info);
|
||||
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM3_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 3
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
//
|
||||
// initEPWM1 Information
|
||||
//
|
||||
void initEPWM1()
|
||||
{
|
||||
//
|
||||
// Information this example uses to keep track
|
||||
// of the direction the CMPA/CMPB values are
|
||||
// moving, the min and max allowed values and
|
||||
// a pointer to the correct ePWM registers
|
||||
//
|
||||
|
||||
// Start by increasing CMPA & CMPB
|
||||
epwm1Info.epwmCompADirection = EPWM_CMP_UP;
|
||||
epwm1Info.epwmCompBDirection = EPWM_CMP_UP;
|
||||
|
||||
// Clear interrupt counter
|
||||
epwm1Info.epwmTimerIntCount = 0;
|
||||
|
||||
// Set base as ePWM1
|
||||
epwm1Info.epwmModule = myEPWM1_BASE;
|
||||
|
||||
// Setup min/max CMPA/CMP values
|
||||
epwm1Info.epwmMaxCompA = EPWM1_MAX_CMPA;
|
||||
epwm1Info.epwmMinCompA = EPWM1_MIN_CMPA;
|
||||
epwm1Info.epwmMaxCompB = EPWM1_MAX_CMPB;
|
||||
epwm1Info.epwmMinCompB = EPWM1_MIN_CMPB;
|
||||
}
|
||||
|
||||
//
|
||||
// initEPWM2 Information
|
||||
//
|
||||
void initEPWM2()
|
||||
{
|
||||
//
|
||||
// Information this example uses to keep track
|
||||
// of the direction the CMPA/CMPB values are
|
||||
// moving, the min and max allowed values and
|
||||
// a pointer to the correct ePWM registers
|
||||
//
|
||||
|
||||
// Start by increasing CMPA & decreasing CMPB
|
||||
epwm2Info.epwmCompADirection = EPWM_CMP_UP;
|
||||
epwm2Info.epwmCompBDirection = EPWM_CMP_DOWN;
|
||||
|
||||
// Clear interrupt counter
|
||||
epwm2Info.epwmTimerIntCount = 0;
|
||||
|
||||
// Set base as ePWM2
|
||||
epwm2Info.epwmModule = myEPWM2_BASE;
|
||||
|
||||
// Setup min/max CMPA/CMP values
|
||||
epwm2Info.epwmMaxCompA = EPWM2_MAX_CMPA;
|
||||
epwm2Info.epwmMinCompA = EPWM2_MIN_CMPA;
|
||||
epwm2Info.epwmMaxCompB = EPWM2_MAX_CMPB;
|
||||
epwm2Info.epwmMinCompB = EPWM2_MIN_CMPB;
|
||||
}
|
||||
|
||||
//
|
||||
// initEPWM3 Information
|
||||
//
|
||||
void initEPWM3(void)
|
||||
{
|
||||
//
|
||||
// Information this example uses to keep track
|
||||
// of the direction the CMPA/CMPB values are
|
||||
// moving, the min and max allowed values and
|
||||
// a pointer to the correct ePWM registers
|
||||
//
|
||||
|
||||
// Start by increasing CMPA & decreasing CMPB
|
||||
epwm3Info.epwmCompADirection = EPWM_CMP_UP;
|
||||
epwm3Info.epwmCompBDirection = EPWM_CMP_DOWN;
|
||||
|
||||
// Start the count at 0
|
||||
epwm3Info.epwmTimerIntCount = 0;
|
||||
|
||||
// Set base as ePWM3
|
||||
epwm3Info.epwmModule = myEPWM3_BASE;
|
||||
|
||||
// Setup min/max CMPA/CMP values
|
||||
epwm3Info.epwmMaxCompA = EPWM3_MAX_CMPA;
|
||||
epwm3Info.epwmMinCompA = EPWM3_MIN_CMPA;
|
||||
epwm3Info.epwmMaxCompB = EPWM3_MAX_CMPB;
|
||||
epwm3Info.epwmMinCompB = EPWM3_MIN_CMPB;
|
||||
}
|
||||
|
||||
//
|
||||
// updateCompare - Update the compare values for the specified EPWM
|
||||
//
|
||||
void updateCompare(epwmInfo *epwm_info)
|
||||
{
|
||||
//
|
||||
// Every 10'th interrupt, change the CMPA/CMPB values
|
||||
//
|
||||
if(epwm_info->epwmTimerIntCount == 10)
|
||||
{
|
||||
epwm_info->epwmTimerIntCount = 0;
|
||||
compAVal = EPWM_getCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A);
|
||||
compBVal = EPWM_getCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B);
|
||||
|
||||
//
|
||||
// If we were increasing CMPA, check to see if
|
||||
// we reached the max value. If not, increase CMPA
|
||||
// else, change directions and decrease CMPA
|
||||
//
|
||||
if(epwm_info->epwmCompADirection == EPWM_CMP_UP)
|
||||
{
|
||||
if(compAVal < epwm_info->epwmMaxCompA)
|
||||
{
|
||||
EPWM_setCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A, ++compAVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
epwm_info->epwmCompADirection = EPWM_CMP_DOWN;
|
||||
EPWM_setCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A, --compAVal);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// If we were decreasing CMPA, check to see if
|
||||
// we reached the min value. If not, decrease CMPA
|
||||
// else, change directions and increase CMPA
|
||||
//
|
||||
else
|
||||
{
|
||||
if(compAVal == epwm_info->epwmMinCompA)
|
||||
{
|
||||
epwm_info->epwmCompADirection = EPWM_CMP_UP;
|
||||
EPWM_setCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A, ++compAVal);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
EPWM_setCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A, --compAVal);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// If we were increasing CMPB, check to see if
|
||||
// we reached the max value. If not, increase CMPB
|
||||
// else, change directions and decrease CMPB
|
||||
//
|
||||
if(epwm_info->epwmCompBDirection == EPWM_CMP_UP)
|
||||
{
|
||||
if(compBVal < epwm_info->epwmMaxCompB)
|
||||
{
|
||||
EPWM_setCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B, ++compBVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
epwm_info->epwmCompBDirection = EPWM_CMP_DOWN;
|
||||
EPWM_setCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B, --compBVal);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// If we were decreasing CMPB, check to see if
|
||||
// we reached the min value. If not, decrease CMPB
|
||||
// else, change directions and increase CMPB
|
||||
//
|
||||
else
|
||||
{
|
||||
if(compBVal == epwm_info->epwmMinCompB)
|
||||
{
|
||||
epwm_info->epwmCompBDirection = EPWM_CMP_UP;
|
||||
EPWM_setCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B, ++compBVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
EPWM_setCounterCompareValue(epwm_info->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B, --compBVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Increment interrupt count if < 10
|
||||
//
|
||||
else
|
||||
{
|
||||
epwm_info->epwmTimerIntCount++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
//
|
||||
// End of file
|
||||
//
|
||||
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const epwm2 = epwm.addInstance();
|
||||
const epwm3 = epwm.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP";
|
||||
epwm1.epwmTimebase_period = 2000;
|
||||
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_2";
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_2";
|
||||
epwm1.epwmCounterCompare_cmpA = 50;
|
||||
epwm1.epwmCounterCompare_cmpB = 50;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm1.epwmEventTrigger_interruptEventCount = "3";
|
||||
epwm1.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
|
||||
epwm2.$name = "myEPWM2";
|
||||
epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP";
|
||||
epwm2.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_2";
|
||||
epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_2";
|
||||
epwm2.epwmTimebase_period = 2000;
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_PERIOD = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_PERIOD = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm2.epwmEventTrigger_interruptEventCount = "3";
|
||||
epwm2.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm2.epwmCounterCompare_cmpA = 50;
|
||||
epwm2.epwmCounterCompare_cmpB = 1950;
|
||||
epwm2.epwm.$assign = "EPWM2";
|
||||
epwm2.epwm.epwmaPin.$assign = "GPIO2";
|
||||
epwm2.epwm.epwmbPin.$assign = "GPIO3";
|
||||
|
||||
epwm3.$name = "myEPWM3";
|
||||
epwm3.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP";
|
||||
epwm3.epwmTimebase_period = 2000;
|
||||
epwm3.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm3.epwmCounterCompare_cmpA = 50;
|
||||
epwm3.epwmCounterCompare_cmpB = 1950;
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_TOGGLE";
|
||||
epwm3.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm3.epwmEventTrigger_interruptEventCount = "3";
|
||||
epwm3.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm3.epwm.$assign = "EPWM3";
|
||||
epwm3.epwm.epwmaPin.$assign = "GPIO4";
|
||||
epwm3.epwm.epwmbPin.$assign = "GPIO5";
|
||||
@@ -0,0 +1,229 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex14_global_load_use_case.c
|
||||
//
|
||||
// TITLE: Use Case Example Code for EPWM Developers Guide
|
||||
//
|
||||
//
|
||||
// This example contains the solution for the use case described in the
|
||||
// C2000 ePWM Developer's Guide (www.ti.com/lit/SPRAD12).
|
||||
//
|
||||
// The use case described in the application report is the following:
|
||||
//
|
||||
// Output frequency of 400 kHz for EPWM1/2/3
|
||||
// Phase shift of 120 degrees for EPWM2 with respect to EPWM1
|
||||
// Phase shift of 240 degrees for EPWM3 with respect to EPWM1
|
||||
// Duty cycle of 45% for EPWM1/2/3
|
||||
// Active high complementary signal pairs with 200 nsec of rising/falling edge delay for EPWM1/2/3
|
||||
// Cycle-by-Cycle trip zone protection through comparator signal on EPWM2
|
||||
// One-Shot trip protection through GPIO on EPWM3
|
||||
// Interrupt generation everytime the time base counter equals zero on EPWM1
|
||||
// Global loading to support asynchronous updates of action qualifier settings
|
||||
// Link CMPA/CMPB of EPWM1 to EPWM2 and EPWM3
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
uint16_t perform_one_shot_load=0;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
__interrupt void INT_myEPWM1_ISR(void);
|
||||
__interrupt void INT_myEPWM2_TZ_ISR(void);
|
||||
__interrupt void INT_myEPWM3_TZ_ISR(void);
|
||||
|
||||
//
|
||||
// Main
|
||||
//
|
||||
void main(void)
|
||||
{
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well)
|
||||
//
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure ePWM1, ePWM2, and TZ GPIOs
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Workaround for Global Loading feature in SysConfig version 1.11 or below
|
||||
// Un-comment the following section for a SysConfig version of 1.11 or below (CCS v11 & C2000Ware version 4.01.00.00)
|
||||
//
|
||||
/*
|
||||
EPWM_setActionQualifierAction(myEPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM1_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM1_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
EPWM_setActionQualifierAction(myEPWM1_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
|
||||
|
||||
EPWM_setActionQualifierAction(myEPWM2_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM2_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM2_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
EPWM_setActionQualifierAction(myEPWM2_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
|
||||
|
||||
EPWM_setActionQualifierAction(myEPWM3_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM3_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM3_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
EPWM_setActionQualifierAction(myEPWM3_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
|
||||
|
||||
|
||||
// EPWM1, EPWM2, EPWM3 are linked so this will update both
|
||||
EPWM_setGlobalLoadOneShotLatch(myEPWM1_BASE);
|
||||
*/
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
|
||||
if(perform_one_shot_load==1)
|
||||
{
|
||||
//
|
||||
// EPWM1, EPWM2, EPWM3 are linked so only EPWM1 needs to be updated
|
||||
//
|
||||
EPWM_setCounterCompareValue(myEPWM1_BASE, EPWM_COUNTER_COMPARE_A, 100);
|
||||
EPWM_setCounterCompareValue(myEPWM1_BASE, EPWM_COUNTER_COMPARE_B, 100);
|
||||
|
||||
//
|
||||
// Change the Action Qualifier Settings for EPWM1, EPWM2, and EPWM3
|
||||
//
|
||||
EPWM_setActionQualifierAction(myEPWM1_BASE,EPWM_AQ_OUTPUT_A,EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM1_BASE,EPWM_AQ_OUTPUT_A,EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM2_BASE,EPWM_AQ_OUTPUT_A,EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM2_BASE,EPWM_AQ_OUTPUT_A,EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM3_BASE,EPWM_AQ_OUTPUT_A,EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(myEPWM3_BASE,EPWM_AQ_OUTPUT_A,EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
|
||||
|
||||
// EPWM1, EPWM2, EPWM3 are linked
|
||||
EPWM_setGlobalLoadOneShotLatch(myEPWM1_BASE);
|
||||
|
||||
// Clear the setting
|
||||
perform_one_shot_load = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void INT_myEPWM1_ISR(void){
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 2
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP2);
|
||||
}
|
||||
|
||||
void INT_myEPWM2_TZ_ISR(void){
|
||||
|
||||
//
|
||||
// Clear the flags
|
||||
//
|
||||
EPWM_clearTripZoneFlag(myEPWM2_BASE, (EPWM_TZ_INTERRUPT | EPWM_TZ_FLAG_CBC));
|
||||
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 2
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP2);
|
||||
}
|
||||
|
||||
void INT_myEPWM3_TZ_ISR(void){
|
||||
|
||||
//
|
||||
// Re-enable the OST Interrupt
|
||||
//
|
||||
EPWM_clearTripZoneFlag(myEPWM3_BASE, (EPWM_TZ_INTERRUPT | EPWM_TZ_FLAG_OST));
|
||||
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 2
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP2);
|
||||
}
|
||||
|
||||
//
|
||||
// End of File
|
||||
//
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const cmpss = scripting.addModule("/driverlib/cmpss.js", {}, false);
|
||||
const cmpss1 = cmpss.addInstance();
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js");
|
||||
const epwm1 = epwm.addInstance();
|
||||
const epwm2 = epwm.addInstance();
|
||||
const epwm3 = epwm.addInstance();
|
||||
const epwmxbar = scripting.addModule("/driverlib/epwmxbar.js", {}, false);
|
||||
const epwmxbar1 = epwmxbar.addInstance();
|
||||
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
|
||||
const gpio1 = gpio.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
const inputxbar_input = scripting.addModule("/driverlib/inputxbar_input.js");
|
||||
const inputxbar_input1 = inputxbar_input.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
cmpss1.$name = "myCMPSS1";
|
||||
cmpss1.dacValHigh = 2500;
|
||||
cmpss1.enableModule = true;
|
||||
|
||||
epwm.generateInitFunctions = true;
|
||||
|
||||
epwm1.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
epwm1.epwmDeadband_enableFED = true;
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm1.epwmTimebase_syncOutPulseMode = ["EPWM_SYNC_OUT_PULSE_ON_CNTR_ZERO"];
|
||||
epwm1.epwmDeadband_enableRED = true;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm1.epwmTimebase_period = 125;
|
||||
epwm1.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm1.epwmEventTrigger_registerInterrupts = true;
|
||||
epwm1.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm1.epwmEventTrigger_interruptEventCount = "1";
|
||||
epwm1.epwmCounterCompare_cmpAGld = true;
|
||||
epwm1.epwmCounterCompare_cmpBGld = true;
|
||||
epwm1.epwmGlobalLoad_gld = true;
|
||||
epwm1.epwmGlobalLoad_enableOneShot = true;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_gld = true;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_shadowMode = true;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_shadowMode = true;
|
||||
epwm1.epwmDeadband_delayRED = 20;
|
||||
epwm1.epwmDeadband_delayFED = 20;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_gld = true;
|
||||
epwm1.epwmCounterCompare_cmpB = 69;
|
||||
epwm1.epwmCounterCompare_cmpA = 69;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmGlobalLoad_oneShotMode = true;
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
epwm1.epwmInt.enableInterrupt = true;
|
||||
|
||||
epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm2.epwmTimebase_period = 125;
|
||||
epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
epwm2.epwmDeadband_enableRED = true;
|
||||
epwm2.epwmDeadband_enableFED = true;
|
||||
epwm2.$name = "myEPWM2";
|
||||
epwm2.copyUse = true;
|
||||
epwm2.copyFrom = "myEPWM1";
|
||||
epwm2.epwmTimebase_phaseEnable = true;
|
||||
epwm2.epwmTimebase_phaseShift = 42;
|
||||
epwm2.epwmTimebase_syncInPulseSource = "EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1";
|
||||
epwm2.epwmDigitalCompare_EPWM_DC_TYPE_DCAH = "EPWM_DC_TRIP_TRIPIN4";
|
||||
epwm2.epwmDigitalCompare_EPWM_TZ_DC_OUTPUT_A2 = "EPWM_TZ_EVENT_DCXH_HIGH";
|
||||
epwm2.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZA = "EPWM_TZ_ACTION_LOW";
|
||||
epwm2.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZB = "EPWM_TZ_ACTION_LOW";
|
||||
epwm2.epwmCounterCompare_cmpAGld = true;
|
||||
epwm2.epwmCounterCompare_cmpBGld = true;
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_gld = true;
|
||||
epwm2.epwmGlobalLoad_gld = true;
|
||||
epwm2.epwmGlobalLoad_enableOneShot = true;
|
||||
epwm2.epwmGlobalLoad_globalePWMLoadLink = "EPWM_LINK_WITH_EPWM_1";
|
||||
epwm2.epwmCounterCompare_cmpALink = "EPWM_LINK_WITH_EPWM_1";
|
||||
epwm2.epwmCounterCompare_cmpBLink = "EPWM_LINK_WITH_EPWM_1";
|
||||
epwm2.epwmGlobalLoad_oneShotForce = true;
|
||||
epwm2.epwmTripZone_tzInterruptSource = ["EPWM_TZ_INTERRUPT_CBC"];
|
||||
epwm2.epwmTripZone_registerInterrupts = true;
|
||||
epwm2.epwmCounterCompare_cmpA = 69;
|
||||
epwm2.epwmDeadband_delayRED = 20;
|
||||
epwm2.epwmDeadband_delayFED = 20;
|
||||
epwm2.epwmCounterCompare_cmpB = 69;
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmGlobalLoad_oneShotMode = true;
|
||||
epwm2.epwmTripZone_cbcSource = ["EPWM_TZ_SIGNAL_DCAEVT2"];
|
||||
epwm2.epwm.$assign = "EPWM2";
|
||||
epwm2.epwm.epwmaPin.$assign = "GPIO2";
|
||||
epwm2.epwm.epwmbPin.$assign = "GPIO3";
|
||||
epwm2.epwmTZInt.enableInterrupt = true;
|
||||
|
||||
epwm3.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm3.epwmTimebase_period = 125;
|
||||
epwm3.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm3.epwmTimebase_phaseEnable = true;
|
||||
epwm3.epwmTimebase_syncInPulseSource = "EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
epwm3.epwmDeadband_enableRED = true;
|
||||
epwm3.epwmDeadband_enableFED = true;
|
||||
epwm3.$name = "myEPWM3";
|
||||
epwm3.copyUse = true;
|
||||
epwm3.copyFrom = "myEPWM2";
|
||||
epwm3.epwmTimebase_phaseShift = 83;
|
||||
epwm3.epwmTripZone_oneShotSource = ["EPWM_TZ_SIGNAL_OSHT1"];
|
||||
epwm3.epwmTripZone_tzInterruptSource = ["EPWM_TZ_INTERRUPT_OST"];
|
||||
epwm3.epwmTripZone_registerInterrupts = true;
|
||||
epwm3.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZA = "EPWM_TZ_ACTION_LOW";
|
||||
epwm3.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZB = "EPWM_TZ_ACTION_LOW";
|
||||
epwm3.epwmCounterCompare_cmpAGld = true;
|
||||
epwm3.epwmCounterCompare_cmpALink = "EPWM_LINK_WITH_EPWM_1";
|
||||
epwm3.epwmCounterCompare_cmpBGld = true;
|
||||
epwm3.epwmCounterCompare_cmpBLink = "EPWM_LINK_WITH_EPWM_1";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_gld = true;
|
||||
epwm3.epwmGlobalLoad_gld = true;
|
||||
epwm3.epwmGlobalLoad_enableOneShot = true;
|
||||
epwm3.epwmGlobalLoad_globalePWMLoadLink = "EPWM_LINK_WITH_EPWM_1";
|
||||
epwm3.epwmGlobalLoad_oneShotForce = true;
|
||||
epwm3.epwmCounterCompare_cmpA = 69;
|
||||
epwm3.epwmDeadband_delayRED = 20;
|
||||
epwm3.epwmDeadband_delayFED = 20;
|
||||
epwm3.epwmCounterCompare_cmpB = 69;
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmGlobalLoad_oneShotMode = true;
|
||||
epwm3.epwm.$assign = "EPWM3";
|
||||
epwm3.epwm.epwmaPin.$assign = "GPIO4";
|
||||
epwm3.epwm.epwmbPin.$assign = "GPIO5";
|
||||
epwm3.epwmTZInt.enableInterrupt = true;
|
||||
|
||||
epwmxbar1.$name = "myEPWMXBAR4";
|
||||
epwmxbar1.muxesUsed = ["XBAR_MUX00"];
|
||||
|
||||
gpio1.$name = "myGPIO6";
|
||||
gpio1.writeInitialValue = true;
|
||||
gpio1.initialValue = 1;
|
||||
gpio1.gpioPin.$assign = "GPIO6";
|
||||
|
||||
inputxbar1.$name = "myINPUTXBAR1";
|
||||
|
||||
inputxbar_input1.$name = "myINPUTXBARINPUT0";
|
||||
inputxbar_input1.inputxbarGpio = "GPIO6";
|
||||
inputxbar_input1.inputxbarLock = true;
|
||||
@@ -0,0 +1,193 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex1_trip_zone.c
|
||||
//
|
||||
// TITLE: ePWM Using Trip-Zone Submodule.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>ePWM Trip Zone</h1>
|
||||
//!
|
||||
//! This example configures ePWM1 and ePWM2 as follows
|
||||
//! - ePWM1 has TZ1 as one shot trip source
|
||||
//! - ePWM2 has TZ1 as cycle by cycle trip source
|
||||
//!
|
||||
//! Initially tie TZ1 high. During the test, monitor ePWM1 or ePWM2
|
||||
//! outputs on a scope. Pull TZ1 low to see the effect.
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - ePWM1A is on GPIO0
|
||||
//! - ePWM2A is on GPIO2
|
||||
//! - TZ1 is on GPIO12
|
||||
//!
|
||||
//! This example also makes use of the Input X-BAR. GPIO12 (the external
|
||||
//! trigger) is routed to the input X-BAR, from which it is routed to TZ1.
|
||||
//!
|
||||
//! The TZ-Event is defined such that ePWM1A will undergo a One-Shot Trip
|
||||
//! and ePWM2A will undergo a Cycle-By-Cycle Trip.
|
||||
//!
|
||||
// _____________ __________________
|
||||
// | | | |
|
||||
// GPIO12 -----| I/P X-BAR |-----TZ1-----| ePWM TZ Module |-----TZ-Event
|
||||
// |___________| |________________|
|
||||
//
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
uint32_t epwm1TZIntCount;
|
||||
uint32_t epwm2TZIntCount;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
__interrupt void epwm1TZISR(void);
|
||||
__interrupt void epwm2TZISR(void);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
//
|
||||
// Initialize global variables
|
||||
//
|
||||
epwm1TZIntCount = 0U;
|
||||
epwm2TZIntCount = 0U;
|
||||
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well)
|
||||
//
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure ePWM1, ePWM2, and TZ GPIOs/Modules
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// epwm1TZISR - ePWM1 TZ ISR
|
||||
//
|
||||
__interrupt void epwm1TZISR(void)
|
||||
{
|
||||
epwm1TZIntCount++;
|
||||
|
||||
//
|
||||
// To re-enable the OST Interrupt, uncomment the below code:
|
||||
//
|
||||
// EPWM_clearTripZoneFlag(EPWM1_BASE,
|
||||
// (EPWM_TZ_INTERRUPT | EPWM_TZ_FLAG_OST));
|
||||
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 2
|
||||
//
|
||||
Interrupt_clearACKGroup(INT_myEPWM1_TZ_INTERRUPT_ACK_GROUP);
|
||||
}
|
||||
|
||||
//
|
||||
// epwm2TZISR - ePWM2 TZ ISR
|
||||
//
|
||||
__interrupt void epwm2TZISR(void)
|
||||
{
|
||||
epwm2TZIntCount++;
|
||||
|
||||
//
|
||||
// Toggle GPIO to notify when TZ is entered
|
||||
//
|
||||
GPIO_togglePin(myGPIO11);
|
||||
|
||||
//
|
||||
// Clear the flags - we will continue to take this interrupt until the TZ
|
||||
// pin goes high.
|
||||
//
|
||||
EPWM_clearTripZoneFlag(myEPWM2_BASE, (EPWM_TZ_INTERRUPT | EPWM_TZ_FLAG_CBC));
|
||||
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 2
|
||||
//
|
||||
Interrupt_clearACKGroup(INT_myEPWM2_TZ_INTERRUPT_ACK_GROUP);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const epwm2 = epwm.addInstance();
|
||||
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
|
||||
const gpio1 = gpio.addInstance();
|
||||
const gpio2 = gpio.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.useCase = "CUSTOM";
|
||||
epwm1.useInterfacePins = ["EPWM#A"];
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_period = 12000;
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm1.epwmCounterCompare_cmpA = 6000;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmTripZone_registerInterrupts = true;
|
||||
epwm1.epwmTripZone_oneShotSource = ["EPWM_TZ_SIGNAL_OSHT1"];
|
||||
epwm1.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZA = "EPWM_TZ_ACTION_HIGH";
|
||||
epwm1.epwmTripZone_tzInterruptSource = ["EPWM_TZ_INTERRUPT_OST"];
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwmTZInt.interruptHandler = "epwm1TZISR";
|
||||
epwm1.epwmTZInt.enableInterrupt = true;
|
||||
|
||||
epwm2.useCase = "CUSTOM";
|
||||
epwm2.useInterfacePins = ["EPWM#A"];
|
||||
epwm2.$name = "myEPWM2";
|
||||
epwm2.epwmTimebase_period = 6000;
|
||||
epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm2.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm2.epwmCounterCompare_cmpA = 3000;
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmTripZone_registerInterrupts = true;
|
||||
epwm2.epwmTripZone_cbcSource = ["EPWM_TZ_SIGNAL_CBC1"];
|
||||
epwm2.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZA = "EPWM_TZ_ACTION_HIGH";
|
||||
epwm2.epwmTripZone_tzInterruptSource = ["EPWM_TZ_INTERRUPT_CBC"];
|
||||
epwm2.epwm.$assign = "EPWM2";
|
||||
epwm2.epwm.epwmaPin.$assign = "GPIO2";
|
||||
epwm2.epwmTZInt.interruptHandler = "epwm2TZISR";
|
||||
epwm2.epwmTZInt.enableInterrupt = true;
|
||||
|
||||
|
||||
gpio1.$name = "myGPIO12";
|
||||
gpio1.qualMode = "GPIO_QUAL_ASYNC";
|
||||
gpio1.padConfig = "PULLUP";
|
||||
gpio1.gpioPin.$assign = "GPIO12";
|
||||
|
||||
gpio2.$name = "myGPIO11";
|
||||
gpio2.direction = "GPIO_DIR_MODE_OUT";
|
||||
gpio2.qualMode = "GPIO_QUAL_ASYNC";
|
||||
gpio2.gpioPin.$assign = "GPIO11";
|
||||
|
||||
inputxbar1.$name = "myINPUTXBAR1";
|
||||
inputxbar1.inputsUsed = ["inputxbar1Gpio"];
|
||||
inputxbar1.inputxbar1Gpio = "GPIO12";
|
||||
|
||||
|
||||
@@ -0,0 +1,433 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex2_updown_aq.c
|
||||
//
|
||||
// TITLE: ePWM Action Qualifier Module - Using up/down count.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1> ePWM Up Down Count Action Qualifier</h1>
|
||||
//!
|
||||
//! This example configures ePWM1, ePWM2, ePWM3 to produce a waveform with
|
||||
//! independent modulation on ePWMxA and ePWMxB.
|
||||
//!
|
||||
//! The compare values CMPA and CMPB are modified within the ePWM's ISR.
|
||||
//!
|
||||
//! The TB counter is in up/down count mode for this example.
|
||||
//!
|
||||
//! View the ePWM1A/B(GPIO0 & GPIO1), ePWM2A/B(GPIO2 &GPIO3)
|
||||
//! and ePWM3A/B(GPIO4 & GPIO5) waveforms on oscilloscope.
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
#define EPWM1_TIMER_TBPRD 2000U
|
||||
#define EPWM1_MAX_CMPA 1950U
|
||||
#define EPWM1_MIN_CMPA 50U
|
||||
#define EPWM1_MAX_CMPB 1950U
|
||||
#define EPWM1_MIN_CMPB 50U
|
||||
|
||||
#define EPWM2_TIMER_TBPRD 2000U
|
||||
#define EPWM2_MAX_CMPA 1950U
|
||||
#define EPWM2_MIN_CMPA 50U
|
||||
#define EPWM2_MAX_CMPB 1950U
|
||||
#define EPWM2_MIN_CMPB 50U
|
||||
|
||||
#define EPWM3_TIMER_TBPRD 2000U
|
||||
#define EPWM3_MAX_CMPA 950U
|
||||
#define EPWM3_MIN_CMPA 50U
|
||||
#define EPWM3_MAX_CMPB 1950U
|
||||
#define EPWM3_MIN_CMPB 1050U
|
||||
|
||||
#define EPWM_CMP_UP 1U
|
||||
#define EPWM_CMP_DOWN 0U
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
uint32_t epwmModule;
|
||||
uint16_t epwmCompADirection;
|
||||
uint16_t epwmCompBDirection;
|
||||
uint16_t epwmTimerIntCount;
|
||||
uint16_t epwmMaxCompA;
|
||||
uint16_t epwmMinCompA;
|
||||
uint16_t epwmMaxCompB;
|
||||
uint16_t epwmMinCompB;
|
||||
}epwmInformation;
|
||||
|
||||
//
|
||||
// Globals to hold the ePWM information used in this example
|
||||
//
|
||||
epwmInformation epwm1Info;
|
||||
epwmInformation epwm2Info;
|
||||
epwmInformation epwm3Info;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
void initEPWM1(void);
|
||||
void initEPWM2(void);
|
||||
void initEPWM3(void);
|
||||
__interrupt void epwm1ISR(void);
|
||||
__interrupt void epwm2ISR(void);
|
||||
__interrupt void epwm3ISR(void);
|
||||
void updateCompare(epwmInformation *epwmInfo);
|
||||
|
||||
//
|
||||
// Main
|
||||
//
|
||||
void main(void)
|
||||
{
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Assign the interrupt service routines to ePWM interrupts
|
||||
//
|
||||
Interrupt_register(INT_EPWM1, &epwm1ISR);
|
||||
Interrupt_register(INT_EPWM2, &epwm2ISR);
|
||||
Interrupt_register(INT_EPWM3, &epwm3ISR);
|
||||
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well)
|
||||
//
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure GPIO0/1 , GPIO2/3 and GPIO4/5 as ePWM1A/1B, ePWM2A/2B and
|
||||
// ePWM3A/3B pins respectively
|
||||
// Configure EPWM Modules
|
||||
//
|
||||
Board_init();
|
||||
|
||||
initEPWM1();
|
||||
initEPWM2();
|
||||
initEPWM3();
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable ePWM interrupts
|
||||
//
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
Interrupt_enable(INT_EPWM2);
|
||||
Interrupt_enable(INT_EPWM3);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// epwm1ISR - ePWM 1 ISR
|
||||
//
|
||||
__interrupt void epwm1ISR(void)
|
||||
{
|
||||
//
|
||||
// Update the CMPA and CMPB values
|
||||
//
|
||||
updateCompare(&epwm1Info);
|
||||
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM1_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
//
|
||||
// epwm2ISR - ePWM 2 ISR
|
||||
//
|
||||
__interrupt void epwm2ISR(void)
|
||||
{
|
||||
//
|
||||
// Update the CMPA and CMPB values
|
||||
//
|
||||
updateCompare(&epwm2Info);
|
||||
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM2_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
//
|
||||
// epwm3ISR - ePWM 3 ISR
|
||||
//
|
||||
__interrupt void epwm3ISR(void)
|
||||
{
|
||||
//
|
||||
// Update the CMPA and CMPB values
|
||||
//
|
||||
updateCompare(&epwm3Info);
|
||||
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM3_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
//
|
||||
// initEPWM1 - Configure ePWM1
|
||||
//
|
||||
void initEPWM1()
|
||||
{
|
||||
//
|
||||
// Information this example uses to keep track of the direction the
|
||||
// CMPA/CMPB values are moving, the min and max allowed values and
|
||||
// a pointer to the correct ePWM registers
|
||||
//
|
||||
epwm1Info.epwmCompADirection = EPWM_CMP_UP;
|
||||
epwm1Info.epwmCompBDirection = EPWM_CMP_DOWN;
|
||||
epwm1Info.epwmTimerIntCount = 0U;
|
||||
epwm1Info.epwmModule = myEPWM1_BASE;
|
||||
epwm1Info.epwmMaxCompA = EPWM1_MAX_CMPA;
|
||||
epwm1Info.epwmMinCompA = EPWM1_MIN_CMPA;
|
||||
epwm1Info.epwmMaxCompB = EPWM1_MAX_CMPB;
|
||||
epwm1Info.epwmMinCompB = EPWM1_MIN_CMPB;
|
||||
}
|
||||
|
||||
//
|
||||
// initEPWM2 - Configure ePWM2
|
||||
//
|
||||
void initEPWM2()
|
||||
{
|
||||
//
|
||||
// Information this example uses to keep track of the direction the
|
||||
// CMPA/CMPB values are moving, the min and max allowed values and
|
||||
// a pointer to the correct ePWM registers
|
||||
//
|
||||
epwm2Info.epwmCompADirection = EPWM_CMP_UP;
|
||||
epwm2Info.epwmCompBDirection = EPWM_CMP_UP;
|
||||
epwm2Info.epwmTimerIntCount = 0U;
|
||||
epwm2Info.epwmModule = myEPWM2_BASE;
|
||||
epwm2Info.epwmMaxCompA = EPWM2_MAX_CMPA;
|
||||
epwm2Info.epwmMinCompA = EPWM2_MIN_CMPA;
|
||||
epwm2Info.epwmMaxCompB = EPWM2_MAX_CMPB;
|
||||
epwm2Info.epwmMinCompB = EPWM2_MIN_CMPB;
|
||||
}
|
||||
|
||||
//
|
||||
// initEPWM3 - Configure ePWM3
|
||||
//
|
||||
void initEPWM3(void)
|
||||
{
|
||||
//
|
||||
// Information this example uses to keep track of the direction the
|
||||
// CMPA/CMPB values are moving, the min and max allowed values and
|
||||
// a pointer to the correct ePWM registers
|
||||
//
|
||||
epwm3Info.epwmCompADirection = EPWM_CMP_UP;
|
||||
epwm3Info.epwmCompBDirection = EPWM_CMP_DOWN;
|
||||
epwm3Info.epwmTimerIntCount = 0U;
|
||||
epwm3Info.epwmModule = myEPWM3_BASE;
|
||||
epwm3Info.epwmMaxCompA = EPWM3_MAX_CMPA;
|
||||
epwm3Info.epwmMinCompA = EPWM3_MIN_CMPA;
|
||||
epwm3Info.epwmMaxCompB = EPWM3_MAX_CMPB;
|
||||
epwm3Info.epwmMinCompB = EPWM3_MIN_CMPB;
|
||||
}
|
||||
|
||||
//
|
||||
// updateCompare - Function to update the frequency
|
||||
//
|
||||
void updateCompare(epwmInformation *epwmInfo)
|
||||
{
|
||||
uint16_t compAValue;
|
||||
uint16_t compBValue;
|
||||
|
||||
compAValue = EPWM_getCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A);
|
||||
|
||||
compBValue = EPWM_getCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B);
|
||||
|
||||
//
|
||||
// Change the CMPA/CMPB values every 10th interrupt.
|
||||
//
|
||||
if(epwmInfo->epwmTimerIntCount == 10U)
|
||||
{
|
||||
epwmInfo->epwmTimerIntCount = 0U;
|
||||
|
||||
//
|
||||
// If we were increasing CMPA, check to see if we reached the max
|
||||
// value. If not, increase CMPA else, change directions and decrease
|
||||
// CMPA
|
||||
//
|
||||
if(epwmInfo->epwmCompADirection == EPWM_CMP_UP)
|
||||
{
|
||||
if(compAValue < (epwmInfo->epwmMaxCompA))
|
||||
{
|
||||
EPWM_setCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
++compAValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
epwmInfo->epwmCompADirection = EPWM_CMP_DOWN;
|
||||
EPWM_setCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
--compAValue);
|
||||
}
|
||||
}
|
||||
//
|
||||
// If we were decreasing CMPA, check to see if we reached the min
|
||||
// value. If not, decrease CMPA else, change directions and increase
|
||||
// CMPA
|
||||
//
|
||||
else
|
||||
{
|
||||
if( compAValue == (epwmInfo->epwmMinCompA))
|
||||
{
|
||||
epwmInfo->epwmCompADirection = EPWM_CMP_UP;
|
||||
EPWM_setCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
++compAValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
EPWM_setCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
--compAValue);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// If we were increasing CMPB, check to see if we reached the max
|
||||
// value. If not, increase CMPB else, change directions and decrease
|
||||
// CMPB
|
||||
//
|
||||
if(epwmInfo->epwmCompBDirection == EPWM_CMP_UP)
|
||||
{
|
||||
if(compBValue < (epwmInfo->epwmMaxCompB))
|
||||
{
|
||||
EPWM_setCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
++compBValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
epwmInfo->epwmCompBDirection = EPWM_CMP_DOWN;
|
||||
EPWM_setCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
--compBValue);
|
||||
}
|
||||
}
|
||||
//
|
||||
// If we were decreasing CMPB, check to see if we reached the min
|
||||
// value. If not, decrease CMPB else, change directions and increase
|
||||
// CMPB
|
||||
//
|
||||
else
|
||||
{
|
||||
if(compBValue == (epwmInfo->epwmMinCompB))
|
||||
{
|
||||
epwmInfo->epwmCompBDirection = EPWM_CMP_UP;
|
||||
EPWM_setCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
++compBValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
EPWM_setCounterCompareValue(epwmInfo->epwmModule,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
--compBValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
epwmInfo->epwmTimerIntCount++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const epwm2 = epwm.addInstance();
|
||||
const epwm3 = epwm.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_period = 2000;
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm1.epwmCounterCompare_cmpA = 50;
|
||||
epwm1.epwmCounterCompare_cmpB = 1950;
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm1.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm1.epwmEventTrigger_interruptEventCount = "3";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
|
||||
epwm2.$name = "myEPWM2";
|
||||
epwm2.epwmTimebase_period = 2000;
|
||||
epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm2.epwmCounterCompare_cmpA = 50;
|
||||
epwm2.epwmCounterCompare_cmpB = 50;
|
||||
epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_PERIOD = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwm.$assign = "EPWM2";
|
||||
epwm2.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm2.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm2.epwmEventTrigger_interruptEventCount = "3";
|
||||
epwm2.epwm.epwmaPin.$assign = "GPIO2";
|
||||
epwm2.epwm.epwmbPin.$assign = "GPIO3";
|
||||
|
||||
epwm3.$name = "myEPWM3";
|
||||
epwm3.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm3.epwmTimebase_period = 2000;
|
||||
epwm3.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm3.epwmCounterCompare_cmpA = 50;
|
||||
epwm3.epwmCounterCompare_cmpB = 1950;
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_PERIOD = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_PERIOD = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm3.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm3.epwmEventTrigger_interruptEventCount = "3";
|
||||
epwm3.epwm.$assign = "EPWM3";
|
||||
epwm3.epwm.epwmaPin.$assign = "GPIO4";
|
||||
epwm3.epwm.epwmbPin.$assign = "GPIO5";
|
||||
@@ -0,0 +1,222 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex3_synchronization.c
|
||||
//
|
||||
// TITLE: ePWM Using The Synch Chain and Phase Shift.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>ePWM Synchronization</h1>
|
||||
//!
|
||||
//! This example configures ePWM1, ePWM2, ePWM3 and ePWM4 as follows
|
||||
//! - ePWM1 without phase shift as sync source
|
||||
//! - ePWM2 with phase shift of 300 TBCLKs
|
||||
//! - ePWM3 with phase shift of 600 TBCLKs
|
||||
//! - ePWM4 with phase shift of 900 TBCLKs
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - GPIO0 EPWM1A
|
||||
//! - GPIO1 EPWM1B
|
||||
//! - GPIO2 EPWM2A
|
||||
//! - GPIO3 EPWM2B
|
||||
//! - GPIO4 EPWM3A
|
||||
//! - GPIO5 EPWM3B
|
||||
//! - GPIO6 EPWM4A
|
||||
//! - GPIO7 EPWM4B
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - None.
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
|
||||
__interrupt void epwm1ISR(void);
|
||||
__interrupt void epwm2ISR(void);
|
||||
__interrupt void epwm3ISR(void);
|
||||
__interrupt void epwm4ISR(void);
|
||||
|
||||
//
|
||||
// Main
|
||||
//
|
||||
void main(void)
|
||||
{
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Assign the interrupt service routines to ePWM interrupts
|
||||
//
|
||||
Interrupt_register(INT_EPWM1, &epwm1ISR);
|
||||
Interrupt_register(INT_EPWM2, &epwm2ISR);
|
||||
Interrupt_register(INT_EPWM3, &epwm3ISR);
|
||||
Interrupt_register(INT_EPWM4, &epwm4ISR);
|
||||
|
||||
|
||||
// Disable sync(Freeze clock to PWM as well). GTBCLKSYNC is applicable
|
||||
// only for multiple core devices. Uncomment the below statement if
|
||||
// applicable.
|
||||
//
|
||||
// SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_GTBCLKSYNC);
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
|
||||
// Configure GPIO0/1 , GPIO2/3 and GPIO4/5 and GPIO6/7 as
|
||||
// ePWM1A/1B, ePWM2A/2B, ePWM3A/3B, ePWM4A/4B pins respectively
|
||||
// Configure EPWM Modules
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable ePWM interrupts
|
||||
//
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
Interrupt_enable(INT_EPWM2);
|
||||
Interrupt_enable(INT_EPWM3);
|
||||
Interrupt_enable(INT_EPWM4);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// epwm1ISR - ePWM 1 ISR
|
||||
//
|
||||
__interrupt void epwm1ISR(void)
|
||||
{
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM1_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
//
|
||||
// epwm2ISR - ePWM 2 ISR
|
||||
//
|
||||
__interrupt void epwm2ISR(void)
|
||||
{
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM2_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
//
|
||||
// epwm3ISR - ePWM 3 ISR
|
||||
//
|
||||
__interrupt void epwm3ISR(void)
|
||||
{
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM3_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
//
|
||||
// epwm4ISR - ePWM 4 ISR
|
||||
//
|
||||
__interrupt void epwm4ISR(void)
|
||||
{
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM4_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const epwm2 = epwm.addInstance();
|
||||
const epwm3 = epwm.addInstance();
|
||||
const epwm4 = epwm.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
const sync = scripting.addModule("/driverlib/sync.js");
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_period = 2000;
|
||||
epwm1.epwmCounterCompare_cmpA = 1000;
|
||||
epwm1.epwmCounterCompare_cmpB = 500;
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP";
|
||||
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_8";
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm2.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm1.epwmEventTrigger_interruptEventCount = "1";
|
||||
epwm1.epwmTimebase_syncOutPulseMode = ["EPWM_SYNC_OUT_PULSE_ON_CNTR_ZERO"];
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
|
||||
epwm2.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_8";
|
||||
epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm2.epwmTimebase_period = 2000;
|
||||
epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP";
|
||||
epwm2.epwmCounterCompare_cmpA = 1000;
|
||||
epwm2.epwmCounterCompare_cmpB = 500;
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm2.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm2.epwmEventTrigger_interruptEventCount = "1";
|
||||
epwm2.$name = "myEPWM2";
|
||||
epwm2.copyUse = true;
|
||||
epwm2.copyFrom = "myEPWM1";
|
||||
epwm2.epwmTimebase_periodLoadEvent = "EPWM_SHADOW_LOAD_MODE_SYNC";
|
||||
epwm2.epwmTimebase_phaseEnable = true;
|
||||
epwm2.epwmTimebase_phaseShift = 300;
|
||||
epwm2.epwmTimebase_syncInPulseSource = "EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1";
|
||||
epwm2.epwm.$assign = "EPWM2";
|
||||
epwm2.epwm.epwmaPin.$assign = "GPIO2";
|
||||
epwm2.epwm.epwmbPin.$assign = "GPIO3";
|
||||
|
||||
epwm3.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_8";
|
||||
epwm3.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm3.epwmTimebase_period = 2000;
|
||||
epwm3.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP";
|
||||
epwm3.epwmCounterCompare_cmpA = 1000;
|
||||
epwm3.epwmCounterCompare_cmpB = 500;
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm2.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm3.epwmEventTrigger_interruptEventCount = "1";
|
||||
epwm3.$name = "myEPWM3";
|
||||
epwm3.copyUse = true;
|
||||
epwm3.copyFrom = "myEPWM2";
|
||||
epwm3.epwmTimebase_periodLoadEvent = "EPWM_SHADOW_LOAD_MODE_SYNC";
|
||||
epwm3.epwmTimebase_phaseEnable = true;
|
||||
epwm3.epwmTimebase_phaseShift = 600;
|
||||
epwm3.epwmTimebase_syncInPulseSource = "EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1";
|
||||
epwm3.epwm.$assign = "EPWM3";
|
||||
epwm3.epwm.epwmaPin.$assign = "GPIO4";
|
||||
epwm3.epwm.epwmbPin.$assign = "GPIO5";
|
||||
|
||||
epwm4.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_8";
|
||||
epwm4.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1";
|
||||
epwm4.epwmTimebase_period = 2000;
|
||||
epwm4.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP";
|
||||
epwm4.epwmCounterCompare_cmpA = 1000;
|
||||
epwm4.epwmCounterCompare_cmpB = 500;
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm4.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm2.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm4.epwmEventTrigger_interruptEventCount = "1";
|
||||
epwm4.$name = "myEPWM4";
|
||||
epwm4.copyUse = true;
|
||||
epwm4.copyFrom = "myEPWM3";
|
||||
epwm4.epwmTimebase_phaseEnable = true;
|
||||
epwm4.epwmTimebase_phaseShift = 900;
|
||||
epwm4.epwmTimebase_syncInPulseSource = "EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1";
|
||||
epwm4.epwm.$assign = "EPWM4";
|
||||
epwm4.epwm.epwmaPin.$assign = "GPIO6";
|
||||
epwm4.epwm.epwmbPin.$assign = "GPIO7";
|
||||
|
||||
|
||||
inputxbar1.$name = "myINPUTXBAR5";
|
||||
inputxbar1.inputsUsed = ["inputxbar5Gpio","inputxbar6Gpio"];
|
||||
inputxbar1.inputxbar5Gpio = "GPIO56";
|
||||
inputxbar1.inputxbar6Gpio = "GPIO56";
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex4_digital_compare.c
|
||||
//
|
||||
// TITLE: ePWM Using Digital Compare Submodule.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>ePWM Digital Compare</h1>
|
||||
//!
|
||||
//! This example configures ePWM1 as follows
|
||||
//! - ePWM1 with DCAEVT1 forcing the ePWM output LOW
|
||||
//! - GPIO25 is used as the input to the INPUT XBAR INPUT1
|
||||
//! - INPUT1 (from INPUT XBAR) is used as the source for DCAEVT1
|
||||
//! - GPIO25's PULL-UP resistor is enabled, in order to test the trip, PULL
|
||||
//! this pin to GND
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - GPIO0 EPWM1A
|
||||
//! - GPIO1 EPWM1B
|
||||
//! - GPIO25 TZ1, pull this pin low to trip the ePWM
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - None.
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
uint32_t epwm1TZIntCount;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
__interrupt void epwm1TZISR(void);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
//
|
||||
// Initialize global variables
|
||||
//
|
||||
epwm1TZIntCount = 0U;
|
||||
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Interrupts that are used in this example are re-mapped to ISR functions
|
||||
// found within this file.
|
||||
//
|
||||
Interrupt_register(INT_EPWM1_TZ, &epwm1TZISR);
|
||||
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well). GTBCLKSYNC is applicable
|
||||
// only for multiple core devices. Uncomment the below statement if
|
||||
// applicable.
|
||||
//
|
||||
// SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_GTBCLKSYNC);
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure ePWM1, and TZ GPIOs
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable interrupts required for this example
|
||||
//
|
||||
Interrupt_enable(INT_EPWM1_TZ);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// epwm1TZISR - ePWM1 TZ ISR
|
||||
//
|
||||
__interrupt void epwm1TZISR(void)
|
||||
{
|
||||
epwm1TZIntCount++;
|
||||
|
||||
//
|
||||
// Uncomment the below lines of code to re-enable the interrupts
|
||||
//
|
||||
//EPWM_clearTripZoneFlag(EPWM1_BASE, EPWM_TZ_INTERRUPT | EPWM_TZ_FLAG_DCAEVT1);
|
||||
|
||||
//
|
||||
// Uncomment the below lines of code to re-enable
|
||||
// the interrupts and the ePWM output if using one-shot
|
||||
//
|
||||
//EPWM_clearTripZoneFlag(EPWM1_BASE, EPWM_TZ_FLAG_OST | EPWM_TZ_INTERRUPT | EPWM_TZ_FLAG_DCAEVT1);
|
||||
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 2
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP2);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
|
||||
const gpio1 = gpio.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.useInterfacePins = ["EPWM#A"];
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_period = 12000;
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm1.epwmCounterCompare_cmpA = 6000;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmDigitalCompare_EPWM_TZ_DC_OUTPUT_A1 = "EPWM_TZ_EVENT_DCXH_LOW";
|
||||
epwm1.epwmDigitalCompare_EPWM_DC_MODULE_A_EPWM_DC_EVENT_1_eventSync = "EPWM_DC_EVENT_INPUT_NOT_SYNCED";
|
||||
epwm1.epwmTripZone_EPWM_TZ_ACTION_EVENT_DCAEVT1 = "EPWM_TZ_ACTION_LOW";
|
||||
epwm1.epwmTripZone_tzInterruptSource = ["EPWM_TZ_INTERRUPT_DCAEVT1"];
|
||||
epwm1.useCase = "CUSTOM";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
|
||||
gpio1.$name = "myGPIO25";
|
||||
gpio1.padConfig = "PULLUP";
|
||||
gpio1.qualMode = "GPIO_QUAL_ASYNC";
|
||||
gpio1.gpioPin.$assign = "GPIO25";
|
||||
|
||||
inputxbar1.$name = "myINPUTXBAR1";
|
||||
inputxbar1.inputsUsed = ["inputxbar1Gpio"];
|
||||
inputxbar1.inputxbar1Gpio = "GPIO25";
|
||||
|
||||
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex5_digital_compare_event_filter.c
|
||||
//
|
||||
// TITLE: ePWM Using Digital Compare Submodule with
|
||||
// Event Filter (Blanking Window).
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>ePWM Digital Compare Event Filter Blanking Window</h1>
|
||||
//!
|
||||
//! This example configures ePWM1 as follows
|
||||
//! - ePWM1 with DCAEVT1 forcing the ePWM output LOW
|
||||
//! - GPIO25 is used as the input to the INPUT XBAR INPUT1
|
||||
//! - INPUT1 (from INPUT XBAR) is used as the source for DCAEVT1
|
||||
//! - GPIO25's PULL-UP resistor is enabled, in order to test the trip, PULL
|
||||
//! this pin to GND
|
||||
//!
|
||||
//! - ePWM1 with DCBEVT1 forcing the ePWM output LOW
|
||||
//! - GPIO25 is used as the input to the INPUT XBAR INPUT1
|
||||
//! - INPUT1 (from INPUT XBAR) is used as the source for DCAEVT1
|
||||
//! - GPIO25's PULL-UP resistor is enabled, in order to test the trip, PULL
|
||||
//! this pin to GND
|
||||
//! - DCBEVT1 uses the filtered version of DCBEVT1
|
||||
//! - The DCFILT signal uses the blanking window to ignore the DCBEVT1
|
||||
//! for the duration of DC Blanking window
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - GPIO0 EPWM1A
|
||||
//! - GPIO1 EPWM1B
|
||||
//! - GPIO25 TRIPIN1, pull this pin low to trip the ePWM
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - None.
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
uint32_t epwm1TZIntCount;
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
__interrupt void epwm1TZISR(void);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
//
|
||||
// Initialize global variables
|
||||
//
|
||||
epwm1TZIntCount = 0U;
|
||||
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Interrupts that are used in this example are re-mapped to ISR functions
|
||||
// found within this file.
|
||||
//
|
||||
Interrupt_register(INT_EPWM1_TZ, &epwm1TZISR);
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well). GTBCLKSYNC is applicable
|
||||
// only for multiple core devices. Uncomment the below statement if
|
||||
// applicable.
|
||||
//
|
||||
// SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_GTBCLKSYNC);
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure ePWM1, and TZ GPIOs
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable interrupts required for this example
|
||||
//
|
||||
Interrupt_enable(INT_EPWM1_TZ);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// epwm1TZISR - ePWM1 TZ ISR
|
||||
//
|
||||
__interrupt void epwm1TZISR(void)
|
||||
{
|
||||
epwm1TZIntCount++;
|
||||
|
||||
//
|
||||
// To re-enable the Interrupts
|
||||
//
|
||||
EPWM_clearTripZoneFlag(EPWM1_BASE,
|
||||
EPWM_TZ_FLAG_DCAEVT1 | EPWM_TZ_FLAG_DCBEVT1 | EPWM_TZ_INTERRUPT);
|
||||
|
||||
//
|
||||
// Acknowledge this interrupt to receive more interrupts from group 2
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP2);
|
||||
}
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
|
||||
const gpio1 = gpio.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_period = 12000;
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm1.epwmCounterCompare_cmpA = 2000;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmDigitalCompare_EPWM_TZ_DC_OUTPUT_A1 = "EPWM_TZ_EVENT_DCXH_LOW";
|
||||
epwm1.epwmDigitalCompare_EPWM_DC_MODULE_A_EPWM_DC_EVENT_1_eventSync = "EPWM_DC_EVENT_INPUT_NOT_SYNCED";
|
||||
epwm1.epwmDigitalCompare_EPWM_TZ_DC_OUTPUT_B1 = "EPWM_TZ_EVENT_DCXH_LOW";
|
||||
epwm1.epwmDigitalCompare_dcFilterInput = "EPWM_DC_WINDOW_SOURCE_DCBEVT1";
|
||||
epwm1.epwmDigitalCompare_useBlankingWindow = true;
|
||||
epwm1.epwmDigitalCompare_blankingWindowLength = 6000;
|
||||
epwm1.epwmDigitalCompare_EPWM_DC_MODULE_B_EPWM_DC_EVENT_1_eventSource = "EPWM_DC_EVENT_SOURCE_FILT_SIGNAL";
|
||||
epwm1.epwmDigitalCompare_EPWM_DC_MODULE_B_EPWM_DC_EVENT_1_eventSync = "EPWM_DC_EVENT_INPUT_NOT_SYNCED";
|
||||
epwm1.epwmTripZone_EPWM_TZ_ACTION_EVENT_DCAEVT1 = "EPWM_TZ_ACTION_LOW";
|
||||
epwm1.epwmTripZone_EPWM_TZ_ACTION_EVENT_DCBEVT1 = "EPWM_TZ_ACTION_LOW";
|
||||
epwm1.epwmTripZone_tzInterruptSource = ["EPWM_TZ_INTERRUPT_DCAEVT1"];
|
||||
epwm1.epwmDigitalCompare_blankingWindowEvent = "EPWM_DC_WINDOW_START_TBCTR_ZERO";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
|
||||
gpio1.$name = "myGPIO25";
|
||||
gpio1.padConfig = "PULLUP";
|
||||
gpio1.qualMode = "GPIO_QUAL_ASYNC";
|
||||
gpio1.gpioPin.$assign = "GPIO25";
|
||||
|
||||
inputxbar1.$name = "myINPUTXBAR1";
|
||||
inputxbar1.inputsUsed = ["inputxbar1Gpio"];
|
||||
inputxbar1.inputxbar1Gpio = "GPIO25";
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex6_valley_switching.c
|
||||
//
|
||||
// TITLE: ePWM Using Valley Switching
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>ePWM Valley Switching</h1>
|
||||
//!
|
||||
//! This example configures ePWM1 as follows
|
||||
//! - ePWM1 with DCAEVT1 forcing the ePWM output LOW
|
||||
//! - GPIO25 is used as the input to the INPUT XBAR INPUT1
|
||||
//! - INPUT1 (from INPUT XBAR) is used as the source for DCAEVT1
|
||||
//! - GPIO25 is set to output and toggled in the main loop to trip the PWM
|
||||
//!
|
||||
//! - ePWM1 with DCBEVT1 forcing the ePWM output LOW
|
||||
//! - GPIO25 is used as the input to the INPUT XBAR INPUT1
|
||||
//! - INPUT1 (from INPUT XBAR) is used as the source for DCAEVT1
|
||||
//! - GPIO25 is set to output and toggled in the main loop to trip the PWM
|
||||
//! - DCBEVT1 uses the filtered version of DCBEVT1
|
||||
//! - The DCFILT signal uses the valley switching module to delay the
|
||||
//! - DCFILT signal by a software defined DELAY value.
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - GPIO0 EPWM1A
|
||||
//! - GPIO1 EPWM1B
|
||||
//! - GPIO25 TRIPIN1 (Output Pin, toggled through software)
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - None.
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
__interrupt void epwm1ISR(void);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Interrupts that are used in this example are re-mapped to ISR functions
|
||||
// found within this file.
|
||||
//
|
||||
Interrupt_register(INT_EPWM1, &epwm1ISR);
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well). GTBCLKSYNC is applicable
|
||||
// only for multiple core devices. Uncomment the below statement if
|
||||
// applicable.
|
||||
//
|
||||
// SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_GTBCLKSYNC);
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure ePWM1, and TZ GPIOs
|
||||
//
|
||||
Board_init();
|
||||
GPIO_writePin(myGPIO25, 1);
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable interrupts required for this example
|
||||
//
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// Delay so the PWM runs for a some time to see the Waveform on
|
||||
// scope
|
||||
//
|
||||
|
||||
SysCtl_delay(600000U);
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
//
|
||||
// PULL Trip GPIO LOW from CTR=4000 to 11000
|
||||
// PULL Trip GPIO HIGH at CTR=11000
|
||||
//
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 4000);
|
||||
GPIO_writePin(myGPIO25, 0);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 11000);
|
||||
GPIO_writePin(myGPIO25, 1);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) > 3000);
|
||||
GPIO_writePin(myGPIO25, 1);
|
||||
NOP;
|
||||
}
|
||||
}
|
||||
|
||||
interrupt void epwm1ISR(void){
|
||||
|
||||
EPWM_clearTripZoneFlag(myEPWM1_BASE, EPWM_TZ_FLAG_OST | EPWM_TZ_FLAG_DCAEVT1 | EPWM_TZ_FLAG_DCBEVT1 | EPWM_TZ_INTERRUPT);
|
||||
EPWM_clearOneShotTripZoneFlag(myEPWM1_BASE, EPWM_TZ_OST_FLAG_DCBEVT1);
|
||||
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM1_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
|
||||
const gpio1 = gpio.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_period = 12000;
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm1.epwmCounterCompare_cmpA = 2000;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm1.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm1.epwmEventTrigger_interruptEventCount = "1";
|
||||
epwm1.epwmTripZone_oneShotSource = ["EPWM_TZ_SIGNAL_DCBEVT1"];
|
||||
epwm1.epwmDigitalCompare_EPWM_TZ_DC_OUTPUT_A1 = "EPWM_TZ_EVENT_DCXH_LOW";
|
||||
epwm1.epwmDigitalCompare_EPWM_DC_MODULE_A_EPWM_DC_EVENT_1_eventSync = "EPWM_DC_EVENT_INPUT_NOT_SYNCED";
|
||||
epwm1.epwmDigitalCompare_EPWM_TZ_DC_OUTPUT_B1 = "EPWM_TZ_EVENT_DCXH_LOW";
|
||||
epwm1.epwmDigitalCompare_dcFilterInput = "EPWM_DC_WINDOW_SOURCE_DCBEVT1";
|
||||
epwm1.epwmDigitalCompare_EPWM_DC_MODULE_B_EPWM_DC_EVENT_1_eventSource = "EPWM_DC_EVENT_SOURCE_FILT_SIGNAL";
|
||||
epwm1.epwmDigitalCompare_EPWM_DC_MODULE_B_EPWM_DC_EVENT_1_eventSync = "EPWM_DC_EVENT_INPUT_NOT_SYNCED";
|
||||
epwm1.epwmDigitalCompare_useEdgeFilter = true;
|
||||
epwm1.epwmDigitalCompare_enableEdgeFilterDelay = true;
|
||||
epwm1.epwmDigitalCompare_SWVDELVAL = 3000;
|
||||
epwm1.epwmDigitalCompare_enableValleyCapture = true;
|
||||
epwm1.epwmDigitalCompare_valleyCaptureSource = "EPWM_VALLEY_TRIGGER_EVENT_CNTR_ZERO";
|
||||
epwm1.epwmTripZone_EPWM_TZ_ACTION_EVENT_DCAEVT1 = "EPWM_TZ_ACTION_LOW";
|
||||
epwm1.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZA = "EPWM_TZ_ACTION_LOW";
|
||||
epwm1.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZB = "EPWM_TZ_ACTION_LOW";
|
||||
epwm1.epwmDigitalCompare_EPWM_TZ_DC_OUTPUT_B1 = "EPWM_TZ_EVENT_DCXH_LOW";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
|
||||
gpio1.$name = "myGPIO25";
|
||||
gpio1.direction = "GPIO_DIR_MODE_OUT";
|
||||
gpio1.qualMode = "GPIO_QUAL_ASYNC";
|
||||
gpio1.gpioPin.$assign = "GPIO25";
|
||||
|
||||
inputxbar1.$name = "myINPUTXBAR1";
|
||||
inputxbar1.inputsUsed = ["inputxbar1Gpio"];
|
||||
inputxbar1.inputxbar1Gpio = "GPIO25";
|
||||
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex7_edge_filter.c
|
||||
//
|
||||
// TITLE: ePWM Using Digital Compare Submodule with
|
||||
// Edge Filter.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>ePWM Digital Compare Edge Filter</h1>
|
||||
//!
|
||||
//! This example configures ePWM1 as follows
|
||||
//! - ePWM1 with DCBEVT2 forcing the ePWM output LOW as a CBC source
|
||||
//! - GPIO25 is used as the input to the INPUT XBAR INPUT1
|
||||
//! - INPUT1 (from INPUT XBAR) is used as the source for DCBEVT2
|
||||
//! - GPIO25 is set to output and toggled in the main loop to trip the PWM
|
||||
//! - The DCBEVT2 is the source for DCFILT
|
||||
//! - The DCFILT will count edges of the DCBEVT2 and generate a signal to
|
||||
//! to trip the ePWM on the 4th edge of DCBEVT2
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - GPIO0 EPWM1A
|
||||
//! - GPIO1 EPWM1B
|
||||
//! - GPIO25 TRIPIN1 (Output Pin, toggled through software)
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - None.
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
__interrupt void epwm1ISR(void);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Interrupts that are used in this example are re-mapped to ISR functions
|
||||
// found within this file.
|
||||
//
|
||||
Interrupt_register(INT_EPWM1, &epwm1ISR);
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well). GTBCLKSYNC is applicable
|
||||
// only for multiple core devices. Uncomment the below statement if
|
||||
// applicable.
|
||||
//
|
||||
// SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_GTBCLKSYNC);
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure ePWM1, and TZ GPIOs
|
||||
//
|
||||
Board_init();
|
||||
GPIO_writePin(myGPIO25, 1);
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Enable interrupts required for this example
|
||||
//
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// Delay to let ePWM do complete uninterrupted cycles
|
||||
// This allows the user to see the PWM waveform uninterrupted
|
||||
// on the scope.
|
||||
//
|
||||
SysCtl_delay(600000U);
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
//
|
||||
// Toggle the GPIO multiple times, the trip occurs
|
||||
// on the 4th edge
|
||||
//
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 4000);
|
||||
GPIO_writePin(myGPIO25, 0);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 5000);
|
||||
GPIO_writePin(myGPIO25, 1);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 6000);
|
||||
GPIO_writePin(myGPIO25, 0);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 7000);
|
||||
GPIO_writePin(myGPIO25, 1);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 8000);
|
||||
GPIO_writePin(myGPIO25, 0);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 9000);
|
||||
GPIO_writePin(myGPIO25, 1);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 10000);
|
||||
GPIO_writePin(myGPIO25, 0);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) < 11000);
|
||||
GPIO_writePin(myGPIO25, 1);
|
||||
while(HWREGH(myEPWM1_BASE + EPWM_O_TBCTR) > 3000);
|
||||
GPIO_writePin(myGPIO25, 1);
|
||||
NOP;
|
||||
}
|
||||
}
|
||||
|
||||
interrupt void epwm1ISR(void){
|
||||
|
||||
EPWM_clearTripZoneFlag(myEPWM1_BASE, EPWM_TZ_FLAG_CBC | EPWM_TZ_FLAG_DCBEVT2 | EPWM_TZ_INTERRUPT);
|
||||
EPWM_clearCycleByCycleTripZoneFlag(myEPWM1_BASE, EPWM_TZ_CBC_FLAG_DCBEVT2);
|
||||
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM1_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const gpio = scripting.addModule("/driverlib/gpio.js", {}, false);
|
||||
const gpio1 = gpio.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_period = 12000;
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm1.epwmCounterCompare_cmpA = 2000;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmEventTrigger_enableInterrupt = true;
|
||||
epwm1.epwmEventTrigger_interruptSource = "EPWM_INT_TBCTR_ZERO";
|
||||
epwm1.epwmEventTrigger_interruptEventCount = "3";
|
||||
epwm1.epwmTripZone_cbcSource = ["EPWM_TZ_SIGNAL_DCBEVT2"];
|
||||
epwm1.epwmDigitalCompare_EPWM_TZ_DC_OUTPUT_B2 = "EPWM_TZ_EVENT_DCXH_LOW";
|
||||
epwm1.epwmDigitalCompare_dcFilterInput = "EPWM_DC_WINDOW_SOURCE_DCBEVT2";
|
||||
epwm1.epwmDigitalCompare_useEdgeFilter = true;
|
||||
epwm1.epwmDigitalCompare_edgeFilterEdgeCount = "EPWM_DC_EDGEFILT_EDGECNT_4";
|
||||
epwm1.epwmDigitalCompare_enableValleyCapture = true;
|
||||
epwm1.epwmDigitalCompare_valleyCaptureSource = "EPWM_VALLEY_TRIGGER_EVENT_CNTR_ZERO";
|
||||
epwm1.epwmDigitalCompare_EPWM_DC_MODULE_B_EPWM_DC_EVENT_2_eventSource = "EPWM_DC_EVENT_SOURCE_FILT_SIGNAL";
|
||||
epwm1.epwmDigitalCompare_EPWM_DC_MODULE_B_EPWM_DC_EVENT_2_eventSync = "EPWM_DC_EVENT_INPUT_NOT_SYNCED";
|
||||
epwm1.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZA = "EPWM_TZ_ACTION_DISABLE";
|
||||
epwm1.epwmTripZone_EPWM_TZ_ACTION_EVENT_TZB = "EPWM_TZ_ACTION_LOW";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
|
||||
gpio1.$name = "myGPIO25";
|
||||
gpio1.direction = "GPIO_DIR_MODE_OUT";
|
||||
gpio1.qualMode = "GPIO_QUAL_ASYNC";
|
||||
gpio1.gpioPin.$assign = "GPIO25";
|
||||
|
||||
inputxbar1.$name = "myINPUTXBAR1";
|
||||
inputxbar1.inputsUsed = ["inputxbar1Gpio"];
|
||||
inputxbar1.inputxbar1Gpio = "GPIO25";
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex8_deadband.c
|
||||
//
|
||||
// TITLE: ePWM Using Deadband Submodule.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>ePWM Deadband</h1>
|
||||
//!
|
||||
//! This example configures ePWM1 through ePWM6 as follows
|
||||
//! - ePWM1 with Deadband disabled (Reference)
|
||||
//! - ePWM2 with Deadband Active High
|
||||
//! - ePWM3 with Deadband Active Low
|
||||
//! - ePWM4 with Deadband Active High Complimentary
|
||||
//! - ePWM5 with Deadband Active Low Complimentary
|
||||
//! - ePWM6 with Deadband Output Swap (switch A and B outputs)
|
||||
//!
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - GPIO0 EPWM1A
|
||||
//! - GPIO1 EPWM1B
|
||||
//! - GPIO2 EPWM2A
|
||||
//! - GPIO3 EPWM2B
|
||||
//! - GPIO4 EPWM3A
|
||||
//! - GPIO5 EPWM3B
|
||||
//! - GPIO6 EPWM4A
|
||||
//! - GPIO7 EPWM4B
|
||||
//! - GPIO8 EPWM5A
|
||||
//! - GPIO9 EPWM5B
|
||||
//! - GPIO10 EPWM6A
|
||||
//! - GPIO11 EPWM6B
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - None.
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull-ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well). GTBCLKSYNC is applicable
|
||||
// only for multiple core devices. Uncomment the below statement if
|
||||
// applicable.
|
||||
//
|
||||
// SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_GTBCLKSYNC);
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
//
|
||||
// Configure ePWMs
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
for(;;)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const epwm2 = epwm.addInstance();
|
||||
const epwm3 = epwm.addInstance();
|
||||
const epwm4 = epwm.addInstance();
|
||||
const epwm5 = epwm.addInstance();
|
||||
const epwm6 = epwm.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwmTimebase_period = 2000;
|
||||
epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm1.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm1.epwmCounterCompare_cmpA = 500;
|
||||
epwm1.epwmCounterCompare_cmpB = 1500;
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
|
||||
epwm2.epwmDeadband_enableRED = true;
|
||||
epwm2.epwmDeadband_enableFED = true;
|
||||
epwm2.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm2.epwmTimebase_period = 2000;
|
||||
epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm2.epwmCounterCompare_cmpA = 500;
|
||||
epwm2.epwmCounterCompare_cmpB = 1500;
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm2.$name = "myEPWM2";
|
||||
epwm2.copyUse = true;
|
||||
epwm2.copyFrom = "myEPWM1";
|
||||
epwm2.epwmDeadband_delayRED = 400;
|
||||
epwm2.epwmDeadband_delayFED = 200;
|
||||
epwm2.epwm.$assign = "EPWM2";
|
||||
epwm2.epwm.epwmaPin.$assign = "GPIO2";
|
||||
epwm2.epwm.epwmbPin.$assign = "GPIO3";
|
||||
|
||||
epwm3.epwmDeadband_polarityRED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
epwm3.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
epwm3.epwmDeadband_enableRED = true;
|
||||
epwm3.epwmDeadband_enableFED = true;
|
||||
epwm3.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm3.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm3.epwmTimebase_period = 2000;
|
||||
epwm3.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm3.epwmCounterCompare_cmpA = 500;
|
||||
epwm3.epwmCounterCompare_cmpB = 1500;
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm3.$name = "myEPWM3";
|
||||
epwm3.copyUse = true;
|
||||
epwm3.copyFrom = "myEPWM1";
|
||||
epwm3.epwmDeadband_delayRED = 400;
|
||||
epwm3.epwmDeadband_delayFED = 200;
|
||||
epwm3.epwm.$assign = "EPWM3";
|
||||
epwm3.epwm.epwmaPin.$assign = "GPIO4";
|
||||
epwm3.epwm.epwmbPin.$assign = "GPIO5";
|
||||
|
||||
epwm4.epwmDeadband_polarityFED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
epwm4.epwmDeadband_enableRED = true;
|
||||
epwm4.epwmDeadband_enableFED = true;
|
||||
epwm4.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm4.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm4.epwmTimebase_period = 2000;
|
||||
epwm4.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm4.epwmCounterCompare_cmpA = 500;
|
||||
epwm4.epwmCounterCompare_cmpB = 1500;
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm4.$name = "myEPWM4";
|
||||
epwm4.copyUse = true;
|
||||
epwm4.copyFrom = "myEPWM1";
|
||||
epwm4.epwmDeadband_delayRED = 400;
|
||||
epwm4.epwmDeadband_delayFED = 200;
|
||||
epwm4.epwm.$assign = "EPWM4";
|
||||
epwm4.epwm.epwmaPin.$assign = "GPIO6";
|
||||
epwm4.epwm.epwmbPin.$assign = "GPIO7";
|
||||
|
||||
epwm5.epwmDeadband_polarityRED = "EPWM_DB_POLARITY_ACTIVE_LOW";
|
||||
epwm5.epwmDeadband_enableRED = true;
|
||||
epwm5.epwmDeadband_enableFED = true;
|
||||
epwm5.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm5.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm5.epwmTimebase_period = 2000;
|
||||
epwm5.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm5.epwmCounterCompare_cmpA = 500;
|
||||
epwm5.epwmCounterCompare_cmpB = 1500;
|
||||
epwm5.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm5.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm5.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm5.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm5.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm5.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm5.$name = "myEPWM5";
|
||||
epwm5.copyUse = true;
|
||||
epwm5.copyFrom = "myEPWM1";
|
||||
epwm5.epwmDeadband_delayRED = 400;
|
||||
epwm5.epwmDeadband_delayFED = 200;
|
||||
epwm5.epwm.$assign = "EPWM5";
|
||||
epwm5.epwm.epwmaPin.$assign = "GPIO8";
|
||||
epwm5.epwm.epwmbPin.$assign = "GPIO9";
|
||||
|
||||
epwm6.epwmTimebase_clockDiv = "EPWM_CLOCK_DIVIDER_4";
|
||||
epwm6.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_4";
|
||||
epwm6.epwmTimebase_period = 2000;
|
||||
epwm6.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN";
|
||||
epwm6.epwmCounterCompare_cmpA = 500;
|
||||
epwm6.epwmCounterCompare_cmpB = 1500;
|
||||
epwm6.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm6.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm6.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm6.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm6.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH";
|
||||
epwm6.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW";
|
||||
epwm6.$name = "myEPWM6";
|
||||
epwm6.copyUse = true;
|
||||
epwm6.copyFrom = "myEPWM1";
|
||||
epwm6.epwmDeadband_outputSwapOutA = true;
|
||||
epwm6.epwmDeadband_outputSwapOutB = true;
|
||||
epwm6.epwm.$assign = "EPWM6";
|
||||
epwm6.epwm.epwmaPin.$assign = "GPIO10";
|
||||
epwm6.epwm.epwmbPin.$assign = "GPIO11";
|
||||
@@ -0,0 +1,371 @@
|
||||
//#############################################################################
|
||||
//
|
||||
// FILE: epwm_ex9_dma.c
|
||||
//
|
||||
// TITLE: ePWM Using DMA.
|
||||
//
|
||||
//! \addtogroup driver_example_list
|
||||
//! <h1>ePWM DMA</h1>
|
||||
//!
|
||||
//! This example configures ePWM1 and DMA as follows:
|
||||
//! - ePWM1 is set up to generate PWM waveforms
|
||||
//! - DMA5 is set up to update the CMPAHR, CMPA, CMPBHR and CMPB every period
|
||||
//! with the next value in the configuration array. This allows the user to
|
||||
//! create a DMA enabled fifo for all the CMPx and CMPxHR registers to
|
||||
//! generate unconventional PWM waveforms.
|
||||
//! - DMA6 is set up to update the TBPHSHR, TBPHS, TBPRDHR and TBPRD every
|
||||
//! period with the next value in the configuration array.
|
||||
//! - Other registers such as AQCTL can be controlled through the DMA as well
|
||||
//! by following the same procedure. (Not used in this example)
|
||||
//!
|
||||
//! \b External \b Connections \n
|
||||
//! - GPIO0 EPWM1A
|
||||
//! - GPIO1 EPWM1B
|
||||
//!
|
||||
//! \b Watch \b Variables \n
|
||||
//! - None.
|
||||
//
|
||||
//
|
||||
//#############################################################################
|
||||
//
|
||||
//
|
||||
//
|
||||
// C2000Ware v5.04.00.00
|
||||
//
|
||||
// Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com
|
||||
//
|
||||
// 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.
|
||||
// $
|
||||
//#############################################################################
|
||||
//
|
||||
// Included Files
|
||||
//
|
||||
#include "driverlib.h"
|
||||
#include "device.h"
|
||||
#include "board.h"
|
||||
|
||||
#define EPWM_TIMER_TBPRD 20000UL
|
||||
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
#define BURST 4 // 4 words per transfer
|
||||
#define TRANSFER 4 // 4 transfers (different configs)
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
|
||||
uint16_t phasePeriodConfigs[TRANSFER*BURST] = {
|
||||
// TBPHSHR , TBPHS , TBPRDHR , TBPRD,
|
||||
9 << 8 , 17U , 13 << 8 , 2000U,
|
||||
10 << 8 , 18U , 14 << 8 , 4000U,
|
||||
11 << 8 , 19U , 15 << 8 , 6000U,
|
||||
12 << 8 , 20U , 16 << 8 , 8000U,
|
||||
};
|
||||
|
||||
uint16_t compareConfigs[TRANSFER*BURST] = {
|
||||
// CMPAHR , CMPA , CMPBHR , CMPB ,
|
||||
1 << 8 , 1001U , 5 << 8 , 1000U,
|
||||
2 << 8 , 2001U , 6 << 8 , 2000U,
|
||||
3 << 8 , 3001U , 7 << 8 , 3000U,
|
||||
4 << 8 , 4001U , 8 << 8 , 4000U,
|
||||
};
|
||||
|
||||
|
||||
// Place buffers in GSRAM
|
||||
#pragma DATA_SECTION(compareConfigs, "ramgs0");
|
||||
#pragma DATA_SECTION(phasePeriodConfigs, "ramgs0");
|
||||
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
void initDMA(void);
|
||||
void initEPWM(uint32_t base);
|
||||
|
||||
__interrupt void dmaCh5ISR(void);
|
||||
__interrupt void dmaCh6ISR(void);
|
||||
__interrupt void epwm1ISR(void);
|
||||
|
||||
//
|
||||
// Main
|
||||
//
|
||||
void main(void)
|
||||
{
|
||||
//
|
||||
// Initialize device clock and peripherals
|
||||
//
|
||||
Device_init();
|
||||
|
||||
//
|
||||
// Disable pin locks and enable internal pull ups.
|
||||
//
|
||||
Device_initGPIO();
|
||||
|
||||
//
|
||||
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
|
||||
//
|
||||
Interrupt_initModule();
|
||||
|
||||
//
|
||||
// Initialize the PIE vector table with pointers to the shell Interrupt
|
||||
// Service Routines (ISR).
|
||||
//
|
||||
Interrupt_initVectorTable();
|
||||
|
||||
//
|
||||
// Assign the interrupt service routines to ePWM interrupts
|
||||
//
|
||||
Interrupt_register(INT_EPWM1, &epwm1ISR);
|
||||
Interrupt_register(INT_DMA_CH5, &dmaCh5ISR);
|
||||
Interrupt_register(INT_DMA_CH6, &dmaCh6ISR);
|
||||
|
||||
//
|
||||
// Configure EPWM and Input X-BAR Pins
|
||||
//
|
||||
Board_init();
|
||||
|
||||
//
|
||||
// Disable sync(Freeze clock to PWM as well). GTBCLKSYNC is applicable
|
||||
// only for multiple core devices. Uncomment the below statement if
|
||||
// applicable.
|
||||
//
|
||||
// SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_GTBCLKSYNC);
|
||||
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
initDMA();
|
||||
initEPWM(myEPWM1_BASE);
|
||||
|
||||
//
|
||||
// Enable sync and clock to PWM
|
||||
//
|
||||
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
|
||||
|
||||
|
||||
// Enable ePWM interrupts
|
||||
//
|
||||
Interrupt_enable(INT_EPWM1);
|
||||
Interrupt_enable(INT_DMA_CH5);
|
||||
Interrupt_enable(INT_DMA_CH6);
|
||||
|
||||
//
|
||||
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
|
||||
//
|
||||
EINT;
|
||||
ERTM;
|
||||
|
||||
EALLOW;
|
||||
DMA_startChannel(DMA_CH5_BASE);
|
||||
DMA_startChannel(DMA_CH6_BASE);
|
||||
|
||||
//
|
||||
// IDLE loop. Just sit and loop forever (optional):
|
||||
//
|
||||
|
||||
for(;;)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// DMA setup channels.
|
||||
//
|
||||
void initDMA()
|
||||
{
|
||||
//
|
||||
// Initialize DMA
|
||||
//
|
||||
DMA_initController();
|
||||
|
||||
//
|
||||
// DMA CH5
|
||||
//
|
||||
DMA_configAddresses(DMA_CH5_BASE, (uint16_t *)(myEPWM1_BASE + EPWM_O_CMPA),
|
||||
compareConfigs);
|
||||
DMA_configBurst(DMA_CH5_BASE, BURST, 1, 1);
|
||||
DMA_configTransfer(DMA_CH5_BASE, TRANSFER, 1, 1-BURST);
|
||||
DMA_configMode(DMA_CH5_BASE, DMA_TRIGGER_EPWM1SOCA, DMA_CFG_ONESHOT_DISABLE |
|
||||
DMA_CFG_CONTINUOUS_ENABLE | DMA_CFG_SIZE_16BIT);
|
||||
|
||||
//
|
||||
// Configure DMA Ch5 interrupts
|
||||
//
|
||||
DMA_setInterruptMode(DMA_CH5_BASE, DMA_INT_AT_END);
|
||||
DMA_enableInterrupt(DMA_CH5_BASE);
|
||||
DMA_enableTrigger(DMA_CH5_BASE);
|
||||
|
||||
//
|
||||
// DMA CH6
|
||||
//
|
||||
DMA_configAddresses(DMA_CH6_BASE, (uint16_t *)(myEPWM1_BASE + EPWM_O_TBPHS),
|
||||
phasePeriodConfigs);
|
||||
DMA_configBurst(DMA_CH6_BASE, BURST, 1, 1);
|
||||
DMA_configTransfer(DMA_CH6_BASE, TRANSFER, 1, 1-BURST);
|
||||
DMA_configMode(DMA_CH6_BASE, DMA_TRIGGER_EPWM1SOCA, DMA_CFG_ONESHOT_DISABLE |
|
||||
DMA_CFG_CONTINUOUS_ENABLE | DMA_CFG_SIZE_16BIT);
|
||||
|
||||
//
|
||||
// Configure DMA Ch6 interrupts
|
||||
//
|
||||
DMA_setInterruptMode(DMA_CH6_BASE, DMA_INT_AT_END);
|
||||
DMA_enableInterrupt(DMA_CH6_BASE);
|
||||
DMA_enableTrigger(DMA_CH6_BASE);
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// DMA Channel 5 ISR
|
||||
//
|
||||
__interrupt void dmaCh5ISR(void)
|
||||
{
|
||||
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP7);
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// DMA Channel 6 ISR
|
||||
//
|
||||
__interrupt void dmaCh6ISR(void)
|
||||
{
|
||||
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP7);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// epwm1ISR - ePWM 1 ISR
|
||||
//
|
||||
__interrupt void epwm1ISR(void)
|
||||
{
|
||||
//
|
||||
// Un-comment below to check the status of each register after CTR=0
|
||||
//
|
||||
// ESTOP0;
|
||||
|
||||
//
|
||||
// Clear INT flag for this timer
|
||||
//
|
||||
EPWM_clearEventTriggerInterruptFlag(myEPWM1_BASE);
|
||||
|
||||
//
|
||||
// Acknowledge interrupt group
|
||||
//
|
||||
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
|
||||
}
|
||||
|
||||
|
||||
void initEPWM(uint32_t base)
|
||||
{
|
||||
EPWM_setEmulationMode(base, EPWM_EMULATION_STOP_AFTER_FULL_CYCLE);
|
||||
|
||||
//
|
||||
// Set-up TBCLK
|
||||
//
|
||||
EPWM_setTimeBasePeriod(base, EPWM_TIMER_TBPRD);
|
||||
EPWM_setPhaseShift(base, 0U);
|
||||
EPWM_setTimeBaseCounter(base, 0U);
|
||||
|
||||
//
|
||||
// Set Compare values
|
||||
//
|
||||
EPWM_setCounterCompareValue(base,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
EPWM_TIMER_TBPRD/2);
|
||||
EPWM_setCounterCompareValue(base,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
EPWM_TIMER_TBPRD/2);
|
||||
|
||||
//
|
||||
// Set up counter mode
|
||||
//
|
||||
EPWM_setTimeBaseCounterMode(base, EPWM_COUNTER_MODE_UP);
|
||||
EPWM_disablePhaseShiftLoad(base);
|
||||
EPWM_setClockPrescaler(base,
|
||||
EPWM_CLOCK_DIVIDER_64,
|
||||
EPWM_HSCLOCK_DIVIDER_1);
|
||||
|
||||
//
|
||||
// Set up shadowing
|
||||
//
|
||||
EPWM_setCounterCompareShadowLoadMode(base,
|
||||
EPWM_COUNTER_COMPARE_A,
|
||||
EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
EPWM_setCounterCompareShadowLoadMode(base,
|
||||
EPWM_COUNTER_COMPARE_B,
|
||||
EPWM_COMP_LOAD_ON_CNTR_ZERO);
|
||||
|
||||
//
|
||||
// Set actions
|
||||
//
|
||||
|
||||
EPWM_setActionQualifierAction(base,
|
||||
EPWM_AQ_OUTPUT_A,
|
||||
EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
|
||||
|
||||
EPWM_setActionQualifierAction(base,
|
||||
EPWM_AQ_OUTPUT_B,
|
||||
EPWM_AQ_OUTPUT_HIGH,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
|
||||
|
||||
EPWM_setActionQualifierAction(base,
|
||||
EPWM_AQ_OUTPUT_A,
|
||||
EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
|
||||
EPWM_setActionQualifierAction(base,
|
||||
EPWM_AQ_OUTPUT_B,
|
||||
EPWM_AQ_OUTPUT_LOW,
|
||||
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
|
||||
|
||||
|
||||
//
|
||||
// Interrupt where we will change the Compare Values
|
||||
// Select INT on Time base counter zero event,
|
||||
// Enable INT, generate INT on 1st event
|
||||
//
|
||||
EPWM_setInterruptSource(base, EPWM_INT_TBCTR_ZERO);
|
||||
EPWM_enableInterrupt(base);
|
||||
EPWM_setInterruptEventCount(base, 1U);
|
||||
|
||||
EPWM_enableADCTrigger(base, EPWM_SOC_A);
|
||||
EPWM_setADCTriggerSource(base,
|
||||
EPWM_SOC_A,
|
||||
EPWM_SOC_TBCTR_ZERO);
|
||||
EPWM_setADCTriggerEventPrescale(base,
|
||||
EPWM_SOC_A,
|
||||
1);
|
||||
EPWM_clearADCTriggerFlag(base,
|
||||
EPWM_SOC_A);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Import the modules used in this configuration.
|
||||
*/
|
||||
const epwm = scripting.addModule("/driverlib/epwm.js", {}, false);
|
||||
const epwm1 = epwm.addInstance();
|
||||
const inputxbar = scripting.addModule("/driverlib/inputxbar.js", {}, false);
|
||||
const inputxbar1 = inputxbar.addInstance();
|
||||
|
||||
/**
|
||||
* Write custom configuration values to the imported modules.
|
||||
*/
|
||||
|
||||
|
||||
epwm1.$name = "myEPWM1";
|
||||
epwm1.epwm.$assign = "EPWM1";
|
||||
epwm1.epwm.epwmaPin.$assign = "GPIO0";
|
||||
epwm1.epwm.epwmbPin.$assign = "GPIO1";
|
||||
|
||||
inputxbar1.$name = "myINPUTXBAR5";
|
||||
inputxbar1.inputsUsed = ["inputxbar5Gpio","inputxbar6Gpio"];
|
||||
inputxbar1.inputxbar5Gpio = "GPIO56";
|
||||
inputxbar1.inputxbar6Gpio = "GPIO56";
|
||||
Reference in New Issue
Block a user