AnsweredAssumed Answered

BF607 core1 PWM interrupt via SEC

Question asked by AlexanderDeurloo on Jan 14, 2016
Latest reply on Jan 21, 2016 by AlexanderDeurloo

I have a PWM signal and need an interrupt every period.

I configured the PWM module such, that it indeed generates one, see result below:

pwm imask = 0x00100000  (PWM TMR4 period)

pwm latch = 0x00100000   (once the pwm runs, the corresponding bit goes hi, so an interrupt is really generated)


The ID for PWMTMR interrupt is 28 (0x1C)

So I configured the SEC accordingly:

bfin_write32(SEC0_GCTL, 0x2);    // reset

bfin_write32(SEC0_CCTL1, 0x2);    // reset

bfin_write32(SEC0_CCTL1, 0x1);    // enable

*pREG_SEC0_SCTL28 = (1<<24) | (0<<3) | (1<<2);        // core1, level sensitive, source signal enable

*pREG_SEC0_SCTL28 = (1<<24) | (0<<3) | (1<<2) | 0x01;    // interrupt enable

bfin_write_PWM0_IMSK(1<<20);    // unmask interrupt on TMR4PER

bfin_write_PWM0_DL0(Pwm_Nmi_CountMax-1);

bfin_write_PWM0_ILAT(1<<20);    // clear latch (better safe than sorry)

bfin_write32(SEC0_GCTL, 0x1);    // enable the SEC

bfin_write_PWM0_ILAT(1<<20);    // clear latch (better safe than sorry)

bfin_write_PWM0_CTL(0x20001);    // Enable PWM module

 

evt11 is pointing to my ISR routine. But is seems that the interrupt signal gets lost somewhere in the SEC module.

 

The result is:

pREG_SEC0_SSTAT28 = 0x00000100  (bit9 = active source)

pREG_SEC0_SCTL28  = 0x0100000d   (core1, source enabled, interrupt enabled)

pREG_SEC0_CGMSK1 = 0x00000000  (nothing masked)

pREG_SEC0_CCTL1 = 0x00000001     (enabled)

 

pREG_SEC0_CPND1 = 0x0000001c     (clearly ID=28=PwmTmr4 period, so the PWM interrupt is received by the SEC)

pREG_SEC0_CACT1 = 0x00000000     (??? I expected this to be 0x1C as well)

pREG_SEC0_CPMSK1 = 0x000000ff    (no prio masking)

pREG_SEC0_CPLVL1 = 0x00000007    (all levels)

 

pREG_SEC0_CSTAT1 = 0x00000500    (SID valid, Pending valid, but Active is not valid !!)

pREG_SEC0_CSID1 = 0x0000001c      (SID = 0x1C, so correct)

CEC_SID = 0x0000001c

 

pREG_SEC0_GCTL = 0x00000001

pREG_SEC0_GSTAT = 0x00000000   (nothing received ???)

pREG_SEC0_RAISE = 0x00000000

pREG_SEC0_END = 0x00000000

 

 

I'm out of ideas. Did I configure something wrong or did I forgot something?

Thanks in advance,

Alexander.

Outcomes