Thank you Bruce
Smaller, tighter, yet perfect speed. Started the clock last night with your change and so far the PIC18F452 has not gained or lost one second.
Tim C
Thank you Bruce
Smaller, tighter, yet perfect speed. Started the clock last night with your change and so far the PIC18F452 has not gained or lost one second.
Tim C
Hi,
I didn't see that one :
http://www.pbpgroup.com/modules/wfse...hp?articleid=8
did I miss something ???
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Alain,
Darrel's great example uses one crystal mine uses 2. And oh if something is sitting there soldered to the dev board and you don't have code to see if it works!!
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
There's a couple good examples. I like Bruce's.
But it uses in-line assembly language instead of straight PBP.
The Elapsed Timer modification is nice too ... but ...
Nobody wins the LCD's.![]()
DT
I was playing with TimC RTC code, and I found 1 problem...
If the interrupt occurs between these lines
There is a chance to show 60 seconds.Code:GoSub get_time ' Update minutes and seconds TOGGLE LED_0 LCDOut $fe,2,"Time: ",DEC hours, ":", DEC2 minutes, ":", DEC2 seconds, " "
It happened to me, so I then wondered what was going on...
Solution:
And remove get_time procedureCode:seconds VAR BYTE bankA ' variables within myint must be in bank 0. minutes VAR Byte bankA ' Elapsed minutes hours var byte bankA : : : @myint ; create myint label TMR1H.7=1 seconds = seconds+1 ' Increment second if seconds > 59 then seconds = seconds - 60 ' better then making seconds=0 minutes = minutes + 1 if minutes > 59 then minutes = 0 hours = hours + 1 if hours > 12 then hours = 1 ' simple 12 hour clock format endif endif PIR1.0=0 ' Clear TMR1 int flag @ retfie FAST
Last edited by pedja089; - 25th May 2011 at 00:11. Reason: Repair CODE tag's
I'm trying to add the calendar.
Does anyone have an idea how to make a calculation of leap year.
I tried this
If day>30+month.0 or (Month=2 and day>28 and year//4<>0) or (Month=2 and day>29 and year//4=0)then
month=month+1
but the code is 300b larger then this
If day>30+month.0 or (Month=2 and day>28)then
month=month+1
Is there a more efficient way?
Bookmarks