PDA

View Full Version : USB bootloader



Demon
- 27th July 2006, 05:08
I starting to look into this subject now that I have a basic program working. I found the MicroChip utility here:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2124&param=en022627

As well as a lot of stuff here:
http://pic18fusb.online.fr/wiki/wikka.php?wakka=UsbBootload

But I'm still confused by the various steps and acrobatics you seemingly have to do. If anyone has a link to a more 'MicroCode Studio' - like utility, I'd appreciate a link.

Robert
:)

sjohansson
- 28th July 2006, 02:46
Hi Robert.

This is quick guide how I did and what I used:
First I created a hexfile as described in step 2 & 3 here:
http://pic18fusb.online.fr/wiki/wikka.php?wakka=UsbBootload
(Attached file Bootfile.zip)
Then I built an ICSP programmer PIC-PG1 like this:
http://www.sparkfun.com/shop/?shop=1&cart=598190&cat=3&
And then I programmed my 18F4550 with Bootfile.hex using WinPic800 v3.58
I connected my 18F4550 to USB-port like this:
http://pic18fusb.online.fr/wiki/wikka.php?wakka=UsbBootload
I created a simple testprogram in MicroCode Studio Plus:
'***********************************************
DEFINE LOADER_USED 1
DEFINE RESET_ORG 800h ' For Microchip USB Bootloader
DEFINE INTERRUPT_ORG 808h ' For Microchip USB Bootloader

led var PORTD.1

loop: HIGH led
Pause 4000
low led
Pause 4000
Goto loop
End
'************************************************
Compile using MPASM and INHX8M checked.
I downloaded the testprogram using USB and
C:\MCHPFSUSB\Pc\Pdfsusb\PDFSUSB.exe (The location in my Pc).
as described in step 1-8 under "USB-bootloading procedure" here:
http://pic18fusb.online.fr/wiki/wikka.php?wakka=UsbBootload

I have probably missed some step but I hope it will help you a little bit.

Good Luck!
Stefan.

Toley00
- 26th August 2006, 01:50
It's been a while I'm thinking of making a working USB connection. So tonight I feel ready to mount the project, program the PIC and plug it in the USB port. Everything looks very clear in the document but MPLAB is not so sweet... After many hours of error messages, changing program location, testing many settings, I'm here now asking for help.

This is the farthest I can go with MPLAB :

Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "D:\Program Files\mcc18\bin\mcc18.exe" -p=18F4550 /i"C:\MCHPFSUSB\fw\Boot" "main.c" -fo="C:\MCHPFS~1\fw\Boot\_output\main.o" -scs
Executing: "D:\Program Files\mcc18\bin\mcc18.exe" -p=18F4550 /i"C:\MCHPFSUSB\fw\Boot" "usbmmap.c" -fo="C:\MCHPFS~1\fw\Boot\_output\usbmmap.o" -scs
Executing: "D:\Program Files\mcc18\bin\mcc18.exe" -p=18F4550 /i"C:\MCHPFSUSB\fw\Boot" "usbdrv.c" -fo="C:\MCHPFS~1\fw\Boot\_output\usbdrv.o" -scs
Executing: "D:\Program Files\mcc18\bin\mcc18.exe" -p=18F4550 /i"C:\MCHPFSUSB\fw\Boot" "usb9.c" -fo="C:\MCHPFS~1\fw\Boot\_output\usb9.o" -scs
Executing: "D:\Program Files\mcc18\bin\mcc18.exe" -p=18F4550 /i"C:\MCHPFSUSB\fw\Boot" "usbdsc.c" -fo="C:\MCHPFS~1\fw\Boot\_output\usbdsc.o" -scs
Executing: "D:\Program Files\mcc18\bin\mcc18.exe" -p=18F4550 /i"C:\MCHPFSUSB\fw\Boot" "usbctrltrf.c" -fo="C:\MCHPFS~1\fw\Boot\_output\usbctrltrf.o" -scs
Executing: "D:\Program Files\mcc18\bin\mcc18.exe" -p=18F4550 /i"C:\MCHPFSUSB\fw\Boot" "boot.c" -fo="C:\MCHPFS~1\fw\Boot\_output\boot.o" -scs
Executing: "D:\Program Files\mcc18\bin\mplink.exe" /l"D:\Program Files\mcc18\lib" /k"D:\Program Files\mcc18\lkr" "D:\Program Files\Microchip\MPASM Suite\LKR\18F4550.lkr" "C:\MCHPFSUSB\fw\Boot\_output\main.o" "C:\MCHPFSUSB\fw\Boot\_output\usbmmap.o" "C:\MCHPFSUSB\fw\Boot\_output\usbdrv.o" "C:\MCHPFSUSB\fw\Boot\_output\usb9.o" "C:\MCHPFSUSB\fw\Boot\_output\usbdsc.o" "C:\MCHPFSUSB\fw\Boot\_output\usbctrltrf.o" "C:\MCHPFSUSB\fw\Boot\_output\boot.o" /o"MCHPUSB.cof" /M"C:\MCHPFS~1\fw\Boot\_output\MCHPUSB.map"
MPLINK 4.00, Linker
Copyright (c) 2005 Microchip Technology Inc.
Error - could not find definition of symbol 'ADCON1' in file 'C:\MCHPFSUSB\fw\Boot\_output\main.o'.
Errors : 1

BUILD FAILED: Fri Aug 25 19:29:12 2006

I know it's not easy to follow but the error seems to came from mplink.exe, but don't ask me why ADCON1 is not define.

If you have any idea it will be appreciate thank you.

Toley00
- 26th August 2006, 12:40
Ok I got my error. I did not choose the good linker scripts in MPLAB (p18f4550.lkr). Better result on saturday morning than on friday night.... Thank you for any help, surely more questions on USB soon.

Emil G
- 30th August 2006, 19:15
There is USB bootloader, but manual is only in german. Try it!
http://www.holger-klabunde.de/usb/18f2550.htm

Regards
Emil

yba2cuo3
- 31st August 2006, 02:04
Also check out: http://www.piccoder.co.uk/content/view/51/26/

Regards
Marc