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
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
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);
}
}
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;