Page 1 of 2

MOD54415 IRQ question.

Posted: Tue Dec 17, 2013 11:01 am
by d9_
Hi guys,

I setup IRQ6 on MOD54415 to be triggered on both positive and negative edges and its works correctly, but if I try to read sim2.eport.eppdr register - it always return zeros. Any ideas why? I need to read current state on the line and call appropriate function.

Re: MOD54415 IRQ question.

Posted: Tue Dec 17, 2013 4:12 pm
by mbrown
Bad news on this front. We ran into this issue with the eport registers a couple of months ago and opened up a ticket with the support line at Freescale. It turns out this functionality was never added to the mcf5441x lines. :( In fact in earlier versions of the reference manual, they make no reference to it. Somewhere along the lines, someone noticed the reserved bit in their reference manual (which is normally the status bit on other product lines) and labeled it as the flag status even though in reality, it doesn't work as such. They mentioned they would be publishing errata for it, but it's possible that hasn't come out yet.

Luckily, the interrupt will trigger on both edges, you just simply can't read the pin's state while it's configured as an eport pin. If you have a spare gpio line, you could tie the two pins together and use the gpio class to read the status of the other pin though. Or if you're more pressed for space, you could change the pin type inside the interrupt routine to gpio, read it's status, then reconfigure it to an interrupt again. I think there were a couple more things you could do to get around it, but they're escaping me right now. Perhaps someone else will have a clever idea...

Re: MOD54415 IRQ question.

Posted: Wed Dec 18, 2013 6:43 am
by d9_
Well, at least it's clear now. Thank you so much for sharing info!!!

Re: MOD54415 IRQ question.

Posted: Tue Nov 11, 2014 7:01 am
by rlupish
I note that the SetPinIRQ( ) function seems to only allow setting the interrupt for rising(1) or falling (-1) edge - so how to go about setting the interrupt for BOTH rising and falling edges - from the above discussion, it's obvious this can be done, but alas, it's not obvious to me as to how to go about setting this up.

Also, did the setting the IRQ pin function to GPIO, reading its state, then setting it back to the IRQ function work properly?? Would like feedback on that, or other alternate ways of reading the pin state.

(using MOD5441x).

Thanks,

Ron

Re: MOD54415 IRQ question.

Posted: Tue Nov 11, 2014 7:39 am
by sulliwk06
You should be able to set the IRQ for both rising and falling edge by passing a 0. As for reading the high or low state of the IRQ, I haven't figured that out yet.

Re: MOD54415 IRQ question.

Posted: Tue Nov 11, 2014 8:42 am
by dciliske
You'll need to strap the IRQ pin to a GPIO in input mode and read the state on that pin instead.

Re: MOD54415 IRQ question.

Posted: Fri Mar 25, 2016 5:57 am
by rlupish
Hi - Bringing this topic up again...

Tying a GPIO pin to the IRQ pin works fine, with the IRQ pin configured to fire on both rising and falling edges, and then reading the state of the tied GPIO pin in the ISR to determine the state.

We are now being tasked with providing additional functionality to our MOD54417 project, which may require the use of more GPIO pins than we currently have available, so it would be a very good thing if we could free up the 2 GPIO pins currently tied to the IRQ pins.

I went ahead and tried changing the state of the IRQ pin within the IRQ itself:

Code: Select all

void PBISR( )
{    ...
    J2[26].function( PINJ2_26_GPIO );
    if (J2[26].read( ) )....
    ...
    J2[26].function( PINJ2_26_IRQ3 );
}
And, not surprisingly, it did not work.

Just bringing this up again, to see if anyone has found a clever way around this.

Thanks,

Ron

Re: MOD54415 IRQ question.

Posted: Fri Mar 25, 2016 7:00 am
by rnixon
It depends on what type of speed you need, but maybe a spi or i2c gpio port expander chip? If you need speed, a parallel address/data us latch?

Re: MOD54415 IRQ question.

Posted: Fri Jun 19, 2020 3:29 pm
by CP2102
Hi, I had the same problem and found that you can make it work if you clear the interrupt flag after checking the state.
Here what I did for IRQ7 on a Nano board:

Code: Select all

uint8_t bMuteState = 0;

INTERRUPT( IO_IRQ_7_ISR, 0x2300 )
{
    Pins[ 9 ].function( PIN_9_GPIO );
    bMuteState = Pins[ 9 ];
    Pins[ 9 ].function( PIN_9_IRQ7 );

    // Clear the interrupt flag
    sim2.eport.epfr = 0x80;
}

Re: MOD54415 IRQ question.

Posted: Sat Jun 20, 2020 7:54 am
by TomNB
Thank you very much for posting that.