In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Capt. Quirk wrote: I am building a data logger for my bicycle, and need help with deciding what timer and interrupt options would best suit the project. One pin will track the front wheel, and the other will track my pedal rotations. Between the two pins, I will need to calculate my final drive gear ratio, mph, and pedal rpm (cadence). I am having trouble with the timer concepts, mainly the how these pins are used (one clocking pin, two capture pins and a timer output pin). I was planning on using a hall sensor for the front wheel and possibly using RB 4 or 5 because of their capture property (seems similar to the timers/pin in the propeller) and it seems like the right time to call an interrupt. But when it comes to the pedal rpm, I have two gear tooth sensors that I can use. At first I was going to use only one to sense the threaded portion of the pedal (threaded inside the cranks). But it would only track 360' of pedal rotation, I believe I would need to take several rotations of the front wheel and average the data, in order to get a final drive gear ratio. Or if I use a gear tooth sensor on the small chain ring (28 tooth) sproket, I could determine rpm and gear ratio in one rotation of the front wheel. Either way, the pin watching the gear tooth sensor would have to count rotations or teeth between each wheel rotation and interrupt. And eventually I would also like to track the accelleration of my right and left legs as they mash the pedals, that, I think, would require a capture pin and interrupt to measure? So possibly use pins RB4 and RB5 and activate a second interrupt (between gear teeth) after the rest of my code has been tested and works? Or, is it not possible to have two seperate interrupt routines at the same time? Thanks Bill M. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=352481 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)