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

18F87J50 vs 18F67J50 Oscillator settings

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



Joined: 21 Feb 2008
Posts: 24

View user's profile Send private message

18F87J50 vs 18F67J50 Oscillator settings
PostPosted: Thu Oct 02, 2008 12:28 pm     Reply with quote

I've been using the 18F87J50 on a demo board for testing until I get my proto PCB's in. I am going to use the 18F67J50. I changed the firmware to use the 67J50 and when I compiled it said "Undefined identifier OSC_PLL_ON".

In the 18F87J50.h file the constants used in setup_oscillator() are:
Code:

// First param:
#define OSC_31KHZ   0
#define OSC_125KHZ  0x10
#define OSC_250KHZ  0x20
#define OSC_500KHZ  0x30
#define OSC_1MHZ    0x40
#define OSC_2MHZ    0x50
#define OSC_4MHZ    0x60
#define OSC_8MHZ    0x70
#define OSC_16MHZ   0x4060
#define OSC_32MHZ   0x4070
// The following may be OR'ed in with the above using |
#define OSC_TIMER1  1
#define OSC_INTRC   2
#define OSC_NORMAL  0
// The following may be OR'ed in with the above using |
#define OSC_IDLE_MODE  0x80
#define OSC_31250   0x8000
#define OSC_PLL_ON  0x4000
#define OSC_PLL_OFF 0
// A second optional parameter may be used with this part to fine
// tune the speed (signed int,0-31)
// Result may be (ignore all other bits)
#define OSC_STATE_STABLE 4
#define OSC_STATE_EXT_RUNNING 8


In the 18F67J50.h file, the constants used in setup oscillator are:
Code:

#define OSC_31KHZ   0
#define OSC_125KHZ  0x10
#define OSC_250KHZ  0x20
#define OSC_500KHZ  0x30
#define OSC_1MHZ    0x40
#define OSC_2MHZ    0x50
#define OSC_4MHZ    0x60
#define OSC_8MHZ    0x70
// The following may be OR'ed in with the above using |
#define OSC_TIMER1  1
#define OSC_INTRC   2
#define OSC_NORMAL  0
// The following may be OR'ed in with the above using |
#define OSC_IDLE_MODE  0x80
// A second optional parameter may be used with this part to fine
// tune the speed (signed int,0-63)
// Result may be (ignore all other bits)
#define OSC_STATE_STABLE 4
#define OSC_STATE_EXT_RUNNING 8


Obviously the reason my code doesn't compile is because OSC_PLL_ON is not defined for the 67J50. My question is, on the 18F67J50, how do I turn the oscillator PLL on? Can I just define OSC_PLL_ON as 0x4000 in the 18F67J50.h?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Oct 03, 2008 5:55 pm     Reply with quote

It looks like they made a mistake. The full set of #define statements
should also have been put in the 18F67J50 header file. The data sheet
doesn't say there is any difference between the 67J50 and the 87J50 PICs.

You should email CCS tech support and tell them about this problem.
I checked vs. 4.080 and it has the bug.
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