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.

tiva switch program

Other Parts Discussed in Thread: TM4C123GH6PM

dear Amit sir,

     i tried but as i have sent a page to u....in that GPIOIntRegister()function,porthandler is not defined any where....when i defined it ll take garbage value.....so i requesting u that if u have any switching program for tiva c series obout pull up/down register or any program related to it....please share me
thank u....
  • Hi Mohammad,

    You could try searching the Tivaware examples and documentation about what to do.
    I just ask you to please give a little more effort into your questions. Even now when I am not sure about a word I try to search if it's correct and ask friends if my phrases even make sense (they don't sometimes).

    GPIOIntRegister() call IntEnable() and IntRegister() (check the source file and you will see just that). While IntEnable() will allow the selected interrupt, IntRegister() will register the interrupt handler in the vector table - that vector table is in your Startup file (if you use TI compiler), should look like "tm4c123gh6pm_startup_ccs.c" if you are using the TM4C123 launchpad. If you check it you will see an array with lots of elements called "IntDefaultHandler" and with a comment in front to tell which peripheral the handler is for. Normally you would need to go there and edit yourself that table to have the correct handlers but the "Register" functions allow you do to just that in run time (can be useful)
    So the handler is a function of the type "void ISR_Name(void)" . So if you simply use "#define ISR_Name something" like you give the idea you did it will just not work. You need to create a function of that type (void ISR_Name (void) ) and then use it's name in GPIOIntRegister().

    There are many more considerations in using an interrupt. Better start reading up on them.