

If the pin is low, we can adjust alarm time by pressing buttons. Switch one is for enabling adjust feature between alarm and time. In the circuit you can see we have used 8bit communication (D0-D7) however this is not a compulsory, we can use 4bit communication (D4-D7) but with 4 bit communication program becomes a bit complex. So as shown in the above table we are connecting 10 pins of LCD to controller in which 8 pins are data pins and 2 pins for control.

PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user) PIN4 or RS (Register Selection) to PD6 of uC PIN3 or VEE to ground (gives maximum contrast best for a beginner) The connections which are done for LCD are given below: We just need to control ENABLE and RS pins to send characters and data accordingly. This puts LCD in highest contrast and read mode. This gives the flexibility of better understanding, the contrast bit and READ/WRITE are not often used so they can be shorted to ground. In the circuit, you can observe that I have only took two control pins. Now in the 14 pins there are 8 data pins (7-14 or D0-D7), 2 power supply pins (1&2 or VSS&VDD or gnd&+5v), 3 rd pin for contrast control (VEE-controls how thick the characters should be shown), and 3 control pins (RS&RW&E) One can power or leave the back light pins. In 16x2 LCD there are 16 pins over all if there is a black light, if there is no back light there will be 14 pins. Here one should remember to disable the JTAG communication in PORTC of ATMEGA by changing the high fuse bytes, if one wants to use the PORTC as a normal communication port. In circuit PORTB of ATMEGA32 is connected to data port LCD. Remember we are not touching the high fuse bits so the JTAG communication would be still enabled.įor telling ATMEGA to disable internal clock and to work on external we need to set: Now for disabling the internal clock of ATMEGA we have to change its LOW FUSE BITS. Software: Atmel studio 6.1, progisp or flash magic.įor accurate timing, we have connected a 11.0592MHz crystal for clock. Hardware: ATmega32 microcontroller, 11.0592MHz crystal, 22pF Capacitor (2 pieces), Power supply (5v), AVR-ISP PROGRAMMER, JHD_162ALCD(16x2 LCD), 100uF capacitor (connected across power supply), buttons (four pieces), 10KΩ resistor (six pieces), 100nF capacito r(four pieces), Three pin switches (2 pieces), 2N2222 transistor, Buzzer, 200Ω resistor. We are going to connect a crystal to ATMEGA32 for getting accurate clock. This crystal generates clock pulses, which is needed for timing calculations. Although there are some other ways to get clock pulses but for accuracy and higher frequency most prefer crystal based clock. This crystal not only present in clock but present in all computing real time systems. ATmega32A microcontroller has a 16 bit timer, and we will be using that timer to count the seconds and develop a digital clock.Īll the digital clocks have a crystal inside of them which is the heart of clock. In this project we are going to design a simple Alarm clock using ATMEGA32 timers.
