Page 1 of 1

MOD54415 - IRQ Logic Level

Posted: Mon Apr 21, 2014 4:54 am
by GeneralUser
Hey guys, struggling to figure out why when I setup IRQ1 to trigger on any edge, the default logic level jumps to HIGH. When I configure the pin as a general IO, the default logic level is LOW. Here is how I am configuring IRQ1 and I am using the MOD54415 board without any additional hardware....

sim2.eport.eppar = 0x000C; /* 00 00 00 00 00 00 11 00 */
sim2.eport.epddr = 0x00; /* All edge port pins as inputs */
sim2.eport.epier = 0x02; /* Enable IRQ1 only 0 0 0 0 0 0 1 0 */
sim2.eport.epdr = 0x00; /* Initial state = Low */

Am I missing something? The input signal I want to drive this pin with is a 100ms active high pulse every 1.0 second but since the logic level is HIGH, the signal I see at the pin is always HIGH...almost like the pin is constantly being driven HIGH....

Re: MOD54415 - IRQ Logic Level

Posted: Mon Apr 21, 2014 5:26 am
by pbreed
Did you configure the pin to be
IRQ and not GPIO?


IE

J2[43].function(PINJ2_43_IRQ2 );

Re: MOD54415 - IRQ Logic Level

Posted: Mon Apr 21, 2014 5:38 am
by GeneralUser
Yes, right before I have the following:

J2[45].function(PINJ2_45_IRQ1);

When I scope pin45 on J2, I see approx. 3.3 volts with nothing connected. I apply my pulse on pin45 and the logic level never goes to zero in between the 100ms pulses.

Re: MOD54415 - IRQ Logic Level

Posted: Mon Apr 21, 2014 8:55 am
by mbrown
When you say the default logic level is HIGH, how do you mean? Do you mean that you can't bring the line low or that you can't read the status of the line appropriately. If you're trying to read the status of the IRQ lines using the eppdr, the flag bits don't work the way you'd expect. See the following link: http://forum.embeddedethernet.com/viewt ... flag#p8176 If you're trying to set the default state of the pins when used as inputs, there does not seem to be a setting to change what the default state that the pins are in. These pins additionally do have 4.7k pull-ups on each line that will tend to drag the default state HIGH. The data register seems to be the closest thing, but the description states "if any pin of the port is configured as an output". When used as inputs, I have a feeling these pins are tri-stated and the pull up resistors tend to bring them to VCC.

You said you wanted to drive an input with this interrupt. Wouldn't it make a more sense to use a PIT timer as an interrupt and to change a GPIO pin's state when the timer counts to a second?

Re: MOD54415 - IRQ Logic Level

Posted: Mon Apr 21, 2014 9:45 am
by GeneralUser
By default I mean that after I configure the IRQ, using a scope, without anything connected to the MOD54415, I read 3.3 volts....

I did not see anywhere where the pin had a 4.7k pull-up so assumed that the level was in tri-state. Is the pull-up in hardware or is it software enabled? Can you point me to the manual where it shows that because this is not in the MCF5441x Reference Manual.

In my design, a device connected to the MOD54414 outputs a pulse, 100ms wide, when it detects a specific event. Using that pulse, my controller will communicate over the CAN bus. So basically using the IRQ as a trigger to start specific actions.

Re: MOD54415 - IRQ Logic Level

Posted: Mon Apr 21, 2014 9:56 am
by dciliske
The MCF5441x processor used in the MOD5441X has internal pull-up/down resistors that can be configured via the PCR register of the appropriate GPIO module (MCF54415 RM, ยง15.3.5).

Re: MOD54415 - IRQ Logic Level

Posted: Mon Apr 21, 2014 10:54 am
by pbreed
Put it in GPIO mode as an input and make sure it reads what you expect...


Paul

Re: MOD54415 - IRQ Logic Level

Posted: Mon Apr 21, 2014 10:59 am
by GeneralUser
Ok, so I changed my code to this:

J2[45].function(PINJ2_45_IRQ1);

sim2.eport.eppar = 0x000C;
sim2.eport.epddr = 0x00;
sim2.eport.epier = 0x02;

sim1.gpio.pcr_c = 0xAAAA;

Which enabled all the pull downs on PORTC. Funny thing, is that my 100ms pulse train still never goes to 0 volts. Peak/High value is 3.3 volts and Valley/Low value is 3.0volts....Again, looks like something is pulling it up...My hardware skills are rusty, so would this mean that the device sending the 100ms pulse train has a stronger pull-up than the MOD54415 pull-down?

Re: MOD54415 - IRQ Logic Level

Posted: Mon Apr 21, 2014 11:13 am
by mbrown
All Netburner devices have pull-ups external to the processor on the IRQ lines, but they're a fairly high value, such as this one, 4.7k just to stabilize the interrupts at a known high value when disconnected. Any decent input should be able to pull it low however, 3.3V/4.7k = 700uA. I know I've read notes in the Freescale manuals or design guides that recommend this kind of circuitry since most interrupts are active low, but I couldn't point to you exactly where this is.

As for the weak internal pull-ups/downs, these are usually meant to stabilize lines when no external pull-ups/downs are added. According to the data-sheet, page 25, the I/O weak internal pull-up/down current is at most 315uA. This won't overcome the external pull-up. How much current can your input device drive onto a pin?

Re: MOD54415 - IRQ Logic Level

Posted: Tue Apr 22, 2014 3:37 am
by GeneralUser
Good information! I'll have to check the manufacturer's datasheet to get the details. I was using an Arduino before but ran out of CPU resources so I switched to the Netburner. With the Arduino, the IRQ's did not have this characteristic; apply the pulse signal and get the waveform at the input so I never bothered to check the datasheet....will check that and figure out the hardware side of things...