Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pulse measurement

Status
Not open for further replies.

PeterDove

New Member
Hi,

I am getting an accelerometer which sends out PWM. The total length of the off and on is 10ms. To measure the On time I can just run a time loop which begins the moment the input pin is high and measures the length of time the pin is high for.

Will this work OK? I havent got the thing yet, just trying to visual it. Can it be this simple? Always worries me when I think something will be simple!

Peter
 
Believe it or not, it is that simple. If you want better performance, consider using the CCP module in your PIC to capture the output. Not only will it be more accurate, but you can have it interrupt driven so you can free up processor time for other applications.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top