2008-01-10 11:26:48 Interrupt problem on gpio (PH5)
Cyril HAENEL (FRANCE)
Message: 49449 Here is very my simple program :
#define VX_INPUT GPIO_PH5
u16 counter = 0;
static irqreturn_t vxInputIrq ( void )
{
counter++;
return IRQ_HANDLED;
}
int _speedInit ( void )
{
if ( request_irq( IRQ_PH5, (void *)vxInputIrq, IRQF_TRIGGER_FALLING, "Speed", NULL) < 0 )
{ debug( "Impossible d'allouer l'interruption sur l'entrée VX\n" );
return( EBUSY );
}
debug( "Gestion Vitesse initialisée\n" );
return 0;
}
When I send a 10Hz signal on the input (verified with the oscilloscope, the signal is very clean), and I print the counter value every second, counter is not incremented by 10 but by > 600 !
What can be the problem !??
Regards
TranslateQuoteReplyEditDelete
2008-01-10 11:55:10 Re: Interrupt problem on gpio (PH5)
Mike Frysinger (UNITED STATES)
Message: 49451 look at /proc/interrupts and see if it is incrementing as you expect
QuoteReplyEditDelete
2008-01-10 11:59:42 Re: Interrupt problem on gpio (PH5)
Cyril HAENEL (FRANCE)
Message: 49452 I looked too, same problem ! It's incredible because my 10Hz square signal sent on the input is very clean.
TranslateQuoteReplyEditDelete
2008-01-10 12:13:03 Re: Interrupt problem on gpio (PH5)
Michael Hennerich (GERMANY)
Message: 49453
PH5 - BF537/BF536 ?
Did you disable the ethernet MAC ?
You need to ...
-Michael
QuoteReplyEditDelete
2008-01-10 12:15:22 Re: Interrupt problem on gpio (PH5)
Cyril HAENEL (FRANCE)
Message: 49454 BF537,
In the kernel confif the ethernel MAC is not activated. Do I need to do something else ?
TranslateQuoteReplyEditDelete
2008-01-10 13:41:22 Re: Interrupt problem on gpio (PH5)
Cyril HAENEL (FRANCE)
Message: 49455 In my interrupt function I toggle a debug port to try to understand :
In fact, my input signal is RC filtered, and take approximately 1ms to go low to high or high to low.
And I seen that my irq function is called 10-20 times at 4us interval when the input is at 1.32V approximately....
In fact there is no schmitt trigger in blackfin inputs...
Hum...I never thought I will have this kind of problem !!
TranslateQuoteReplyEditDelete
2008-01-10 15:47:25 Re: Interrupt problem on gpio (PH5)
Robin Getz (UNITED STATES)
Message: 49456 There are only a few pins which have schmitt triggers on them -
It is pretty important that inputs to the Blackfin are monotonic - sometimes faster (no RC) is better.
-Robin
QuoteReplyEditDelete
2008-01-11 03:48:03 Re: Interrupt problem on gpio (PH5)
Cyril HAENEL (FRANCE)
Message: 49473 What is the signification of monotonic ?
Regards
TranslateQuoteReplyEditDelete
2008-01-11 08:01:12 Re: Interrupt problem on gpio (PH5)
Robin Getz (UNITED STATES)
Message: 49500 http://en.wikipedia.org/wiki/Monotonic_function
QuoteReplyEditDelete
2008-01-11 13:16:56 Re: Interrupt problem on gpio (PH5)
Cyril HAENEL (FRANCE)
Message: 49511 So, my input signal is monotonic, it's sure, I verified with the scope, but maybe to slow apparently.
I corrected this behavior with a timer to count the first interrupt and not the other if they are too close.
It's not clean but I have no other solution because my customer has a board and I cannot modify his board...
But in the final product this interrupt input will not be used so it's not important.
TranslateQuoteReplyEditDelete
2008-01-11 14:03:01 Re: Interrupt problem on gpio (PH5)
Robin Getz (UNITED STATES)
Message: 49513 Cyril:
The issue with problems like this - is the Blackfin will react to signals that you will not see on a "standard" (500MHz bandwidth, 1GHz sampling DSO). In fact the probe (30pF/1Mohm) can make the problem go away.
The Blackfin is done on a much faster process, so it reacts to things as small as a few ps (picosecond).
From doing investigations here - unless you have a 20GHz bandwidth scope, with active FET probes (setups that are more expensive than what a average car in North America costs) - you may not see the problem.
If you are getting multiple interrupts on rising or falling edges - by definition your signal is non-monotonic. Otherwise it would not happen.
-Robin