Overview
With in the TWI module of Atmega32 MCU, I have already post about interfacing and programming with the DS1307 RTC. However, in the previous post, the display interface was a simple multiplexed 7-segment display. Here, the display is an HD44780-based character LCD.
In this example post, the program read the date/time and day of week from the RTC. Those data will display on a character LCD for every one second.
A running example program |
DS1307 RTC Interfacing And Programming With ATMega32 AVR
DS1307 has a writing address of 0xD0 while the writing address is 0xD1. Its RAM registers store time, date, configuration register and general purpose SRAM registers. The RAM address of 0x00 is the second register and so on. This post store some information about the DS1307.
Schematic |
PORTD interfaces to the character LCD. PC0 and PC1 are the TWI clock and data pins, respectively. As we can see, the DS1307 TWI device doesn't need its two pull up resistors. Setting PC0 and PC1 high by software eliminates the requirement of external resistors.
Click here to download the archive of this example.
For more tutorial on HD44780 character LCD:
No comments:
Post a Comment