Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Is the two-clock start-up technique common these days?

+1
−0

Is the two-clock start-up technique common these days?

Came across a low power technique for microcontrollers. A crystal may take few hundred milliseconds to start up. The MCU is consuming power, and not executing instructions during that time. Imagine a situation where an MCU is in cyclic sleep, and it needs to do only 20ms worth of work every second¹. It would have to spend more time waiting for the crystal to start up than doing the work.

crystal xtal start up, oscilloscope screenshot

An internal RC is quicker to start up: down to single-digit microseconds. But an internal RC is less accurate.

internal RC oscillator start up, oscilloscope screenshot

The proposed technique is two-clock start-up. The MCU wakes up and starts the internal RC. If the MCU determines that it will be doing something that requires a precise clock², then it starts the crystal and waits the necessary time for it to come up. Otherwise, the MCU continues on the internal RC, and goes back to sleep.

I came across this technique in the book A Baker’s dozen by Bonnie Baker (2005). There’s also this EE Times article by Bonnie Baker (2003). There’s a firmware doc for 8-bit PICs. Bonnie Baker worked for Microchip during the 8-bit PIC era, so all these sources have the common origin.

¹ Something like checking the “on” button (which nobody presses for days), and maybe monitoring state of charge.

² That would happen only once in a while, and not every cyclic sleep epoch. For example, it could be communication.

History

0 comment threads

1 answer

+1
−0

I'm not sure what kind of answer you're looking for since the question is very subjective, but I'd say yes, this feature is reasonably common. I'm mostly familiar with Microchip PIC microcontrollers, and many of them have "dual speed startup" options.

Of course it's hard to tell from that how commonly it is actually used, but at least one major company thinks the feature is important enough to include in many of their parts.

I don't remember ever having started a microcontroller with the built-in RC oscillator, then switching to a crystal later if high timing accuracy is needed. I may have started with the RC oscillator only to get fast wakeup response, then switching to the crystal when it was ready.

I have done something sortof similar with a PIC 10F where I used the watchdog timer to wake up the processor periodically. It needed to be asleep most of the time due to running on a small battery. The processor would always run from the internal RC oscillator, but timing was lost between wakeups and I needed to keep track of elapsed real time. To get around that, every 256 wakeups I'd leave the processor running to measure the time to the next watchdog event. That effectively calibrated the time between watchdog wakeups to allow tracking total elapsed time well enough.

History

0 comment threads

Sign up to answer this question »