Results 1 to 10 of 10

Thread: Question on using a PIC chip to program another PIC chip

  1. #1

    Question on using a PIC chip to program another PIC chip

    Is is possible to program another PIC chip with a PIC chip? I have a device I'm building that incorporates several PIC chips but I can only access one without opening up the enclosure which I don't want to do.
    In a perfect world I would not need to do an update to the various programs on the various chips in the device but such is not the case. I was thinking I could compile the code and send it serially to the main chip which could store it on a FRAM memory chip and then use the main chip to program the other chip. Is something like this possible?

  2. #2
    Actually, we are considering such a product for future release. We use such a chip on our Trainer and D-Stick boards. It has the capability of controlling multiplexors to program multiple PICs in a system. I designed a product that uses this system to update 3 PICs with each firmware update. It's been in the field for a couple of years and is working well.

    The chip supports all of the devices that our U2 does and works with the meProg software. The current limitation is that it only works for low-voltage-programming. It works best with newer PICs that do LVP on the MCLR pin. Most PICs with part number patterns PIC16F1xxx and PIC18FxxKxx do this.

    As a bonus, it also enumerates as a USB Virtual COM Port. You wire your RX/TX to pins on the programmer chip for this purpose.

    See the D-Stick Product Instructions section 2.3 for a simplified schematic: http://melabs.com/downloads/DStick19...uct_Insert.pdf

    I would be happy to supply chips for beta testing. I haven't written a datasheet yet, but I have the required information. Is this a one-off project, or are you planning on mass production? Have you chosen the target PIC devices yet?
    Charles Leo
    ME Labs, Inc.
    http://melabs.com

  3. #3
    Hi Charles,

    Thanks for responding.
    I'm using two different PIC chips. One is an 18F87K22 and the other is an 18F26K22. Both should be low voltage.
    I'm currently building the prototype and expect to be field testing it in early April. I do expect to be producing these devices at about 50 per month come July 2017.
    These units will be on mining equipment in remote areas. If software bugs come up, I would like to be able to send out a file and have them flash it in. The enclosure currently has one serial port to access the main PIC as well as a port for programming the main PIC. Assuming your device could work, I'd like to set up my circuitry to accommodate it even though you mentioned it's still in the pipeline.

    Regards,
    Eric

  4. #4
    I can post a schematic for multiplexed connection to the PICs you are using. (They happen to be the same PICs that I use. Feeling the K22 love!)

    I can supply the programmer chip in 28-pin SPDIP, SOIC, SSOP, or QFN packages. The QFN has different pin numbering. Should I draw the schematic for the SPDIP/SOIC/SSOP packages?

    The multiplexing for multiple targets requires an additional chip. I use the SN74LV4053ADR. You specify the address of the target device on the meProg command line (or from a menu/dialog). The programmer chip puts that address on output pins that feed the 4053's selection pins. I can think of ways to attempt this without the mux chip, but I haven't tested anything.

    Our chip is ready and thoroughly tested in the field. The only reason it's not on our store already is that I hate writing datasheets.

    The meProg software already supports the chip and all of its functions. It is possible in the current version of meProg to apply your brand (so the user sees your company name on the progress bars). There are various ways to batch the update process or embed the hex code in your software application. Your customers won't see the meProg interface unless you want them to. The meProg installation includes a digitally-signed driver for the COM port and I can assist if you want sign a duplicate with your company name.
    Charles Leo
    ME Labs, Inc.
    http://melabs.com

  5. #5
    It would be great if you could post a schematic for the multiplex connection to the PICs as well as a schematic for the SPDIP/SOIC/SSOP package programmer chip. I can incorporate it into my PCB layouts.
    Once I get the new boards made (in 3 weeks), I'll order some programmer chips from you and start experimenting. This will be a fantastic help.

    Regards,
    Eric

  6. #6
    I've created a schematic example:

    http://melabs.com/downloads/mux_example.pdf

    The power pins don't show in my software. The programmer chip is shown as a PIC18F25K50 because that's what we use for a base. Connect power as you would normally to a PIC.

    I've shown normal ICSP connections for each target. These should work when the programmer chip is installed.

    I'll answer questions as needed.
    Charles Leo
    ME Labs, Inc.
    http://melabs.com

  7. #7
    Hi Charles,

    Thank you for the schematic!
    I have a quick question on the schematic.
    I'm making use of several PICs. One PIC is dedicated to the keyboard and lcd. There are a lot of submenus on the LCD for viewing data as well as changing EEPROM settings so I have dedicated a 18F87K22 to this task. I could have gone with a smaller PIC but I wanted all the extra RAM space that the '87 offers. A second PIC (18F26K22) is dedicated to the GPS. It receives the GPS data as well as correction signals and processes it. A third PIC (18F26K22) is dedicated to the sensors of which there are several and needs to be monitored continuously in spite of them having FIFO buffers. And finally, I have a main PIC (18F87K22) which acts as a central switch board interacting with the other PICS as well as managing power distribution, and 6 different serial interfaces (Quarts with their deep buffers are handy for this). As you can see, I have 4 PICs running. On your schematic I noticed only two PICs. Can I add connections to include 2 more PICs? I don't know if there are any useable Muxs that are 4 channels with 3 circuits.

    Eric
    Last edited by khufumen; 03-04-2017 at 10:48 AM.

  8. #8
    I didn't realize you had more than 2 targets. The programmer chip will output addresses 0-7 on pins 3, 4 and 5.

    Code:
    PIN:  5   4   3
    0     0   0   0
    1     0   0   1
    2     0   1   0
    3     0   1   1
    4     1   0   0
    5     1   0   1
    6     1   1   0
    7     1   1   1
    Instead of the single 74LV4053 that I've drawn, you could use two of the MC74HC4052A for a 1x4 mux controlled by pins 3/4 of the programmer.

    Note the serial resistance on the MCLR lines (R99, R101). The purpose of these is to allow a high-voltage programming cycle from a normal ICSP connector to any single chip. If you don't have resistance, the low-voltage method still works from the programmer chip, but the mux chip won't allow Vpp above Vdd for normal programming.

    I also think it's a good idea to have steering resistors on all the pins that will float when not connected through the mux. On my schematic, these are resistors R2, R5, R6, R7, R69, R72.

    Is this enough info? I can draw it if needed, but it will be probably be a day or so before I get to it.
    Charles Leo
    ME Labs, Inc.
    http://melabs.com

  9. #9
    Hi Charles,
    Thanks so much for your help on this.
    I'll go ahead and design for two muxs.
    I'll go ahead and put together a schematic during the coming week and then send it your way to check that I got it right.

    Thanks again,
    Eric

  10. #10

    I have 2 PIC's to remote program from a remote location.

    Charles.... Interesting functionality.
    I am also interested in this programming option.
    We use a 18F2520 and 18F2431 in a motor controller product.
    We are looking for a way to remote update one or both PIC's from our lab.
    Our package is potted and remotely located so sometimes we do not have the option of re programming locally.
    We now use your field programmer for non potted product but would like to have the same function only from a remote location by sending out each PIC hex file via the internet.
    This is basically the same function we see when our cell phones are updated only we will be re programming the PIC of choice.
    We are OK with adding the extra stuff and expense inside the product if we can have an option of remote updates to the product.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •