What do you mean by this?...and sent to output the present frequency multiplied by 11.
Do you want the pic to generate a square wave output from 11Hz to 11MHz on an output pin?
What do you mean by this?...and sent to output the present frequency multiplied by 11.
Do you want the pic to generate a square wave output from 11Hz to 11MHz on an output pin?
What sort of resolution are we talking about and how much jitter can you tolerate (ie how "clean" must the output signal be)?
I would think that your best bet is to use a PIC that has a 20bit NCO-peripheral. 18F25K42 is one such device. If you don't know how DDS frequency generation works make sure to read up on that in order to determine if it'll fit your application.
If DDS works but the NCO won't live up to requirements you might be able to use an external DDS-chip with a higher base frequency and/or higher resolution and use the PIC to control that chip.
/Henrik.
Please feel free to correct any faulty assumptions.
First realize that to multiply a frequency by 11, you are dividing a time frame by 11.
What does your frequency input look like? Is it a perfect square wave (50% duty cycle), an irregular square wave (!=50% DC), a sine wave?
Assuming a square wave input, try using CCP1 in Capture Mode to measure the time frame of one Gate (low-high starts Capture, high-low stops it). Use CCP2 with the same source clock and divide that time frame and plug it into PWM at 50% DC.
If your input is sine wave, you might need to use a Comparator to mark low-high and high-low transitions, then feed that into your CCP1.
If you have an irregular square wave input, you need to measure low-high to low-high period.
If your input frequency is extremely long (like 1 Hz), you may need a Signal Measurement Timer with 24 bits to measure the input period time. Keeping the clocks the same for measuring input and for your output means you just run the math (input period / 11 = output period).
I hope this gives you ideas.
Bookmarks