atmega 32 based digital clock circuit diagram
#1

hire you looking for atmega 32 based digital clock circuit diagram ?
Type your request / requirement / comment about atmega 32 based digital clock circuit diagram in to the right box for getting free material and support from us/dedicated premium members...
Its a free service...==>
==>
==>
==>
Dont forget to save this page.>!
Scroll down to see Save button...!
Reply
#2

atmega 32 based digital clock circuit diagram

In this project we are going to design a simple Alarm clock using ATMEGA32 timers. ATmega32A microcontroller has a 16 bit timer, and we will be using that timer to count the seconds and develop a digital clock.

All the digital clocks have a crystal inside of them which is the heart of clock. This crystal not only present in clock but present in all computing real time systems. 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. We are going to connect a crystal to ATMEGA32 for getting accurate clock.

Components Required

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.

For accurate timing, we have connected a 11.0592MHz crystal for clock. Now for disabling the internal clock of ATMEGA we have to change its LOW FUSE BITS. Remember we are not touching the high fuse bits so the JTAG communication would be still enabled.

For telling ATMEGA to disable internal clock and to work on external we need to set:
LOW USE BYTE = 0xFF or 0b11111111.

In circuit PORTB of ATMEGA32 is connected to data port LCD. 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 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. One can power or leave the back light 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), 3rd pin for contrast control (VEE-controls how thick the characters should be shown), and 3 control pins (RS&RW&E)

In the circuit, you can observe that I have only took two control pins. This gives the flexibility of better understanding, the contrast bit and READ/WRITE are not often used so they can be shorted to ground. This puts LCD in highest contrast and read mode. We just need to control ENABLE and RS pins to send characters and data accordingly.

The connections which are done for LCD are given below:
PIN1 or VSS to ground
PIN2 or VDD or VCC to +5v power
PIN3 or VEE to ground (gives maximum contrast best for a beginner)
PIN4 or RS (Register Selection) to PD6 of uC
PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user)
PIN6 or E (Enable) to PD5 of uC
PIN7 or D0 to PB0 of uC
PIN8 or D1 to PB1 of uC
PIN9 or D2 to PB2 of uC
PIN10 or D3 to PB3 of uC
PIN11 or D4 to PB4 of uC
PIN12 or D5 to PB5 of uC
PIN13 or D6 to PB6 of uC
PIN14 or D7 to PB7 of uC

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.

Switch one is for enabling adjust feature between alarm and time. If the pin is low, we can adjust alarm time by pressing buttons. If its high buttons are for adjusting just TIME. There are FOUR buttons present here, first is for increment MINUTES in alarm or time. Second is for decrement MINUTES in alarm or time. Third is for increment HOUR in alarm or time. FOURTH is for decrement HOURS in alarm or time.

The capacitors present here is for nullifying the bouncing effect of buttons. If they are removed the controller might count more than one each time the button is pressed. The resistors connected for pins are for limiting the current, when the button is pressed to pull down the pin to the ground.

Whenever a button is pressed, The corresponding pin of controller gets pulled down to ground and thus the controller recognizes that certain button is pressed and corresponding action is taken.

First of all, the clock we choose here is 11059200 Hz, dividing it by 1024 gives 10800. So for every second we get 10800 pulses. So we are going to start a counter with 1024 prescaler to get the counter clock as 10800 Hz. Second we are going to use the CTC (Clear Timer Counter) mode of ATMEGA. There will be a 16 bit register where we can store a value (compare value), when the counter counts up to the compare value an interrupt is set to generate.

We are going to set the compare value to 10800, so basically we will have a ISR (Interrupt Service Routine on every comparison) for every second. So we are going to use this timely routine to get the clock we needed.

#include<avr/io.h>

#include<util/delay.h>

#define lcdport PORTA

#define signal PORTB

#define en PB2

#define rw PB1

#define rs PB0

void lcdcmd(unsigned char cmd);

void lcdint();

void lcddata(unsigned char data);

void dis_clk(int,int,int);

void lcd_print(char * str);

void main()

{

DDRA=0xff;

DDRB=0x07;

lcdint();

lcdcmd(0x86);

lcd_print("clock");

int hr,mm,ss;

while(1)

{

for(hr=00;hr<=24;hr++) // 24 hour format

{

for(mm=00;mm<=59;mm++)

{

for(ss=00;ss<=59;ss++)

{

dis_clk(hr,mm,ss);

}

}

}

}

}

void dis_clk(int x,int y,int z) // conversion

{

int p,q,r;

int a,b,c,d,e,f;

p=x;

q=y;

r=z;

a=p/10;

b=p%10;

lcdcmd(0xc4);

lcddata(a+48);

lcddata(b+48);

lcddata(':');

c=q/10;

d=q%10;

lcddata(c+48);

lcddata(d+48);

lcddata(':');

e=r/10;

f=r%10;

lcddata(e+48);

lcddata(f+48);

_delay_ms(1000);

}

void lcdint()

{

lcdcmd(0x38);

_delay_ms(1);

lcdcmd(0x01);

_delay_ms(1);

lcdcmd(0x0E);

_delay_ms(1);

}

void lcdcmd(unsigned char x)

{

lcdport=x;

signal=(0<<rs)|(0<<rw)|(1<<en);

_delay_ms(1);

signal=(0<<rs)|(0<<rw)|(0<<en);

_delay_ms(50);

}

void lcddata(unsigned char data)

{

lcdport= data;

signal= (1<<rs)|(0<<rw)|(1<<en);

_delay_ms(1);

signal= (1<<rs)|(0<<rw)|(0<<en);

_delay_ms(50);

}

void lcd_print(char * str)

{

unsigned char i = 0;

while(str[i]!=0)

{

lcddata(str[i]);

i++;

}

}

Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: at89c2051 digital clock circuit diagram, dtmf based evm using atmega, digital clock circuit without microcontroller pdf, car parking system project atmega circuit diagram, atmega32 osciloscope, osciloscope atmega32, diy propeller clock diagram using atmega,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  data flow diagram for whatsapp 2 4,184 09-12-2018, 02:30 PM
Last Post: Rhysevans371a
  self inductance of a coil depends by observing the effect of this coil in a series with resistor in a circuit fed up by 2 1,469 01-10-2016, 09:27 PM
Last Post: Guest
Wink uml diagram for privacy preserving public auditing for secure cloud storage 2 1,001 19-09-2016, 10:20 PM
Last Post: harikash
  hidden camera jammer with circuit diagrams 2 1,013 01-09-2016, 01:16 AM
Last Post: Guest
  circuit Breaker Switching & Arc Modeling selvarajkeerthi 1 1,068 23-08-2016, 02:09 PM
Last Post: seminar report asees
  fault finding luminous inverter circuit 4 1,081 17-08-2016, 02:31 PM
Last Post: dhanabhagya
  matlab code energy based spectrum sensing in cognitive radio energy threshold based algorithm 2 1,050 06-08-2016, 03:30 PM
Last Post: murthyhs
  atta maker circuit diagram 2 977 22-07-2016, 04:25 PM
Last Post: dhanabhagya
  employee management system all diagram pdf 2 1,237 21-07-2016, 04:51 PM
Last Post: visalakshik
Heart piezoelectric mobile charger circuit mini project pdf 2 1,740 21-07-2016, 03:19 PM
Last Post: dhanabhagya

Forum Jump: