Shop OBEX P1 Docs P2 Docs Learn Events
program a PIC 18F4520 with basicstamp — Parallax Forums

program a PIC 18F4520 with basicstamp

sirbow2sirbow2 Posts: 3
edited 2011-08-04 20:23 in BASIC Stamp
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.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-04 19:26
    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
  • sirbow2sirbow2 Posts: 3
    edited 2011-08-04 19:34
    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: 23,514
    edited 2011-08-04 20:15
    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
  • sirbow2sirbow2 Posts: 3
    edited 2011-08-04 20:23
    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.