Vizier87
Active Member
Hi guys,
I'm revisiting my old project for a bigger job now. I'm configuring the timing for my PIC18F4455 with a 1000-ms delay for a blinking LED using MikroC. I'm using a 20-MHz crystal oscillator.
Now, I understand that you have to set the speed from the configuration settings. Here's mine:
However, the blinking period doesn't match the computer clock (I watch the sync between the clock ticking and the LED blink) which I'm using as a reference. It seems the PIC is going a tad bit faster but definitely noticeable. This has made my subsequent programming (which involves UART and other comm protocols) a problem.
I've tried some combinations like changing the Prescaler, CPU postscaler, and whatnot but this hasn't helped. I've definitely understood this whole clocking part poorly.
Anybody can point me in the right direction?
Thanks.
Vizier87
EDIT: I've set the oscillator as 19 MHz as part of my attempts to see if this makes it more accurate. It seems to have changed but still a very messy thing to do. Hasn't worked also though.
I'm revisiting my old project for a bigger job now. I'm configuring the timing for my PIC18F4455 with a 1000-ms delay for a blinking LED using MikroC. I'm using a 20-MHz crystal oscillator.
Now, I understand that you have to set the speed from the configuration settings. Here's mine:
However, the blinking period doesn't match the computer clock (I watch the sync between the clock ticking and the LED blink) which I'm using as a reference. It seems the PIC is going a tad bit faster but definitely noticeable. This has made my subsequent programming (which involves UART and other comm protocols) a problem.
I've tried some combinations like changing the Prescaler, CPU postscaler, and whatnot but this hasn't helped. I've definitely understood this whole clocking part poorly.
Anybody can point me in the right direction?
Thanks.
Vizier87
EDIT: I've set the oscillator as 19 MHz as part of my attempts to see if this makes it more accurate. It seems to have changed but still a very messy thing to do. Hasn't worked also though.
Last edited: