Need help with input capture

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Need help with input capture

Postby zol » Sun Apr 24, 2011 3:35 am

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
zol
Fledgling
 
Posts: 1
Joined: Sun Apr 24, 2011 3:29 am

Re: Need help with input capture

Postby yonghui » Sun Apr 24, 2011 9:09 am

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.
thanks&regards,
yh
yonghui
Professional
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Need help with input capture

Postby robosang » Mon Apr 25, 2011 8:19 pm

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:
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Need help with input capture

Postby shahrul » Tue May 03, 2011 11:27 am

Did you use Timer Interrupt for measure PW width?
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 1 guest