joshdoe
Nuclear
- May 11, 2004
- 8
I've got an 8254 timer/counter chip that is part of a DAQ system.
What I want to do is generate a 15kHz signal, but have it put out only a very precise number of pulses, in a range from 100,000 to 2,000,000. However, I am getting a wide range of pulses, so when I ask for 200,000, instead I get 153,743 or 185,436 or some other seemingly random number. You can see an image of my setup here:
Counter 0:
set to mode 3, and loaded with 523
clocked by an 8MHz source
gated by the inverted output of counter 2
out tied to counter 1 and puts out the desired pulses
Counter 1:
set to mode 2, and loaded with 1000
clocked by counter 0
gated to run freely
out tied to counter 2
Counter 2:
set to mode 0, and loaded with the desired number of pulses divided by 1,000
clocked by counter 1
gated to run freely
out line inverted to gate counter 0
So the output from counter 0 should be 15kHz, which then gets divided by 1000 by counter 1, which then causes counter 2 to be decremented. The number of pulses divided by a thousand is loaded into counter 2 to start the pulses, and should put out (counter 2 count value)*1000 pulses.
Any ideas of what I'm missing? Thank you all
What I want to do is generate a 15kHz signal, but have it put out only a very precise number of pulses, in a range from 100,000 to 2,000,000. However, I am getting a wide range of pulses, so when I ask for 200,000, instead I get 153,743 or 185,436 or some other seemingly random number. You can see an image of my setup here:
Counter 0:
set to mode 3, and loaded with 523
clocked by an 8MHz source
gated by the inverted output of counter 2
out tied to counter 1 and puts out the desired pulses
Counter 1:
set to mode 2, and loaded with 1000
clocked by counter 0
gated to run freely
out tied to counter 2
Counter 2:
set to mode 0, and loaded with the desired number of pulses divided by 1,000
clocked by counter 1
gated to run freely
out line inverted to gate counter 0
So the output from counter 0 should be 15kHz, which then gets divided by 1000 by counter 1, which then causes counter 2 to be decremented. The number of pulses divided by a thousand is loaded into counter 2 to start the pulses, and should put out (counter 2 count value)*1000 pulses.
Any ideas of what I'm missing? Thank you all