2025-11-16 9:18 PM - edited 2025-11-16 9:31 PM
Hi I am trying to migrate my code from SPL(old version) to HAL based code I have conveted the same setup code to cubemx to generate the init function and I am using a clrc663 IC(card reader) along with it when the Ic Generates an interupt the mcu doesnt process the interuppt but when using test case using software to check the interupt handler it works but when the pin goes from high to low but there is no interupt happening. can anyone explain why it is not working.
mcu->spi & interupt ->clrc663
DBG: TCONTROL read=0x00
state 1 = HIGH
DBG: Write IRQ1EN st=0x0000 write=0xC2 read=0xC2
DBG: IRQ1 cleared
state 2 = HIGH
DBG: TCONTROL written start=0x33
state 1 = LOW
DBG: Before WaitIrq
DBG: MCU IRQ pin after RC663 GLOBALIRQ = LOW
these are the debug outpur ihave used a print statement inside the interupt handle but it is not printed
2025-11-16 10:16 PM
> ... ihave used a print statement inside the interupt handle ...
Which is almost always a bad idea.
Check the implementation of of the debug print function, it surely messes up the timing of your application, blocking other interrupts because it uses interrupts itself.
> ... the Ic Generates an interupt the mcu doesnt process the interuppt but when using test case using software to check the interupt handler it works but when the pin goes from high to low but there is no interupt happening. can anyone explain why it is not working.
Probably not, because your description is not very comprehensible.
Either try to validate your code in steps, as a stop in the debugger most probably breaks up the sequence.
Or, when trying in real-time, take care not to modify the application timing, as debug prints will surely do.
2025-11-16 10:24 PM
but when i use the software testing code the interupt works fine even if i take out the print statements and only place one insisde the handler it still doesnt work.
The IC generates the transition I can tell it for sure because in the middle of the code I have placed program to check the state of the pin and print it the pin only transitions after start signal is send to ic to start timer and the timer sends irq once completed
2025-11-17 2:23 AM
Have you verified that the interrupt is actually enabled?
Is the handler being called?
@naveen-0 wrote:can anyone explain why it is not working.
We can't see your system or your code - so, no.
@naveen-0 wrote:when using test case using software
Unclear what you mean by that.
How to write your question to maximize your chances to find a solution.