- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I'm having some troubles with reading data out of a linear sensor. I'll be posting later about the ADC step, but I need to figure out something else first. Basically I want to be able to either multiplex two clocks on a single digital IO line. I need a 10Mhz clock for part of the sensors cycle, but then, when it's time to read out the video signal, I need to slow down the clock (the minimum the sensor can run is 200kHz). The reason I need to slow it down is so that I can do ADC on the signal, and it has to be fast (10Mhz) so that I can have a low integration time.
I've been successful setting the fractional clock divider in an pwm interrupt to slow down and speed up the clock, but I'd rather have the PWM output change the clock without the interrupt.
Here's the linear sensor ( http://www.hamamatsu.com/resources/pdf/ssd/s11639_kmpd1136e04.pdf)
I have the driver circuit all developed, and everything is working, except that I now have to get the data out, and I know that I have to slow down the clock to allow the ADC to have enough time...
Thoughts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The SAR is rated for <= 1 MSPS, 12 bits.
Does the clock have to be glitch free ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dana, While I waited for a reply, I continued searching. And found this article. http://www.cypress.com/?rID=80799 Which I implemented in my own way and it works amazing. See attached picture.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looking at your post...looks similar. Any reason why mine wouldn't be ideal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, yours is better, because I waste 1/2 the clock cycles with mine, and ideally I wanted to run my high clock at 10Mhz.... I'll give it a try....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So I tried to implement yours Dana, but it didn't work because I couldn't directly tie clock signals to the AND gates....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As the linked article states: in PSoC4, clocks are clocks and data is data. They cannot be mixed together directly.
But why not using a clock directly? The clock component has an API, and you can sets its divider during runtime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One side effect of using clock directly and controlling divider, look
at APIs, they indicate clock will get stopped, possibly truncating
or expanding clock cycle. You may or may not care about this in
the scheme of things.
Depends on your design criteria.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@WiegerTheFarmer, you can always convert the clk to data as
suggested by the article you found, but eats up more HW.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@hli, the problem with using the api is that since the clock is running at 10mhz, and I have to instantly respond to a pulse from the sensor, I don't have extra cycles to spare in jumping into the interrupt handler and calling the api.
The API works perfectly, but I found that it would be easily 30+ clock cycles from the point of the sensor raising the line till the clock's api to set the divider completed.