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

Assignment Help:

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.


Related Discussions:- Program to create a digital clock

Explain the function fseek, Question: (a) Explain the function fseek()....

Question: (a) Explain the function fseek(). Using an appropriate example, write the full syntax for this function. (b) Write a C or C++ program that will perform the follo

Euclidean Algorithm , how can I find the GCD of 2 given numbers using Eucli...

how can I find the GCD of 2 given numbers using Euclidean Algorithm ?

Program to calculate the n factorial, Debug the following program to calcul...

Debug the following program to calculate N! #include using namespace std; main() {             int N, factorial=1;             cout             cin >> N;

Command line arguments, i want to check the command line argument is whethe...

i want to check the command line argument is whether an integer or a string

Static optimality theorem, Question 1 Describe the following with respect ...

Question 1 Describe the following with respect to pointers in C language- Pointers and Arrays Usage of Pointers in functions Write programs in C to demonstrate the

Define functions with arguments and return values, Define Functions with ar...

Define Functions with arguments and return values? The earlier category functions receive values from the calling function through arguments but do not send back any value rath

What are user defined data types, Q: What are User Defined data types? ...

Q: What are User Defined data types? C supports an extraordinary feature known as "type definition" that permits users to define an identifier that would represent an existing

Advanced features of c, We are now quite happy to use the basic mathematica...

We are now quite happy to use the basic mathematical expressions, however in engineering we use scientific functions i.e Sin , Cos  , ln etc . Within C we have the following functi

Fibonacci function by using simple recursive approach, Implement, in rPeANU...

Implement, in rPeANUt, the a Fibonacci function by using the simple recursive approach. The Fibonacci function can be implemented in c as follow: int fib(int x) {   if (x

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd