A digital clock is a type of clock that displays the time digitally (i.e. in numerals or other symbols), as opposed to an analog clock, where the time is indicated by the positions of rotating hands. The clock/calendar provides seconds, minutes, hours information. The clock operates in either the 24-hour or 12-hour format with AM/PM indicator.
In this project, we will learn How to design a DS1307 Real Time Clock(RTC) based digital clock with AVR ATmega16 microcontroller and 7-Segment Displays in 12 hour format. Here, we will read time(Hour, Minute and Second) from the DS1307 RTC and we will display the hour and minute value in 4 7-segment displays. The second value from the DS1307 is used to blink the dot(.) of the middle 7-segment display. The data communication between DS1307 RTC and AVR ATmega16 microcontroller takes place using TWI(Two Wire Interface) communication protocol. But before reading the DS1307 RTC, the DS1307 RTC needs to be initialized with hour, minute and second values. The DS1307 RTC is initialized only once. We will initialize the hour, minute and second value of the DS1307 RTC with of 5, 0 and 0(Clock will start with 5 hour(PM), 0 minute and 0 second). You can change the initialization values according to your need by changing the initialization values in the DS1307 write section of the code. After initialization of DS1307 RTC, the AVR ATmega16 microcontroller will read the second, minute and hour values from the DS1307 continuously through two wire interface communication and it will display those hour and minute values in 4 7-segment displays. The microcontroller will use the second value to blink the dot (.) of the middle 7-segment display.
The step-by-step connection guide for DS1307 RTC based Digital Clock Designing in 12 Hour Format with ATmega16 and 7-Segment Display is as follows
Steps - 1 ( 0f 9 )
Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.
Steps - 2 ( 0f 9 )
Connect PortB header of AVR Trainer Board-100 with 7 Segment header of Quad 7-Segment Display with a 10 to 10 FRC Female Connector.
Steps - 3 ( 0f 9 )
Connect the DIS1, DIS2, DIS3 and DIS4 pins of Display Select header of Quad 7-Segment Display with PD0, PD1, PD2 and PD3 pins of PortD header respectively of AVR Trainer Board-100 with 1 to 1 Connectors.
Steps - 4 ( 0f 9 )
Connect the EEPROM & RTC header of EEPROM & RTC with PortC header of AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.
Steps - 5 ( 0f 9 )
Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header of AVR USB Programmer with a 10 to 10 FRC Female Connector.
Steps - 6 ( 0f 9 )
Connect the AVR USB Programmer to the PC/Laptop's USB Port directly or with the help of USB AM-AF Cable.
Steps - 7 ( 0f 9 )
Switch on the power with the help of Power Switch of AVR Trainer Board-100.
Steps - 8 ( 0f 9 )
Download DS1307 RTC based Digital Clock Designing in 12 Hour Format with ATmega16 and 7-Segment Display Hex file to AVR Trainer Board-100 with the help of SinaProg Hex downloader and AVR USB Programmer.
Steps - 9 ( 0f 9 )
Wait for some time(30 seconds) and delete or convert the code between DS1307 write section starts here and DS1307 write section ends here into comments in the C Program of the project and compile the code. After compilation, download the code.
Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.
Steps - 1 ( 0f 9 )
Connect PortB header of AVR Trainer Board-100 with 7 Segment header of Quad 7-Segment Display with a 10 to 10 FRC Female Connector.
Steps - 2 ( 0f 9 )
Connect the DIS1, DIS2, DIS3 and DIS4 pins of Display Select header of Quad 7-Segment Display with PD0, PD1, PD2 and PD3 pins of PortD header respectively of AVR Trainer Board-100 with 1 to 1 Connectors.
Steps - 3 ( 0f 9 )
Connect the EEPROM & RTC header of EEPROM & RTC with PortC header of AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.
Steps - 4 ( 0f 9 )
Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header of AVR USB Programmer with a 10 to 10 FRC Female Connector.
Steps - 5 ( 0f 9 )
Connect the AVR USB Programmer to the PC/Laptop's USB Port directly or with the help of USB AM-AF Cable.
Steps - 6 ( 0f 9 )
Switch on the power with the help of Power Switch of AVR Trainer Board-100.
Steps - 7 ( 0f 9 )
Download DS1307 RTC based Digital Clock Designing in 12 Hour Format with ATmega16 and 7-Segment Display Hex file to AVR Trainer Board-100 with the help of SinaProg Hex downloader and AVR USB Programmer.
Steps - 8 ( 0f 9 )
Wait for some time(30 seconds) and delete or convert the code between DS1307 write section starts here and DS1307 write section ends here into comments in the C Program of the project and compile the code. After compilation, download the code.
Post a Comment
Knoweldge Centre
Popular Post
Line Follower Robot with ATmega16 using Analog IR Sensor ...
LED Blinking with ATmega16 ...
16X2 Alphanumeric LCD Interfacing with ATmega16 ...
4X4 Keypad Interfacing with ATmega16 and LCD Display ...
HC-05 Bluetooth Module Interfacing with ATmega32 ...
L293D based DC Motor Driver Interfacing with ATmega16 in 5V ...
LM35 Temperature Sensor Interfacing with ATmega32 and LCD Di ...
PC to ATmega16 Communication with LED Display ...
Analog IR Sensor Interfacing with ATmega16 and LED Display ...
00 to 99 Display in Quad 7-Segment Display with ATmega16 ...
Get Socialize With us