Main Site Documentation

Pin goes High without interupt being triggered


#1

OK…I have a strange situation here. I have the Parallax PIR from Radio Shack and hooked it up thru a bread board to IO9 on my Cobra…works great (used the code out on Fezzer). So, I decide to actually solder it to a board and use one of the 3 pin connectors. Here is where it gets strange. If I try to plug it into any of the on board 3 pin connectors already mounted on the Cobra (like IO7), it doesnt work. The pin goes high and just keeps calling my interrupt. But, if I take that same 3 pin connector and put it back on IO9, it works just great. Another slightly strange thing…if I just plug the cable (without the PIR attached) into one of those on board connectors, it immediately starts going high again. In fact, it went high a few times with me just getting my hand NEAR the thing (static electricity maybe? Who knows). So, what is the difference there between a pin like IO9 and IO7 on the Cobra that would cause this?

The code is on Fezzer but here is the basic code setting up the interrupt:

interruptPort = new InterruptPort(pin,false,Port.ResistorMode.Disabled,Port.InterruptMode.InterruptEdgeHigh);

Thanks ahead of time…Steve


#2

Just to be sure, double check that 3 pin connector connects to right pins on the PIR.


#3

Architect - Checked that. If I plug the same pins into 5V out (or 3.3V out), Ground, and IO9, works great. I’ve looked at the schematics till I am blue in the face ana am sure the pins are correct. The funniest (weirdest) part is that it just goes high by itself with only the cable attached and not even the PIR…strange.


#4

Is the cable ok?
Try adding pull- down resistor and see if it helps.


#5

Tried a few different cables. I put a 1K resistor in line between the pin on PIR and the pin on the board…is that what you are referring to?


#6

I mean connecting IO7 with 1K resistor to the ground. That way the active state is low on that pin - guaranteed.


#7

Hm…ok, but I’m confused…(here goes Steve COMPLETE lack of electrical knowledge), but if it is already grounded, then how does it ever get set? Sorry, thanks for the help.


#8

Here is information on pull-down and pull-up resistors from “Expert .NET Micro Framework” by Jens Kühner:


#9

Read this as well:

http://www.tinyclr.com/forum/2/1403/


#10

OK, so, if you can indulge my lack of understanding here, here is a very poor electrical diagram of how I currently have this set up. And, this works. Where on here would I put a resistor for something like IO7? Thanks again so much.


#11

Here it is. That way you will guarantee that pin is not floating.


#12

Fantastic…THANK YOU SO MUCH :slight_smile: I will try that this evening…REALLY appreciate your help.


#13

You are welcome! ;D


#14

Well…sad to say…did what you showed…tried every possible code settings I could, Port.ResistorMode.PullDown, Port.ResistorMode.PullUp, even set the interupt mode to Port.InterruptMode.InterruptEdgeBoth and could not get a reading. Instead of the problem I had before, now it won’t trigger at all…any more ideas? I kow I hve a lot o learn, but this can certainly get a little frustrating after a while :wink:


#15

OK…think I have it working…went back and re-did everything…looks like I must have not had the resistor soldered correctly or something? all is well now…learned a lot wiht something I thought would be so simple…thanks again.


#16

Great!

I am glad it worked for you.