Hello,
I made my own PCB with a Cyclone III, a simple DAC controlled with a SPI bus and I use Quartus II 10.1 with VHDL. The board is working but now i'm trying to connect to the DAC with a SPI bus. I would like to use the FPGA as master. Could someone please help me connecting to the DAC with SPI? Frans.链接已复制
7 回复数
Are you using a CPU such as Nios, or just HDL?
There is a SPI master available in SOPC builder, but if you are making your own HDL, it may be easier to do your own SPI master. The SPI bus is one of the simplest serial buses that exist... you just have a clock, a select signal that must be valid during the transfer and a shift register that holds the data.Dear Daixiwen,
I'm a hardware engineer having some difficulties programming my DAC with a shift register. Could you please help me find my way a little bit? I just need to transfer 16 bits serial. For example, how can I just put 1111 1111 1111 1111 on an output serially on a clock.Something like below. For slower speed, the clock pin would be set in the code as well.
signal sr : std_logic_vector (15 downto 0);
//...
if rising_edge(clk) then
if load = '1' then
sr <= data;
else
sr <= sr(14 downto 0) & '0';
end if;
end if;
out_pin <= sr(15);
