![]() |
Forum Index : Microcontroller and PC projects : MICROMITE RTC WAKEUP
Author | Message | ||||
crez![]() Senior Member ![]() Joined: 24/10/2012 Location: AustraliaPosts: 152 |
The pcf8563 RTC chip has a countdown timer and alarm functions built in. This allows you to wake the uMite from low power sleep at a specified time. Connect pin 3 of the RTC to the wakeup pin of the uMite (pin 16 in my case) and also a 1Meg resistor to the uMite 3.3v supply. The following code sets the countdown timer in the RTC to 25 and then puts the uMite to sleep. The RTC then wakes the uMite after 25 seconds have expired. Moving the ' from the 6th to the 7th line will make the delay 25 minutes instead of seconds. It is also possible to set a wakeup at a particular time, day of month, day of week or combination thereof. RTC gettime Print"time before sleep ";Time$ I2C open 100,100 T=25 'THIS VALUE IS LOADED INTO THE COUNTDOWN TIMER I2C write &H51,0,2,&H0F,T 'set COUNTDOWN VALUE AT &H0F TO T 'I2C write &H51,0,2,&H0E,&B10000011 'CLK=MINUTES,TIMER ENABLED I2C write &H51,0,2,&H0E,&B10000010 'CLK=SECONDS,TIMER ENABLED I2C write &H51,0,2,&H01,&B00000001 'CLEAR FLAGS, START TIMER I2C CLOSE CPU sleep RTC gettime Print "time after sleep ";Time$ David |
||||
psergiu![]() Regular Member ![]() Joined: 09/02/2013 Location: United StatesPosts: 83 |
On the Olimex MOD-RTC UEXT module, according to the schematic, the "R4" and "R8" solder pads are there for exactly this purpose and will connect pcf8563 pin3 to the UEXT/COM3 RX pin - but i don't know which pin number is that on a DuinoMite - anyone knows ? Thanks. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |