program a PIC 18F4520 with basicstamp

sirbow2sirbow2 Posts: 3
edited August 2011 in BASIC Stamp Vote Up0Vote Down
hi i have a 18F4520 that needs a bootloader on it so that i can use USB or RS232 to program it (the PIC) without a separate programmer chip. But, i dont have one of these programming kits...So can i use my basic stamp to either load a program (the hex file) or a bootloader on to my PIC?

thanks!

PS i found this:
"On one level - yes you could. That is: you could add the tiny amount of
extra hardware needed to switch Vpp & Vdd and write a PBasic program to
read a hex file from your PC and burn that code into a PIC. In other
words, you could use a Stamp as the brains behind a PIC programmer."
Here: http://forums.parallax.com/showthread.php?75462-Programming-a-PIC-microcontroller&p=515835&viewfull=1#post515835
but how? is what i thought after reading that.
Tagged:

Comments

  • 5 Comments sorted by Date Added Votes
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 19,552
    edited August 2011 Vote Up0Vote Down
    I've done this on the MoBoStamp-pe for the onboard AVR chip, and it works without a hitch. As long as the PIC has a serial programming mode, what you want to do should be possible. The only gotcha might be generating the VPP voltage necessary, if something other than Vdd is required for programming. You need to consult the Microchip programming AppNote for the chip you want to program to see what the requirements are. You probably won't get -- and should not expect -- much further help from this forum, though, unless someone else has already duplicated what you're trying to do.

    -Phil
    “Impossible is just a big word thrown around by small men who find it easier to live in the world they'’ve been given than to explore the power they have to change it. Impossible is not a fact. It’'s an opinion. Impossible is not a declaration. It'’s a dare. Impossible is potential. Impossible is temporary. Impossible is nothing.” –Muhammad Ali
  • sirbow2sirbow2 Posts: 3
    edited August 2011 Vote Up0Vote Down
    i cant program via SERIAL or USB until it has a bootloader. first the PIC must be flashed using ICSP (ICSP is built into the PIC + doesnt require a bootloader, but requires a programmer). ICSP->USB adapter or ICSP->SERIAL adapter. or in my case i want to do a ICSP-> BasicStamp. afterwards if it works i can just go from my PIC directly to my PC's USB or SERIAL port.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 19,552
    edited August 2011 Vote Up0Vote Down
    ICSP (in-circuit serial programming) is what I meant by "serial". As long as you can do that and can generate the necessary programming voltages, the BASIC Stamp should be able to handle the job. But you're going to be pretty much on your own making it happen, unless someone here has already done it or you can find assistance on one of the PIC forums.

    -Phil
    “Impossible is just a big word thrown around by small men who find it easier to live in the world they'’ve been given than to explore the power they have to change it. Impossible is not a fact. It’'s an opinion. Impossible is not a declaration. It'’s a dare. Impossible is potential. Impossible is temporary. Impossible is nothing.” –Muhammad Ali
  • sirbow2sirbow2 Posts: 3
    edited August 2011 Vote Up0Vote Down
    ok, got ya.

    ... and i have no clue what i need to program the BS2 with for this to work. for anyone reading this, do you know how to write a program for the BS2 to write hex programs to PIC's?

    ICSP has a data port and a clock port(and the volt stuff). would these just be two I/O pins on the BS2?
Sign In or Register to comment.