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.

TIMER INTERRUPT PROBELM - TM4C123GH6PM

Hi,

////////////Common Header Files
#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"

/////////Peripheral Header File
#include "driverlib/timer.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "inc/hw_ints.h"

int toggle;
void timer_B_0_Int(void)
{
	TimerIntClear(TIMER0_BASE, TIMER_TIMB_TIMEOUT);
	toggle ^=0x00000002;
	 GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, toggle);


}


int main(void)
{
	 SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
	 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	 GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_3|GPIO_PIN_2|GPIO_PIN_1);
	 SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
	 TimerConfigure(TIMER0_BASE, TIMER_CFG_B_PERIODIC);
	 TimerClockSourceSet(TIMER0_BASE,TIMER_CLOCK_SYSTEM);
	 TimerLoadSet(TIMER0_BASE, TIMER_B, SysCtlClockGet());
	 IntEnable(INT_TIMER0B);
	 TimerIntEnable(TIMER0_BASE, TIMER_TIMB_TIMEOUT);
	 toggle = 0x00000000;
	 TimerEnable(TIMER0_BASE, TIMER_B);
    while(1)
    {

    }
}

1) In the above code i cant able to get the output

2) which I use the timer interrupt for TIMER A , the above code is working.   its not working in TIMER B

  • Hello Haresh,

    When using timer-b the split mode needs to be configured.

    //
    // Configure Timer0B as a 16-bit periodic timer.
    //
    TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_PERIODIC);


    Also Have you updated the startup file to map the Timer-B interrupt handler?

    Regards
    Amit
  • Hi Again Amit, I insist on side effect, Ok if forum was splitted, from root perspective you was able to see all thing appear, but if poster was searching on specific section of, "timers" trouble where immediately at Eye, and specially with this new limited version of forum software this can be the way to avoid disperse information...
    One other and I stop do this ... (Old fora on root of all was my preferred way to see if someone answered to all I was following, now require see all single area by polling)
    TIVA is a very complex chip and IMHO need be specialized to best serve similar problem...