18F4550 noob problem

Status
Not open for further replies.

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.

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.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…