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 support@ccsinfo.com

PIC18F24j50 -> USB dont work !!

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



Joined: 09 Jul 2010
Posts: 2

View user's profile Send private message MSN Messenger

PIC18F24j50 -> USB dont work !!
PostPosted: Tue Jul 13, 2010 11:21 pm     Reply with quote

compiler -> 4.104 CCS
Xtal --> 20 Mhz (resonator)

My program:
Code:

#include <18F24J50.h>
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES HSPLL                    //High Speed Crystal/Resonator with PLL enabled
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NOPROTECT                //Code not protected from reading
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES IOL1WAY                  //Allows only one reconfiguration of peripheral pins
#FUSES PRIMARY                  //Primary clock is system clock when scs=00
#FUSES NOWPCFG               
#FUSES WPEND                 
#FUSES WPDIS                 
#FUSES NOCPUDIV             
#FUSES LPT1OSC                  //Timer1 configured for low-power operation
#FUSES T1DIG                 
#FUSES MSSPMSK7             
#FUSES PLLDIV5               
#FUSES DSWDT2147483648       
#FUSES DSWDT                 
#FUSES DSBOR                 
#FUSES RTCOSC_T1             
#FUSES DSWDTOSC_INT         
#FUSES WPFP0                 
#FUSES WPFP1                 
#FUSES WPFP2                 
#FUSES WPFP3                 
#FUSES WPFP4                 
#FUSES WPFP5                 

#use delay(clock=48000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

#include <usb_cdc.h>

void main(void)
{
   char c;
   usb_init_cs();

   while (TRUE)
   {
      usb_task();
      if (usb_cdc_kbhit())
      {
      c=usb_cdc_getc();
      usb_cdc_putc(c+1);
      }
   }
}

ERROR ---> Unknown device on my PC Sad help me guys please !
rwskinner



Joined: 08 Dec 2006
Posts: 125
Location: Texas

View user's profile Send private message

PostPosted: Sun Jul 18, 2010 8:11 am     Reply with quote

Did you get it going?

Here is some of my stuff....
Code:

#FUSES HSPLL
#FUSES PLLDIV5
#FUSES NOCPUDIV
#FUSES NOXINST
#FUSES NOPROTECT
#FUSES NOLPT1OSC
#FUSES PRIMARY
#USE delay(clock=48000000)

Also, you have to set the PLL up manually in the beginning of your Main....
Code:
 
setup_oscillator(OSC_PLL_ON);
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