Go Down

Topic: Attiny25/45/85 with an rtc DS3231 using the Arduino platform. (Read 1 time) previous topic - next topic

7immy

Mar 09, 2013, 09:36 pm Last Edit: Mar 11, 2013, 10:01 pm by 7immy Reason: 1
Is it posible to accuratly keep track of time using a attiny chip and a real time clock like a DS3231 (http://www.maximintegrated.com/datasheet/index.mvp/id/4627).

The usage would be for example to flash a light every 15mins over long periods of time for months or even years an stay relatively accurate over this period of time.

Many thanks



Jack Christensen

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

7immy

Thanks for this Jack, that looks very useful! I've been doing a bit more research on this RTC stuff (I'm a bit of a noob)  :~ and I've found a simular one called DS3234 which is SPI instead?? If someone could kindly enlighten me to what the difference is between I2C and SPI is that would be awesome. Also is this compatible with the attiny chips and the arduino platform.

..and then there's the DS3231m (http://www.maximintegrated.com/datasheet/index.mvp/id/6861) which is the size I'm looking for as its smaller and has less pins but I can't find it anywhere.. this is getting confusing :~

any help would be much appreciated :)

Jack Christensen

I2C and SPI are just two different bus protocols:
http://en.wikipedia.org/wiki/I2c
http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

Arduino supports both:
http://arduino.cc/en/Reference/Wire
http://arduino.cc/en/Reference/SPI

I2C is also sometimes called TWI (two-wire interface). SPI needs three or four wires usually. Personally I tend to use RTCs with I2C interfaces, but there's nothing wrong with using SPI. The DS3234 is essentially an SPI version of the DS3231 or DS3232, all of which should be available at Mouser or Digikey.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

7immy

Thank you much, you're awesome!! :D I'm learning a lot today! Your links helped in leading me to here:
http://tronixstuff.wordpress.com/2010/10/20/tutorial-arduino-and-the-i2c-bus/
and here
http://tronixstuff.wordpress.com/2011/05/13/tutorial-arduino-and-the-spi-bus/

Which put it all into context for me and now I understand it allllll! :)

Thanks again!

Jack Christensen

Glad to help a little bit. tronixstuff is a really nice site, I should spend more time there myself.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Go Up