1
\$\begingroup\$

is it in general possible to implement a frequency doubler completely on FPGA? I saw some implementations on google by delaying the input and XORing it with the original. But they also say that this method is not reliable, and we may not achieve a 50% duty cycle output. I do not want to compromise on duty cycle because i may need to use the doubler 3 times to achieve a x8 frequency

The input clock undergoes a +/- 5% jump in frequency (from 13.56 Mhz) every 30 us.

I tried using a DCM - while the input to the DCM jumps at an instant, the output from the DCM gradually drifts to the required frequency over a span of 20 us. This timing is unacceptable because we jump in frequency every 30 us and we cannot have drifting clock for 20 us of 30 us.

The input clock comes from an external DSP processor, using two DDS (Direct Digital Synthesis) blocks to generate the 13.56 Mhz signal on two ports. The DDS jumps the frequency of the 13.56Mhz every 30 us and also varies its phase from -45deg to +45deg, whilst the other varies phase in the opposite direction. These two 13.56 Mhz signals are enter the FPGA domain.

The FPGA produces 8x signals from these two inputs, totally 16 in number and varying in steps of 45 degrees wrt each other. Currently the FPGA uses a DCM and flip flops to do this. The 13.56 Mhz is fed to the DCM and 8x clock comes out of it. Both the input to the DCM and the output from the DCM are fed to a phase shifter module which shifts the input clock by the period of the 8x clock (45 degrees). All this works fine without frequency jumping but fails due to frequency jumps.

\$\endgroup\$
  • 3
    \$\begingroup\$ You might want to use the PLL blocks in the FPGA to achieve this. \$\endgroup\$ – Roger C. Feb 2 '15 at 14:35
  • \$\begingroup\$ What is the variation in the input signal you are trying to track? +/- 10% ? How much noise can you tolerate on the output before your process becomes unstable? \$\endgroup\$ – shuckc Feb 2 '15 at 14:38
  • 1
    \$\begingroup\$ I thought this was resolved when we discussed (in the comments to your first question) having the DDS generate the 8x clock directly. Did this solution not work out for some reason? It would really help us help you if you kept all of the information related to your problem in one place, rather than scattering related questions all over the site. \$\endgroup\$ – Dave Tweed Feb 2 '15 at 15:11
  • \$\begingroup\$ BTW, there are many other ways to generate phase-shifted or time-delayed versions of signals using DSP techniques that don't involve fiddling with the clocks at all. But you need to give us a lot more detail about your application and the performance specifications you need to meet before we can advise you. \$\endgroup\$ – Dave Tweed Feb 2 '15 at 15:15
  • \$\begingroup\$ @DaveTweed sorry for that. The DDS is unable to provide 8x clock due to design constraints. The DDS has fiyed number of channels and it is unable to output the 8x clock. AS we discussed earlier DCM is not an option. Therefore I was trying out combinatorial options as described in the question. \$\endgroup\$ – Sai Gautam Feb 2 '15 at 15:16
1
\$\begingroup\$

All of the DCM blocks (digital clock managers) in FPGAs I've worked with can scale up and shift clock frequencies cleanly. Ensure that your input base clock arrives on a specific clock pin if you can, as this will introduce the least skew routing to the dcm.

If you want more specific guidance, which part are you targeting and what frequencies? If you are targeting Ghz for instance on a cheap part, it probably isn't going to happen.

The DCM blocks often have multiple outputs that can be driven to different frequencies from the same base clock, so all your generated clocks can have a common duty and phase.

Edit: I see the sorry history of your previous questions clocking on spartan6 FPGAs and Spartan 6 DCM unstable clock output - Please link the questions in future.

As other commenters have noted, what you are asking is impossible in the general case. A clock management unit cannot be both stable (rejecting noise on the base clock) and respond to linear/step changes in the input quickly. These are contradictory design goals.

If I were you, I'd settle for a nice stable, fixed clock coming into the FPGA, and then re-program the DCM module's output clock ratios using logic in your design. I know offhand that the StratixV parts have a bus into the DCMs to allow ratio and phase changes while operating. This should avoid the need to settle and lock the input clock each time.

Whatever feedback or user interface you use to make these adjustments would then be done by the FPGA, e.g. decoding UART instructions from a PC or scanning keypad/switches.

Have a look at this Xilinx App Note, it suggests the Spartan 6 PLLs do have a dynamic reconfiguration port for doing this sort of thing: http://www.xilinx.com/support/documentation/application_notes/xapp879.pdf

Update: If for some reason you really need to have the input coming from a varying clock, you may choose to design an input stage that measures the frequency of the input clock against some stable base clock, measuring the frequency shift (in Hertz) and uses this to dynamically reprogram the DCM. This is advanced stuff, theres probably only a few dozen engineers in the world who use the dynamic ports on FPGAs. It may need some analogue design, eg. an external beat-mixer/Heterodyne first to get enough resolution on . Expect to have to raise a few queries with Xilinx to get it all working.

\$\endgroup\$
  • \$\begingroup\$ okay...i will link my questions in the future. But as such there is no combinatorial digital logic to multiply clock signals? \$\endgroup\$ – Sai Gautam Feb 2 '15 at 14:50
  • \$\begingroup\$ There is no synchronous digital logic to multiply clock signals. There are some asynchronous tricks you mentioned in the question, but I wouldn't advocate them. \$\endgroup\$ – shuckc Feb 2 '15 at 16:13
  • \$\begingroup\$ It looks like the subsystem division in this "big project to control the ignition and stability of a plasma chamber" are ill-informed (at best) and leave you looking for a part that is over complicated to design. Good luck! \$\endgroup\$ – shuckc Feb 2 '15 at 16:17
  • 1
    \$\begingroup\$ frequency doubling is not possible with combinatorial logic, because the output depends only on the input. Therefore the output can't change faster than the input. \$\endgroup\$ – Roland Mieslinger Feb 2 '15 at 16:18
  • \$\begingroup\$ @RolandMieslinger it absolutely is possible - all gates have a propagation delay and if you run enough NOT-gates back to back you can produce the phase change needed and xor it with the base clock. This would be considered a very poor design though given the far preferable built in blocks. See Altera Cookbook 14-3 for more examples that intentionally violates good synchronous design practices. \$\endgroup\$ – shuckc Feb 4 '15 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.