I have a microcontroller and an FPGA on the same board. If they're both going to run at the same clock speed, can I just use one oscillator to clock them both? There seems like there is something I should watch out for here, but I can't immediately think of any problems with it if I just keep the traces short. Has anyone done this before? What would be some common pitfalls of doing this?
Electronic – Sharing an oscillator between two ICs
clockfpgamicrocontrolleroscillatorrouting
Related Topic
- Electronic – arduino – dynamically change the input clock frequency of the AT91SAM3X8E
- Electronic – PIC32MX can’t get 80 MHz Clock from Internal RC OSC
- Electronic – Understanding requirements for USB 2.0 high-speed
- Electrical – Using Altera Max II Internal Oscillator
- Electronic – How to redirect/regenerate an input clock to an output pin in the FPGA design (Verilog)
- Electronic – PIC18F25K50 – 48MHz with internal oscillator does not work
- Electronic – Does this clipped-sine oscillator need a buffer
Best Answer
Yes, most likely that's fine. You have to make sure each chip is set up to expect a ready clock in, not to drive the crystal itself. You have to look at the datasheets, of course, but most likely the devices can be set up that way.
However, there may be a less expensive way. Very likely at least one (probably both) of the chips can drive a crystal directly. You can have one of them do that, and possibly use it to drive the other chip. This can get a little tricky since the crystal drive output line is more of a analog signal than a digital one, and it may not be interpreted as intended by the other chip if used directly. It may not be interpreted as intended by a ordinary digital gate either, so buffering it close to the crystal and then sending that digital signal to the other chip may not work either. This is where you have to consult the datasheets very carefully and do some experimentation.
A totally reliable way would be to have one chip drive the crystal, have that signal be buffered internally and then driven out on another pin as real guaranteed digital signal. This is more likely to work with the FPGA driving the crystal since you should be able to have the clock signal driven out to a pin. Microcontrollers sometimes have clock out pins, but in the case of PICs at least (what I am most familiar with), that is usually the oscillator/4 frequency, not the oscillator frequency directly. You probably don't want to run the FPGA and 1/4 the clock rate of the micro.