I am trying to write code for a SPI circuit (in VHDL) for the Altera Cyclone II FPGA. I think I understand the implementation of essentially what amounts to a shift register. However, what is a good way to deal with the serial clock. The FPGA will act as a master interfacing with a slave A/D converter that supports SPI interface. Thus, the FPGA will need to generate the SPI clock. The FPGA will contain a simple processor implementation. I think the processor clock can be used to derive the SPI clock, but would it better to provide an independent clock for the SPI? If so, what is a good way to do this? I am not much experienced in FPGA design, so any help or references/links would be greatly appreciated.
Thanks!