5213 external pulse width measurment

Discussion to talk about software related topics only.
Post Reply
ahbushnell
Posts: 25
Joined: Thu Apr 24, 2008 7:45 pm

5213 external pulse width measurment

Post by ahbushnell »

Hi, I would like to measure a pulse width on an external pin. This will be between 500 us and 10 ms. It looks like the GPT can do this but I'm having a hard time figuring out how to set it up.

Andy
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: 5213 external pulse width measurment

Post by pbreed »

The GPT Timer is aonly a 16 bit time, so one has to keep track of roll over...
The DMA timers are 32 bit timers and are probably better for this.

Basic operation is set up the timer to run, then capture both edges and look at the capture times.

Paul
Post Reply