INCLUDE "DT_INTS-18.pbp" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.pbp" ; Include if using PBP interrupts"
INCLUDE "DT_INTS-18.pbp" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.pbp" ; Include if using PBP interrupts"
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
The earlier versions I wrote had NO asm but lost almost a minute an hour. To make up for that one could re-tune using TMR1H and TMR1L with a larger value. Problem is every change made to the program would mean spending a few days retuning and it would never be as precise.
So yea I would love to be able to do this without asm in PBP AND be as accurate!
Down the road I intend to join this interrupt sample with a SNTP internet program so I can have a near perfect millisecond low power $60 clock.
Regards
Tim C
Should do it.Code:' Int handler doesn't mess with any PBP system variables - or lower 15-bits ' of TMR1 accumulated time. Uses only 4 instructions to set TMR1H high bit, ' increment seconds, clear the interrupt flag bit, save & restore WREG, STATUS, ' BSR and return from int handler. @myint ; create myint label TMR1H.7=1 ' Set TMR1 high bit for 1 second overflows seconds = seconds+1 ' Increment seconds PIR1.0=0 ' Clear TMR1 int flag @ retfie FAST ; Return with 'auto restore' of WREG, STATUS and BSR
Bookmarks