Hi,
I'm sure I am missing something or doing something wrong and hopefully someone can spot it for me.
I am trying to get the PWMSS0 ECAP APWM output working (pin ECAP0_IN_PWM0_OUT) on our AM3358 processor as a PWM output to control a backlight LED. I currently see that the output line is low with no PWM activity occurring. I am actually using WEC7 operating system with Adeneo BSP but I don't think this will matter too much with regard to getting the PWM working on the processor, which is the issue I am facing.
I have done the following:
-Configured ECAP0_IN_PWM0_OUT to output with pull up/down enabled, Mode 0.
-Enabled PWMSS0 module clock through CM_PER_EPWMSS0_CLKCTRL register.
-I set PWMSS0 CLKCONFIG Register to 0x101 (EPWMCLK and ECAPCLK enabled).
-I set PWMSS0 ECAP ECCTL2 Register to 0x280 (APWM Mode, Disable Sync Out Signal, TSCTR Stopped).
-I then set CAP1 and CAP3 to (0x1000 - 1), writing to each register directly.
-Followed by setting CAP2 and CAP4 to 0x500, writing to each register directly.
-I then set TSCTR Register to 0;
-I then set ECCTL2 Register TSCTR bit so counter is running, ECCTL2 = 0x290.
-At this point I then hope to see a PWM signal on ECAP0_IN_PWM0_OUT.
Are there any steps or configurations which I have missed? My period and duty values probably don't match exactly what I am trying to do, but just to see some PWM output on the line would be great to begin with.
I have some trace output which shows the virtual addresses of my mapping to the PWM ECAP registers and some read backs of the registers after I write them.
Backlight PddInit+
Backlight PddInit: TSCTR_REG:0x90300100
Backlight PddInit: CTRPHS_REG:0x90300104
Backlight PddInit: CAP1_REG:0x90300108
Backlight PddInit: CAP2_REG:0x9030010C
Backlight PddInit: CAP3_REG:0x90300110
Backlight PddInit: CAP4_REG:0x90300114
Backlight PddInit: ECCTL1_REG:0x90300128
Backlight PddInit: ECCTL2_REG:0x9030012A
Backlight PddInit: ECEINT_REG:0x9030012C
Backlight PddInit: ECFLG_REG:0x9030012E
Backlight PddInit: ECCLR_REG:0x90300130
Backlight PddInit: ECFRC_REG:0x90300132
Backlight PddInit: REVID=0x44D22100
Backlight PddInit: before register configuration 1
Backlight PddInit: after register configuration 1, CLKCONFIG=0x101
Backlight PddInit: before register configuration 2
Backlight PddInit: after register configuration 2, temp=0x280, ECCTL2_REG=0x280
+[BKL_PDD]BL_SetBrightness(50), period = 4096, duty = 1280
Backlight SetBrightnessLevel: after CAP write, CAP1_REG=0xFFF, CAP3_REG=0xFFF
Backlight SetBrightnessLevel: after CAP write, CAP2_REG=0x500, CAP4_REG=0x500
Backlight SetBrightnessLevel: before register write, ECCTL2_REG=0x280
Backlight SetBrightnessLevel: after register write, ECCTL2_REG=0x290
-[BKL_PDD]BL_SetBrightness
If anyone has any ideas, it would be greatly appreciated.
Thanks
John