Jump to content
43oh

sampling frequency


Recommended Posts

As low as you want.

 

General idea is: set up timer to provide periodic interrupt. If not low enough freq, count the interrupts and do what is needed every n interrupts. Put processor to sleep.

 

On interrupt, or after n interrupts, start ADC conversion. Set for interrupt on completion. Let processor go back to sleep.

 

When conversion is done, interrupt wakes it back up so you can read value and do what you will with it.

 

I have a device that has been going for over a year on a set of AA batteries using a 32KHz crystal for moderately precise timing, waking up every 8sec (max that the process will allow... could go longer) to do its thing. Most of the time, it is just counting and going back to sleep, for a period of roughly 5 min, but the period does vary, so the count is varied as needed.

 

If major processing is needed from the ADC value, leave that in your main loop, and force full wake up when ADC is complete, so that the processing can be done. Then go back to sleep.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...