how to set the clock frequency to 4mhz can any one help with PIC c
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
Posted: Tue Dec 02, 2008 4:57 am
The frequency of the PIC is set by the crystal attached to its OSC pins. If you put a 4MHz crystal, and set (one of) your fuses to 'XT', you can use this crystal.
Some PICs also have an internal oscillator preset at 4MHz, or a dual speed oscillator, or a selectable-speed oscillator. You need to use the 'INTRC' or 'INTRC_IO' fuses to do this.
If you have a multi-speed internal oscillator have a look at the 'setup_oscillator' instruction.
Rohit
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
Posted: Tue Dec 02, 2008 9:48 am
Read the manual about the #use delay() preprocessor directive. It is simple for the older chips, but gets complex for the newer chips with many clock options. Also read clock section of the datasheet for your PIC. _________________ The search for better is endless. Instead simply find very good and get the job done.
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