Forum Discussion
Altera_Forum
Honored Contributor
10 years agoconnecting 4 GPIO pins to DAC using SPI interface
Hi. I am new to altera and am interested in connecting a DAC via the GPIO pins on my development board. the DAC takes a data connection using the spi interface so I am wondering what is the best ...
Altera_Forum
Honored Contributor
10 years agoI think that one mistake I made was that I created an SPI slave rather than SPI master to write out signals. I've changed the SPI from slave to master, but still it doesn't work. I have the following code that basically runs if an button is pressed:
if (print_cnt == 1) printf("LED Pattern 1\n"); alt_u8 tx = 10020; alt_u8 rx = 0; return_code = alt_avalon_spi_command(SPI_0_BASE,0 , 1, tx, 0, rx, 0); For some reason, this causes the FPGA to get stuck and stop working. Any thoughts why?