I have a problem with a PIC 12F675 and a switch on GP3. I have made a simple test program that will one time blink a LED after a switch is pushed.
This program only works (run one time) when the Pickit 2 is connected. If I disconnect the Pickit 2 the program runs nonstop and regardless of the switch.
I have placed the program in this message and post some screenshots from the schematic.
Thanks for helping me out.
12F675 and GP3 as Input
Moderator: Benj
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: 12F675 and GP3 as Input
Hi Frank,
I'm a bit confused looking at your circuits.
You have got 10K from MCLR to GND
But you have also got 10K+ 470R going from MCLR to + 5V
This means that no mater if switch is pressed or not, the resistors will act as a potential divider and bias VPP at:
10k/(10k + 470R +10k) * 5V
= 2.44V
That's classed as logic 1
So when switch is pressed & released, Voltage on VPP is going from 5 back down to 2.44V
Just remove R17 and R18.
Martin
I'm a bit confused looking at your circuits.
You have got 10K from MCLR to GND
But you have also got 10K+ 470R going from MCLR to + 5V
This means that no mater if switch is pressed or not, the resistors will act as a potential divider and bias VPP at:
10k/(10k + 470R +10k) * 5V
= 2.44V
That's classed as logic 1
So when switch is pressed & released, Voltage on VPP is going from 5 back down to 2.44V
Just remove R17 and R18.
Martin
Martin
-
- Posts: 192
- Joined: Mon Mar 04, 2013 8:07 pm
- Has thanked: 29 times
- Been thanked: 15 times
- Contact:
Re: 12F675 and GP3 as Input
Thanks Martin,
It is working now. I have used this ICSP config with the resistors in all my schematics because this is the “standard” from the ICSP / Pickit datasheets.
But I never used this on a MCLR pin in combination with a switch due to the maximum pins on this chip.
Indeed, this was my error.
Thanks also for the good explanation. It's now clear to me.
It is working now. I have used this ICSP config with the resistors in all my schematics because this is the “standard” from the ICSP / Pickit datasheets.
But I never used this on a MCLR pin in combination with a switch due to the maximum pins on this chip.
Indeed, this was my error.
Thanks also for the good explanation. It's now clear to me.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact: