PDA

View Full Version : PIC power supply basics



shottootto
- 11th November 2013, 14:09
Can anybody help this newby please.
I have studied a few datasheets and other docs, forums and FAQ's, but I just end up with more questions than answers.

I get from a Microchip document that the 12V VPP is supposed to be some kind of pulse.
Now assuming that the 5V VDD is a continuous smooth voltage (and I am not sure), how can the DIY programmers that are posted all over the web, draw these two voltages from the same comms pin?

I tried to program a PIC16F690 with the simple "walk.hex" but while the chip verifies OK, it will not program. I think it has to do with the power supplies.
When I try to read, I get "Read error or chip empty". It is a new chip, but should it not at least read the device ID from memory?

I get power from the serial pin 3:
Via 4.7 K to VPP
Via 7805 IC to VDD with 10uF on chip side and .22uF on computer side.

I will probably end up buying an entry level programmer from RS , but I would like to play around a bit first.

Charlie
- 11th November 2013, 15:42
Do a search on PIC programmers - there are plenty of designs documented here. But honestly you'd be far better off to buy a proven programmer before trying to write code and test it with an unknown quantity.

shottootto
- 12th November 2013, 09:02
Thank you Charlie

I agree, there are far too many pitfalls for comfort and an entry level, off the shelf unit is cheap, tested and probably comes with instructions and notes on different chips.

Thing is, I am kind of inquisitive and DIY helps me understand things better. It is also about the satisfaction in getting a self-built thing to work. As said, I will eventually buy a programmer -
probably December (bonus month), but not until I at least understand the power supply requirements.

It would help me (and probably some other newbies also) if we can get a discussion going here on the 2 power supplies only. Things like: "Vpp is raised to 12V to put the chip into programming/verification mode.
The chip itself generates the required HV pulse during programming." would be helpful. [comments in quote not necessary factual]

I did some more reading. With the "Vdd first" method, Vdd can have 5V all the time. This leaves only Vpp that requires switching. Brings me back to my first question. Is it possible that these home-brew programmers rely on
a capacitor to smooth out the switched 5V to a continuous voltage, or are they using the Vpp first method?
On my contaption so far (Vpp and Vdd from same comms pin), I can see the LED on Vdd switching during transfer. This does not seem right to me. (Unless it's Vpp first).

So my next step is to hard wire Vdd from an external, regulated 5V. Next, I want to see if I can also use external 12V, switched by the comms port via a transistor to Vpp.
Will have to do some reading to get the transistor circuit right. NPN? PNP? and will BJT rise time be fast enough? Another option I am thinking of is a 4066 or similar bilateral switch. Going to look for datasheets on that now.

Archangel
- 12th November 2013, 09:18
http://www.instructables.com/id/Simple-JDM-PIC-Programmer/

My First programmer:
http://www.ebay.com/itm/PIC-MCU-JDM-Programmer-for-Microchip-/171169040200?pt=LH_DefaultDomain_0&hash=item27da784748

I have one of these:
http://www.ebay.com/itm/Clone-Microchip-Development-Programmer-Mini-PICKIT-3-/350637699036?pt=LH_DefaultDomain_0&hash=item51a3a2afdc

and one of these:
http://www.ebay.com/itm/Microchip-Programmer-Pickit-2-PG164120-/190962579441?pt=LH_DefaultDomain_0&hash=item2c7641b7f1

shottootto
- 13th November 2013, 06:58
Nice toys, Archangel.

I was also inspired by the JDM post. Problem is, I tried to get smart and substituted the zener for a 7805 (have a bunch of those).
Maybe it's better to try the wheel round first before testing if square works!
On that JDM post again. How in the world does he get such a nice PCB using the iron-on process. I was doing that years ago and even started using magazine paper way back as my own idea(now suggested all over).
The color fliers dished out at traffic intersections also work well.

Art
- 13th November 2013, 11:02
Most so called RS232 serial ports don't put out the presumed 12 Volt supply nowadays.
A programmer that requires it, won't work with a 5 Volt serial port.
A 12 Volt supply can be produced with a buck converter the way that
a max 232 provides a real RS232 serial port for a pic with a 5 Volt supply.

Johnsteave
- 4th December 2013, 14:31
when the PIC microcontroller can operate from a power supply voltage in the range 2 to 6V. The supply voltage in digital in digital electronic circuits is +5v and this is the voltage with which the PIC microcontrollers are mostly operated. and it is not possible to obtain 5v using standard batteries only. which gives 4.5v and this is not enough to power logic circuits. Thanks!!!!!!!

shottootto
- 19th December 2013, 13:58
I got my programmer to work. It is the David Tait classic printer port programmer. I am using an ATX computer power supply which is common ground for 5V & 12V.
Both voltages are switched by the programmer using small PNP switching transistors. These are then inverted in the software setup to supply VDD & VPP.
Probably because of the common ground, I found by trial & error that I had to move the 2X series diodes from PS ground to PS 12V. I am not sure that these are needed in my setup, but it works so no changes for now.

I have done about 8 program runs and had no failures.
Last program was a "LED walk" from PORTC-0 to PORTC-6 which I adapted from a PORTC-0 flash asm program.
It programmed first time fine. Only worked from second time due to code bug. For some reason the BTFSC & BTFSS commands works inversely to my logic!