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

PIC 18F87J50 and OSCTUNE register for USB settings [solved]

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



Joined: 16 Apr 2009
Posts: 18
Location: Spain

View user's profile Send private message

PIC 18F87J50 and OSCTUNE register for USB settings [solved]
PostPosted: Fri Dec 04, 2009 4:22 am     Reply with quote

Hello everybody¡¡

I'm working with the 18F66J50 and the 18F87J50 PIC micros.

I'm trying to configure the USB at 48MHz and I've done this:

I use 8Mhz crystal ------> I need to convert it to 4MHz so ---> #FUSES HS and #FUSES PLL2...

and I seen on this forum I need to manually set on the 96MHz PLL because this isn't done automatically (PIC18f4550 did it), so I used this code:
Code:

//Define a variable in the right place...
#BYTE OSCTUNE = 0xF9B
#BIT OSCTUNE_PLLEN = 0xF9B.6

//and in main() while initializing I done:

//OSCTUNE_PLLEN = 1;    // Enable PLL

But while debugging the value of the OSCTUNE register doesn't change...
I'm very confused and I need to use the USB pheripheral...

Can somebody help me???

Thank you in advance.
rvalor



Joined: 16 Apr 2009
Posts: 18
Location: Spain

View user's profile Send private message

Problem solved¡¡¡
PostPosted: Fri Dec 04, 2009 4:40 am     Reply with quote

Hello everybody,

I've solved the problem:

The correct fuse to configure the PLL is the
Code:
#FUSE H4_SW         //High speed osc with SW enabled 4x PLL

then
Code:
#FUSES PLL2                     //Divide By 2(8MHz oscillator input)

and in main() now I can pull-up the PLLEN bit.

Doing this, the PIC has been recognized by the PC inmediately.
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