Jump to content
munny

ADC12 timer trigger

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×