Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:38 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : (DM) internal RTC and SLEEP

Author Message
Olimex
Senior Member

Joined: 02/10/2011
Location: Bulgaria
Posts: 226
Posted: 07:08am 15 Dec 2011
Copy link to clipboard 
Print this post

good news!

Ken managed to run the low frequency crystal which is on the board to keep the date/time with the internal PIC32 RTC and working on SLEEP command which put DuinoMite in low power mode. It's not deep sleep but the power consumption decrease to about 11 mA, so this open up possibilities for handheld battery operated devices, data loggers etc.

The Duinomite rock bottom low power capabilities are down to 30uA power consumption, and they are not achieved yet, but this may be implemented in the future firmware improvement.

PIN(21) is the Li-Po battery voltage monitoring, you can measure the battery voltage

here is sample code Ken ran on DuinoMite and it's seen how the battery charges:


10 SLEEP 10 ' sleep for 10 minutes
30 PIN(0)=1 ' flash green led for a bit
40 PAUSE 500
50 PIN(0)=0
60 OPEN "testlog.txt" FOR append AS #1
65 PRINT DATE$,TIME$,PIN(21) ' write date time battery voltage to file
70 PRINT #1,DATE$,TIME$,PIN(21)
80 CLOSE #1
90 GOTO 10

12-14-2011 01:17:42 1.17788
12-14-2011 01:27:42 1.18271
12-14-2011 01:37:42 1.17896
12-14-2011 01:47:42 1.18486
12-14-2011 01:57:42 1.18594
12-14-2011 02:07:42 1.18379
12-14-2011 02:17:42 1.19023
12-14-2011 02:27:42 1.19722
12-14-2011 02:37:42 1.20205
12-14-2011 02:47:42 1.20151
12-14-2011 02:57:42 1.20688
12-14-2011 03:07:42 1.20903
12-14-2011 03:17:42 1.21011
12-14-2011 03:27:42 1.20742
12-14-2011 03:37:42 1.21011
12-14-2011 03:47:42 1.21064
12-14-2011 03:57:42 1.21602
12-14-2011 04:07:42 1.20957
12-14-2011 04:17:42 1.21548
12-14-2011 04:27:42 1.21763
12-14-2011 04:37:42 1.22031
12-14-2011 04:47:42 1.21709
12-14-2011 04:57:42 1.22139
12-14-2011 05:07:42 1.22139
12-14-2011 05:17:42 1.223
12-14-2011 05:27:42 1.22407
12-14-2011 05:37:42 1.22783
12-14-2011 05:47:42 1.22891
12-14-2011 05:57:42 1.23213
12-14-2011 06:07:42 1.23535
12-14-2011 06:17:42 1.23643
12-14-2011 06:27:42 1.23589
12-14-2011 06:37:42 1.24072
12-14-2011 06:47:42 1.24287
12-14-2011 06:57:42 1.2375
12-14-2011 07:07:42 1.24771
12-14-2011 07:17:42 1.24233
12-14-2011 07:27:42 1.24609
12-14-2011 07:37:42 1.25039
12-14-2011 07:47:42 1.25254
12-14-2011 07:57:42 1.25361
12-14-2011 08:07:42 1.25684
12-14-2011 08:17:42 1.26167
12-14-2011 08:27:42 1.26328
12-14-2011 08:37:42 1.26113
12-14-2011 08:47:42 1.26812
12-14-2011 08:57:42 1.26812
12-14-2011 09:07:42 1.26812
12-14-2011 09:17:42 1.27563
12-14-2011 09:27:42 1.27617
12-14-2011 09:37:42 1.27563
12-14-2011 09:47:42 1.28799
12-14-2011 09:57:42 1.2896
12-14-2011 10:07:42 1.29551
12-14-2011 10:17:42 1.30356
12-14-2011 10:27:42 1.3041

note that the battery voltage is measured through 1000:470 K divider, so to get the real voltage you should multiply the reading of PIN(21) by the magic number 3.13 :)

additional SLEEP syntax options:

* sleep minute 00 ' Seconds 0-59
Will wakeup every minute when seconds = 0

* sleep hour 10,00 ' Minutes 0-59, Seconds 0-59
Will wakeup every hour when Minutes = 10 Seconds = 0

* sleep day 10,10,00 ' Hours 0-23, Minutes 0-59, Seconds 0-59
Will wakeup every day at 10:10:00

* sleep week 0,10,10,00 ' Day Of Week 0-6, Hours 0-23, Minutes 0-59, Seconds 0-59
Will wakeup every sunday at 10:10:00

* sleep month 1,10,10,00 ' Day of month 1-31, Hours 0-23, Minutes 0-59, Seconds 0-59
Will wakeup every month on the 1st at 10:10:00

* sleep year 12,1,10,10,00 ' Month 1-12, Day of month 1-31, Hours 0-23, Minutes 0-59, Seconds 0-59
Will wakeup on every Dec 1st at 10:10:00

you can also do them all without the numbers
10 sleep day ' will wakeup 24hours from now


so is there any volunteers for beta testing of the new features? (looking at David :) )

 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3800
Posted: 09:54am 15 Dec 2011
Copy link to clipboard 
Print this post

As the voltage increased, the board was plugged in and battery being charged - right?
 
Olimex
Senior Member

Joined: 02/10/2011
Location: Bulgaria
Posts: 226
Posted: 12:54pm 15 Dec 2011
Copy link to clipboard 
Print this post

correct, the board was powered by external power supply with Li-Po battery connected
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024