Page 1 of 1
MOD54415 IRQ question
Posted: Tue May 28, 2013 4:22 pm
by nicobari
Hi,
I am using IRQ on MOD54415 to generate interrupts on both rising and falling edge. How can I figure out which edge caused the interrupt?
Thanks,
TM
Re: MOD54415 IRQ question
Posted: Tue May 28, 2013 4:31 pm
by pbreed
Read the state of the pin....
Paul
Re: MOD54415 IRQ question
Posted: Tue May 28, 2013 4:34 pm
by nicobari
Is there any specific way to read it because every time I read it I just get zeros.
Thanks again,
TM
Re: MOD54415 IRQ question
Posted: Tue May 28, 2013 5:09 pm
by pbreed
See section 18.54.5 of the MCF5441XRM.pdf
Or try...
#include <sim.h>
//Read the current state of ALL IRQ pins...
//Bit 7 ie 0x80 will be IRQ7
//Bit 6 ie 0x40 will be IRQ6
//Bit 5 ie 0x20 will be IRQ5
//Bit 4 ie 0x10 will be IRQ4
//Bit 3 ie 0x08 will be IRQ3
//Bit 2 ie 0x04 will be IRQ2
//Bit 1 ie 0x02 will be IRQ1
BYTE state=sim2.eport.eppdr;
Re: MOD54415 IRQ question
Posted: Wed May 29, 2013 6:36 am
by nicobari
Hi I tried the above way before but it only returns zero!!
Thanks,
TM
Re: MOD54415 IRQ question
Posted: Wed May 29, 2013 12:46 pm
by pbreed
If it only returns zeros, maybe only the low going ISR is happening?
Or maybe the high going ISR is a glitch....
Re: MOD54415 IRQ question
Posted: Thu May 30, 2013 6:11 am
by nicobari
For now I changed my code to go into interrupt at rising edge. Will post if I have success with the previous one.
Thanks again,
TM