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
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,
(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
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.
(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.