![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
joven
Joined: 30 Jan 2007 Posts: 56 Location: Viana do Castelo - Portugal
|
USB bootloader |
Posted: Fri Apr 20, 2007 5:25 am |
|
|
Hi
I'm testing the usb bootloader, but i haven't sucess.
In the fuses have #fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN,NOPBADEN,WRTB
When load the hex file don't give-me any warnings.
the problem is I don't know exactly i have to put for #org and #build.
i have tested some i found in the forum and didn't work.
Someone can help-me?
Thanks |
|
![](templates/subSilver/images/spacer.gif) |
NicolasC
Joined: 14 Sep 2006 Posts: 27
|
|
Posted: Fri Apr 20, 2007 5:39 am |
|
|
Hello
This is what I have in my main .c file for a PIC18F2550
Code: |
#include "bootloader.h"
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN,NOPBADEN,WRTB
|
bootloader.h
Code: |
#if defined(__PCM__)
#define LOADER_END 0x1FF
//#define LOADER_SIZE 0x1BF
#elif defined(__PCH__)
#define LOADER_END 0x7FF
//#define LOADER_SIZE 0x6FF
#endif
#ifndef _bootloader
#define _bootloader
#if defined(__PCM__)
#build(reset=LOADER_END+1, interrupt=LOADER_END+5)
#elif defined(__PCH__)
#build(reset=LOADER_END+2, interrupt=LOADER_END+9)
#endif
#org 0, LOADER_END void bootloader(void) {}
#endif |
Regards |
|
![](templates/subSilver/images/spacer.gif) |
joven
Joined: 30 Jan 2007 Posts: 56 Location: Viana do Castelo - Portugal
|
|
Posted: Fri Apr 20, 2007 8:35 am |
|
|
i'm using 18F4550 the memory is the same?
Isn't working.
the message of PSUSB is nÂș 6 the indicator is invalid.
What can be? |
|
![](templates/subSilver/images/spacer.gif) |
meereck
Joined: 09 Nov 2006 Posts: 173
|
|
Posted: Tue Apr 24, 2007 5:18 am |
|
|
The USB bootloader stopped to work after you had downloaded an user application, I guess.
I had several problems with fuses as well. I found out that when Pdfsusb application asks you what to do with the fuses, I have to click on "Cancel". Otherwise the bootloader sometimes stopped to work.
Flash a PIC with the bootloader again and use the following stencil for an user application (change your USB settings in fuses):
Code: |
#include <18f2455.h>
#device ADC=10 // 10 bits return value from ADC
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL6,CPUDIV1,VREGEN,NOPBADEN,WRTB,MCLR,NOCPD,NOWRTC
#use delay(clock=48000000)// full speed USB device
#use rs232(baud=19200,xmit=PIN_C6, rcv=PIN_C7, STREAM=RS232)
// START OF bootloader definition
#define LOADER_END 0x7FF
#define LOADER_SIZE 0x6FF
#build(reset=LOADER_END+1, interrupt=LOADER_END+9)
#org 0, LOADER_END {} // nothing will replace the bootloader memory space
// END OF bootloader definition
#define TICKS_PER_SECOND 183 //183 how often per second is timerirq routine called
byte timing = 0;
#int_rtcc
void timerirq()
{
if(++timing==TICKS_PER_SECOND){fprintf(RS232,"irq\r\n");
timing=0;output_toggle(PIN_B0);}
}
void main()
{
fprintf(RS232,"load\r\n");
output_low(PIN_B0);
set_timer0(0);
setup_counters( RTCC_INTERNAL, RTCC_DIV_256 | RTCC_8_BIT);
enable_interrupts(INT_RTCC);
enable_interrupts(GLOBAL);
while(1);
}
|
|
|
![](templates/subSilver/images/spacer.gif) |
joven
Joined: 30 Jan 2007 Posts: 56 Location: Viana do Castelo - Portugal
|
|
![](templates/subSilver/images/spacer.gif) |
softjad
Joined: 21 Sep 2006 Posts: 3
|
|
Posted: Thu Jun 21, 2007 4:27 pm |
|
|
How can I use this bootloader in automatic mode (without manual reset...)?
Thanks |
|
![](templates/subSilver/images/spacer.gif) |
joven
Joined: 30 Jan 2007 Posts: 56 Location: Viana do Castelo - Portugal
|
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|