Read should capture counters, but capture is not simple on ripple counters, as you need to be sure you do not capture while values overflow. In theory, reading a RTC should not affect the counter, but anything is possible.Įg If you say it was running faster, then maybe extra clock edges are being injected from the bus crosstalk. I configured the DS3231 to give a square wave output of 1hz.Upon each pin change(configure the interrupt either on falling or on rising),avr will count 1s.Also I configured the avr in such a way so that it will only read the ds3231 in 12hr interval.Now using this method,my clock is running successfully over a year without almost no significant delay like i described before!!Still I am using the counterfeit chinese replica of the ds3231. I would say that this method of readings too often induced a delay. Unlike other counties that have US restrictions, surely India is free to import what it likes. You just weigh up the costs for imported or domestic electronic products. you pay import duties or higher rate of VAT for imported goods. I can understand that India will want to encourage / protect its home industries. L suspect that if I spent $100000, they might offer me special terms. They treat a small customer just as well as a large customer. ![]() Obviously Farnell would prefer me to spend $1000s. They are quite happy to take my money and add a handling charge for small orders. In the UK, I or any humble punter can buy anything from the big Distributors. I am fascinated how Farnell or Digikey work in India. They work ok for hobbyist purposes but I would not want to use them in a commercial product. Genuine crystals are pretty cheap too.Įven so, Chinese Ebay vendors are so cheap that I suspect that some or all of the components are QC rejects. are pretty cheap, even from Distributors. Genuine RTC chips from ST, TI, Microchip. There are many different RTC chips from every i.c. Personally, I use the 1Hz output to tell the Arduino that the RTC has changed. Reading I2C will not affect the timekeeping in any way. Is it normal for the DS3231 to get slow if reading it frequently?I have read the datasheet but found no such illustration.Someone faced this sort of things?Previously I have used DS1307,but in that case also,it was getting damn slow.So i thought t ask the experts.and here I am. Now I upgraded the hardware(pulled up the sqw line and changed the cpu to mega32 for higher pincount) and set the DS3231 to give a square wave output of 1hz.Now the Idea is to sync every second for update without reading the RTC using level change interrupt.I have planned to read the RTC only two times a day(every am to pm conversion or vice-versa). Recently i was building a precise timeclock with mega328 and GLCD and DS3231.I was using a Casio G-shock(Pretty accurate I think) as my reference.I found that my DS3231 clock was about 17sec slow as compared to my reference Casio after a 12hr runtime.At the whole time,DS3231 as well as the whole circuit was powered by external 5v(not by internal battery of DS3231).I was reading the DS3231 every second and was updating the reading to the GLCD.Then i thought to sync after every 5 mins.This time i ran the clock for nearly 24hr and found a delay of nearly 2s with my reference clock.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |