i want to measure the speed of the motor and to be displayed on LCD interfacing with Tiva Launchpad TM4C123GLX. so if you guys have any information on that it will be helpful for me as I am quite new to this microcontroller.
many thanks
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
i want to measure the speed of the motor and to be displayed on LCD interfacing with Tiva Launchpad TM4C123GLX. so if you guys have any information on that it will be helpful for me as I am quite new to this microcontroller.
many thanks
Hi shaho,
Well, then that's not really MCU specific. The Tiva does have QEI to interface with some encoders.
What you require is to use a timer in time capture mode. This will give you the time of a revolution (since you are just detecting that). I assume you have just 1 edge per revolution (instead of many to give more precision).
Other option is having a timer in edge count mode (let's say timer0) + other in periodic mode (let's say timer1). You could set the periodic one (timer1) with a period of 1mS, with a timeout interrupt. You would have the edge count one (timer0), counting every time the wheel does a revolution. Then in the timeout handler for timer1 you would check how many edges timer0 counted. That would give you revolutions per millisecond. You could adjust the periodic timer to a lower value to give a value closer to the instantaneous speed but since you seem to just have 1 edge per revolution you can't really get a really low period.
There are a lot of info about the MCU you have to know..
key things you have to see is the timers modes. Periodic mode, Input edge count mode, Input time capture mode.