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
Moderator: Benj
-
- 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
Hi Frank,
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.
With your flowchart you should have 2 x 1 sec delays.Frank607 wrote:It is essential that the pause between two blinks is 1 second.
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
-
- Posts: 192
- Joined: Mon Mar 04, 2013 8:07 pm
- Has thanked: 29 times
- Been thanked: 15 times
- Contact:
Re: Clock speed PIC12F1571
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
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