Hi. I would recommend for the sake of experimantation to increase the sampling of the count command to say 2000msec and see what happens.
The timer1 interrupts the count every 105 msec and is obvious that there is interference since the Count also samples at 100 msec. Remember that the Interrupts are not Instant with the exact meaning. There is an overhead to save and restore the variables and program counter.
Also at your program:
make it as
and
Code:
while 1=1
COUNT rpmIn, 100, rpm
LCDOUT $FE,1, "PULS/S ", DEC(RPM)
LCDOUT $FE, $C0, "RPM ", DEC(rpm)*60
wend
make it as:
Code:
rpm var word
LCDOUT $FE,1, "PULS/S ", $FE,$C0,"RPM:"
while 1=1
COUNT rpmIn, 2000, rpm:rpm=rpm*60
LCDOUT $FE, $80,dec," ", rpm,$FE,$C5, DEC rpm," "
wend
this is much faster.
Ioannis
Bookmarks