Author Topic: PIC programming voltage by Arduino with shield  (Read 3345 times)

0 Members and 1 Guest are viewing this topic.

Offline blesbokTopic starter

  • Newbie
  • Posts: 5
PIC programming voltage by Arduino with shield
« on: May 25, 2013, 07:13:58 pm »
Hello community

This 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?
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: PIC programming voltage by Arduino with shield
« Reply #1 on: May 25, 2013, 07:26:10 pm »
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...
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline blesbokTopic starter

  • Newbie
  • Posts: 5
Re: PIC programming voltage by Arduino with shield
« Reply #2 on: May 25, 2013, 07:59:18 pm »
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 command

ardpicprog --device pic16f628a -p /dev/ttyACM0 -output-hexfile output.txt

The 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?
 

Online amyk

  • Super Contributor
  • ***
  • Posts: 8264
Re: PIC programming voltage by Arduino with shield
« Reply #3 on: May 26, 2013, 09:44:02 am »
Your multimeter has a MAX function. Use that.
 

Offline blesbokTopic starter

  • Newbie
  • Posts: 5
Re: PIC programming voltage by Arduino with shield
« Reply #4 on: May 27, 2013, 07:58:05 pm »
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.
 

Offline blesbokTopic starter

  • Newbie
  • Posts: 5
Re: PIC programming voltage by Arduino with shield
« Reply #5 on: May 29, 2013, 08:54:42 am »
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? :-/O

 

Offline blesbokTopic starter

  • Newbie
  • Posts: 5
Re: PIC programming voltage by Arduino with shield
« Reply #6 on: June 01, 2013, 09:00:51 pm »
Further investigation of the setup reveals
1) 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?  :phew:
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf