View previous topic :: View next topic |
Author |
Message |
bwhiten
Joined: 26 Nov 2003 Posts: 151 Location: Grayson, GA
|
Programming connections for two devices, one RJ |
Posted: Thu Jan 03, 2008 8:13 am |
|
|
I couldn't find a related topic doing a search but it's hard to believe this isn't being done.
I have two PIC devices on the same board and I would like to use only one RJ connection to program both. Does one device need to be held in reset or some other state while the other is being programmed or are they connected in series some way device-to-device?
By the way, I'm using the ICD-U40.
Thanks. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Thu Jan 03, 2008 9:07 am |
|
|
Will you be doing high voltage programming? |
|
|
bwhiten
Joined: 26 Nov 2003 Posts: 151 Location: Grayson, GA
|
Possibly not |
Posted: Thu Jan 03, 2008 9:12 am |
|
|
I believe the ICD-U40 will allow you to do low voltage programming? If so and it allows me to eliminate the second RJ connector that's what I'm looking for. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Thu Jan 03, 2008 9:17 am |
|
|
Is it just the physical RJ connector you don't like??
ie: "wires are wires", you could use a 6 pin header on .1" centers.(i do)
[[you could even use less than 6 pins]] |
|
|
bwhiten
Joined: 26 Nov 2003 Posts: 151 Location: Grayson, GA
|
|
Posted: Thu Jan 03, 2008 9:22 am |
|
|
No. I just don't want to populate two connectors for two PICs. Trying to save miniscule amounts of money wherever possible. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Thu Jan 03, 2008 9:45 am |
|
|
High voltage programming is by far the most common. Use it.
For 5 pin this is simply done with two lines for clock and data, and three
other lines for power, ground and the programming voltage.
If you want debugging then I'd use 6 pins (MCLR,+5,gnd,RB7,RB6,RB3)
RB3 is optional and what CCS uses for debug serial info.
So i would use two 6pin headers. one for each then run the the lines to the PICs for programming/debug.
You can't run them in parallel because PIC1 may drive a line low while the other PIC2 tries to drive it high.((it might be possible if a PIC is held in reset, but it doesn't seem cost justified)) ((what if you want to debug both at the same time))
Is this for a production part? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Thu Jan 03, 2008 1:54 pm |
|
|
You might get away with one programming header, but I think you'll need at least 4 additional headers to disconnect one PIC or the other's Vcc & MCLR pins. If the PICs you're using have multiple Vcc pins, then you'll either have to install more disconnect headers or the layout on the board gets a bit more difficult.
The 'disconnect' I'm thinking of is a 2 pin header on the board with a shorting jumper. I don't know if this would actually work either. You'd need to breadboard it to see if you can actually program either one or the other while keeping the program data & clock lines in common. |
|
|
bwhiten
Joined: 26 Nov 2003 Posts: 151 Location: Grayson, GA
|
|
Posted: Thu Jan 03, 2008 3:26 pm |
|
|
Yeah, I already have a schematic with a 3 x 4 header (read "jumper block") on it that I could use but it is almost as expensive and takes as much real estate as the RJ connector and I don't like jumpers for ruggedness in the field.
I may just use my RJ-12 to 6 pin header adapter cable and place the smallest header I can find on the pcb.
I've also seen the threads on programming one PIC with another and that's an option I might try.
I'm a little suprised there is no standard method of daisy-chaining PIC programs like JTAG. |
|
|
adrian
Joined: 08 Sep 2003 Posts: 92 Location: Glasgow, UK
|
|
Posted: Fri Jan 04, 2008 7:55 am |
|
|
I can think of a way using a 6 pin header and a DPDT switch - but I have not tried it.
It also depends upon what your MCLR pins are connected to.
The pinout for ICSP is as follows:
1 Vpp
2 Vcc
3 Gnd
4 Data
5 Clock
6 Debug
If on your PCB,
pin 1 is tracked to MCLR of chip 1.
Pins 2 through 5 are wired as normal to both chips.
pin 6 is tracked to MCLR of chip 2.
You can then wire your programming adapter as follows.
Pin 1 goes to common1 of the switch.
Pins 2 through 5 are connected as normal to the programmer
Pin 6 goes to common2 of the switch.
Do not connect pin 6 of the programmer.
In switch position 1:
Pin 1 is routed to Vpp of the programmer to programme chip 1.
Pin 6 is grounded holding chip 2 in reset.
In switch position 2:
Pin 1 is grounded holding chip 1 in reset.
Pin 6 is routed to Vpp of the programmer to programme chip 2.
I tried to do some ASCII artwork - which was fine when typing in the message, but it got screwed up when viewed in the preview window.
This arrangement has two problems:
One chip is always held in reset, you would need to unplug the programming link to get both chips to run.
And like treitmey said, you would not be able to use this for debugging. |
|
|
ratgod
Joined: 27 Jan 2006 Posts: 69 Location: Manchester, England
|
|
Posted: Tue Jan 08, 2008 5:20 pm |
|
|
I did a method on a board where I had a single programming header and 3 sets of jumpers to switch PGD, PGC and MCLR pins between the 2 chips.
Works fine for me |
|
|
|