PIC programming voltage by Arduino with shield - Page 1
Forum section: electronics / general

author: blesbok
author_rank: Newbie
timestamp: May 25, 2013, 07:13:58 pm
content: Hello communityThis is my first attempt at burning a PIC; a PIC16F628. Attached is an Arduino shield and the PIC is connected as shown.The yellow program LED blinks once and a voltage of 10.04V appears at pin 4. The analogue output from Arduino pulses the BC548’s base through a 4.7K resistor. The collector is connected directly to the PIC's pin 4 /MCLR and the collector current flows through a 10K resistor. The voltage in is 13.97V; that from a 7AH 12V battery in series with a large Eveready Power Plus Gold 1.5V cell.Is that 10V pulse enough, i.e. adequate programming voltage? (That's the reading I get on a digital meter) If not, should I reduce that 10K resistance value, or up the voltage in but adding another cell, i.e. 15.5V?

author: c4757p
author_rank: Super Contributor
timestamp: May 25, 2013, 07:26:10 pm
content: No, it's not enough. (Read the datasheet, it's in there...) But how exactly are you measuring it? I don't see why it would only reach 10V unless there's something wrong with that transistor. Even if there was a whopping 10 nF of capacitance on that node, the 10k resistor would still charge it in under a millisecond...

author: blesbok
author_rank: Newbie
timestamp: May 25, 2013, 07:59:18 pm
content: Thanks for the speedy reply. Means of measurement? A Fluke 85 III true RMS multimeter on DC voltage, free ranging. With black lead on Ground and red lead on Pin 4 of the PIC, 10.04V appears for a moment as the ENTER key is pressed, with commandardpicprog --device pic16f628a -p /dev/ttyACM0 -output-hexfile output.txtThe software responds something like no PIC present or no programming voltage present.Re possibility of transistor damage, I did first try it with the collector and emitter swapped. 10V does seem low but I wondered if there was a higher peak. Changing the transistor is a possiblity but what else can (safely) be done to make it work?

author: amyk
author_rank: Super Contributor
timestamp: May 26, 2013, 09:44:02 am
content: Your multimeter has a MAX function. Use that.

author: blesbok
author_rank: Newbie
timestamp: May 27, 2013, 07:58:05 pm
content: Well, this simply leaves me baffled. The transistor was replaced with one similar and the peak voltage/ maximum was 9.2V Removing the transistor altogether resulted in 14V continually on MCLR. A new inspiration dawned: surely running an Arduino as a programmer off a laptop's USB port was stretching things? So 10.98V was connected to the Arduino's supply jack. Result? No change! The resistance values are right; 9,68k between In and collector; 4.78k between A1 and the base and 980R on the red LED. The Arduino is probably okay as the TX and RX lights flicker when the sketch is uploaded. Well, I'll keep trying.

author: blesbok
author_rank: Newbie
timestamp: May 29, 2013, 08:54:42 am
content: After rebreadboarding the lot but leaving out the reset button, it did more. Data could be read from the PIC. The MCLR voltage remains low however (9V). This gets me thinking, the A5 pulse from the Arduino is probably good-- but what about its ground? The Arduino ground on the digital side is connected, i.e. right hand if USB and power jack face away from you.Beside the Atmel's pin 20 is a GND can be seen. What do the Arduino sabios say?

author: blesbok
author_rank: Newbie
timestamp: June 01, 2013, 09:00:51 pm
content: Further investigation of the setup reveals1) Programming voltage will be provided when A1's voltage is LOW.2) If A1 is low enough, transistor Q1 will turn off and there will be 0V voltage drop across the 10K resistor and thus 13V at MCLR.3) Short of Q1 turning off, the voltage drop across that 10K resistor will be about 4V.4) A1's voltage measures 0.6V, whether at the terminal or on the base of Q1.5) Above-mentioned 0.6V prevents Q1 from turning off. However, it is present even with only the high voltage (13V) connected.6) There seems to be inadequate isolation between the two circuits, i.e. 13V circuit and 5V circuit.Any comments, folks?