krgoodwin
Mechanical
- May 9, 2013
- 8
Hello,
I am trying to design a circuit capable of dividing a 70Hz - 5.7kHz square wave signal down to a 1Hz - 1kHz square wave signal. The exact output frequency must be adjustable.
I am currently working with a PIC16F631 chip and had some luck with low frequencies <300Hz using if statements and counting the input pulse. extremely simplified the code was:
if input on, run timer
if input off, stop timer
multiply timer value by x to get y
switch output every y
I then tried using the interrupts built into the chip but the results ended up worse than with the if statements.
I am not an electronics guy and have zero experience in designing circuits. Is the PIC chip even a good architecture for me to be attempting this on? I am not stuck with the PIC, I just chose it because it looked simple and I could program it in C. Is there anything pre-built out there that can accomplish what I am trying to do? Any help would be welcome.
I am trying to design a circuit capable of dividing a 70Hz - 5.7kHz square wave signal down to a 1Hz - 1kHz square wave signal. The exact output frequency must be adjustable.
I am currently working with a PIC16F631 chip and had some luck with low frequencies <300Hz using if statements and counting the input pulse. extremely simplified the code was:
if input on, run timer
if input off, stop timer
multiply timer value by x to get y
switch output every y
I then tried using the interrupts built into the chip but the results ended up worse than with the if statements.
I am not an electronics guy and have zero experience in designing circuits. Is the PIC chip even a good architecture for me to be attempting this on? I am not stuck with the PIC, I just chose it because it looked simple and I could program it in C. Is there anything pre-built out there that can accomplish what I am trying to do? Any help would be welcome.