CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

USB bootloader + application 18F4550

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
loggin



Joined: 23 Sep 2010
Posts: 10

View user's profile Send private message

USB bootloader + application 18F4550
PostPosted: Wed Oct 27, 2010 7:50 am     Reply with quote

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....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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