Forum Discussion
Altera_Forum
Honored Contributor
19 years agoSPI RX problems
Hi I am trying to receive data via SPI on the Nios II using a Cyclone II. The Nios is the slave and the SPI master transmits data at 2MHz. I have tested transmitting data from the Nios ...
Altera_Forum
Honored Contributor
19 years agoopps!
provided that you are interested in rx only .... //SPI RX while (1) { //if new byte arrived via SPI if ((IORD_ALTERA_AVALON_SPI_STATUS(SPI_0_BASE) & ALTERA_AVALON_SPI_STATUS_RRDY_MSK) == 1){ //read the byte and print it to screen printf("%x\n", (IORD_ALTERA_AVALON_SPI_RXDATA(SPI_0_BASE) & 0x0FF)); //clears the status register IOWR_ALTERA_AVALON_SPI_STATUS(SPI_0_BASE, 0); } } Thanx for the advice, but it did not work. Any other ideas? Eric