Page 1 of 1

questions regarding crystal use

Posted: Fri Mar 16, 2007 5:32 pm
by christian
hi, i'm trying to run this program using Pic16F88. I'm using the 19Mhz crystal and when i download the programm on the pic it actually runs correctly but if i set the RC switch not the XTAL. actually i want to work with the 19Mhz crystal. any suggestions?

For timing i'm using the delay_s command, is this an accurate timing command? and secondly when using delay_ms, the program is not working well.

#include <system.h>

void main (void)
{
unsigned int i ;



set_tris_b (0x1e);
while (1) {

output_high_port_b (0);
delay_s(1);
output_low_port_b (0);
delay_s(1);

}
}

Posted: Mon Mar 19, 2007 10:24 am
by Benj
Hello

You need to configure your program to XTAL mode before you program the PIC. This can be done in the compiler youu are using or it can be done in PPP. If the program you are using already has config data embedded into it then you can make PPP ignore this by selecting

Options -> Options -> Ignore Hex Fuse Data.

The delay_s(); and delay_ms(); routines are based on your clock speed so you also have to make sure that this is set correctly to get accurate timing.