Counter module and pulse counting
Hello,
I'm again lost with counters modules !!!
The problem is (seems) simple: I want to generate a 20MHz (18 Mhz exactly) pulses on a pin for a fixed number of times (138 pulses exactly to control an external device).
I used counter module to generate such signal, but if I try to poll the phXs register to stop the signal after having generated exaclty nth pulses, I can't do it precisely. Spin is too slow, asm does not do better at this frequency!!!
I tought to use a second counter (B) to count the number of pulses generated by first counter (A), but how to stop the counter A ???
the only solution I can see is to add an external hardware buffer that disconnect the 20Mhz clock signal from my external device. This can give me more time to stop counter A completely.
Before diving in such brutal solution, I wanted to know if someone here (counter expert) can propose a clever and more elegant solution using only the propeller possibilities?
Regards
I'm again lost with counters modules !!!
The problem is (seems) simple: I want to generate a 20MHz (18 Mhz exactly) pulses on a pin for a fixed number of times (138 pulses exactly to control an external device).
I used counter module to generate such signal, but if I try to poll the phXs register to stop the signal after having generated exaclty nth pulses, I can't do it precisely. Spin is too slow, asm does not do better at this frequency!!!
I tought to use a second counter (B) to count the number of pulses generated by first counter (A), but how to stop the counter A ???
the only solution I can see is to add an external hardware buffer that disconnect the 20Mhz clock signal from my external device. This can give me more time to stop counter A completely.
Before diving in such brutal solution, I wanted to know if someone here (counter expert) can propose a clever and more elegant solution using only the propeller possibilities?
Regards
Comments
Another alternative is to use the video generator to produce the burst. It's advantage is that it can produce exactly the pulse stream that you want and gives you enough time between waitvids to do the necessary calculations.
-Phil
(v3 works up to almost 40 MHz)
@Phil, I didn"t tought to the video signal generator, I'll check deeply the doc and get back to this post to give my conclusions.
again, thak you Phil and Tracy ...
Regards