A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
I'd
like to implement the ICSP feature into a board but this feature seems somewhat
non-trivial. The Microchip app notes just show a diode in the MCLR line to isolate the VDD based RC network from the 13v VPP. This seems fine except that how does the MCLR line go low from a pwr-on reset? It looks like it would float. I have a scheme for managing the remaining pins (VDD, RB6&7, PGM) but isolating the VPP seems to be a problem. thanks, dave. |
|
|
|
> I'd like to
implement the ICSP feature into a board but this feature seems somewhat non-trivial.
Which programmer do you want to use (for instance: my Wisp628 requires that the R at /MCLR is 33k or higher), and what reset circuit would you have used if ICSP was not an issue? Note that for the PICs that can configure /MCLR
as input the programmer must also be able to switch Vcc!
Wouter van Ooijen |
|
One approach I have tried with success uses a 10 pin (2 rows of 5) header. When programming the programmer connects through the header to the pins of the PIC. When operating there is a shorting plug inserted. Don't forget the new requirement to deal with RB3 (it must be held to ground during programming). I guess a 12 pin header will be required in future designs. You might look at the info on www.newfoundelectronics.com where this method is discussed. You might also look at the Wisp628 programmer that Wouter van Ooijen sells at http://www.voti.nl/wisp628/index.html. He has a different approach to the MCLR' problem that seems interesting. I am certain he will weigh in on this and he has a lot of experience. --- In , dkbovaird@a... wrote: > I'd like to implement the ICSP feature into a board but this feature seems > somewhat non-trivial. > > The Microchip app notes just show a diode in the MCLR line to isolate the VDD > based RC network from the 13v VPP. This seems fine except that how does the > MCLR line go low from a pwr-on reset? It looks like it would float. > > I have a scheme for managing the remaining pins (VDD, RB6&7, PGM) but > isolating the VPP seems to be a problem. > > thanks, > dave. |
|
I'm
in the process of wiring up my own programmer based on the david tate CPP design, or
similar to the ProPic2 design. I've attached my schematic and would welcome any comments.
I'm nearly done wiring and so haven't tested it yet. (I'm still waiting for my K149 kit,
maybe sometime today....I think its on the slow boat from China, but thats ok since I'm
cheap) The reset circuit I would generally use would be a 10K res. to Vdd and a 100nF cap to gnd with possibly a N.O. switch across the cap for manual resets with a 100ohm res. connecting this net to the MCLR pin. I took a quick look at your Wisp628 design and it looks quite nice. Changing the 10K-100 resistor pair in my typical reset net to meet your reset circuit requirements shouldn't be an issue. I guess the relatively high resistor values you recommend would limit the amount of current being fed back into the 5v source of the target bd. I was planning to keep the target power off and adding a jumper in the supply line to the PIC to switch between the Vdd programming voltage supplied by the programmer instead of the target bd. Vdd. A second jumper could isolate the MCLR/Vpp pin on the PIC. But I was wondering how others overcame these questions. thanks, dave. In a message dated 6/3/03 8:59:45 AM Pacific Daylight Time, w...@voti.nl writes: Which programmer do you want to use (for instance: my Wisp628 requires that the R at /MCLR is 33k or higher), and what reset circuit would you have used if ICSP was not an issue? Note that for the PICs that can configure /MCLR as input the programmer must also be able to switch Vcc! | |||
| |||
|
|
|
I
thought that I could just add a 10K pull down (or some variation on this if the line was
normally pulled up for some reason in my app.) on the RB line and not have to worry about
adding a PGMEn line to the ICSP I/F. dave. In a message dated 6/3/03 9:11:23 AM Pacific Daylight Time, r...@pacbell.net writes: Don't forget the new requirement to deal with RB3 (it must be held to |
|
> I took a quick
look at your Wisp628 design and it looks quite nice. Changing the 10K-100 resistor pair in
my typical reset net to meet your reset circuit requirements shouldn't be an issue. I
guess the relatively high resistor values you recommend would limit the amount of current
being fed back into the 5v source of the target bd.
For Wisp628 compatibility the C
will cause trouble, you could use a 10k and 33k in series and put the C at the
junction.
> I was planning to keep the target power off and adding a jumper in the supply line to the PIC to switch between the Vdd programming voltage supplied by the programmer instead of the target bd. Vdd. A second jumper could isolate the MCLR/Vpp pin on the PIC. I always
opt for 'no hands' ICSP, so no jumpers to set or switches to toggle between program and
run mode.
But I am
not familiar with your type of programmer, so I can not comment more.
Wouter van Ooijen |
|
I
think I found a method to handle the VddP and Vpp during ICSP within Microchips AN820
which I can adapt to my own circuits. This will allow me to have a "hands free" or
jumperless interconnect between my programmer and the application bd. Microchips app note (DS30277) specifically describing ICSP with just a diode for isolation of the MCLR would never work without a pulldown somewhere (and apparently its not internal to the chip) so you have to add one externally (around a 100K or so). If anyone is interested I can elaborate more on the technique I plan to use. thanks for the previous comments, dave. |
|
|
|
You are correct, I don't think the diode isolated RC reset circuit will work either. The diode does work to prevent Vpp from reaching Vdd on the board but I can't see the reset capacitor doing much without some other pull-down. But I think MCLR' is the least of the problems because it is not required to have an RC reset circuit as long as the power supply ramps up fairly quick. In battery operated projects this is certainly the case. If your device has LVP on RB3 you must hold it to ground - again, this may affect your circuit design. Of course the other two RB pins have the same design problem - how to isolate the external circuitry. In every situation ICSP is driving the design - what pins can be inputs, what can be outputs, what about the rest of the project, if or how Vdd is isolated so the programmer doesn't power up the project, etc. The more I look at it the more convinced I get that the header solution proposed by Newfoundland Electronics is the best way to go. One could, I suppose, put in the 12 pin header and run it to a switch box with a 6 pole double throw switch during development and install the jumper plug when the system is ready for production. In fact, I like this idea - I think I will build this for all future projects. I realize this takes board space but it is guaranteed to work for all conditions and standardizes the design across the entire flash family in one way or another. --- In , dkbovaird@a... wrote: > I think I found a method to handle the VddP and Vpp during ICSP within > Microchips AN820 which I can adapt to my own circuits. This will allow me to have a > "hands free" or jumperless interconnect between my programmer and the > application bd. > > Microchips app note (DS30277) specifically describing ICSP with just a diode > for isolation of the MCLR would never work without a pulldown somewhere (and > apparently its not internal to the chip) so you have to add one externally > (around a 100K or so). > > If anyone is interested I can elaborate more on the technique I plan to use. > > thanks for the previous comments, > dave. |
|
|
|
> The more I look at it the more convinced I get that the header > solution proposed by Newfoundland Electronics is the best way to go. Does this give you a hands-off program-and-run? IMHO it is of little use for development when you must fiddle with the hardware to restore the 'real' circuit. My idea would be: - PGM is pulled low, requires a single resistor. it can be used as an output by the circuit, or even as an input when it is guaranteed to be low during reset (for instance a pulldown-R and a normally-open switch to Vcc) - RB6 and RB7 can be inputs or outputs for the circuit, as long as the circuit loads these pins sufficiently light for the programmer to drive the pins (for Wisp628 10k will do, 1k will do when the series resistors are 47 ohm) - I put a 33k between /MCLR and the reset of the circuit. For a simple 'reset' this R can go to Vcc. - for PICs that require Vpp-before-Vcc the Vcc must be supplied by an 78(L)05 and the elco at the Vcc pin (if any) must not be too large (I mostly use 22uF). For a Wisp628 programmer 3 extra components are needed (1n4148, 1k, TIP120). With this setup I simply clip a DIL test clip on the PIC, no PCB area wasted, and I can program and test without touching the target circuit. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products |
|
|
|
Actually, it could be hands-off if the cable from the programmer went to a double throw switch before going to the 12 pin header. Toggle switch in one position to program and the other position to run. Finish the project by putting a jumper plug in the header and call it a day. Even your design means I can't put a 220 ohm resistor and LED on RB6 and RB7. I actually like your scheme more than the one from Microchip - the 5 pin header still takes space and the dip clip is a very nice way to do the job. --- In , "Wouter van Ooijen" <wouter@v...> wrote: > > The more I look at it the more convinced I get that the header > > solution proposed by Newfoundland Electronics is the best way to go. > > Does this give you a hands-off program-and-run? IMHO it is of little use > for development when you must fiddle with the hardware to restore the > 'real' circuit. > > My idea would be: > - PGM is pulled low, requires a single resistor. it can be used as an > output by the circuit, or even as an input when it is guaranteed to be > low during reset (for instance a pulldown-R and a normally-open switch > to Vcc) > - RB6 and RB7 can be inputs or outputs for the circuit, as long as the > circuit loads these pins sufficiently light for the programmer to drive > the pins (for Wisp628 10k will do, 1k will do when the series resistors > are 47 ohm) > - I put a 33k between /MCLR and the reset of the circuit. For a simple > 'reset' this R can go to Vcc. > - for PICs that require Vpp-before-Vcc the Vcc must be supplied by an > 78(L)05 and the elco at the Vcc pin (if any) must not be too large (I > mostly use 22uF). For a Wisp628 programmer 3 extra components are needed > (1n4148, 1k, TIP120). > > With this setup I simply clip a DIL test clip on the PIC, no PCB area > wasted, and I can program and test without touching the target circuit. > > Wouter van Ooijen > > -- ------------------------------------------- > Van Ooijen Technische Informatica: www.voti.nl > consultancy, development, PICmicro products |
|
|
|
Using
a dip clip is a nice way around having to dedicate board real estate to a 5 pin header,
asuming you're using a PDIP or SOIC package whch I guess most of us probably are in hobby
type applications. dave. In a message dated 6/4/03 3:14:14 PM Pacific Daylight Time, r...@pacbell.net writes: I actually like your scheme more than the one from Microchip - the 5 |
|
> Actually, it could be hands-off if the cable from the programmer went > to a double throw switch before going to the 12 pin header. Toggle > switch in one position to program and the other position to run. > Finish the project by putting a jumper plug in the header and call it > a day. I would not call that hands-off, you have to manipulate the switch so you can't run let's say 1000 tests automatically during a night. > Even your design means I can't put a 220 ohm resistor and LED on RB6 > and RB7. No. I am afraid 220 ohm is to high a load even without series resistor to get a reliable level. You would need a beefy driver for this. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products |
|
|
|
On Wed, 4 Jun 2003, rtstofer wrote:
> Actually, it could be hands-off if the cable from the programmer went > to a double throw switch before going to the 12 pin header. Toggle > switch in one position to program and the other position to run. > Finish the project by putting a jumper plug in the header and call it > a day. > > Even your design means I can't put a 220 ohm resistor and LED on RB6 > and RB7. Probably because your programmer does not assure enough programming current. Any paralel programmer will allow this, with or without suplying the board with external +5V supply. For fun, mounting a buzzer on RB7 ( via a npn driver) will transform your programmer into an old Sinclair Spectrum in loading phase...:) Vasile |
|
On Thu, 5 Jun 2003, Wouter van Ooijen wrote: > > Actually, it could be hands-off if the cable from the programmer went > > to a double throw switch before going to the 12 pin header. Toggle > > switch in one position to program and the other position to run. > > Finish the project by putting a jumper plug in the header and call it > > a day. > > I would not call that hands-off, you have to manipulate the switch so > you can't run let's say 1000 tests automatically during a night. > > > Even your design means I can't put a 220 ohm resistor and LED on RB6 > > and RB7. > > No. I am afraid 220 ohm is to high a load even without series resistor > to get a reliable level. You would need a beefy driver for this. > I'll not be so sure... :) 5V-1.5V(led droupout)=3.5V/220=aprox16mA I haven't take in account the voltage drop on internal pmos or nmos which is not zero. My parallel programmer can more than 30mA on both clk and data. |