loggin
Joined: 23 Sep 2010 Posts: 10
|
USB bootloader + application 18F4550 |
Posted: Wed Oct 27, 2010 7:50 am |
|
|
Hello,
I use 18F4550 and load an app through a bootloader. Everything works but when application runs it uses a bootloader's PID and VID, i.e. the application uses bootloader's USB settings. I cannot change the TX size and etc. Here is a part of the bootloader code:
Code: |
#include <18F4550.h>
#fuses HS,NOVREGEN,HSPLL,WRTB,NOPBADEN,NOWDT,PROTECT,NOLVP,NODEBUG,USBDIV,PLL5
#use delay(clock=48000000)
#include "pic18_usb_.h"
#include "usb_desc.h"
#include <usb.c>
int in_buff[22];
void main(void) {
set_tris_d(0xFF);
if ( !input(PIN_D3) )
{
usb_init();
usb_task();
usb_wait_for_enumeration();
while (TRUE)
{
if(usb_enumerated())
{
if (usb_kbhit(1))
{
usb_get_packet(1, in_buff, 22);
if (com== 0xB0)
{
usb_put_packet(1, ver, 16, USB_DTS_TOGGLE);
}
}
}
}
}
else {
#asm
goto 0x2000
#endasm
}
}
|
and the beginning of the app code:
Code: |
#include "18F4550.h"
#fuses HS,NOVREGEN,HSPLL,WRTB,NOPBADEN,NOWDT,PROTECT,NOLVP,NODEBUG,USBDIV,PLL5
#use delay(clock = 48M)
#build(reset = 0x2000, interrupt = 0x2008)
#org 0x0000,0x1FFF { }
|
I'm afraid about build and org directives, and maybe interrupt process.
Thank You in advance!
Cheers.... |
|