AnsweredAssumed Answered

Programming Timer IRQ on BF60X

Question asked by MarkH on Nov 12, 2012
Latest reply on Nov 13, 2012 by AkashA

Hello everyone!

 

We would like to program an timer-based IRQ (like in EE-192) on the BF609. However, the "System Interrupts" Chapter in the Processor Hardware Reference is missing, so we do not know the SIC_IARx assignments.

 

Here is the code we tried so far:

 

#define TIMER_OUTDIS (1<<11)

#define TIMER_IRQ_PERIOD_EXPIRED 0x30

#define TIMER_MODE_CONTINOUS_PWM 12

#define TIMER_PULSE_HI 0x80

uint32_t timerClock;

 

volatile uint32_t counter=0;

 

#pragma section("L1_code")

EX_INTERRUPT_HANDLER(timerIrqHandler)

{

if (counter++ >= 22050/32) {

  evkitLedToggle(1);

  counter=0;

}

 

}

 

// We are using Timer 7 for the service.

*pREG_TIMER0_TMR7_CFG = TIMER_OUTDIS  

                        | TIMER_IRQ_PERIOD_EXPIRED      

                        | TIMER_PULSE_HI    

                        | TIMER_MODE_CONTINOUS_PWM;    

*pREG_TIMER0_TMR7_PER = timerClock;

*pREG_TIMER0_TMR7_WID = 2; 

register_handler_ex (ik_ivg11, timerIrqHandler, EX_INT_ENABLE); // is ivg11 correct?

*pIMASK |= 0x0800;  // Enable IVG11

*pREG_TIMER0_RUN_SET |= 0x80; // Start TIMER 7

 

Any hints?

 

Mark

Outcomes