If you have internal pull-ups ON, and you're testing the input pin for logic 1, the only
way your LED shoud NOT blink would be when GPIO.5 is pulled to ground.
If you have internal pull-ups ON, and you're testing the input pin for logic 1, the only
way your LED shoud NOT blink would be when GPIO.5 is pulled to ground.
Got it working, added INTCON=7. changed input to PULSIN. Everyting is working well.
OOPS should be INTCON=0 not INTCON=7.
I'm not seeing where the INTCON or the PULSIN statements should make a difference...
And if you look back at your first post:
Why would the internal pull UP work as expected to keep the input LOW?Simple code to work with. I am using GPIO.5 as input as digital. The LED still blinks from GPIO.2. The internal pull up dont work as expected to keep input low. Am I missing something?
Err, OK, but INTCON is already zero, by default, at power-up. Not sure where PULSIN fits into the grand scheme, but at least you got it working...;o}OOPS should be INTCON=0 not INTCON=7.
That way it been erratic behavior and You are right about that the led should not blink when GPIO.5 is opened. that way when I opened the path from ground, the led still blinks. After I added INTCON=0 to it, it behaves much better and dont blink when opened. When I closed the GPIO.5 to ground, the led did blink.
I dont know why but added INTCON=0, system stablizes. Like other PIC I know dont have issues with out this configuration. Maybe it a requirement?
Last edited by hvacrtech; - 26th July 2008 at 20:26.
Clearing INTCON should not be necessary unless you had previously placed some value
in it you need to clear. At power on INTCON by default is already clear.
If it wasn't you could really have some odd behaviour with unexpected interrupts firing.
Bookmarks