Forum Discussion
Altera_Forum
Honored Contributor
16 years agoNios2 SPI
Hi, I'm having some trouble reading from my IO expander with the SPI core from Altera :confused: Can anybody provide me with an example on how to issue a correct read to the spi inter...
Altera_Forum
Honored Contributor
16 years agoI use something like that
IOWR(SPI_CYCLONE3_BASE, ALTERA_AVALON_SPI_TXDATA_REG, tosend);
while (!(IORD(SPI_CYCLONE3_BASE, ALTERA_AVALON_SPI_STATUS_REG) & 0x0020));
return IORD(SPI_CYCLONE3_BASE, ALTERA_AVALON_SPI_RXDATA_REG);