Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 12th May 2008, 08:08 PM   (permalink)
Experienced Member
engkhlaif can only hope to improve
Default Real Time calendar

i need a help in a real time calendar using PIC16F877A
iam using c language and then i need to display the time and date on lcd 16*1 like:
10:15:59
21 jan 2008
i just need the function that calculate the time and the date and thanx for every one who can help me
engkhlaif is offline   Reply With Quote
Old 12th May 2008, 08:47 PM   (permalink)
Experienced Member
 
Gordz is on a distinguished road
Default

most of it can be done with simple counters and a real time interupt. In the interupt service routine ripple through each counter. Say the interupt happenes every second, increment the seconds counter each time and see if it has reached sixty. When it does reach sixty, clear it and increase the minutes counter by one and so on until you are counting hours, days, months and years.
Gordz is offline   Reply With Quote
Old 12th May 2008, 11:43 PM   (permalink)
Experienced Member
engkhlaif can only hope to improve
Default

Quote:
Originally Posted by Gordz
most of it can be done with simple counters and a real time interupt. In the interupt service routine ripple through each counter. Say the interupt happenes every second, increment the seconds counter each time and see if it has reached sixty. When it does reach sixty, clear it and increase the minutes counter by one and so on until you are counting hours, days, months and years.
thanx
but do u have a sample code
iam not to use the interrupts as our instructor said
engkhlaif is offline   Reply With Quote
Old 13th May 2008, 12:33 AM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

If you download the 16F88 data sheet you will find the code you require on page 77 in example 7-3. Aren't Microchip a nice company.

BTW, don't use the interrupt, just poll the timer1 bit.

Mike.
Pommie is offline   Reply With Quote
Old 13th May 2008, 06:20 AM   (permalink)
Experienced Member
bryan is on a distinguished road
Default

If you can tackle assembler Microchip has the code for a 16f. Just search Maestro.

http://ww1.microchip.com/downloads/e...int.readme.pdf



It is one of the supplied modules, does leap years and is good to the year 12700<g>
bryan is offline   Reply With Quote
Old 13th May 2008, 11:11 AM   (permalink)
Experienced Member
engkhlaif can only hope to improve
Default

Quote:
Originally Posted by Pommie
If you download the 16F88 data sheet you will find the code you require on page 77 in example 7-3. Aren't Microchip a nice company.

BTW, don't use the interrupt, just poll the timer1 bit.

Mike.
thanx man i will do that
and do u think that will run on PIC16F877A
thanx again i will try the code
engkhlaif is offline   Reply With Quote
Old 13th May 2008, 11:41 AM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Quote:
Originally Posted by engkhlaif
thanx man i will do that
and do u think that will run on PIC16F877A
thanx again i will try the code
They both have the same 14 bit core, so there should be no problems.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 13th May 2008, 11:58 AM   (permalink)
Experienced Member
 
Gordz is on a distinguished road
Default

iam not to use the interrupts as our instructor said[/quote]

OK, you did not specify that in your requirement. Like Mike said, poll TMR1.
Gordz is offline   Reply With Quote
Old 13th May 2008, 02:27 PM   (permalink)
Experienced Member
engkhlaif can only hope to improve
Default

Quote:
Originally Posted by Pommie
If you download the 16F88 data sheet you will find the code you require on page 77 in example 7-3. Aren't Microchip a nice company.

BTW, don't use the interrupt, just poll the timer1 bit.

Mike.
thanx for ur hint
but i dont know the assembler iam just using PICC C compiler in MBLAP v7.31
and iam using c language not assembly
so any one just has the code that find the time and date and iam very glad to him
engkhlaif is offline   Reply With Quote
Old 13th May 2008, 02:30 PM   (permalink)
Experienced Member
 
Blog Entries: 4
blueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to behold
Send a message via Skype™ to blueroomelectronics
Default

Post the code you've done so far.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Using Oscilloscopes mechie Electronic Theory 9 29th November 2007 09:48 PM
Help me to calculate the interrupt time Suraj143 Micro Controllers 20 11th October 2007 04:54 AM
PIC18F2550 with real time counter (DS1302) ash87 Micro Controllers 8 30th July 2007 03:21 AM
Real Time Clock RTC 8583 sonic Micro Controllers 0 16th May 2004 07:32 PM
Real Time voltmeter CarElectronics Electronic Projects Design/Ideas/Reviews 1 4th September 2002 02:16 PM



All times are GMT. The time now is 10:34 AM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.