munny 0 Posted November 13, 2018 Share Posted November 13, 2018 Hello, I am trying to collect data from the following optical dust sensor: https://www.sparkfun.com/datasheets/Sensors/gp2y1010au_e.pdf According to page 5 of the datasheet, I generated the correct PWM signal using timer A for input PIN 3 of the sensor and observed the signal in my oscilloscope. Now at the same page Figure 2, they talked about the output pulse sample timing. Anyone can help me understand how should I set up my ADC12 for this? Few queries regarding this: 1. Should my sample and hold time be 0.28ms? 2. If so then should I wait for next 0.04ms + 9.68ms to collect my next ADC value as the next input pulse needs that much time to arrive? 3. If 1 and 2 are correct, how can I set up my ADC for this? Just for information, I am using MSP430F5438A, IDE: Code Composer Studio Thanks, Row Quote Link to post Share on other sites
jsolarski 94 Posted December 3, 2018 Share Posted December 3, 2018 Reading the data sheet..... you need a PWM time of 10ms. with a duty cycle of .32ms Your AD read time should be from 0ms to .28ms from the start of your pulse on the LED Setup up your ADC for single conversion, one channel count how many clock pulses and figure out how long conversion and sampling time. munny 1 Quote Link to post Share on other sites
jsolarski 94 Posted December 3, 2018 Share Posted December 3, 2018 to expand 1. Should my sample and hold time be 0.28ms? your hold time should start after .28ms, and holding the peak value between 0ms and .28ms 2. If so then should I wait for next 0.04ms + 9.68ms to collect my next ADC value as the next input pulse needs that much time to arrive? Your next sample should start on your next pulse to the LED which is 9.68ms 3. If 1 and 2 are correct, how can I set up my ADC for this? ADC setup is a case by case basis, and will be trial and error. but a good place to start is the code examples for your chip, and the user guide.... My tip to you, is look into pulse sampling. munny 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.