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
,Calendar
andAlarm
which can be cycled by pressing theMODE
button. - Once you are at any given screen and need to modify the values, press and hold the
MODE
button for approximately 3 seconds to enter theEdit Mode
. - Once you are in
Edit Mode
you can use theSET
button to change the active blinking digit. - Pressing
MODE
when inEdit Mode
allows you to toggle between the digits. - To exit
Edit Mode
, press and hold theMODE
button again for 3 seconds to exitEdit Mode
and 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
AE
orAd
flag 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
bin
directory toPATH
Windows 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
commandline
topath
as before.
- For Linux, follow the instructions available on this repository.
- Use the following command to compile and create the HEX file in folder
build
make all
- Alternatively, Atmel Studio 7 project files are available.
-
Use
make flashUSBasp
to dump the created HEX file into your MCU. Script inMakefile
usesavrdude
andUSBasp
. -
If you are using Micronucleus, use
make flashMicronucleus
to do the same.