milan.rajik
Banned
I am attaching my mikroC PRO PIC project files. I have to get 1 us timer0 interrupt. RD0 should toggle once every 1 us but it is toggling once every 0.5 us.
The oscillator configuration is like this.
Datasheet page no. 24
Primary oscillator PPLDIV/5 = 20 MHz / 5 = 4 MHz
USB Clock = 96 MHz / 2 = 48 MHz
CPUDIV/2 HSPLL = 96 MHz / 2 = 48 MHz
Primary Oscillator
I have used mikroE Timer calculator to generate Timer0 Interrupt code.
The oscillator configuration is like this.
Datasheet page no. 24
Primary oscillator PPLDIV/5 = 20 MHz / 5 = 4 MHz
USB Clock = 96 MHz / 2 = 48 MHz
CPUDIV/2 HSPLL = 96 MHz / 2 = 48 MHz
Primary Oscillator
Code:
OSCCON.SCS0 = 0;
CSCCON.SCS1 = 0;
I have used mikroE Timer calculator to generate Timer0 Interrupt code.