Hi all, I'm using MPC5643L. I'd like to measure length of the signal. I want to connect switch to my mpc, press it, stop and see on my lcd in ms how long signal was high. How could I make it? Sorry for my english.Thank you.
There could be several ways to achieve this. You can do a SW poll of the external pin and start/stop some internal timer upon high/low level detection. You can also connect a switch to pin which enable interrupt upon edge detection. Within such interrupt you can again start/stop internal timer.
You can also use the eTimer module in various modes, like Gated mode. In this mode you will count internal clock when external input is high (or low). Or you can use eTimer’s Capture feature to save value of internal counter at the time of external input high/low edge detection.
Retrieving data ...