Page 1 of 1

Need help with input capture

PostPosted: Sun Apr 24, 2011 3:35 am
by zol
Hi all,
I am currently trying to interface a Maxbotix ultrasonic sensor with a PIC32.
I am trying to detect distance using the PW output.
However, I do not know how to setup timer3 in the program (TICK, PRESCALE, PB_DIV, etc).
In addition, has long as I clear the interrupt flag in the beginning of the program, I will not have to worry about it, right?
Thanks

Re: Need help with input capture

PostPosted: Sun Apr 24, 2011 9:09 am
by yonghui
how much the maximum pulse and minimum pulse frequency from the sensor? u will need to set the prescaler of the timer so that the timer register wont overflow in one pulse cycle of the frequency, the reference manual of pic32 peripheral will help u on how to set for capturing.

Re: Need help with input capture

PostPosted: Mon Apr 25, 2011 8:19 pm
by robosang
woh... PIC32, that is 32-bit microcontroller. No time to try out 8-)

well, if you want to use microcontroller, you got to understand it. those bits in register are the most important parameters. You can use sample source code, but it can only help you to start, once you need to modify, you will still need to understand the working register :shock:

Re: Need help with input capture

PostPosted: Tue May 03, 2011 11:27 am
by shahrul
Did you use Timer Interrupt for measure PW width?