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

18F2550 and internal clock ??

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



Joined: 30 Jan 2012
Posts: 219

View user's profile Send private message

18F2550 and internal clock ??
PostPosted: Mon Jan 30, 2012 1:52 pm     Reply with quote

hey everybody !
I have a problem that i don't know/understand how to solve :

I want to use a 18f2550 at 4MHz without quartz, but I don't find how to configure the .h file in my project to do it.

What is the Fuse setting to do it?
I try a lot of different possibility, but i don't find a good one

Can you help me please? if some one use this pic without external component, can he/she send me his .h file

For example I tried:
Code:

...
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES INTRC                    //Internal RC Osc, no CLKOUT
#FUSES NOPROTECT                //Code not protected from reading
#FUSES BROWNOUT                 //Reset when brownout detected
#FUSES MCLR                  //Master Clear pin enabled
#FUSES NOCPD                    //No EE protection
#FUSES NOPUT                    //No Power Up Timer
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES FCMEN                    //Fail-safe clock monitor enabled

#use delay(clock=4000000)


but when i put this code in Main :
Code:
while(1){
      output_high(pin_A2);
      delay_ms(5);
      output_low(pin_A2);
      delay_ms(5);
   }

I have in reality 650ms high, 650ms low

thanks for your help

spilz
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

internal oscillator
PostPosted: Mon Jan 30, 2012 3:55 pm     Reply with quote

It looks like your internal oscillator is running at the 18F2550's default 31kHz frequency.

I have not used the 18F2550 but suspect you need to add "setup_oscillator(OSC_4MHZ)" to your initialisation code.

Mike
spilz



Joined: 30 Jan 2012
Posts: 219

View user's profile Send private message

PostPosted: Mon Jan 30, 2012 4:05 pm     Reply with quote

it works !!!
thank you so much !!
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