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

PLL with PIC18F45K20

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



Joined: 11 Aug 2011
Posts: 5

View user's profile Send private message

PLL with PIC18F45K20
PostPosted: Mon Dec 12, 2011 11:06 am     Reply with quote

I have been working with the pic18f45k20 with the internal oscillator with PLL on, I follow the .h file and there is an error.

to make it work to 64MHz from 16MHz clock I had to write:
Code:

setup_oscillator(0x70); //see osccon register on datasheet

not
Code:

#define OSC_64MHZ   0x4070  as seen in the .h file.

writting 0x70 fix the problem
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 12, 2011 1:26 pm     Reply with quote

But what is your compiler version ?
dap20



Joined: 11 Aug 2011
Posts: 5

View user's profile Send private message

PostPosted: Mon Dec 12, 2011 1:31 pm     Reply with quote

pcwhd version 4.120
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 12, 2011 2:12 pm     Reply with quote

I tested the following program just now in hardware with vs. 4.120 and
it works fine. It blinks the LED at a 1 Hz rate. This was tested on an
Olimex PIC-P40 board, with the 3.3v jumper installed.
Code:

#include <18F45K20.h>
#fuses INTRC_IO, NOWDT, BROWNOUT, PUT, NOPBADEN
#use delay(clock=64M)

//=========================================
void main()


// Blink LED once per second.
while(1)
  {
   output_toggle(PIN_A0);
   delay_ms(500);
  }
       
}
dap20



Joined: 11 Aug 2011
Posts: 5

View user's profile Send private message

PostPosted: Mon Dec 12, 2011 2:18 pm     Reply with quote

It may jump to the low freq. oscillator. did you measure the output on PINA6, it should be 16MHz if you use #FUSE INTRC
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 12, 2011 2:41 pm     Reply with quote

I get 16 MHz on pin A6 (with INTRC fuse).
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