View Single Post
Old 06-09-2008, 02:10 PM   #232 (permalink)
Yoshi
SuperMID designer
 
Yoshi's Avatar
 
Join Date: Mar 2008
Location: Yokohama, JAPAN
Posts: 37
Thanks: 0
Thanked 13 Times in 2 Posts
Quote:
Originally Posted by dcb View Post
at some point during the long test, the trip mph dropped to 8.5mph instead of 20mph, probably overflowing, instant is fine.
I checked your numbers and program code.
In the mph() routine, there is one, (vssPulses*3600).

You saw 2,148,300 (vssPulses), then vssPulses*3600=7,733,880,000, which is 0x1CCF9A4C0 in hex. It becomes more than 32bit, or more than the unsigned long range.

Yoshi
  Reply With Quote