Program to create a digital clock, C/C++ Programming

Create a C language code, only one program, to implement the following task.

Task:

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/25/2013 12:45:13 AM | Location : United States







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

Write discussion on Program to create a digital clock
Your posts are moderated
Related Questions
real time application of b tree

Reusability  Reusability means reusing code written earlier, may be from some earlier project or from the library. Reusing old code not only saves development time, but also sa

C Program for Palindrome Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Operation on array: void Array::add( Object& toAdd ) {     lastElementIndex++;     while( ptrAt( lastElementIndex ) != ZERO &&            lastElementIndex

Write two different arrays. Store the names in it and then compare if both the names entered by the user are the same.


Why many companies are switching their current business language to PHP? Where PHP basically used? PHP is rapidly gaining popularity and numerous companies are switching their

Explain about Evaluation of Expression in c language? An Expressions are evaluated using an assignment statement of the form: variable = expression; The Variable is any v

Ask question #Minimum 100 words accepted program for polishing jewels#

What is the use of default constructor? - It's a constructor that doesn't accept any parameters. - If there is no user-defined constructor for a class, compiler declares a d