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.

Compiler/TM4C1294NCPDT: Why does the timer interrupt do not trigger

Part Number: TM4C1294NCPDT

Tool/software: TI C/C++ Compiler

  • Hi,

      You are trying to capture events using TIMER0. Did you provide an input signal on one of the below pins? For example, did you provide an input signal to PD0? If you place a breakpoint in the interrupt ISR does it stop there?

      

  • Also make sure you add and properly configure the selected GPIO pin for timer capture function.
  • Thank you for your reply. I provided a signal(GPIOPinConfigure(GPIO_PA0_T0CCP0);GPIOPinTypeTimer(GPIO_PORTN_BASE, GPIO_PIN_0);), but it still didn't trigger.
  • The "run together" code listing (above) reveals "GPIOPinConfigure( GPIO_PA0_TOCCP0);" and then lists, "GPIOPinTypeTimer(GPIO_PORTN_BASE, GPIO_PIN_0)" - is not poster's "conflict" easily noted?

  • But I change it into" GPIOPinConfigure(GPIO_PA0_T0CCP0 );
    GPIOPinTypeTimer(GPIO_PORTA_BASE,GPIO_PIN_0);GPIOPinTypeGPIOInput(GPIO_PORTA_BASE,GPIO_PIN_0);"The timer interrupt still do not trigger.
  • Your "change" was not (especially) clear - was it? Making it "hard" for your helpers - does NOT serve your interests - does it?

    Let's look at a "proper" (more readable) version of your latest code.     (still SQUISHED together - adding space does NOT increase your "cost" here - and makes the code FAR MORE READABLE!

    GPIOPinConfigure(GPIO_PA0_T0CCP0 );     //   Here you've "config'ed" GPIO_PA0 as a Timer

    GPIOPinTypeTimer(GPIO_PORTA_BASE, GPIO_PIN_0);    //    And here you've "typed" GPIO_PA0 as Timer.     *** Good so far!

    And then arrives:

    GPIOPinTypeGPIOInput(GPIO_PORTA_BASE, GPIO_PIN_0);    //     Have you not - thru this action - "invalidated your (earlier/above) Timer Settings" for PA0?

    There are many, many code examples - should you not search for - then find - then seriously review them?     It is doubted that (any) of those examples will "switch the previously set pin from "Timer" to GPIO Input - as you've done...       Remove that line of code (just above) - and run/report...

  • Hi cb1,
    Thanks for the feedback on the unnecessary GPIOPinTypeGPIOInput. One more thing to check is if ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA) is issued to enable GPIOA. In the original code, only GPION was enabled.


    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    ROM_GPIOPinConfigure( GPIO_PA0_T0CCP0 );
    ROM_GPIOPinTypeTimer( GPIO_PORTA_BASE , GPIO_PIN_0) ;
  • Indeed Charles - indeed. I "did" think of that - yet decided - as poster's code DID RUN - he (likely) had met that "Periph_En" compliance.
    His post "borders upon the unreadable" which is outside his interest - thus I 'took the liberty" of noting such.

    Posters are NOT charged by the "Forum Inch" (at least for now) ... yet the authors of "LIKE's" Removal - surely have such (other) "helpful" methods under consideration...