Tool/software: Code Composer Studio
Hello,
My partner and I are currently working on using a timer to get a measured cadence of a bicycle crank. We plan on using a reed switch and a magnet to read when the crank passes the frame. There is only one point per revolution on the bike for us to gather our data. This spot needs to read and reset the tmer as it passes this point. We know we need a 32-bit timer because of the long period due to the low RPM(~40-100) we are using, and our 40 MHz clock. The format we plan on using is having the hardware trigger the ISR, which will read and reset the current register, and put a flag up. When the flag is up in main it will do the calculation for RPM. We are looking for advice on how to set the timer up.
Advice for set up:
1. peripheral enable
2. timer configure
3. timer load value
4. enable timer
5. enable interupt