Nov 21, 2016

Digital Clock with DS3231, TM1637 (STM32F103C8T6)

It is really simple to do. Only 4 wires for DS3231 (the real time clock), 4 wires for TM1637 (in this case is 4 digit display), 2 wires for STM32F103C8 (32-bit microcontroller).
DS3231 wires are: VCC, GND, SCL (goes to PA.7), SDA (goes to PA.6)
TM1637 wires are: VCC, GND, CLK (goes to PA.0), DIO (goes to PA.1)
STM32F103C8 wires are: VCC and GND.
DS3231 is an extremely accurate I2C real time clock, accuracy 2ppm (at 0-40 degC) that is about a minute per year.

DS3231 equipped with 3V battery to keep RTC counting when power off. There's no push buttons for time setup yet, time setup is done in the software. After running program with time setup, give comment sign (//) to the time setup line and reload program. You can get the code here, compile it and download the hex to microcontroller using ST-LINK2.

No comments:

Post a Comment

MAX7219 8-digits 7-segment (STM32F103C8T6)

I made MAX7219 for C51 but now I need it for STM32F103 too. The wiring is simple: MAX7219_CLK   hooked up to PORTA0, MAX7219_...