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

PLL 40 mhz with 18f452

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



Joined: 10 Jan 2018
Posts: 1

View user's profile Send private message

PLL 40 mhz with 18f452
PostPosted: Wed Jan 10, 2018 2:40 pm     Reply with quote

Hi

I have a 18f452 20 mhz pic.
I want to run it at 40 mhz osc by using 10 mhz crystal.
How I write this program in ccs c ?

Please help me.
Ttelmah



Joined: 11 Mar 2010
Posts: 13552

View user's profile Send private message

PostPosted: Wed Jan 10, 2018 3:06 pm     Reply with quote

Code:

#include <18F452.h>
#fuses H4, NOLVP, NOWDT, NOPROTECT
//Add other fuses you need
#USE DELAY (CLOCK=40MHz)

void main(void)
{
    //with a suitable 10MHz crystal, chip is now running 40Mhz

    while (TRUE)
    {
         output_toggle(PIN_B0); //test by toggling pin 1/second
         delay_ms(1000);
    }
}
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