Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Digital Clock Using pic16f877a and assembly language

Status
Not open for further replies.

lera

New Member
Hi i have been trying to do my homework i have described in title. I made some searches but i couldn't find a good solution. Can anyone help me for the project?
 
Have you done a schematic? That will give us an idea to how you want it to work..
If you have any code, even if it doesn't work, it will also help.
i dont have a real schematic. I just put the pic and segments nothing more. There is one more thing i must use common anode segment led.
 
Maybe build a flux capacitor, travel back in time and pay attention in class and do the homework so you'll have a clue?
 
Thanks all of you i did some progress and made a proteus simulation. It has been attached.
Must remember this reply. It'll come in useful for many threads.

Mike.
Maybe build a flux capacitor, travel back in time and pay attention in class and do the homework so you'll have a clue?
Have you done a schematic? That will give us an idea to how you want it to work..
If you have any code, even if it doesn't work, it will also help.
 

Attachments

  • saat1-2-3-4.rar
    19.4 KB · Views: 330
Okay... Decent start.... Now you need an interrupt or delay to give you exactly 1 second and variables to hold seconds minutes hours etc..

kinda like this...

loop
wait 1 second add 1 to seconds variable​
if seconds is bigger than 60 make seconds zero and add 1 to minutes​
if minutes is bigger than 60 make minutes zero and add 1 to hours​
if hours is bigger than 24 make hours zero​
display minutes​
display hours​
goto loop​
then you can start on adjusting...
 
Okay... Decent start.... Now you need an interrupt or delay to give you exactly 1 second and variables to hold seconds minutes hours etc..

kinda like this...

loop
wait 1 second add 1 to seconds variable​
if seconds is bigger than 60 make seconds zero and add 1 to minutes​
if minutes is bigger than 60 make minutes zero and add 1 to hours​
if hours is bigger than 24 make hours zero​
display minutes​
display hours​
goto loop​
then you can start on adjusting...
can you help me a bit more with the code? I have always struggle with algorithms.
 
There is no algorithm...

count 60.... count 60... count 24... The only thing you need to calculate is the timer..

If you use a crystal of 4Mhz, your timer0 will increment every 0.1us if you set the OPTION_REG to Watchdog timer (even if you don't use it ) and no prescaler, you can work out how many timer spills are needed to make 1 second..
 
Hi Ian,
I thought it was just a typo. I like the comments in posts #5 & #6 of this thread. The OP seems to think he does not need to know how to do the homework himself. He seems to think all he has to know it how to find the answer with Google or get one of us to provide the answer.

Les.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top