[SOLVED] Leds with Pic are blinking slow

Status
Not open for further replies.

M.Rehan

Full Member level 2
Joined
Feb 10, 2016
Messages
129
Helped
2
Reputation
66
Reaction score
33
Trophy points
28
Activity points
972
LEDs at PORTD are blinking about after 3 seconds
Is there problem with oscillator selection?

PIC 18F4550
MikroC pro



Code C - [expand]
1
2
3
4
5
6
7
8
9
10
void main()
{    TRISD = 0x00;
     while(1)
     {
      PORTD = 0xFF;
      Delay_ms(100);
      PORTD = 0x00;
      Delay_ms(100);
     }
}




 
Last edited by a moderator:

Oscillator settings are wrong. Please zip and post the complete mikroC project files. I will set the oscillator settings properly.
 

To select 8 MHz INTOSC, OSCCON need to be written, presently default 1 MHz will be used.
 
Reactions: M.Rehan

    M.Rehan

    Points: 2
    Helpful Answer Positive Rating
And also IRCFx_bits have to be set properly. Look 4550 datasheet Oscillator section for IRCFx_bit values.
 
Reactions: M.Rehan

    M.Rehan

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…