This is a fun project that I did. The accuracy of the clock over time is understandably low since I'm just using the internal oscillator of the ATTiny85.
This app is designed to work with a 6-digit, 7-segment display and due to the number of pins needed, uses two 74HC595 8-bit shift registers. There are two buttons MODE and SET to switch between the time, calendar and alarm screen and to set the time and alarm.
- The clock app has three screens -
Time,CalendarandAlarmwhich can be cycled by pressing theMODEbutton. - Once you are at any given screen and need to modify the values, press and hold the
MODEbutton for approximately 3 seconds to enter theEdit Mode. - Once you are in
Edit Modeyou can use theSETbutton to change the active blinking digit. - Pressing
MODEwhen inEdit Modeallows you to toggle between the digits. - To exit
Edit Mode, press and hold theMODEbutton again for 3 seconds to exitEdit Modeand enter the normal mode. - The above applies to each of the three screens, including the alarm, for which the third screen allows you to set the alarm time and whether the alarm is enabled or disabled using the
AEorAdflag respectively.
Note: The date is displayed in DD-MM-YY and the time in 24-hour formats.
- Use the Proteus file to simulate what has been described without using actual hardware.
- Download and extract AVR GNU Toolchain for Windows and add the
bindirectory toPATHWindows Environment variable.
-
Download and extract avrdude to any location on your PC. Add the folder to Windows Environment variable
PATH.(or)
-
You can also use the Micronucleus bootloader. Download and add the folder
commandlinetopathas before.
- For Linux, follow the instructions available on this repository.
- Use the following command to compile and create the HEX file in folder
buildmake all - Alternatively, Atmel Studio 7 project files are available.
-
Use
make flashUSBaspto dump the created HEX file into your MCU. Script inMakefileusesavrdudeandUSBasp. -
If you are using Micronucleus, use
make flashMicronucleusto do the same.

