Page 1 of 1

Oscillator question (LP-mode)

Posted: Mon Aug 16, 2021 5:14 pm
by MJU
In the datasheet for the 16F1827 ( http://ww1.microchip.com/downloads/en/d ... 41391d.pdf ) as from page 299, I see tables with different BAUD rates with different Xtal's. "BAUD RATES FOR ASYNCHRONOUS MODES"

I want to use a PIC that consumes as less power as possible, and then I see the 32khz XTAL configuration (LP mode) as the most power efficient..

My question is if the 32khz crystal can generate a decent 9600baud signal and a 1-wire signal for a DS18B20?
Maybe I need to make a leap to a 1Mhz, or even 4Mhz crystal but in these modes the chip consumes more energy.
How does Flowcode handle the baudrates?

Do they really mean a 32Khz or a 32.786kHz (Page 55 5.2.1.5 TIMER1 Oscillator), elsewhere in the datasheet them keep on calling it a 32Khz Xtal

And, how can I set the project options to 32khz?

Re: Oscillator question (LP-mode)

Posted: Mon Aug 16, 2021 7:29 pm
by kersing
Why do you post the same question on both this and the V9 forum?

For one wire you need a faster clock. However you could consider using the internal oscillator at high speed and switching back to the 32khz clock afterwards.

Re: Oscillator question (LP-mode)

Posted: Mon Aug 16, 2021 11:50 pm
by chipfryer27
Hi MJU

I'm guessing this is perhaps a follow on from previous posts regarding power savings?

If so, when you execute a Sleep instruction, the Clock is disabled and the PIC then uses it's internal 31KHz Osc for duration. If for example you were running at a higher speed as Kersing suggests then that would allow your comms, but would only be running when not asleep. I think that chip allows a sleep of around four or five minutes, so your ratio of sleep/awake may possibly negate your power concerns of "running" at a higher speed.

Timer 1 is a separate dedicated Oscillator in itself.

Hope this is of some help.

Regards

Edit....
Just seen Ben's reply on the v9 Forum sent around the same time. In it he explains why your baud rate won't work and also provides further info on 1-wire.