Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Digital Clock using 8051 and mikroC code.

Status
Not open for further replies.

tak_iiec@yahoo.com

Newbie level 6
Newbie level 6
Joined
Feb 28, 2011
Messages
11
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,420
Dear All;
I need 8051 mikroC code for Digital clock. Kindly help me in this regard.
I shall be greatful.
thanks
Tanvir
 

Your question is nice and good choice for project, because you can learn a lot with this simple project. But, you must give us a few more details about your project.

1. you want to build digital clock, but what you will use like a hardwer - RTC (Real Time Clock), or you will use timer interupt routine every seconds?
2. will you represent time on seven segment display or you will use some LCD display? (I agree this question is not unnecessary to be answered before starting to write code for digital clock)

Here is only simple example for algoritm for thinking about this task:

Code:
// variables
int second = 0;
int minute = 0;
int hour = 0;

// timer interupt routine
timer_interupt()
{
 second++; // increment seconds and check the value
 if (second == 60) {
    second = 0;
    minute++;
    }
 if (minute == 60) {
    minute = 0;
    hour++;
    }
 if (hour == 25) {
    hour = 0;
    }
 }
 
Last edited:

Thanks alot brother for your kind reply. I shall use RTC IC and want to display the on 7 segment display. I shall be greatful if any one sends me both codes of 7 segment and LCD. and also for both Timer0 and RTC IC.
Thanks
Your question is nice and good choice for project, because you can learn a lot with this simple project. But, you must give us a few more details about your project.

1. you want to build digital clock, but what you will use like a hardwer - RTC (Real Time Clock), or you will use timer interupt routine every seconds?
2. will you represent time on seven segment display or you will use some LCD display? (I agree this question is not unnecessary to be answered before starting to write code for digital clock)

Here is only simple example for algoritm for thinking about this task:

Code:
// variables
int second = 0;
int minute = 0;
int hour = 0;

// timer interupt routine
timer_interupt()
{
 second++; // increment seconds and check the value
 if (second == 60) {
    second = 0;
    minute++;
    }
 if (minute == 60) {
    minute = 0;
    hour++;
    }
 if (hour == 25) {
    hour = 0;
    }
 }
 
I shall be greatful if any one sends me both codes of 7 segment and LCD. and also for both Timer0 and RTC IC.

Just so I understand you correctly, not only would you like a forum member to provide you the working code for your project, you would like it provided four different ways?


BigDog
 

yes you are right. I need it if anyone can plz help me out. or just provide Mikroc8051 code using 7 segment display with timer interrupt.
 

You want to much for less gived details. Will you tell us something about your board?

Do you want to learn basic knowledge or you need solution for your problem?

You know, if you want code for 7segment displays, I could explain you how that works, but, you must adapt that example to your board and pins which you plan to use for that. Also, if you need code for LCD, that will not go so easy like 7segment displays, because we must choose and library for LCD which you plan to use.

So, give more details about your board and about your expectations, and after that you can except some help.
 

Thanx Dear. Well i want solution for my problem and also want to learn something. Finally now I need mikroc pro 8051 code for digital clock using 7 segments. Timer0 interrupt will be used for RTC. Any1 can help plz?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top