Shop OBEX P1 Docs P2 Docs Learn Events
VP tachometer — Parallax Forums

VP tachometer

JWolfeJWolfe Posts: 1
edited 2005-02-23 07:38 in General Discussion
I have interfaced a Javelin to the sensors and actuator of a Furby. The problem I have is that for any reasonable motor speed I lose tachometer pulses if I'm not in a tight loop reading tach. By the time I exit the tach-count loop, deactivate the motor and begin counting again, I·often miss a tach pulse. I'd love to use a VP for tach counting as this would make all the programming much more fluid, but none of the available VPs seem adaptable to this.
Does Parallax plan to make available any more VPs, or will Parallax ever release updated firmware and spec that allows users to load custom VPs? I could accomplish everything I need in several assembly statements without branching.

//The following code, run in background, and executed every 8.68us can accurately count tach over 3,000,000rpm (uneven duty cycles will see linearly decreased performance)
currentValue = [noparse]/noparse][i]InputPort[/i & bitmask
difference = currentValue ^ lastValue
tachcount += difference
lastValue = currentValue

One foreground method would allow user to atomically read/clear tach
Initializer would set bitmask=1<<PinNum (PinNum would be arg to constructor), and set lastValue=[noparse]/noparse][i]InputPort[/i&bitmask
Sign In or Register to comment.