PDA

View Full Version : Pulse Frequency Multiplication



jamie_s
- 21st August 2005, 10:07
Hi all,

Im sort of new to PBP, previously I have been playing with picaxes..

I am trying to design a project that will multiply pulses, but the input pulses are at a variable frequency. Therefore it would need to time the pulse lengths in the background, and send 8 pulses in the "low" section of the input pulse,

for example the input would be:

_____|ˉˉ|_________________________________________ __|ˉˉ|__

and the output i require would be

_____|ˉˉ|__|ˉˉ|__|ˉˉ|__|ˉˉ|__|ˉˉ|__|ˉˉ|__|ˉˉ|__|ˉˉ |__

ie 8 pulses on the output in the time between each pulse on the input.

I have played around with pulsin and rc time, but it doesnt do what i want it to do due to the variable frequency of the input pulses.. The pic will sometimes skip the next input cycle just after it finishes sending out the pulse s.
The basic code I was using and got reasonable results but still not right was adding rctime for low and high, dividing by 16, and pulseout the value on two pins alternatively (one dummy pin to time the low cycle) however the next cycle would be incorrect because it skips one input cycle, and measures the pulse on the next.

Does anyone have any hints / suggestions etc on of / how it would be possible to output the 8 pulses evenly in the low cycle between the input at 50% duty cycle, but at teh same time, measure the low cycle of the input pulses?

Acetronics2
- 21st August 2005, 10:24
Hi, s_Jaimie

And what about a simple CD 4046 ???? of couse if the 8 pulses duration do not have to be the same as for the input...

Alain

jamie_s
- 21st August 2005, 10:39
Alain,

Thanks for the quick reply,

The output pulses need to fit inbetween the input pulses, therefore i dont think the 4046 will work?

I just found this example, i think it *might* help me, providing the CCP operates in the background and i can use the time value after each measured cycle to provide 8 pulses on the output.

http://picbasic.com/resources/samples/x2/pbp/ccpx2.bas