I am driving myself nuts over this trivial problem. The program execution is terribly slow! I am using HI-TECH compiler and simply using the LCD demo that came with the compiler. I have only added this main.c program:
Code:
#include <htc.h>
#include "lcd.h"
void
main(void)
{
ADCON0=0; //turn off A/D
PCFG0=0;PCFG1=1;PCFG2=1;PCFG3=1; //PORTA all digital, except RA0
RBIE = 0; //Disable all PORTB Change interrupts
GIE = 0; // Global interrupt enable
lcd_init(FOURBIT_MODE);
lcd_goto(0); // select first line
lcd_puts("12345678");
lcd_goto(0x40); // Select second line
lcd_puts("Hello world");
for(;;);
}
The LCD works fine, however I can visibly see the words being printed in DEBUG MODE ONLY. It does NOT run in "release" if I select programmer and flash it.
My config bits are all set to disabled. I have Oscillator set at "XT".
The crystal is shaped like a tin can and is 3.579545MHz. I verified this with an O-scope. I have also placed 20pF caps to the correct locations.
I can run the program, but I can literally see the LCD parsing each line.
I have tried multiple crystalls...right now I am using a 10MHz.
I would only need to set everything in the CONFIG BITS to get the oscillator right correct?
the PIC18F258 does not have an internal oscillator...so something is wrong with how it it receiving the signal. I have verified the crystalls with an O-scope so I'm not sure where I'm going wrong.
Thanks for your help.[/img]
Added after 3 hours 47 minutes:
OK,
I simply toggled one of the ports high and then low and I am measuring the output being only 625KHz......