Finding the operation time - Personal Mechatronics Lab2024-03-29T15:35:35Zhttp://www.pml4all.org/forum/topics/finding-the-operation-time?commentId=6212885%3AComment%3A27396&feed=yes&xn_auth=no 60 and add to seconds. That…tag:www.pml4all.org,2014-05-01:6212885:Comment:277032014-05-01T09:26:25.453ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p><span> </span><span><span class="UFICommentBody"><span>60 and add to seconds. That gives you the proper time difference in seconds, then you have to convert this binary difference back into BCD, which involves continually dividing by 10, so you need to write a subroutine for dividing by 10, which is just subtracting in a loop. Then you can display the BCD on the LCD</span></span></span></p>
<p><span> </span><span><span class="UFICommentBody"><span>60 and add to seconds. That gives you the proper time difference in seconds, then you have to convert this binary difference back into BCD, which involves continually dividing by 10, so you need to write a subroutine for dividing by 10, which is just subtracting in a loop. Then you can display the BCD on the LCD</span></span></span></p> If you want to do it with sub…tag:www.pml4all.org,2014-05-01:6212885:Comment:277022014-05-01T09:26:20.475ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p><span><span>If you want to do it with subtraction, it's quite a tedious process, i did it this way: you have to first convert the 2 BCD digit RTC gives you into proper binary numbers, which means you need a multiply the second digit by 10 and add to the first digi</span></span><span><span><span>t, just add the number to itself 10 times in a loop to multiply. After you did this to both minutes and seconds, you subtract the minutes and seconds, you might get a negative number in seconds in 2's…</span></span></span></p>
<p><span><span>If you want to do it with subtraction, it's quite a tedious process, i did it this way: you have to first convert the 2 BCD digit RTC gives you into proper binary numbers, which means you need a multiply the second digit by 10 and add to the first digi</span></span><span><span><span>t, just add the number to itself 10 times in a loop to multiply. After you did this to both minutes and seconds, you subtract the minutes and seconds, you might get a negative number in seconds in 2's complement, but that's ok, the pic handles it properly without any assistance. Then multiply the difference in minutes by</span></span></span></p> at this point, ima just gonna…tag:www.pml4all.org,2014-05-01:6212885:Comment:277012014-05-01T09:26:13.615ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p><span>at this point, ima just gonna reset seconds and take that as the time, like Alex said</span>
<span>just fond out about interrupts yesterday</span></p>
<p><span>at this point, ima just gonna reset seconds and take that as the time, like Alex said</span>
<span>just fond out about interrupts yesterday</span></p> I did it with subtraction but…tag:www.pml4all.org,2014-05-01:6212885:Comment:274682014-05-01T09:26:07.807ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p><span>I did it with subtraction but with pic18 I can multiply</span> <span>Endtenmin - startten min</span>
<span>Mult by ten</span><br />
<span>Add end min</span><br />
<span>Subtract start min</span><br />
<span>Mult by sixty</span><br />
<span>Store in memory</span><br />
<span>Clr w, movf end ten sec</span><br />
<span>Minus start ten sec</span><br />
<span>Multiply by 10</span><br />
<span>Plus endsec</span><br />
<span>Minus start sec</span><br />
<span>You could probably write a loop to add rather than multiply (2 x 10 is adding 10 2…</span></p>
<p><span>I did it with subtraction but with pic18 I can multiply</span>
<span>Endtenmin - startten min</span><br />
<span>Mult by ten</span><br />
<span>Add end min</span><br />
<span>Subtract start min</span><br />
<span>Mult by sixty</span><br />
<span>Store in memory</span><br />
<span>Clr w, movf end ten sec</span><br />
<span>Minus start ten sec</span><br />
<span>Multiply by 10</span><br />
<span>Plus endsec</span><br />
<span>Minus start sec</span><br />
<span>You could probably write a loop to add rather than multiply (2 x 10 is adding 10 2 times)</span></p> No, I don't use any subtract…tag:www.pml4all.org,2014-05-01:6212885:Comment:275382014-05-01T09:26:02.534ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p><span> </span><span><span class="UFICommentBody"><span>No, I don't use any subtraction.</span></span></span></p>
<p><span> </span><span><span class="UFICommentBody"><span>No, I don't use any subtraction.</span></span></span></p> so you don't need subtractio…tag:www.pml4all.org,2014-05-01:6212885:Comment:275372014-05-01T09:25:56.778ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<div class="UFICommentContent"><span> </span><span>so you don't need subtraction right? i honestly dunno how to subtract two digit numbers</span></div>
<p><span> </span></p>
<div class="UFICommentContent"><span> </span><span>so you don't need subtraction right? i honestly dunno how to subtract two digit numbers</span></div>
<p><span> </span></p> Well, I have a minutes displa…tag:www.pml4all.org,2014-05-01:6212885:Comment:276262014-05-01T09:25:52.353ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p><span>Well, I have a minutes display, in case it goes over</span></p>
<p><span>Well, I have a minutes display, in case it goes over</span></p> hats genius. so basically it…tag:www.pml4all.org,2014-05-01:6212885:Comment:275362014-05-01T09:25:43.677ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p><span>hats genius. <span> </span><span><span class="UFICommentBody"><span>so basically it's under like 59sec</span></span></span></span></p>
<p><span>hats genius. <span> </span><span><span class="UFICommentBody"><span>so basically it's under like 59sec</span></span></span></span></p> I don't have a real time date…tag:www.pml4all.org,2014-05-01:6212885:Comment:275352014-05-01T09:25:32.643ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p>I<span> don't have a real time date display</span></p>
<p>I<span> don't have a real time date display</span></p> I reset the RTC at the start…tag:www.pml4all.org,2014-05-01:6212885:Comment:275342014-05-01T09:25:26.152ZKenny Kimhttp://www.pml4all.org/profile/KennyKim
<p><span> </span><span><span class="UFICommentBody"><span>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</span></span></span></p>
<p><span> </span><span><span class="UFICommentBody"><span>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</span></span></span></p>