EmbeddedRelated.com
Forums

what is the easiest way to control a pic from a pc?

Started by mr_gees100_peas July 21, 2006
> although I'm inclined to go with the
> 18F4550. The boot loader might be a good idea also. Then the program can
> be downloaded over USB. Could also download over RS-232, of course.
>
> Alan KM6VV
Hi

Sorry for a little thread jacking but the answer to my question may
help others searching the archives in the future, I have just got a
pair of 4550's and this loading over usb with a boot loader looks
interesting, it sounds like I could speed up development if I'm not
constantly swapping the chip out the prototype board back into the
programmer to put it back into the prototype etc ect

How do I do it (sorry for a newbie type question)

My old programmer died about a month ago, I just took delivery of a
willem this morning and now need to find a way to connect that to it.

If I only need to do it once to burn a boot loader into it and then
usb from then on, that would be great solution for quick one-offs.

failing that it has an isp connector, with the usual gnd,vpp,vcc, rb6
rb7, can I just solder a few flyleads on a 4550 and burn it that way
and then go usb-bootloader.

Lez
I tend to use the ISP for on board programming. With access to a
programmer that does ISP there is no real advantage to using a
bootloader which usually requires the use of another custom program
anyway. Just solder the header to the board and go.

DLC

Lez wrote:
>> although I'm inclined to go with the
>> 18F4550. The boot loader might be a good idea also. Then the program can
>> be downloaded over USB. Could also download over RS-232, of course.
>>
>> Alan KM6VV
>
> Hi
>
> Sorry for a little thread jacking but the answer to my question may
> help others searching the archives in the future, I have just got a
> pair of 4550's and this loading over usb with a boot loader looks
> interesting, it sounds like I could speed up development if I'm not
> constantly swapping the chip out the prototype board back into the
> programmer to put it back into the prototype etc ect
>
> How do I do it (sorry for a newbie type question)
>
> My old programmer died about a month ago, I just took delivery of a
> willem this morning and now need to find a way to connect that to it.
>
> If I only need to do it once to burn a boot loader into it and then
> usb from then on, that would be great solution for quick one-offs.
>
> failing that it has an isp connector, with the usual gnd,vpp,vcc, rb6
> rb7, can I just solder a few flyleads on a 4550 and burn it that way
> and then go usb-bootloader.
>
> Lez
>
>
HI Lez,

Follow all the threads on this URL, and you'll learn much! Ways to build up
a bootable PIC, and the PC apps to go with it.

http://pic18fusb.online.fr/wiki/wikka.php?wakkaCOMx
In it there are links to the MicroChip site, where you'll find ZIPs of
MCHPFSUSB, the files for the MicroChip PICDEM FS USB board.

Get the boot loader on the PIC; then you can use the PC downloader program.
No reason why you can't use ICD2 or other to program it the first time.

Circuit here for getting the USB stuff set up to look like a PICDEM board.
More then you need to work with the USB, 'tho.

http://www.burger-web.com/Projects/PIC18F4550USB/en_PIC18UsbBoard.htm.en

Gerhard also has a CNC project that uses USB and the 18F4550 that I'm
looking into. I have a board and firmware (programmed PIC) ordered. There
is a TON of info and source code on this site. Not all the pages are
translated to English, but don't let that stop you. Much to download. PC
app in Delphi I believe. I like C.
The MicroChip URL for the PICDEM board.

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId06&
dDocName=en021940
This site takes you through a PC application in Visual C and Visual BASIC.
Also some background on USB. It's the one I'm studying.

http://www.comvcon.com/
Jan Axelson's URL. New Mass Storage class book out. Where's the CDC class
book or info?

http://www.lvr.com/
The Create URL has a USB project and HID example. Also a simplified PICDEM
schematic. Good links! But watch for the S2 switch, I think they put it on
a DIFFERENT pin then PICDEM does. (Well, SOMEBODY is using a different
pin).

http://www.create.ucsb.edu/~dano/CUI/
Some PIC and C info here as well. Boot loader for '452.

http://www.microchipc.com./

If you're after CNC, Bert has a controller program and firmware (PIC) to run
it over USB. I've got this running, but there's no source code here.
Schematic for a simple board, 'tho.

http://www.usbcnc.com/
Any more good ones out there? I'd like to hear!
Alan KM6VV

>
> > although I'm inclined to go with the
> > 18F4550. The boot loader might be a good idea also. Then the program
> can
> > be downloaded over USB. Could also download over RS-232, of course.
> >
> > Alan KM6VV
> Hi
>
> Sorry for a little thread jacking but the answer to my question may
> help others searching the archives in the future, I have just got a
> pair of 4550's and this loading over usb with a boot loader looks
> interesting, it sounds like I could speed up development if I'm not
> constantly swapping the chip out the prototype board back into the
> programmer to put it back into the prototype etc ect
>
> How do I do it (sorry for a newbie type question)
>
> My old programmer died about a month ago, I just took delivery of a
> willem this morning and now need to find a way to connect that to it.
>
> If I only need to do it once to burn a boot loader into it and then
> usb from then on, that would be great solution for quick one-offs.
>
> failing that it has an isp connector, with the usual gnd,vpp,vcc, rb6
> rb7, can I just solder a few flyleads on a 4550 and burn it that way
> and then go usb-bootloader.
>
> Lez
>
Hi Dennis,

True. I use the ICD2, and find it very fast to reprogram a PIC. I think
the advantage of a boot loader is AFTER the product is installed. But good
for a very low cost approach to working with a PIC (no programmer!).

It just so happens that the PICDEM FS USB board and its support files DO go
into the Boot, which is nice. The boot code is also a simple example of
USB. The demo is good too!

Alan KM6VV

> Of Dennis Clark
>
> I tend to use the ISP for on board programming. With access to a
> programmer that does ISP there is no real advantage to using a
> bootloader which usually requires the use of another custom program
> anyway. Just solder the header to the board and go.
>
> DLC
>
> Lez wrote:
> >> although I'm inclined to go with the
> >> 18F4550. The boot loader might be a good idea also. Then the program
> can
> >> be downloaded over USB. Could also download over RS-232, of course.
> >>
> >> Alan KM6VV
> >
Alan,

I too have the FS USB PICDem board and have noted the bootloader over
the USB, I guess that they use that as a further example of using a USB.
And of course you are correct, the bootloader is essential for field
upgrades. Love the "circle the mouse" demo. If ever a workable IDE
exists on a Mac or Linux box the the bootloader would also be great
since getting the ICD2 to work on anything but Windows native has been,
so far, a bust.

I've been trying to see if MC can help me with CDC driver information
on ANYTHING but a Wintel PC, but no joy there. I've heard it rumored
that setting up CDC drivers on a Mac is easier than on a Wintel, but
heck, all you need to do to flesh out the CDC on the Wintel is fiddle
with an .inf text file on the PC, so, what is needed on a Mac?

have fun,
DLC

Alan Marconett wrote:
> Hi Dennis,
>
> True. I use the ICD2, and find it very fast to reprogram a PIC. I think
> the advantage of a boot loader is AFTER the product is installed. But good
> for a very low cost approach to working with a PIC (no programmer!).
>
> It just so happens that the PICDEM FS USB board and its support files DO go
> into the Boot, which is nice. The boot code is also a simple example of
> USB. The demo is good too!
>
> Alan KM6VV
>>Of Dennis Clark
>>
>>I tend to use the ISP for on board programming. With access to a
>>programmer that does ISP there is no real advantage to using a
>>bootloader which usually requires the use of another custom program
>>anyway. Just solder the header to the board and go.
>>
>>DLC
>>
>>Lez wrote:
>>
>>>>although I'm inclined to go with the
>>>>18F4550. The boot loader might be a good idea also. Then the program
>>
>>can
>>
>>>>be downloaded over USB. Could also download over RS-232, of course.
>>>>
>>>>Alan KM6VV
>>>
>
>
Hi Dennis,

Yes, I'm having fun! I haven't actually ported my stepper code or anything
over to work under USB, but I guess that's next. The Visual C++ side on
things on the PC will slow me down.

Other thought was to write a DOS driver to do CDC (or HID, anything!), but
that may be a lost cause. It's probably NOT the way to expand my knowledge
and all that. Only reason for me to do it would be to allow my CNC
controller program (which runs under DOS) to use USB to generate step
pulses. Maybe just run in a window? I know. Move on! I did really enjoy
writing it. Learned a LOT.

Sorry about Mac and Linux. Can't help you there. I thought Linux supported
USB already? Debian?? I have it, but haven't fired it up (alternate boot)
for months. The IDE would be a problem, 'tho.

Alan
> Of Dennis Clark
>
> Alan,
>
> I too have the FS USB PICDem board and have noted the bootloader over
> the USB, I guess that they use that as a further example of using a USB.
> And of course you are correct, the bootloader is essential for field
> upgrades. Love the "circle the mouse" demo. If ever a workable IDE
> exists on a Mac or Linux box the the bootloader would also be great
> since getting the ICD2 to work on anything but Windows native has been,
> so far, a bust.
>
> I've been trying to see if MC can help me with CDC driver information
> on ANYTHING but a Wintel PC, but no joy there. I've heard it rumored
> that setting up CDC drivers on a Mac is easier than on a Wintel, but
> heck, all you need to do to flesh out the CDC on the Wintel is fiddle
> with an .inf text file on the PC, so, what is needed on a Mac?
>
> have fun,
> DLC
>
> Alan Marconett wrote:
> > Hi Dennis,
> >
> > True. I use the ICD2, and find it very fast to reprogram a PIC. I
> think
> > the advantage of a boot loader is AFTER the product is installed. But
> good
> > for a very low cost approach to working with a PIC (no programmer!).
> >
> > It just so happens that the PICDEM FS USB board and its support files DO
> go
> > into the Boot, which is nice. The boot code is also a simple example of
> > USB. The demo is good too!
> >
> > Alan KM6VV
> >
> >
> >>Of Dennis Clark
> >>
> >>I tend to use the ISP for on board programming. With access to a
> >>programmer that does ISP there is no real advantage to using a
> >>bootloader which usually requires the use of another custom program
> >>anyway. Just solder the header to the board and go.
> >>
> >>DLC
It isn't so much support for USB, but MC support for drivers on anything
but a Wintel PC. I guess I'll just have to do that all by myself.

DLC

Alan Marconett wrote:
> Hi Dennis,
>
> Yes, I'm having fun! I haven't actually ported my stepper code or anything
> over to work under USB, but I guess that's next. The Visual C++ side on
> things on the PC will slow me down.
>
> Other thought was to write a DOS driver to do CDC (or HID, anything!), but
> that may be a lost cause. It's probably NOT the way to expand my knowledge
> and all that. Only reason for me to do it would be to allow my CNC
> controller program (which runs under DOS) to use USB to generate step
> pulses. Maybe just run in a window? I know. Move on! I did really enjoy
> writing it. Learned a LOT.
>
> Sorry about Mac and Linux. Can't help you there. I thought Linux supported
> USB already? Debian?? I have it, but haven't fired it up (alternate boot)
> for months. The IDE would be a problem, 'tho.
>
> Alan
>
>>Of Dennis Clark
>>
>>Alan,
>>
>> I too have the FS USB PICDem board and have noted the bootloader over
>>the USB, I guess that they use that as a further example of using a USB.
>> And of course you are correct, the bootloader is essential for field
>>upgrades. Love the "circle the mouse" demo. If ever a workable IDE
>>exists on a Mac or Linux box the the bootloader would also be great
>>since getting the ICD2 to work on anything but Windows native has been,
>>so far, a bust.
>>
>> I've been trying to see if MC can help me with CDC driver information
>>on ANYTHING but a Wintel PC, but no joy there. I've heard it rumored
>>that setting up CDC drivers on a Mac is easier than on a Wintel, but
>>heck, all you need to do to flesh out the CDC on the Wintel is fiddle
>>with an .inf text file on the PC, so, what is needed on a Mac?
>>
>>have fun,
>>DLC
>>
>>Alan Marconett wrote:
>>
>>>Hi Dennis,
>>>
>>>True. I use the ICD2, and find it very fast to reprogram a PIC. I
>>
>>think
>>
>>>the advantage of a boot loader is AFTER the product is installed. But
>>
>>good
>>
>>>for a very low cost approach to working with a PIC (no programmer!).
>>>
>>>It just so happens that the PICDEM FS USB board and its support files DO
>>
>>go
>>
>>>into the Boot, which is nice. The boot code is also a simple example of
>>>USB. The demo is good too!
>>>
>>>Alan KM6VV
>>>
>>>
>>>
>>>>Of Dennis Clark
>>>>
>>>>I tend to use the ISP for on board programming. With access to a
>>>>programmer that does ISP there is no real advantage to using a
>>>>bootloader which usually requires the use of another custom program
>>>>anyway. Just solder the header to the board and go.
>>>>
>>>>DLC
>
>
>