Forum Discussion
Altera_Forum
Honored Contributor
13 years agoSPI with NIOS2 in qsys
Hi, I want to implement SPI in Qsys with one side NIOS 2. Well in SPI core of altera there is a function " int alt_avalon_spi_command(alt_u32 base, alt_u32 slave,alt_u32 write_length,c...
Altera_Forum
Honored Contributor
13 years agoHi,
Have a look at the data sheet for the SPI memory you're using. You'll find that the write requires you to send at least two bytes, but for this example let's assume it's just two. The first would be the address and the second the byte to write to that address. With a read you send a byte as the address and then read one as the response. The NIOS has no idea what's out there on your SPI bus so it's up to you to send (and receive) the bytes required by your memory or other SPI devices. Mark.