This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I can generate SOCA and SOCB using all the available options in ETSEL except decrementing CMPB (EPwm1Regs.ETSEL.bit.SOCASEL = 0x7). Is there something different when using this value? CMPB incrementing (0x6) as well as CMPA inc/dec (0x4, 0x5) work fine. My PWM counter is set up as count up/down (EPwm1Regs.TBCTL.bit.CTRMODE = 0x2).
This does not work:
EPwm1Regs.ETSEL.bit.SOCAEN = 1;
EPwm1Regs.ETSEL.bit.SOCASEL = 7;
EPwm1Regs.ETPS.bit.SOCAPRD = 1;
but this does:
EPwm1Regs.ETSEL.bit.SOCAEN = 1;
EPwm1Regs.ETSEL.bit.SOCASEL = 6;
EPwm1Regs.ETPS.bit.SOCAPRD = 1;
I am having this problem with both PWM1 and PWM2 for both SOCA and SOCB.
Any help would be great.
Cheers
Benriah
Hi Richard,
Thanks for the reply.
EPwm1Regs.TBCTL.bit.CTRMODE and EPwm2Regs.TBCTL.bit.CTRMODE are both configured (and stay) with the value 2.
I am currently recreating the problem using the debugger in CCS by just changing the value of EPwm2Regs.ETSEL.SOCASEL and/or EPwm1Regs.ETSEL.SOCASEL
I am measuring SOCA with an Oscilloscope connected to GPIO32 which is configured as SOCA.
TBPRD = 529;
CMPA.half.CMPA = 264
CMPB = 264
SOCAPRD = 1;
SOCASEL = (1-6 work fine), 7 does not (no SOCA pulses at all).
HRPCTL=0;
I am using a Control Card v0.2 with a TMS320F28069UPZPS.
Cheers
Benriah
Benriah,
Yes, that's correct. In immediate update mode there is no shadowing; writes to CMPB go straight into the active register.
Glad to know you found the problem.
Regards,
Richard