Tool/software:
Dear TI experts,
We now use AM2612 r5f 4 channel PWM module to cooperate with high-speed relay output.
We hope generate PWMA&B pulse for a specified period on GPIO output is closed or opened and the waveforms of PWMA and PWMB are exactly inverted.
Now the waveform has a problem like the following picture: the yellow is PWMA, the blue is PWMB. There are random overlapping high parts when the timer clock is timeout, which can't be permitted.
But I don't know how to prevent it.
Please find the attachment for the example.syscfg file.
/** * These arguments were used when this file was generated. They will be automatically applied on subsequent loads * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. * @cliArgs --device "AM261x_ZFG" --part "AM2612" --package "ZFG" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM261x@10.00.01" * @v2CliArgs --device "AM2612" --package "NFBGA (ZFG)" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM261x@10.00.01" * @versions {"tool":"1.23.0+4000"} */ /** * Import the modules used in this configuration. */ const eeprom = scripting.addModule("/board/eeprom/eeprom", {}, false); const eeprom1 = eeprom.addInstance(); const ethphy_cpsw_icssg = scripting.addModule("/board/ethphy_cpsw_icssg/ethphy_cpsw_icssg", {}, false); const ethphy_cpsw_icssg1 = ethphy_cpsw_icssg.addInstance(); const pmic = scripting.addModule("/board/pmic/pmic", {}, false); const pmic1 = pmic.addInstance(); const edma = scripting.addModule("/drivers/edma/edma", {}, false); const edma1 = edma.addInstance(); const epwm = scripting.addModule("/drivers/epwm/epwm", {}, false); const epwm1 = epwm.addInstance(); const epwm2 = epwm.addInstance(); const epwm3 = epwm.addInstance(); const epwm4 = epwm.addInstance(); const gpio = scripting.addModule("/drivers/gpio/gpio", {}, false); const gpio1 = gpio.addInstance(); const gpio2 = gpio.addInstance(); const gpio3 = gpio.addInstance(); const gpio4 = gpio.addInstance(); const gpio5 = gpio.addInstance(); const gpio6 = gpio.addInstance(); const gpio7 = gpio.addInstance(); const gpio8 = gpio.addInstance(); const gpio9 = gpio.addInstance(); const gpio10 = gpio.addInstance(); const gpio11 = gpio.addInstance(); const gpio12 = gpio.addInstance(); const gpio13 = gpio.addInstance(); const gpio14 = gpio.addInstance(); const gpio15 = gpio.addInstance(); const gpio16 = gpio.addInstance(); const gpio17 = gpio.addInstance(); const gpio18 = gpio.addInstance(); const i2c = scripting.addModule("/drivers/i2c/i2c", {}, false); const i2c1 = i2c.addInstance(); const i2c2 = i2c.addInstance(); const i2c3 = i2c.addInstance(); const pruicss = scripting.addModule("/drivers/pruicss/pruicss", {}, false); const pruicss1 = pruicss.addInstance(); const pruicss2 = pruicss.addInstance(); const clock = scripting.addModule("/kernel/dpl/clock"); const debug_log = scripting.addModule("/kernel/dpl/debug_log"); const dpl_cfg = scripting.addModule("/kernel/dpl/dpl_cfg"); const mpu_armv7 = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false); const mpu_armv71 = mpu_armv7.addInstance(); const mpu_armv72 = mpu_armv7.addInstance(); const mpu_armv73 = mpu_armv7.addInstance(); const mpu_armv74 = mpu_armv7.addInstance(); const mpu_armv75 = mpu_armv7.addInstance(); const general = scripting.addModule("/memory_configurator/general", {}, false); const general1 = general.addInstance(); const region = scripting.addModule("/memory_configurator/region", {}, false); const region1 = region.addInstance(); const section = scripting.addModule("/memory_configurator/section", {}, false); const section1 = section.addInstance(); const section2 = section.addInstance(); const section3 = section.addInstance(); const section4 = section.addInstance(); const section5 = section.addInstance(); const section6 = section.addInstance(); const section7 = section.addInstance(); const section8 = section.addInstance(); const section9 = section.addInstance(); const section10 = section.addInstance(); const enet_cpsw = scripting.addModule("/networking/enet_cpsw/enet_cpsw", {}, false); const enet_cpsw1 = enet_cpsw.addInstance(); /** * Write custom configuration values to the imported modules. */ eeprom1.$name = "CONFIG_EEPROM0"; eeprom1.i2cAddress = 0x54; ethphy_cpsw_icssg1.$name = "CONFIG_ENET_ETHPHY0"; ethphy_cpsw_icssg1.phySelect = "CUSTOM"; ethphy_cpsw_icssg1.customDeviceName = "mxl86111"; ethphy_cpsw_icssg1.isStrappedPhy = true; ethphy_cpsw_icssg1.skipExtendedConfig = true; scripting.suppress("Warning : Ethphy device is not linked to a network peripheral", ethphy_cpsw_icssg1); pmic1.$name = "CONFIG_PMIC0"; pmic1.name = "TPS65036xx"; edma1.$name = "CONFIG_EDMA0"; edma1.edmaRmDmaCh[0].$name = "CONFIG_EDMA_RM0"; edma1.edmaRmQdmaCh[0].$name = "CONFIG_EDMA_RM1"; edma1.edmaRmTcc[0].$name = "CONFIG_EDMA_RM2"; edma1.edmaRmParam[0].$name = "CONFIG_EDMA_RM3"; epwm1.$name = "HSHB1"; epwm1.epwmTimebase_period = 500; epwm1.epwmCounterCompare_cmpA = 20; epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP"; epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm1.epwmDeadband_enableRED = true; epwm1.epwmDeadband_enableFED = true; epwm1.epwmDeadband_delayRED = 30; epwm1.epwmDeadband_delayFED = 30; epwm1.epwmCounterCompare_cmpB = 270; epwm1.epwmDeadband_dbControlGld = true; 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.EPWM.$assign = "EPWM3"; epwm1.EPWM.A.slewRate = "high"; epwm1.EPWM.A.$assign = "GPIO49"; epwm1.EPWM.B.slewRate = "high"; epwm1.EPWM.B.$assign = "GPIO50"; epwm2.$name = "HSHB2"; epwm2.epwmGroup = "EPWM_GROUP1"; epwm2.epwmTimebase_period = 500; epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP"; epwm2.epwmCounterCompare_cmpA = 20; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm2.epwmDeadband_enableRED = true; epwm2.epwmDeadband_delayRED = 30; epwm2.epwmDeadband_enableFED = true; epwm2.epwmDeadband_delayFED = 30; epwm2.epwmCounterCompare_cmpB = 270; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm2.EPWM.$assign = "EPWM2"; epwm2.EPWM.A.$assign = "GPIO47"; epwm2.EPWM.B.$assign = "GPIO48"; epwm3.$name = "HSHB3"; epwm3.epwmTimebase_period = 500; epwm3.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP"; epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm3.epwmCounterCompare_cmpA = 20; epwm3.epwmCounterCompare_cmpB = 270; epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm3.epwmDeadband_enableRED = true; epwm3.epwmDeadband_enableFED = true; epwm3.epwmDeadband_delayRED = 30; epwm3.epwmDeadband_delayFED = 30; epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm3.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm3.EPWM.$assign = "EPWM1"; epwm3.EPWM.A.$assign = "GPIO45"; epwm3.EPWM.B.$assign = "GPIO46"; epwm4.$name = "HSHB4"; epwm4.epwmTimebase_period = 500; epwm4.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP"; epwm4.epwmCounterCompare_cmpA = 20; epwm4.epwmCounterCompare_cmpB = 270; epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm4.epwmDeadband_enableRED = true; epwm4.epwmDeadband_enableFED = true; epwm4.epwmDeadband_delayRED = 30; epwm4.epwmDeadband_delayFED = 30; epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm4.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm4.EPWM.$assign = "EPWM0"; epwm4.EPWM.A.$assign = "GPIO43"; epwm4.EPWM.B.$assign = "GPIO44"; gpio1.$name = "LED0"; gpio1.pinDir = "OUTPUT"; gpio1.GPIO_n.$assign = "GPIO0"; gpio2.$name = "LED1"; gpio2.pinDir = "OUTPUT"; gpio2.GPIO_n.$assign = "GPIO1"; gpio3.$name = "PCB_VER0"; gpio3.GPIO_n.$assign = "GPIO5"; gpio4.$name = "PCB_VER1"; gpio4.GPIO_n.$assign = "GPIO6"; gpio5.$name = "PCB_VER2"; gpio5.GPIO_n.$assign = "GPIO11"; gpio6.$name = "PCB_VER3"; gpio6.GPIO_n.$assign = "GPIO14"; gpio7.$name = "PCBA_VER0"; gpio7.GPIO_n.$assign = "GPIO15"; gpio8.$name = "PCBA_VER1"; gpio8.GPIO_n.$assign = "GPIO16"; gpio9.$name = "PCBA_VER2"; gpio9.GPIO_n.$assign = "GPIO17"; gpio10.$name = "SLOT0"; gpio10.GPIO_n.$assign = "GPIO24"; gpio11.$name = "SLOT1"; gpio11.GPIO_n.$assign = "GPIO23"; gpio12.$name = "SLOT2"; gpio12.GPIO_n.$assign = "GPIO21"; gpio13.$name = "SLOT3"; gpio13.GPIO_n.$assign = "GPIO25"; gpio14.$name = "PHY_RESET"; gpio14.pinDir = "OUTPUT"; gpio14.defaultValue = "1"; gpio14.pu_pd = "pu"; gpio14.GPIO_n.$assign = "GPIO22"; gpio15.$name = "SLOT4"; gpio15.GPIO_n.$assign = "GPIO19"; gpio16.$name = "PRESENT_N"; gpio16.pu_pd = "pu"; gpio16.GPIO_n.$assign = "GPIO26"; gpio17.$name = "DO_PWR_CDE"; gpio17.pu_pd = "pd"; gpio17.pinDir = "OUTPUT"; gpio17.GPIO_n.$assign = "GPIO51"; gpio18.$name = "GPIO_OSPI_RST"; gpio18.pinDir = "OUTPUT"; gpio18.GPIO_n.$assign = "GPIO20"; i2c1.$name = "EEPROM"; eeprom1.peripheralDriver = i2c1; i2c1.ownTargetAddr = 0x51; i2c1.I2C.$assign = "I2C0"; i2c1.I2C.SCL.$assign = "GPIO135"; i2c1.I2C.SDA.$assign = "GPIO134"; i2c1.I2C_child.$name = "drivers_i2c_v1_i2c_v1_template0"; i2c2.$name = "A1006"; i2c2.I2C.$assign = "I2C1"; i2c2.I2C.SCL.$assign = "GPIO131"; i2c2.I2C.SDA.$assign = "GPIO130"; i2c2.I2C_child.$name = "drivers_i2c_v1_i2c_v1_template1"; i2c3.$name = "PMIC"; i2c3.ownTargetAddr = 0x18; pmic1.peripheralDriver = i2c3; i2c3.I2C.$assign = "I2C2"; i2c3.I2C.SCL.$assign = "GPIO83"; i2c3.I2C.SDA.$assign = "GPIO84"; i2c3.I2C_child.$name = "drivers_i2c_v1_i2c_v1_template2"; pruicss1.$name = "CONFIG_PRU_ICSS0"; pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; pruicss1.AdditionalICSSSettings[0].PruGPIO.create(1); pruicss1.AdditionalICSSSettings[0].PruGPIO[0].$name = "CONFIG_PRU_ICSS_GPIO0"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].$assign = "PRU-ICSS0"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO7.$assign = "GPIO124"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO7.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO11.$assign = "GPIO99"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO11.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO12.rx = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO12.$assign = "GPIO100"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO12.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO15.$assign = "GPIO98"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO15.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO0.rx = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO0.$assign = "GPIO93"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO0.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO1.$assign = "GPIO94"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO1.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO6.$assign = "GPIO91"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO6.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO2.$assign = "GPIO95"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO2.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO3.$assign = "GPIO96"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO3.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO4.rx = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO4.$assign = "GPIO92"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO4.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO16.rx = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO16.$assign = "GPIO97"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO16.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO13.$assign = "GPIO101"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO13.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO14.rx = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO14.$assign = "GPIO102"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO14.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO5.$assign = "GPIO87"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO5.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO10.$assign = "GPIO89"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO10.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO9.rx = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO9.$assign = "GPIO88"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO9.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO8.$assign = "GPIO90"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU0_GPIO8.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO5.$assign = "GPIO103"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO5.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO8.$assign = "GPIO106"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO8.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO9.$assign = "GPIO104"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO9.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO10.rx = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO10.$assign = "GPIO105"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO10.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO18.$assign = "GPIO120"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO18.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO19.$assign = "GPIO119"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO19.$used = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO17.rx = true; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO17.$assign = "GPIO125"; pruicss1.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS0"].PR0_PRU1_GPIO17.$used = true; pruicss1.intcMapping.create(1); pruicss1.intcMapping[0].$name = "CONFIG_ICSS0_INTC_MODE1_MAPPING1"; pruicss1.intcMapping[0].event = "22"; pruicss1.intcMapping[0].channel = "1"; pruicss2.$name = "CONFIG_PRU_ICSS1"; pruicss2.instance = "ICSSM1"; pruicss2.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO1"; pruicss2.AdditionalICSSSettings[0].PruGPIO.create(1); pruicss2.AdditionalICSSSettings[0].PruGPIO[0].$name = "CONFIG_PRU_ICSS_GPIO1"; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].$assign = "PRU-ICSS1"; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO0.rx = true; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO0.$assign = "GPIO71"; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO0.$used = true; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO1.$assign = "GPIO72"; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO1.$used = true; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO9.$assign = "GPIO74"; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO9.$used = true; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO10.rx = true; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO10.$assign = "GPIO123"; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO10.$used = true; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU0_GPIO20.$assign = "GPIO132"; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU0_GPIO20.$used = true; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO7.$assign = "GPIO133"; pruicss2.AdditionalICSSSettings[0].PruGPIO[0]["PRU-ICSS1"].PR1_PRU1_GPIO7.$used = true; pruicss2.intcMapping.create(1); pruicss2.intcMapping[0].$name = "CONFIG_ICSS1_INTC_MODE1_MAPPING0"; pruicss2.intcMapping[0].event = "22"; pruicss2.intcMapping[0].channel = "1"; const soc_ctrl_adc = scripting.addModule("/drivers/soc_ctrl/v0/subModules/soc_ctrl_adc", {}, false); const soc_ctrl_adc1 = soc_ctrl_adc.addInstance({}, false); soc_ctrl_adc1.$name = "soc_ctrl_adc0"; const soc_ctrl = scripting.addModule("/drivers/soc_ctrl/soc_ctrl", {}, false); soc_ctrl.soc_ctrl_adc = soc_ctrl_adc1; const soc_ctrl_cmpss = scripting.addModule("/drivers/soc_ctrl/v0/subModules/soc_ctrl_cmpss", {}, false); const soc_ctrl_cmpss1 = soc_ctrl_cmpss.addInstance({}, false); soc_ctrl_cmpss1.$name = "soc_ctrl_cmpss0"; soc_ctrl.soc_ctrl_cmpss = soc_ctrl_cmpss1; const soc_ctrl_epwm = scripting.addModule("/drivers/soc_ctrl/v0/subModules/soc_ctrl_epwm", {}, false); const soc_ctrl_epwm1 = soc_ctrl_epwm.addInstance({}, false); soc_ctrl_epwm1.$name = "soc_ctrl_epwm0"; epwm.epwmTbClkSync = soc_ctrl_epwm1; soc_ctrl.soc_ctrl_epwm = soc_ctrl_epwm1; const soc_ctrl_sdfm = scripting.addModule("/drivers/soc_ctrl/v0/subModules/soc_ctrl_sdfm", {}, false); const soc_ctrl_sdfm1 = soc_ctrl_sdfm.addInstance({}, false); soc_ctrl_sdfm1.$name = "soc_ctrl_sdfm0"; soc_ctrl.soc_ctrl_sdfm = soc_ctrl_sdfm1; clock.usecPerTick = 200; debug_log.enableUartLog = true; debug_log.enableCssLog = false; debug_log.uartLog.$name = "CONFIG_UART0"; debug_log.uartLog.UART.$assign = "UART0"; debug_log.uartLog.UART.RXD.$assign = "GPIO27"; debug_log.uartLog.UART.TXD.$assign = "GPIO28"; debug_log.uartLog.child.$name = "drivers_uart_v2_uart_v2_template0"; mpu_armv71.$name = "CONFIG_MPU_REGION0"; mpu_armv71.size = 31; mpu_armv71.attributes = "Device"; mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD"; mpu_armv71.allowExecute = false; mpu_armv72.$name = "CONFIG_MPU_REGION1"; mpu_armv72.size = 15; mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD"; mpu_armv73.$name = "CONFIG_MPU_REGION2"; mpu_armv73.baseAddr = 0x80000; mpu_armv73.size = 15; mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD"; mpu_armv74.$name = "CONFIG_MPU_REGION3"; mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD"; mpu_armv74.baseAddr = 0x70000000; mpu_armv74.size = 21; mpu_armv75.$name = "CONFIG_MPU_REGION4"; mpu_armv75.attributes = "NonCached"; mpu_armv75.baseAddr = 0x70040000; mpu_armv75.size = 12; general1.$name = "CONFIG_GENERAL0"; general1.heap_size = 1024; general1.linker.$name = "TIARMCLANG0"; region1.$name = "MEMORY_REGION_CONFIGURATION0"; region1.memory_region.create(7); region1.memory_region[0].type = "TCMA"; region1.memory_region[0].$name = "R5F_VECS"; region1.memory_region[0].auto = false; region1.memory_region[0].size = 0x40; region1.memory_region[1].type = "TCMA"; region1.memory_region[1].$name = "R5F_TCMA"; region1.memory_region[1].size = 0x7FC0; region1.memory_region[2].type = "TCMB"; region1.memory_region[2].size = 0x8000; region1.memory_region[2].$name = "R5F_TCMB"; region1.memory_region[3].$name = "CPPI_DESC"; region1.memory_region[3].auto = false; region1.memory_region[3].size = 0x4000; region1.memory_region[3].manualStartAddress = 0x70040000; region1.memory_region[4].$name = "OCRAM"; region1.memory_region[4].auto = false; region1.memory_region[4].manualStartAddress = 0x70044000; region1.memory_region[4].size = 0x13C000; region1.memory_region[5].type = "FLASH"; region1.memory_region[5].$name = "FLASH"; region1.memory_region[5].auto = false; region1.memory_region[5].manualStartAddress = 0x60100000; region1.memory_region[5].size = 0x80000; region1.memory_region[6].$name = "SBL"; region1.memory_region[6].size = 0x40000; region1.memory_region[6].auto = false; section1.load_memory = "R5F_VECS"; section1.group = false; section1.$name = "Vector Table"; section1.output_section.create(1); section1.output_section[0].$name = ".vectors"; section1.output_section[0].palignment = true; section2.load_memory = "OCRAM"; section2.$name = "Text Segments"; section2.output_section.create(5); section2.output_section[0].$name = ".text.hwi"; section2.output_section[0].palignment = true; section2.output_section[1].$name = ".text.cache"; section2.output_section[1].palignment = true; section2.output_section[2].$name = ".text.mpu"; section2.output_section[2].palignment = true; section2.output_section[3].$name = ".text.boot"; section2.output_section[3].palignment = true; section2.output_section[4].$name = ".text:abort"; section2.output_section[4].palignment = true; section3.load_memory = "OCRAM"; section3.$name = "Code and Read-Only Data"; section3.output_section.create(2); section3.output_section[0].$name = ".text"; section3.output_section[0].palignment = true; section3.output_section[1].$name = ".rodata"; section3.output_section[1].palignment = true; section4.load_memory = "OCRAM"; section4.$name = "Data Segment"; section4.output_section.create(1); section4.output_section[0].$name = ".data"; section4.output_section[0].palignment = true; section5.load_memory = "OCRAM"; section5.$name = "Memory Segments"; section5.output_section.create(3); section5.output_section[0].$name = ".bss"; section5.output_section[0].output_sections_start = "__BSS_START"; section5.output_section[0].output_sections_end = "__BSS_END"; section5.output_section[0].palignment = true; section5.output_section[1].$name = ".sysmem"; section5.output_section[1].palignment = true; section5.output_section[2].$name = ".stack"; section5.output_section[2].palignment = true; section6.load_memory = "OCRAM"; section6.$name = "Stack Segments"; section6.output_section.create(5); section6.output_section[0].$name = ".irqstack"; section6.output_section[0].output_sections_start = "__IRQ_STACK_START"; section6.output_section[0].output_sections_end = "__IRQ_STACK_END"; section6.output_section[0].input_section.create(1); section6.output_section[0].input_section[0].$name = ". = . + __IRQ_STACK_SIZE;"; section6.output_section[1].$name = ".fiqstack"; section6.output_section[1].output_sections_start = "__FIQ_STACK_START"; section6.output_section[1].output_sections_end = "__FIQ_STACK_END"; section6.output_section[1].input_section.create(1); section6.output_section[1].input_section[0].$name = ". = . + __FIQ_STACK_SIZE;"; section6.output_section[2].$name = ".svcstack"; section6.output_section[2].output_sections_start = "__SVC_STACK_START"; section6.output_section[2].output_sections_end = "__SVC_STACK_END"; section6.output_section[2].input_section.create(1); section6.output_section[2].input_section[0].$name = ". = . + __SVC_STACK_SIZE;"; section6.output_section[3].$name = ".abortstack"; section6.output_section[3].output_sections_start = "__ABORT_STACK_START"; section6.output_section[3].output_sections_end = "__ABORT_STACK_END"; section6.output_section[3].input_section.create(1); section6.output_section[3].input_section[0].$name = ". = . + __ABORT_STACK_SIZE;"; section6.output_section[4].$name = ".undefinedstack"; section6.output_section[4].output_sections_start = "__UNDEFINED_STACK_START"; section6.output_section[4].output_sections_end = "__UNDEFINED_STACK_END"; section6.output_section[4].input_section.create(1); section6.output_section[4].input_section[0].$name = ". = . + __UNDEFINED_STACK_SIZE;"; section7.load_memory = "OCRAM"; section7.$name = "Initialization and Exception Handling"; section7.output_section.create(3); section7.output_section[0].$name = ".ARM.exidx"; section7.output_section[0].palignment = true; section7.output_section[1].$name = ".init_array"; section7.output_section[1].palignment = true; section7.output_section[2].$name = ".fini_array"; section7.output_section[2].palignment = true; section8.group = false; section8.load_memory = "CPPI_DESC"; section8.type = "NOLOAD"; section8.$name = "ENET_CPPI_DESC"; section8.output_section.create(1); section8.output_section[0].$name = ".bss:ENET_CPPI_DESC"; section8.output_section[0].alignment = 128; section9.$name = "ENET_DMA_PKT_MEMPOOL"; section9.load_memory = "OCRAM"; section9.group = false; section9.type = "NOLOAD"; section9.output_section.create(1); section9.output_section[0].$name = ".bss:ENET_DMA_PKT_MEMPOOL"; section9.output_section[0].alignment = 128; section10.$name = "CONFIG_SECTION0"; section10.load_memory = "OCRAM"; section10.output_section.create(1); section10.output_section[0].$name = ".bss.filebuf"; section10.output_section[0].alignment = 128; enet_cpsw1.$name = "CONFIG_ENET_CPSW0"; enet_cpsw1.cptsHostRxTsEn = false; enet_cpsw1.macport2LinkDuplexity = "ENET_DUPLEX_FULL"; enet_cpsw1.macport1LinkDuplexity = "ENET_DUPLEX_FULL"; enet_cpsw1.macport2LinkSpeed = "ENET_SPEED_100MBIT"; enet_cpsw1.cptsRftClkFreq = "CPSW_CPTS_RFTCLK_FREQ_200MHZ"; enet_cpsw1.macport1LinkSpeed = "ENET_SPEED_1GBIT"; enet_cpsw1.DisableMacPort2 = true; enet_cpsw1.customBoardEnable = true; enet_cpsw1.macAddrConfig = "Manual Entry"; enet_cpsw1.mdioPollEnMask = ["0"]; enet_cpsw1.macAddrList = "02:00:54:00:30:04,02:00:54:00:20:04"; enet_cpsw1.MDIO.$assign = "MDIO0"; enet_cpsw1.MDIO.MDC.$assign = "GPIO42"; enet_cpsw1.MDIO.MDIO.$assign = "GPIO41"; enet_cpsw1.RGMII1.$assign = "RGMII1"; enet_cpsw1.RGMII1.RD0.$assign = "GPIO109"; enet_cpsw1.RGMII1.RD1.$assign = "GPIO110"; enet_cpsw1.RGMII1.RD2.$assign = "GPIO111"; enet_cpsw1.RGMII1.RD3.$assign = "GPIO112"; enet_cpsw1.RGMII1.RX_CTL.$assign = "GPIO108"; enet_cpsw1.RGMII1.RXC.$assign = "GPIO107"; enet_cpsw1.RGMII1.TD0.$assign = "GPIO115"; enet_cpsw1.RGMII1.TD1.$assign = "GPIO116"; enet_cpsw1.RGMII1.TD2.$assign = "GPIO117"; enet_cpsw1.RGMII1.TD3.$assign = "GPIO118"; enet_cpsw1.RGMII1.TX_CTL.$assign = "GPIO114"; enet_cpsw1.RGMII1.TXC.$assign = "GPIO113"; enet_cpsw1.RGMII2.RD0.$used = false; enet_cpsw1.RGMII2.RD1.$used = false; enet_cpsw1.RGMII2.RD2.$used = false; enet_cpsw1.RGMII2.RD3.$used = false; enet_cpsw1.RGMII2.RX_CTL.$used = false; enet_cpsw1.RGMII2.RXC.$used = false; enet_cpsw1.RGMII2.TD0.$used = false; enet_cpsw1.RGMII2.TD1.$used = false; enet_cpsw1.RGMII2.TD2.$used = false; enet_cpsw1.RGMII2.TD3.$used = false; enet_cpsw1.RGMII2.TX_CTL.$used = false; enet_cpsw1.RGMII2.TXC.$used = false; enet_cpsw1.txDmaChannel[0].$name = "ENET_DMA_TX_CH0"; enet_cpsw1.rxDmaChannel[0].$name = "ENET_DMA_RX_CH0"; /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ enet_cpsw1.RGMII2.$suggestSolution = "RGMII2";
For timer clock function code of stop PWM is as follows:
void PWMTimerCb(ClockP_Object *clkInst, void *arg)
{
uint32_t temp = (int)arg;
cnt ++;
#if 1
/* If EnableMask = 1&DisableMask = 1, set PWM disable */
if( temp & 1 )
{
EPWM_setActionQualifierAction(HSHB1_BASE_ADDR, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setDeadBandDelayPolarity(HSHB1_BASE_ADDR, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_HIGH);
EPWM_setActionQualifierAction(HSHB1_BASE_ADDR, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
}
if( temp & 2 )
{
EPWM_setActionQualifierAction(HSHB2_BASE_ADDR, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setDeadBandDelayPolarity(HSHB2_BASE_ADDR, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_HIGH);
EPWM_setActionQualifierAction(HSHB2_BASE_ADDR, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
}
if( temp & 4 )
{
EPWM_setActionQualifierAction(HSHB3_BASE_ADDR, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setDeadBandDelayPolarity(HSHB3_BASE_ADDR, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_HIGH);
EPWM_setActionQualifierAction(HSHB3_BASE_ADDR, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
}
if( temp & 8 )
{
EPWM_setActionQualifierAction(HSHB4_BASE_ADDR, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setDeadBandDelayPolarity(HSHB4_BASE_ADDR, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_HIGH);
EPWM_setActionQualifierAction(HSHB4_BASE_ADDR, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
}
#endif
}
PWM start code:
if( j == 0 )
{
EPWM_setActionQualifierAction(HSHB1_BASE_ADDR, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setActionQualifierAction(HSHB1_BASE_ADDR, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setDeadBandDelayPolarity(HSHB1_BASE_ADDR, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_LOW);
}
else if( j == 1 )
{
EPWM_setActionQualifierAction(HSHB2_BASE_ADDR, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setActionQualifierAction(HSHB2_BASE_ADDR, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setDeadBandDelayPolarity(HSHB2_BASE_ADDR, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_LOW);
}
else if( j == 2 )
{
EPWM_setActionQualifierAction(HSHB3_BASE_ADDR, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setActionQualifierAction(HSHB3_BASE_ADDR, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setDeadBandDelayPolarity(HSHB3_BASE_ADDR, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_LOW);
}
else if( j == 3 )
{
EPWM_setActionQualifierAction(HSHB4_BASE_ADDR, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPB);
EPWM_setActionQualifierAction(HSHB4_BASE_ADDR, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setDeadBandDelayPolarity(HSHB4_BASE_ADDR, EPWM_DB_FED, EPWM_DB_POLARITY_ACTIVE_LOW);
}
}
Best Regards,
LY