Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Isolating port pins during icsp

Status
Not open for further replies.

fiveten

Member
Hello all!

I am working on a project and need some advise. In my project the gpio3 is switched high for one mode and low for another mode. When icsp is used vpp or gpio3 is 12v right? So if gpio3 is in high mode How do I isolate vpp from my high signal circuit. (high signal switched from vdd). How do I isolate the low signal? (low switched from vss).

I am thinking that I need a resistor between vss and gpio3, but what value? and a diode between vdd and gpio3.

Thank you for any help

fiveten

ps: I am using a pic12f675 microcontroller
 
Last edited:
Here you some thing to go by It's how I do it
 

Attachments

  • 12f675.PNG
    12f675.PNG
    6.9 KB · Views: 1,369
You are correct about the need for a diode and resistor, be80be showed you how. A 10K pull-down resistor to ground (switched of course) would be fine.
 
Last edited:
You don't use a pull down to ground from mclr chip will not run if you forget and set MCLR to ON in your config bits
 
Sure, but he says he is using it as a general purpose pin. Therefore surely he needs to switch it (not permanently wire) to GND or it will float?
 
I would pull it up like I showed him never pull mclr down then he can do what ever he wants GP3 is input only so if he used it with a switch it would read high and go low which is fine. But I wouldn't pull it low asking for trouble.
 
Thanks for everyones help,

So If the circuit is switched in the vss mode I will not be able to program via icsp? I see in the diag. that only the vdd is wired to the vpp/mclr. My config has the mclr off. can I just have a 10k res. between the gpio3 and vss and be able to program via icsp?

thanks,

fiveten
 
Why would you want that pin low even if you used a switch on it and let it be high switch open and low switch close you'll be ok here read this and see for yourself
The PIC12F629/675 microcontrollers can be serially
programmed while in the end application circuit. This is
simply done with two lines for clock and data, and three
other lines for:
• power
• ground
• programming voltage
This allows customers to manufacture boards with
unprogrammed devices, and then program the
microcontroller just before shipping the product. This
also allows the most recent firmware or a custom
firmware to be programmed.
The device is placed into a Program/Verify mode by
holding the GP0 and GP1 pins low, while raising the
MCLR (VPP) pin from VIL to VIHH (see Programming
Specification). GP0 becomes the programming data
and GP1 becomes the programming clock. Both GP0
and GP1 are Schmitt Trigger inputs in this mode.
After RESET, to place the device into Programming/
Verify mode, the program counter (PC) is at location
00h. A 6-bit command is then supplied to the device.
Depending on the command, 14-bits of program data
are then supplied to or from the device, depending on
whether the command was a load or a read. For
complete details of serial programming, please refer to
the Programming Specifications.
the programmer has to pull it up from +5 volts to over 8.5volts min some need even more like 11 or 12 volts
if it can't over come the resistance it will not program
 
Last edited:
Thanks again,

The pin is actually not switched. It has to be manually shorted low or high. I thought saying it was switched would be easier to understand. It is programmed and closed within a video game controller. there are two types of controller so the low or high on gp3 would tell the mc what code to execute. The chip will be enclosed within the controller and will not be accessible. If it were in mode 1 (low) I wanted to be able to program it without opening the controller or adding a external switch to the controller.

I have found some shared code using a pic12f683, I may start playing around with that one if this does not work.

All of you have been most helpful, thank you very much be80be 4 your help.

fiveten
 
If you program the chip first and then Install you can switch low or high just make sure
you turn mclr off and you'll be good to go. Because your chips not in the circuit. There some code on here for rapid fire with a 12f683 if that's what your doing
 
Yes, I am doing rapid fire....I wanted to add an icsp port so I can update the code when I need to change the fire rates and\or delays without having to disassemble the controller desoldering the bridged pads and programming. I am using a smt chip so removing the chip and sticking it in a programmer is not an option. Should I just change the gpoi port that tell the chip the mode or is there a work around?

fiveten
 
If MCLR is pulled high with the normal resistor+diode combination and pulled low with a switch, it should program fine when the switch is off.

Mike.
 
That what I said all long I don't see a good way to program in socket and have mclr being pulled low. You can program the chip and turn off mclr and then use it like he wants. But it is a bad idea to switch mclr low. That's how it resets the chip. Post your circuit. Are you wanting something like this **broken link removed** there not pulling mclr low it's pulled high and when you press the button it goes Low just like what I been telling you you could added what i posted to it and be all set for icsp.https://www.electro-tech-online.com/attachments/12f675-png.31597/
 
Last edited:
If you look at the controller in sleeper mode. (the first 2 pics of the mc wired to the controller) vpp is tied to vss in one wiring and vdd in the other. This is how I have mine wired. This tells the mc what code to use. You can see gp2 is open would it be easier to use this pin as the mode select pin?

thanks,

fiveten
 
Fiveten you have to preprogram your chip to use it like the CG Sleeper you need p-dips like there using or put a jumper to unhook mclr till you get it programed
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top