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.

What is wrong with this pic?

Status
Not open for further replies.

vlad777

Member
Hello.

**broken link removed**


I am trying to detect and test program pic16f628a .
I am using winpic800.
I tried many things but it all fails.
Please check my schematics and my settings.

First of all, I noticed ,in winpic800 hardware settings,
that when I test, states shuffle around so I tried
changing lpt mode in bios to spp, but it doesn't help.

I am not sure if data,data in or clock should be inverted in settings.
LPT pins 2,3 are not inverted but busy is inverted in LPT hardware.

So please tell me how should I set up inv for data,data in and clock in settings.
I think I read that signals are latched on falling edge of the clock.
Does that mean that clock should be inverted?

This is how I wired pic:
data - pin 13
clock - pin 12
vss - pgm pin 10
vss - pin 5
vdd - pin 14
vpp - pin 4


This is my first time doing this, so don't hold back your reprimands. :)

Please help.
Many thanks.


Edit:

**broken link removed**
 
Last edited:
Main concern is the lack of the essential capacitors round the regulators. I'm also not happy about the lack of BE resistors either, and the 20K's are rather high to switch the PNP's properly (although for the low current requirement they may be OK.
 
Hi,


I agree there should be base emitter resistors too.

Also, a few changes should help or at least make it better:

PNP=2N3906
NPN=2N3904
Change all 20k to 10k.
Add 100k resistor from base to emitter on all PNP's.
Add 10k from collector of PNP's to ground.
For Vpp at the collector of one PNP, you might want to try a 0.1uf to ground also. This requirement depends on the programming software too though so you may not need it.
May also want to add a 0.1uf cap across that diode on the 7812. May not even need that diode really if it is shorted out...check the Vpp program voltage spec's to check this.
 
Last edited:
May not even need that diode really if it is shorted out...check the Vpp program voltage spec's to check this.

It depends on the specific PIC, certainly many of the older devices may very well not work without the diode, personally I'd sooner aim for 13V on Vpp rather than only 12V.
 
The Vpp will be about 12.5/6 depending on the diode.. but I agree 13.2 would work better....

I made a pickit2 clone recently and it couldn't maintain > 12.5 v whilst programming, once I changed a couple of components I could maintain 13.2 volts and every chip programs fine..
 
Last edited:
Where did you get your schematic from? I can't seem to find the one that winpic800 specifys!!

It is my concoction but I hope it can work.

PNP=2N3906
NPN=2N3904

Those are exactly what I am using.

I tried 10k but lpt signals drop to 3 something volts.
I'll try to implement the rest of what you said.

So I will add 100K on pnp be.
Another diode in serial.
0.1 uF across diodes.
0.1 uF on pnp collectors.
add 10k load resistors.
change pnp base resistors to 10k.

Edit: I did this and still no success. /Edit

I tested and measured Vdd and Vpp and they seem fine,
only if AC characteristics need to improve.

I am really uncertain about settings in winpic800 and
about signal part of the schematics,
so can you please tell me about those?
 
Last edited:
Hi again,

You might want to check the signal timings to make sure they comply with the requirements for the uC being programmed. If they are not right it wont work either...it's not just a matter of hardware.
 
Hi again,


Oh very good news and im happy to hear that. Yes would be nice to see the complete project here next.
Good luck with it. Maybe you'll be posting one of your uC projects later too.
 
To meet the programming spec for many PICs the Vpp needs to rise very quickly, so there should be no capacitance on the switched Vpp output.

You have a 100nF cap on the switched Vpp output.
 
I glanced at programming specification and I think it also says that Vpp rises before Vdd for programming mode.
I think MrAl specifically told me to put that cap there. (post #4)

OK I'll have to read up and decide on that.

Thanks.
 
Last edited:
Most of the early programmers didn't have a cap.

If you rise Vpp to 14v when Vdd is 0v you should be ok. From memory the problem occurs when Vpp rises slowly while the micro is powered up, as the osc and program counter might run a few cycles as the Vpp passes through the 5v zone.
 
So here is my first code.
It works (somewhat, I have problems with pins 3,4).

Code:
LIST p=16F628          ;tell assembler what chip we are using
 include "P16F628.inc"  ;include the defaults for the chip
 __config 0x3D18        ;sets the configuration settings (oscillator type etc.)


 org 0x0000 

 movlw  0x07
 movwf  CMCON    ;turn comparators off (make it like a 16F84)

 bsf 	STATUS,RP0
 movlw  b'00000000'
 movwf  TRISA
 movlw  b'11111111'
 movwf  TRISB
 bcf	STATUS,RP0

 movlw 0x80
 movwf 0x20 
 movwf PORTA 

loop   btfsc PORTB,1
       call  fwd
hold1  btfsc PORTB,1
       goto  hold1

       btfsc PORTB,2    
       call  bck
hold2  btfsc PORTB,2
       goto  hold2

       goto loop


fwd     btfsc 0x20,7
        goto end1
        bcf STATUS,C
        rlf 0x20,1
        movf 0x20,0
        movwf PORTA 
end1    return


bck     btfsc 0x20,0
        goto end2
        bcf STATUS,C
        rrf 0x20,1        
        movf 0x20,0   
        movwf PORTA 
end2    return


 end
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top