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

USB CDC problem with CPUDIV

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



Joined: 13 Jul 2010
Posts: 45

View user's profile Send private message

USB CDC problem with CPUDIV
PostPosted: Tue Sep 21, 2010 4:22 pm     Reply with quote

Hi I'm trying a PIC 18f14k50 with usb-cdc emulating a serial com, I use a real crystal of 20MHz but unfortunately when I connect the circuit to the pc tells me that it did not work properly ... I'm sure I have some problem with the crystal and its setting ... I also connected capacitor 470nF and the circuit is ok ... these are the fuses:

Code:

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

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS           
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES NOBROWNOUT               //No browno BORV19             
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOCPD                    //No EE protection
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOXINST                  //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOMCLR                     //Master Clear pin disabled
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOCPB                    //No Boot Block code protection
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES HFOFST               
#FUSES NOWRT0               
#FUSES NOWRT1               
#FUSES USBDIV1         
#FUSES BBSIZ2K                  //2K words Boot Block size
#FUSES CPUDIV3
#FUSES PLLEN           
#FUSES PCLKEN     

#use delay(clock=20000000)


What's wrong?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 21, 2010 4:47 pm     Reply with quote

The 18F14K50 data sheet doesn't show a 20 MHz crystal to be an option
for USB. It must be a 6 MHz or 12 MHz crystal. Look at these tables
in the PIC data sheet:
Quote:

TABLE 2-4: LOW SPEED USB CLOCK SETTINGS

TABLE 2-5: FULL-SPEED USB CLOCK SETTINGS

Besides those crystals, there are some other options for an external
oscillator, as shown in the tables given above.

Also, you can't use the internal oscillator. The data sheet says:
Quote:
2.11 USB Operation
Because of timing requirements imposed by the USB
specifications, the Primary External Oscillator is
required for the USB module.


If you want more crystal options for USB, you need to use a PIC that
allows them, such as the 18F4550.
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