Jump to content
Sign in to follow this  
superbrew

Timer Interrupts

Recommended Posts

Hello,

I am trying to read in two PWM signals from an RC receiver. I have managed to read in one and have got the result I expected.

However, I am unable to read in two channels. The interrupt handlers never get called. I have modified the startup.ccs.c file to call the appropriate handler.

Here is the configuration code that I am using:

    //Enable PortB Interrupt
    SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    GPIOPinConfigure(GPIO_PB0_T2CCP0);
    GPIOPinConfigure(GPIO_PB1_T2CCP1);
    GPIOPinTypeTimer(GPIO_PORTB_BASE, GPIO_PIN_0);
    GPIOPinTypeTimer(GPIO_PORTB_BASE, GPIO_PIN_1);
    TimerConfigure(TIMER2_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_CAP_TIME | TIMER_CFG_B_CAP_TIME);
    TimerControlEvent(TIMER2_BASE, TIMER_A, TIMER_EVENT_BOTH_EDGES);
    TimerControlEvent(TIMER2_BASE, TIMER_B, TIMER_EVENT_BOTH_EDGES);
    TimerEnable(TIMER2_BASE, TIMER_BOTH);
    TimerIntClear(TIMER2_BASE, TIMER_CAPA_EVENT | TIMER_CAPB_EVENT);
    //
    // Enable interrupts to the processor.
    //
    ROM_IntEnable(INT_TIMER2A | INT_TIMER2B);
    TimerIntEnable(TIMER2_BASE, TIMER_CAPA_EVENT | TIMER_CAPB_EVENT);
    ROM_IntMasterEnable();

I have put breakpoints at the interrupt handlers and it never reaches them. I had this working with one channel, now expanding to two.

 

Thanks

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...