Multiplexing Clocks or something similar

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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?  

0 Likes
10 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The SAR is rated for <= 1 MSPS, 12 bits.

   

 

   

Does the clock have to be glitch free ?

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Something like this ?

   

 

   

    

   

          http://www.design-reuse.com/articles/5827/techniques-to-make-clock-switching-glitch-free.html

   

 

   

0 Likes
Anonymous
Not applicable

 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.

   

 

   

imgur.com/3BKtM19

   





0 Likes
Anonymous
Not applicable

 Looking at your post...looks similar.  Any reason why mine wouldn't be ideal?

0 Likes
Anonymous
Not applicable

 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....

0 Likes
Anonymous
Not applicable

So I tried to implement yours Dana, but it didn't work because I couldn't directly tie clock signals to the AND gates....

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

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.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

@WiegerTheFarmer, you can always convert the clk to data as

   

suggested by the article you found, but eats up more HW.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 @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.

0 Likes