kk serious question, no jokes.
how do you find elapsed time? either with timers or RTC?


Views: 363

Reply to This

Replies to This Discussion

RTC working, cannot subtract

 the 'proper' way is the timer/counter that's built into the PIC

I'm sure you can hack together a way to do it with RTC though if you really wanted to

 There's a way to do it with the RTC that isn't hard, but the TA's look at you funny if you use it like that


probably beats no time at all, do you just subtract minutes and seconds? or something?

 I reset the RTC at the start of my test, which starts it counting from zero, and then I just read the time at the end of the test

I don't have a real time date display

hats genius.  so basically it's under like 59sec

Well, I have a minutes display, in case it goes over

 so you don't need subtraction right? i honestly dunno how to subtract two digit numbers


 No, I don't use any subtraction.

I did it with subtraction but with pic18 I can multiply Endtenmin - startten min
Mult by ten
Add end min
Subtract start min
Mult by sixty
Store in memory
Clr w, movf end ten sec
Minus start ten sec
Multiply by 10
Plus endsec
Minus start sec
You could probably write a loop to add rather than multiply (2 x 10 is adding 10 2 times)


© 2023   Created by PML.   Powered by

Badges  |  Report an Issue  |  Terms of Service