Number17
New Member
This is the first time I worked with an 18F. I want to make the hello world project (flashing a LED).
I thought it would be easy just like a 16F chip, but its not. I've programmed the pic to flash a led at 4Hz but its way slower (about 0.5Hz).
I've checked that the oscillator is correct. I have tested the same program on a 16F and it worked fine. I've searched google, but all I can find is people with USB problems.
I have disabled all the fuses and used the internal oscillator. When I measure RA6 I get a frequency of 250Khz.
I thought it would be easy just like a 16F chip, but its not. I've programmed the pic to flash a led at 4Hz but its way slower (about 0.5Hz).
I've checked that the oscillator is correct. I have tested the same program on a 16F and it worked fine. I've searched google, but all I can find is people with USB problems.
Code:
void main() {
LATA = 0x00;
ADCON1 = 0x0f;
CMCON = 0x07;
TRISA = 0x00;
while(1){
PORTA = 0x01;
delay_ms(250);
PORTA = 0x00;
delay_ms(250);
}
}
I have disabled all the fuses and used the internal oscillator. When I measure RA6 I get a frequency of 250Khz.