IoTone / ProjectGyr

ProjectGyr is a presence tracking/foot traffic tracker built using RFID for easy tracking of visits and user movement
BSD 3-Clause Clear License
3 stars 0 forks source link

Integrate RTC clock with Espressobin #18

Open truedat101 opened 5 years ago

truedat101 commented 5 years ago

We need a hardware clock to manage time even when this device is offline. Otherwise, the system will always forget what time it was before, and will boot up either with a clock skew of number of days of downtime, or it will be reset to EPOCH time. To fix this, integrate this part :+1:

https://www.sparkfun.com/products/10160

And datasheets are here:

https://www.digikey.com/product-detail/en/sparkfun-electronics/BOB-10160/1568-1101-ND/5318743

Here's the espressobin information:

truedat101 commented 5 years ago

So first step: Coin Cell Battery - 12mm (CR1225) . Need a 1225 battery. Then get the wiring figured out.

truedat101 commented 5 years ago

Couldn't find this battery at CVS. Order some online I guess.

truedat101 commented 5 years ago

I got the battery. Try out the clock on Arduino. Then try wiring into the espressobin.

truedat101 commented 5 years ago

So there are a few things to do:

Grab this as a zip and install the arduino library: https://github.com/sparkfun/DeadOn_RTC

truedat101 commented 5 years ago

Here's another repo: https://github.com/sparkfun/SparkFun_DS3234_RTC_Arduino_Library

truedat101 commented 5 years ago

So first thing, just get this working with an Arduino Due to verify.

Here''s the datasheet for pinouts: https://web.archive.org/web/20180328233937/http://www.robgray.com/temp/Due-pinout-fillable-form.pdf

truedat101 commented 5 years ago

I'm thinking this might just be just be easier to wire in directly on the espressobin. Interesting, this work was done by Spotify : https://github.com/spotify/linux/blob/master/drivers/rtc/rtc-ds3234.c

truedat101 commented 5 years ago

Ok, so the one I am confused about is the MISO and MISI. There is a good description here: https://electronics.stackexchange.com/a/173761/105192

Based on the datasheet block diagram, I have just the 7 pins to wire up: https://www.sparkfun.com/datasheets/BreakoutBoards/DeadOn%20RTC%20-%20DS3234%20Breakout-v11.pdf

Should connect over SPI interface.

truedat101 commented 5 years ago

Here's a good article on differences between RTC chipsets: https://blog.heypete.com/2017/09/05/major-differences-between-the-ds3231-and-ds3231m-rtc-chips/

truedat101 commented 5 years ago

Try to finish this weekend or get help from one of the EE people.