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.

On a falling edge turn on a led

Hi.

I try to turn on a led using interrupts : on a falling edge the led must turn on.

I dont know what is the correct syntax to enable the interrupts. 

This is the code :

 

  • Hi,

    Unlike other micro controllers you may worked with, this one has two levels of interrupts:

    a) peripheral interrupt: extern  void IntEnable(uint32_t ui32Interrupt);

    b) general interrupt : extern bool IntMasterEnable(void);

    See the documentation of peripheral driver library + interrupt.h and interrupt.c files.

    Since you do not use driverlib, your code is hard to read and follow - not good for helpers, neither for you - think at least about maintaining the code later, modifying it, cooperation inside team...

    Petrei

  • Petrei,

    I generally try to think of it as three levels of interrupt....

    GPIOIntEnable TivaWare function will unmask an interrupt and send the signal to the NVIC (Interrupt controller).

    IntEnable TivaWare function will allow the signal from the GPIO (or other peripheral) to be "heard" by the NVIC

    IntMasterEnable allows the NVIC signal to be sent by the NVIC and received by the core and an actual interrupt happens.

    More generally you need three API calls and a properly configured vector table to get interrupts.  The peripheral API call, the INTEnable call and IntMasterEnable.

    If the original poster does not want to use TivaWare then he/she can look inside our source code and find out what each of these calls is doing and replicate in their code.

    Dexter