Forum Discussion
Altera_Forum
Honored Contributor
16 years agoyou can setup the spi for 17 bit
shift your data you want to transmit spi_out_data = ( 1,1,0,a6-a0 ) << 8 and when you read data from spi discard to upper 9 bit indata = spi_in_data & 0x0F this should work in this case as transmit and receive is done at the same time, in your case just imagine that after A0 you send 8 time a 0 and every bit before Dn is not needed the spi ip also has the capability of extending the transmision. this means after all bits have been transmitted and received, the spi ip does not release CS and keeps it in the active state. if you now start the next transmit & receive, another N clock and shifts will be executed. that is usefull if your protocol needs to transfer longer bit streams.