# 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;
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.

#### be80be

##### Well-Known Member
You need to set the OSCCON =\$72 so oscillator will run at full speed

Status
Not open for further replies.

Replies
16
Views
5K
Replies
12
Views
6K
Replies
44
Views
9K
Replies
8
Views
5K
Replies
3
Views
2K