ICSP with several PIC mcu on the same board ? - Page 1
Forum section: electronics / general

author: Jaunedeau
author_rank: Regular Contributor
timestamp: March 24, 2015, 05:27:29 pm
content: Hi,I am currently working on a board which will have 3 small Pic mcus. The MCU will drive leds, and I guess that if I plug an ICSP on the board, I will power the three MCU, and two will start blinking leds while I programme the third, and that may draw too much current from the programmer.Another issue is that I am very short on space and having three separate 5 pins header is nor possible.Is there a known solution to this problem ?Thank you,John.

author: 6thimage
author_rank: Regular Contributor
timestamp: March 24, 2015, 06:01:56 pm
content: You could use jumpers for each of the pic power connectors - this would allow you to only have one pic powered at a time and would also allow them to share the same ICSP header. Alternatively, if you are using through hole pics, you could use sockets and program them on a different board.

author: nctnico
author_rank: Super Contributor
timestamp: March 24, 2015, 06:21:10 pm
content: I have seen designs where 10 PICs where programmed in parallel. Just one PIC reports back to the programmer. However for your own sanity I strongly suggest to move to a different controller which is big enough to do the task of the 3 PICs. It may seem more work for now but getting several microcontrollers to work together reliably is much harder (and more work)!

author: Jaunedeau
author_rank: Regular Contributor
timestamp: March 24, 2015, 07:05:53 pm
content: The PCB will be apparent and its aesthetic is very important :-Having jumpers for each mcu will not look nice.-The pcb is only 8mm wide, and I could not find an mcu with a shape that fit the constraints. I spent hours looking at datasheet of leds drivers, but I could only find one that may suit (using 2 of them plus some IO on the PIC to drive the 24 leds), but in the end it is not really more handy (+more expensive components which are harder to source) than using 3 pics.-Of course, the MCU are QFN and can not be programmed on sockets.The only problem with the 3 mcu solution is that I don't find a way to have ICSP.Of course, I could proto with DIP PICs, and use some UQFN20 socket (I could not find where to buy them, I guess you have to DIY one ?), but I'd like the device to be hackable (it will be open soft / hard).Another possibility I have is to power the device with the normal PSU, and have 3x3 small apparent pad for mclr/icspdat/icspclk. I could then make a icsp to pogo pins adapter. But I'm still open to any idea

author: 6thimage
author_rank: Regular Contributor
timestamp: March 24, 2015, 07:59:45 pm
content: That makes things a little more difficult - you could always use a CMOS switch for the power line, but it will limit the maximum current - Analog's ADG849 comes in an SC70 package and has a maximum current of 400 mA. In a similar way, you could always use a mosfet.I'm surprised you couldn't find any other microcontrollers that fit the size constraints - which pic are you using? I've had a quick look on Farnell - Freescale have a Cortex M0 in a 24 pin QFN that's 4 x 4 mm (it was the MKL04Z8VFK4) and ST also have a Cortex M0 (STM32F030F4P6TR), but in a 20 pin TSSOP, which at 6.6 mm might be a bit more of a squeeze, but not impossible on an 8 mm wide board.

author: 22swg
author_rank: Frequent Contributor
timestamp: March 24, 2015, 08:39:19 pm
content: Could you just switch the mclr/reset pin with a smd switchhttp://uk.farnell.com/c-k-components/rte0300g04/switch-sp3t-0-1a-30vdc-smd/dp/2320092

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: March 24, 2015, 09:09:36 pm
content: Why are you powering from the programmer?And why can't you just increase the current available?

author: David_AVD
author_rank: Super Contributor
timestamp: March 24, 2015, 09:20:33 pm
content: I made myself a short 6 pin male-female ICSP cable with a DC socket spliced into the Vdd and Vss lines.Great for powering the board temporarily from the ICSP header but not putting any strain on the programmer's supply rail.

author: Jaunedeau
author_rank: Regular Contributor
timestamp: March 24, 2015, 10:16:34 pm
content: Quote from: mikeselectricstuff on March 24, 2015, 09:09:36 pmI tryed to find the information in the datasheet (but apparently it is in the programming document and not in the datasheet), but I was not sure if it is possible to continuously power the pic and jsut use the GND, ICSDAT, ICSPCLK and MCLR pin from the programmer. If it is possible, that would make the pogo pin solution simpler.QuoteWhat I could not found are dedicated led driver that use no or few external component and are available in 4x4mm or 5x5mm package.There are plenty of Pic mcu that can be used as a led driver. Pics are interesting because of the internal current limiting diode which means I do not have to add 24 resistors on my tiny PCB. The only problem is that it make me want to add to more ICSP header and that waste space.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: March 25, 2015, 12:15:53 am
content: Quote from: Jaunedeau on March 24, 2015, 10:16:34 pmMost, if not all, PICs have no requirements for power sequencing during programming (I have a feeling that there were one or two very old ones that did), so yes, you can usually just have everything powered normally to program.If the programmer is not outputting power it will usually need to be fed power so it can sense the voltage - e.g. pickit 3 and ICD3 use this to detect when the programmer is connected, and attempt to connect and ID the chip.I don't think I've ever done it any other way with various 8,16 and 32 bit devices. If I'm programming a board that isn't powered, I just stuff 5 or 3.3V as appropriate on the power pin of the programming connector/pogo pins

author: Jaunedeau
author_rank: Regular Contributor
timestamp: March 25, 2015, 08:40:39 am
content: Ok, thank you !I'll start the 6th version of the board, with pads for pogo pins and external power supply for programming.