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);
}
}
questions regarding crystal use
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel