Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - How to implement RTC (Real Time Clock) on LDMicro

(you are viewing a thread; or go back to list of threads)

How to implement RTC (Real Time Clock) on LDMicro (by marcelo)
Dear friends, I need to use LDMicro with time events and was thinking in how to implement RTC (Real Time Clock) on LDMicro, any ideas ?

Thanks

Marcelo
Fri Apr 3 2015, 17:19:11
...RTC... (by Dzairo)
Hi marcelo..
there is possible use only experimental version of LDmicro ..
with this version you can change all register .. memory .. etc.. is possible use I2C RTC ... search in this forum...

dzairo
Fri Apr 10 2015, 02:04:33
Como adquirir essa versão experimental?. (by Charles)
Gostaria de adquirir esta versão de software do ldmicro urgente para implementa todos os recursos dos microcontroladores.
desde já agradeço.

att,
Wed May 6 2015, 19:03:01
(no subject) (by hariyanto)
How to implement RTC (Real Time Clock) on LDMicro
Dear friends, I need to use LDMicro with time events and was thinking in how to implement RTC (Real Time Clock) on LDMicro, any ideas ? ic rtc is ds 1302

Thanks

Hariyanto
Tue Jun 2 2015, 10:42:18
Typical ladder logic approach (by Don Fitchett)
Could you use typical ladder logic approach used with PLCs that do not have RTC built in?

IE: 1 second pulse incrementing cascading counters.
minutes CTU 60, hours CTU 60, days CTU 24, years CTU 365
Granted if you need to go on for years, with leap years and all (365.24218967 days) it can get a little more complex. But may work for your app.
Sun Jul 5 2015, 11:07:48
(no subject) (by Jonathan Westhues)
Like Don said. An example is attached that handles seconds, minutes, hours, and day of week, similar to a typical thermostat. Day of month would be more work, but you could use a lookup table.

If you take this approach, then make sure to choose the capacitors for your crystal according to the crystal's and micro's datasheet, and/or confirm the frequency of oscillation with an accurate frequency counter (for example, on a PWM output; if you put a probe directly on the crystal then you'll affect the frequency). That oscillator will run over a wide range of capacitance, but a few pF there may correspond to minutes of error per year.
Sun Jul 5 2015, 11:32:43, download attachment rtc.ld
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):