This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPIS ORC register not being used

I have managed to get the SPIS block working using standard sets of read and transmit buffers. This all works.

I am now trying to use the ORC register to send a single byte to be transmitted rather than supplying a separate buffer, because in the main I wish to only transmit one byte and receive many. I don't mind if this byte is repeated either. The byte is a read command to an external SPI device, so doesn't need a long buffer.

If I set the NRF_SPIS1->MAXTX = 0, the ORC value does not appear on the SPI output, AND the status register does not show an over read. I get an all high signal.

If I set the NRF_SPIS1->MAXTX = 1, and set NRF_SPIS1->TXDPTR = &buffer, the first byte of the buffer is transmitted, but the ORC value still does not appear on the SPI output, BUT the status register does show an over read. The SPI transmits an all high signal when I have set the ORC value to something else. I also noticed that the AMOUNTTX is only equal to 1 when I know from my signal analyser that there has been 2 bytes transmitted, and AMOUNTRX = 2 as well.

Is this a known errata? or am I missing something

Parents
  • Hi Peter

    Are you setting your NRF_SPIS1->MAXTX = 0 in the spi_slave_init function? If so, that does not work because the MAXTX configuration is overwritten when you call spi_slave_buffers_set. To adjust the MAXTX, modify the third parameter when you call spi_slave_buffers_set function. The spi_slave_buffers_set function is called for the first SPI transaction in spi_slave_example_init but for all subsequent SPI transaction in the SPIS handler, i.e. spi_slave_event_handle. So to set MAXTX as e.g. 3, set

    err_code = spi_slave_buffers_set(m_tx_buf, m_rx_buf, 3, sizeof(m_rx_buf));
    APP_ERROR_CHECK(err_code);
    
Reply
  • Hi Peter

    Are you setting your NRF_SPIS1->MAXTX = 0 in the spi_slave_init function? If so, that does not work because the MAXTX configuration is overwritten when you call spi_slave_buffers_set. To adjust the MAXTX, modify the third parameter when you call spi_slave_buffers_set function. The spi_slave_buffers_set function is called for the first SPI transaction in spi_slave_example_init but for all subsequent SPI transaction in the SPIS handler, i.e. spi_slave_event_handle. So to set MAXTX as e.g. 3, set

    err_code = spi_slave_buffers_set(m_tx_buf, m_rx_buf, 3, sizeof(m_rx_buf));
    APP_ERROR_CHECK(err_code);
    
Children
Related