Clock speed PIC12F1571

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
Frank607
Posts: 192
Joined: Mon Mar 04, 2013 8:07 pm
Has thanked: 29 times
Been thanked: 15 times
Contact:

Clock speed PIC12F1571

Post 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 196 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Clock speed PIC12F1571

Post 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.
Martin

Frank607
Posts: 192
Joined: Mon Mar 04, 2013 8:07 pm
Has thanked: 29 times
Been thanked: 15 times
Contact:

Re: Clock speed PIC12F1571

Post 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

Post Reply