Page 1 of 1

Clock speed PIC12F1571

Posted: Tue Apr 30, 2019 6:16 pm
by Frank607
Clock speed PIC12F1571

I’m struggling with the exact clock speed from the PIC12F1571. I can’t that this right.

Attached I have a simple blink led program. It is essential that the pause between two blinks is 1 second.

This chip with LED runs on a battery cell coin CR2032 – 3V. So, it must also be energy efficient.

Can someone explain to me how to find in the datasheets the settings what I must use for Microchips?

Thanks,

Frank
Clock Speed PIC12F1571.fcfx
(7.9 KiB) Downloaded 243 times

Re: Clock speed PIC12F1571

Posted: Tue Apr 30, 2019 8:56 pm
by medelec35
Hi Frank,
Frank607 wrote:It is essential that the pause between two blinks is 1 second.
With your flowchart you should have 2 x 1 sec delays.
However you have got 1 x 1 sec delay and 1 x 50ms delay.
If you change the 50ms to 1sec it should work the way intended as the OSCCON = 0x78; is correct for 16MHz.
Personally I would use a timer interrupt rather than 1 sec delay.
AS with delays it halts the microcontroller, when it could be doing something else useful.

Re: Clock speed PIC12F1571

Posted: Wed May 01, 2019 3:17 pm
by Frank607
Hi Martin,

Thanks for you answer. The LED must blink for 50ms and then a pause for 1 second.

It works now perfect.

I’m trying to understand your idea to use an Timer Interrupt and how to use it. I’m reading this topic:
viewtopic.php?f=76&t=20595 and I have download Ben’s demo.fcfx .

On this PCB is just one PIC12F1571 and an RGB LED. Powered by an CR2032 (3V) Coin Cell. This whole configuration must be as low energy consumption as possible. The LED does only flash in a period of time.

Is it better to use in this case an Timer Interrupt?

Thanks,

Frank