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

clock problems

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



Joined: 07 Apr 2006
Posts: 2

View user's profile Send private message Send e-mail AIM Address MSN Messenger

clock problems
PostPosted: Fri Apr 07, 2006 12:33 pm     Reply with quote

I have been using an external 20 MHz clock with my pic 16f874.

Now i wanto change the frequency to 4 MHZ and I changed the code as follows

#use delay(clock=4000000) and the pin from clock is going to 13 of the PIC.

It dosent seem to work as when i check with the scope i see about 450 Hz signal (and not MHz)

do i need to change this line of code too?
#fuses HS


PLEASE HELP .

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 07, 2006 12:52 pm     Reply with quote

When you say "external clock", I assume you are using the metal "can"
type of oscillator. It looks like this:
http://rocky.digikey.com/WebLib/Abracon/Web%20Photos/ACO%20SERIES.jpg
Is that correct ?

If so, disconnect the 4 MHz oscillator from the PIC and look at
the output pin with your oscilloscope. If the oscillator is correctly
connected to power and ground, you should see a 4 MHz square wave
on the output pin.

---------
If you're using a crystal, then it will look something like this:
http://rocky.digikey.com/WebLib/ECS/Web%20Photos/HC-49US.jpg
desai



Joined: 07 Apr 2006
Posts: 2

View user's profile Send private message Send e-mail AIM Address MSN Messenger

clock
PostPosted: Fri Apr 07, 2006 2:12 pm     Reply with quote

yep the shiny metal kinnda clock like the one in the picture with 4 pins.

Sorry i assumed that the clock and x-tal were the same things.

I dont have a 4 MHz clock I just have a 20 MHz clock. But is there a way to divide 20 MHz clock to be used as a 4 MHz clock.

I thought PIC 16F874 had an internal clock of 4 MHz but did not see anything like that on the data sheet anywhere.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 07, 2006 2:28 pm     Reply with quote

You would have to use an external divide-by-5 circuit.
It's easier just to buy a 4 MHz oscillator.
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