I want to use the switch SW1 in K40DX256 tower module. I added the components Init_GPIO and InterruptVector for using PTC5 (SW1 - PTC5). My Init_GPIO Configurations are:
For InterruptVector Module , It will show an error like
how to debug this error or if there is any other configurations to use the switch.
Hi Keerthana,
You could use your Interrupt for PORTC without using InterruptVector component, I attached a simple project where I toggle on-board LED when pressing SW3.
As you could see, you need to configure all interrupt settings in your GPIO component:
And then populate your ISR function in order to attend your interrupt service request.
void PORTC_ISR(void) {
if (PORT_PDD_GetPinInterruptFlag(PTC_PORT_DEVICE,5)) {
PORT_PDD_ClearPinInterruptFlag(PTC_PORT_DEVICE,5);
GPIO_PDD_TogglePortDataOutputMask(PTC_DEVICE,1 << 7);
}
}
I hope this can help.
Best Regards,
Isaac Avila
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you very much for your answer. Really Its working .I have tested. :):):):)
With Regards,
Keerthana. S