Program that implements a digital clock, C/C++ Programming

Write C code for a program that implements a digital clock (HH:MM:SS).

The clock includes a two-digit hour indicator HH (00-23), a two-digit minute indicator MM (00-59), and a two-digit second indictor SS (00-59).

The main interface is through the serial port to the terminal program.

At start or upon reset, the program displays "00:00:00".

The program should use one or multiple timers of the microcontroller to create a timebase of 1 sec that acts as the clock's heartbeat.

In passing of each 1 second, the following tasks should be performed:

(i) SS+1; SS=60?→SS=00, MM+1; MM=60?→MM=00, HH+1; HH=24??HH=00.

(ii) Display the new HH:MM:SS on the terminal program.

Whenever a pushbutton is pressed, the clock should be reset restarting from "00:00:00".

An interrupt routine should be used to detect the pressing of the pushbutton. Thus, select one of the eight pushbuttons that is able to interrupt the microcontroller.

The following can be used as guide to write the code. (do not write code for separately  the following.  The code should compile in ATMEL Studio 6 and able to display in a Terminal Program Interface.

1. Write the code to display time on the terminal program.

2. Write the code to use one or multiple timers of the microcontroller to create a timebase of 1 sec that acts as the clock's heartbeat.

3. Write the code to calculate and keep track of time.

4. Write the code to detect the pressing of the pushbutton using an interrupt based approach, and reset the clock.

5. Write the code to implement additional functionalities to the C program (considered for Problem 3 only).

6. It would be helpful to understand your coding if you draw a flowchart and develop the corresponding pseudo.

7. Processor, 8 bit,  ATMEGA 128, 16MHz.

Posted Date: 2/19/2013 8:26:07 AM | Location : United States







Related Discussions:- Program that implements a digital clock, Assignment Help, Ask Question on Program that implements a digital clock, Get Answer, Expert's Help, Program that implements a digital clock Discussions

Write discussion on Program that implements a digital clock
Your posts are moderated
Related Questions
Programming an odds betting website Project Description: We want someone to program a odds betting website, Require someone with experience and skills! Skills required are

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, int pos) Assuming t

#C Why don''t online compilers support the header file? What can I do to resolve this? PS. I have tried , does''nt work either. Thannk in advance.


Differences between a pointer and a reference 1.  A reference must always point to some object where as this restriction is not imposed on a pointer. e.g. int *pi = 0;

What is the difference between structure and class? - Members of structures are public while those of a class are private. - Classes provide data hiding while structures don

It is a feature in C++ to reduce name collisions in the global name space. This namespace keyword assigns a separate name to a library that allows other libraries to use the simila

C language lets us do this in a structure definition by putting: bit length after the variable that is. struct packed_struct { unsigned int f1:1; unsigned int f2:1; unsigned

#include #include using namespace std; class Book { private: string title; int iD; int year_pub; string author; public: string getTitle(); int getId(); int getYear_Pub(); st

Damjibhai and Shamjibhai are two jeweler friends. They decide to play a simple game. The game comprises of removing the jewels for polishing, turn by turn. Once a jewel is removed