View previous topic :: View next topic |
Author |
Message |
russellchung
Joined: 02 Jan 2006 Posts: 1
|
16F684 clk speed setup |
Posted: Mon Jan 02, 2006 4:40 pm |
|
|
Hello all,
I have a question on setting up the clk for a 16F684. I need 4 MHz clk using internal RC but the pic wizard gave me some really slow clk. Do I need to use a special fuse to do this ? the following fuses are use:
#include <16F684.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC_IO //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 NOIESO //Internal External Switch Over mode disabled
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#use delay(clock=4000000)
The assem code seems to know about the delay_us function properly by generating like 5 NOP for a delay of 5 uS. However, on the scope, things are really really slow. it looks like it is running on 32 kHz clk !!!
Any suggestion ?
rc |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jan 02, 2006 5:19 pm |
|
|
1. Post a small test program. I need to see what code the Wizard
is inserting, with regard to oscillator setup.
2. Post your compiler version. This will be a number such as 3.191,
or 3.241, etc. It can be found at the start of the .LST file, which
will be in the project folder. |
|
|
|