Counter Module - Counting down event
tdeyle
Posts: 85
Would I be able to use one of the counters in a cog to countdown an event by throwing a negative number in the FRQa/b register?
Say, to put out a clock signal for a specified number of pulses?
Say, to put out a clock signal for a specified number of pulses?
Comments
Check this post [post=967493]Counter module and pulse counting[/post].
That is essentially what I would like to do, but I wanted to use only one counter. I don't think I will be able to do that.
Basically, I want to pulse a pin, then countdown 65ms to pulse again and not repeat until signaled to do so again. But in between this, I wanted to pulse a clock pin, (@ 50ns positive and negative pulse width) a set number of times.
I would have liked to do this within the same cog utilizing two counters, but don't think it is possible.
I cobbled an assembly program that gets a 12bit sample in ~4us, but, I would like to use this as a call to perform the read from the TSL1401 linescanning module that I am using. In order to get an output on the module, I need to pulse the SI pin, then pulse the CLK pin 129 times. The exposure time starts from the SI pin pulse and ends at a second SI pulse.
I wanted the space between the two SI pulses to be timed.
I am thinking now, that I would be able to take a CNT measure, pulse the SI pin, send a pulse train down the CLK pin 129 times, then pulse the SI pin when the exposure time is done.
Now, in order to measure the voltage on the AO pin from the imager, I need to pulse the CLK pin to shift out the data. But, I wanted to setup another exposure, timed from the most recent SI pulse, to another, that is equal to the exposure time.
Well, I guess, considering that the ADC takes 4.4us to sample the voltage, with 128 pixels, it would only take around 563us. Considering that an exposure would be from 1/30s to 1/125s, the conversion would be over before the SI pulse would be needed to end the exposure.
I don't know if it will help, but I'm attaching an updated version of my NCOburst object. It corrects a couple of issues with the math in the earlier version, and now it can generate any given number of pulses from Spin, (up to 26 second burst length) at frequencies from 1 Hz to 39.999999 MHz (clkfreq=80MHz).