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.

New to PIC18F2550 and MiKroC 6.4.0

Status
Not open for further replies.

lachmannmarcel

Junior Member level 3
Joined
Jan 15, 2011
Messages
29
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Romania
Activity points
1,431
Hi
I downloaded MikroC 6.4.0 and i try my first program: blinking led. I have one led on RB7. No Qtal just internal osc.

This is my code
Code:
void main() {
   PORTB=0;
   TRISB=0;
   CMCON = 0x07;   // Disable comparators
   ADCON1 = 0x0F;  // Disable Analog functions

   while(1){
   PORTB = ~PORTB;
   Delay_ms(1000);
   }
}
Ok is working, BUT 1 second delay is in fact 9 seconds.
What settings do i have to changes to oscilator to work properly?

- - - Updated - - -

fixed with
Code:
  OSCCON.IRCF0=1;///Internal Oscillator Frequency Select bits, 8Mhz
   OSCCON.IRCF1=1;
   OSCCON.IRCF2=1;
 

Zip and post complete mikroC project files.
 

No need. I just fixet. It look that in Mikroc when you fix clock in fact is only a declaration for delay function (like XTAL_Frec from Hitech C).
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top