MOD54415 IRQ question.

Discussion to talk about software related topics only.
d9_
Posts: 5
Joined: Tue Dec 17, 2013 10:52 am

MOD54415 IRQ question.

Post 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.
mbrown
Posts: 61
Joined: Tue Jan 29, 2013 7:12 pm

Re: MOD54415 IRQ question.

Post 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...
d9_
Posts: 5
Joined: Tue Dec 17, 2013 10:52 am

Re: MOD54415 IRQ question.

Post by d9_ »

Well, at least it's clear now. Thank you so much for sharing info!!!
rlupish
Posts: 26
Joined: Thu Oct 10, 2013 6:15 am

Re: MOD54415 IRQ question.

Post 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
sulliwk06
Posts: 118
Joined: Tue Sep 17, 2013 7:14 am

Re: MOD54415 IRQ question.

Post 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.
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD54415 IRQ question.

Post by dciliske »

You'll need to strap the IRQ pin to a GPIO in input mode and read the state on that pin instead.
Dan Ciliske
Project Engineer
Netburner, Inc
rlupish
Posts: 26
Joined: Thu Oct 10, 2013 6:15 am

Re: MOD54415 IRQ question.

Post 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
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: MOD54415 IRQ question.

Post 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?
CP2102
Posts: 5
Joined: Thu Jan 23, 2020 12:26 pm

Re: MOD54415 IRQ question.

Post 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;
}
User avatar
TomNB
Posts: 569
Joined: Tue May 10, 2016 8:22 am

Re: MOD54415 IRQ question.

Post by TomNB »

Thank you very much for posting that.
Post Reply