12F675 and GP3 as Input

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Frank607
Posts: 192
Joined: Mon Mar 04, 2013 8:07 pm
Has thanked: 29 times
Been thanked: 15 times
Contact:

12F675 and GP3 as Input

Post by Frank607 »

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.

Image

Image

Image
Attachments
Flashing LED with Button.fcf
(8 KiB) Downloaded 506 times

medelec35
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

Post by medelec35 »

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
Martin

Frank607
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

Post by Frank607 »

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.

medelec35
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

Post by medelec35 »

Hi Frank,
Your welcome.
Glad to have been some help.


Martin
Martin

Post Reply