Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Leds with Pic are blinking slow

Status
Not open for further replies.

M.Rehan

Full Member level 2
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);
     }
}




Capture.PNG
 
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.
 
  • Like
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.
 
  • Like
Reactions: M.Rehan

    M.Rehan

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top