zeeshan ahmed
Joined: 02 Dec 2010 Posts: 22
|
need help with crystal Fuses setting for 18f26k22 |
Posted: Thu Feb 16, 2012 1:27 am |
|
|
Hi all,
I am stuck in a problem, I think problem arised due to wrong fuse setting or wrong crystal oscillator. I want to use 20Mhz or 25 Mhz crystal oscillator. When i compiled the program, and tested it, I found controller is not running at correct frequency.
Compiler version = 4.124
below is the code i used to test it.
Code: |
#include <18F26k22.h>
#device adc=10
#FUSES NOWDT,HSH,PUT,NOLVP
#use delay(clock=20M)
#use rs232(baud=38400,xmit=PIN_C6, rcv=PIN_C7)
void main(void)
{
while(true)
{
output_toggle(pin_c0);
delay_ms(100);
}
}
|
so, what I found is the delay time between toggles is 25ms, instead of 100ms.
Can any one tell me whats is going wrong.
Thank you & Best regards. |
|