Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

pic16f877 in circuit programming

Status
Not open for further replies.

D1_DRE

Member level 3
Joined
Apr 26, 2002
Messages
61
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
518
pic16f877a circuit

Well I'm attempting to integrate in circuit programming into my application and I was wondering whether anyone has done this before. My problem is interfacing high voltage in circuit serial programming for PIC16F877 via pin PIN 1, RB6 and RB7 at the same time use this pin for another application. I have considered using jumpers to switch affected pins but this I don't really like. Do you guys know of a better way of making this system completly automated? i.e. I will only have to plugin the programming cable and program the pic straight away. Use of Bootloader is not an option though

Thanks
 

digidot

Junior Member level 1
Joined
Apr 13, 2002
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
80
pic16f877 in-circuit programming

I have not seen another way of doing this automatically. The best isolaton is with jumpers or DIP switches. If there is another way I would also be interested. My understanding is that the high voltage only effects the /MCLR pin and not RB6 and RB7.

Good luck
 

D1_DRE

Member level 3
Joined
Apr 26, 2002
Messages
61
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
518
use rb7 18f2550

You're correct digidot about high voltages only affecting /MCLR pin. voltages RB7 and RB6 are not always 0v-5v either and are dependent of how good the programmer is. This might have an adverse effect on any device dependent of these pins. Also you don't want to send the attached device into an unknown state.



Thus I have 2 solution for 2 scenarios

1> programming will occur via a plug n play connector.
which will behave much like the jumpers you sugested. Only this time one of the pins on he connector will switch ON an active low trasistor logic which will in turn, enable or disable RB7 and RB6 for either programming mode or I/O mode

2> Introducing an enable bit for the affected pins. This will of course involve sacrificing an extra IO pin, to enable 2 trasistor switches for normal IO mode and vice versal.

In some cases however we need not worry too much if the device connected have a master enable pin e.g an LCD. When the PIC enters programming mode the device will automatically be disabled anyway so invalid data ment for the PIC will simply be ignored by the LCD. Well, that was the idea I had after researching a bit further. Feel free to suggest modifications to this.
 

digidot

Junior Member level 1
Joined
Apr 13, 2002
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
80
pic16f877 circuit

Hi D1_DRE
The idea of using transistors to switch the RB6 and RB7 lines seems to be the best. I really like the idea. I will try it out on a new design. If you try it before I do then please let me know. I will do likewise.

Keep well
 

tapa

Super Member
Joined
Feb 17, 2002
Messages
134
Helped
8
Reputation
16
Reaction score
5
Trophy points
1,298
Location
spain
Activity points
1,094
pic 16f877 circut

why don't you use the low voltage mode programing (0-5v all pins)??
 

gelly

Junior Member level 2
Joined
May 17, 2001
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
138
pic16877 in circuit programming

using low voltage mode, is the same as
losing the pin rB3 i/o. so, i dont like it either....
otherwise, using standard high voltage mode
could be done, when u use a voltage switcher on the mclr pin, combined with a
analog switch 4066 on the rb7, rb6 pin.
this all, switched automaticly or with a
slide switch (program/normal).

for now, i am using a testboard (home made)
that i switch with a rotary sw.
prog/normal/off
that rotary is switching the mclr/rb6/rb7/power lines.
in prog mode, i use a mini relais to switch off the parallel port lines, and put the
attached buffers to the appropriate level.

maybe this setup is helping, to solve
a new setup who is better/portable.

greetz.



<font size=-1>[ This Message was edited by: gelly on 2002-04-28 22:35 ]</font>
 

D1_DRE

Member level 3
Joined
Apr 26, 2002
Messages
61
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
518
icsp pic16f877 vpp voltage

Very good point gelly. LVP is definately not an option. And Using a mechanical switch is what I'm trying to get rid of altogether. Back to the use of transistors. A slight modification. I can take advantage of the fact that, during high voltage programming the voltage on MCLR will exceed well over 10V in comperison with 5V during normal operation. A simple detection circuit can be used to control an analogue switch or transistors for RB7 and RB6 as the case may be. However, the big quenstion I'm yet to investigate is that, once programming begins,will I be correct to say that the voltage on MCLR will never drop below 10V even for 1ns until programming is finished?

I will appreciate your insight into this. And yes Digidot I'll be applying this method to a prototype and will let you know about the outcome.
 

mrcube_ns

Advanced Member level 1
Joined
Apr 10, 2002
Messages
452
Helped
48
Reputation
96
Reaction score
34
Trophy points
1,308
Location
Europe
Activity points
3,814
pic16f8xx parallel port programmer lvp

I use small rele and one taster to switch between programing uC and use uC. There is no mistake.

Regards.
 

D1_DRE

Member level 3
Joined
Apr 26, 2002
Messages
61
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
518
icsp lcd rb6 rb7

that should work i suppose

_________________


<font size=-1>[ This Message was edited by: D1_DRE on 2002-05-01 19:27 ]</font>
 

Stallion

Junior Member level 1
Joined
Oct 25, 2001
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
71
mclr pic16f877 circuit

I just added ICSP in both of my circuits. Here is what/how I found/did.

Using the 16F was pretty easy. Simply put a diode on the VPP (pin 1), RB6 & RB7 are both outputs on my circuit. So, this had no adverse effect by simply connecting them directly to my programmer.

The 18F part was a little more difficult. RB6 and RB7 were outputs, but they went to an RF chip. So, I had to add a pull-down resistor to make sure that the RF chip was in stand-by mode when programming. The stand-by pin also went to the pic, but I couldn't leave it floating during programming.

I tested the PIC16F parts with the ICSP from Microchip and had no problems. I did have to set a flag in Hi-Tech compiler to tell it I was doing ICSP.

The PIC18F parts have been nothing but trouble for me. I tried to use Microchip's ICD2. I have had NO luck at all. It simply doesn't work. I don't know if the problem in the 18F part or the ICD2. I tried upgrading the firmware and MPLab, but nothing seems to work. I tried different PIC18F242 parts, nope. I'm hoping they'll fix this soon, so that my new design can use this feature.

BTW - both of my circuits are running at 3.5V. ICSP works fine according the data sheets and app. notes. ONLY VPP goes to 13V. The only difference in low-voltage mode is that you loose a port B pin and you don't need 13V on VPP. In BOTH cases RB6 and RB7 only go to your VCC voltage.

Hope this helps...

Stallion
 

jetmarc

Member level 3
Joined
Dec 17, 2001
Messages
54
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,235
My problem is interfacing high voltage in circuit serial programming for PIC16F877 via pin PIN 1, RB6 and RB7 at the same time use this pin for another application.
I have not use the F877 so far, but you write it as if the high voltage pin is used for other applications as well. Ok, then just isolate it with a resistor (say 1k) and put a 5V1 Zener diode to the other circuit. On the PIC side you put the Programming connector. The pin can then be connected to 5V logic, and still be used as high voltage input during program (without damage to the other circuit).

Use 3V3 Zener for 3V logic.

jetmarc
 

D1_DRE

Member level 3
Joined
Apr 26, 2002
Messages
61
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
518
nice idea about the use of zener diode. However, This method will not prevent transmission of false data to the device pluged to this IO pin. what if the device is something a digital potentiometer. This implies that at the end of a programming sequence either you like it or not your tim pot would have shifted by an unknown increment. Think of what the implication will be, if the device is used in active control such as my application
 

msmax

Full Member level 1
Joined
May 6, 2001
Messages
99
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Pays Bas
Activity points
919
Still use a resistor as suggested by jetmarc and use a pin on your ICSP connector to pull used lines via diodes to low after the resistor (no need for zeners).

You also can use diodes to prevent High voltage being directed to your local 5V power supply of target circuit.

This should work even if processor is running.
Programming mode will be entered as soon MCLR is triggered.

Any lines connected to other circuits will carry "0" level and not any data or so.
 

btbass

Advanced Member level 5
Joined
Jul 20, 2001
Messages
1,897
Helped
438
Reputation
880
Reaction score
287
Trophy points
1,363
Location
Oberon
Activity points
12,861
Just put a series resistor in the RB6 and RB7 i/o lines of about 4K7 to isolate them from the rest of the circuit. (min 2K7) If they are inputs, depending on the source impedance, it wont hurt them, if they are outputs, depends what thier driving, worst case, use a buffer or transitor the circuit end of the resistors.
Most proggramers are quite happy with this arrangement.
Good luck. :-?
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top