GPIO interrupt not working on LPC1769

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO interrupt not working on LPC1769

2,014 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DjCracks on Tue Nov 06 13:08:37 MST 2012
I've been using the GPIO interrupts for a sumo bot I'm building but when I connect the motors the interrupts activate alone. I suppose it is because of some kind of magnetic field the motors are producing. Does anyone know how to solve this?

Thank you.
0 Kudos
Reply
10 Replies

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Fri Nov 09 12:43:26 MST 2012
In hardware:

Try to implement a passive RC filter in the uC inputs

In software:

Implent debouncing techniques:
a) Measure the time that the input is in its active state, say low-level. If such a level lasts for at least n cycles, then the inputs is taken as a correct one; otherwise it's discarded.

b) Poll the input and count the different levels, and after some time take as valid input the one that has the majority.
0 Kudos
Reply

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Nov 08 11:47:54 MST 2012
As mentioned already 2 days ago: chokes as shown in figure 23 of http://cache.freescale.com/files/microcontrollers/doc/app_note/AN2764.pdf ;)
0 Kudos
Reply

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DjCracks on Thu Nov 08 10:48:19 MST 2012
The problem after some tests is this: when I disconnect the sensors from the LPC the interrupts don't activate by themselves but when I connect the cable they do. I've installed a 1k pullup resistor and it's still the same. Now I'm using a shielded cable and some caps to filter and they improved a little bit but still don´t work fine. The motors are definetley introducing noise in the cables. Does anyone know some workaround?

Thanks.
0 Kudos
Reply

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Wed Nov 07 18:53:55 MST 2012

Quote: DjCracks
I do know what a pullup resistor is. Is it necessary (even though I set the input as Tristate and it is just receiving the signal of a phototransistor from a CNY70 sensor) to add a pull up resistor?



Normally a phototransistor doesn't include a pull-up resistor in its output. Besides, it's said (somewhere) in the user manual that the internal pull-up resistors inside the uC are not intended to be as general purpose ones. So, in a noisy enviroment it's better off you use a strong pull-ups.
0 Kudos
Reply

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by graynomad on Wed Nov 07 18:40:06 MST 2012
Do you have the input on the collector of the sensor?

If so then when there is no reflection the transistor is off and the input is floating. You should [B]never [/B]have a floating input so yes I'd say you need the pullup.
0 Kudos
Reply

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DjCracks on Wed Nov 07 18:29:00 MST 2012

Quote: graynomad
Presumably you know what a pullup resistor is, normally you use 10k or even up to 100k but I would suggest "strong" is more like 1k.


I do know what a pullup resistor is. Is it necessary (even though I set the input as Tristate and it is just receiving the signal of a phototransistor from a CNY70 sensor) to add a pull up resistor?
0 Kudos
Reply

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by graynomad on Wed Nov 07 16:41:23 MST 2012
Presumably you know what a pullup resistor is, normally you use 10k or even up to 100k but I would suggest "strong" is more like 1k.
0 Kudos
Reply

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DjCracks on Wed Nov 07 14:26:29 MST 2012
We are using fast diodes (free-wheel) but I don't know what you mean by strong pull-up resistors in the inputs. Could you clarify this for me?

Thanks
0 Kudos
Reply

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fjrg76 on Tue Nov 06 22:34:14 MST 2012
Free-wheel diodes? Strong pull-ups in inputs?
0 Kudos
Reply

1,969 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Nov 06 13:20:16 MST 2012
Just a guess: Some kind of EMC protection :confused:

http://cache.freescale.com/files/microcontrollers/doc/app_note/AN2764.pdf
0 Kudos
Reply