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 on 18F46J50

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



Joined: 01 Jun 2011
Posts: 6

View user's profile Send private message

USB on 18F46J50
PostPosted: Sun Nov 06, 2011 2:38 pm     Reply with quote

Hello Forum,

i want to setup an 18F46J50 for USB. The external crystal is 8 MHz. The PC shows only an unknown Device.

Code:
#include <18F46J50.h>
#fuses NOWDT
#FUSES HSPLL
#fuses PLL2
#fuses CPUDIV6   
#use delay(clock=8MHz)

#define PIN_USB_SENSE PIN_C6
#define HW_INIT() setup_oscillator(OSC_PLL_ON); delay_ms(50)
Ttelmah



Joined: 11 Mar 2010
Posts: 19553

View user's profile Send private message

PostPosted: Sun Nov 06, 2011 3:47 pm     Reply with quote

What supply are you running the chip off?. How are you powering Vusb?. Note1, Figure 29.1 in the data sheet.

Best Wishes
guenter



Joined: 01 Jun 2011
Posts: 6

View user's profile Send private message

PostPosted: Sun Nov 06, 2011 3:52 pm     Reply with quote

Hello I got it!
Code:

#include <18F46J50.h>
#fuses NOWDT
#FUSES HSPLL
#fuses PLL2
#fuses NOCPUDIV 
#use delay(clock=48MHz)

#define PIN_USB_SENSE PIN_C6
#define HW_INIT() setup_oscillator(OSC_PLL_ON); delay_ms(50)
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