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

nRF52832's SPIS Frequency and Buffer.

I using nRF52832 with nRF SDK 16.0.

I tested the SPIS example in the SDK. 

I want to change the SPI Clock frequency to 8Mhz and read max 255byte at once.

How to set the SPIS clock speed of nRF52832 to 8Mhz?

APP_ERROR-CHECK(nrf_drv_spis_buffers_set(&spis, 0, 0, &m_rx_buf[0][0], 1);

I try to change the buffer size by the above function, but it did not work.

Please let me know how I can change the buffer size?

Parents
  • Hello,

    I want to change the SPI Clock frequency to 8Mhz and read max 255byte at once.

    You might want to read up on SPI communication, in case you have not done so already.
    Have you seen the SPIM Example? Clock frequency must be set by the SPI Master, and it is done during its initialization.
    Data transfer is usually done using 1 byte word size, but other word sizes may also be used.

    APP_ERROR-CHECK(nrf_drv_spis_buffers_set(&spis, 0, 0, &m_rx_buf[0][0], 1);

    What exactly are you trying to do here, and why do you use a two dimensional array for your received bytes? The last argument you pass indicates that you buffer is length 1, which might not be what you were trying to do.

    I try to change the buffer size by the above function, but it did not work.

    Have you seen the API Reference for the function?
    I suspect that I do not understand you fully on what you mean when you say "change the buffer size", could you elaborate for me what you are trying to do?
    Are you attempting to increase the buffer size? If so, then you need to allocate more space to the m_rx_buf when it is initialized, and change the length inputted to nrf_drv_spis_buffers_set().

    Best regards,
    Karl

Reply
  • Hello,

    I want to change the SPI Clock frequency to 8Mhz and read max 255byte at once.

    You might want to read up on SPI communication, in case you have not done so already.
    Have you seen the SPIM Example? Clock frequency must be set by the SPI Master, and it is done during its initialization.
    Data transfer is usually done using 1 byte word size, but other word sizes may also be used.

    APP_ERROR-CHECK(nrf_drv_spis_buffers_set(&spis, 0, 0, &m_rx_buf[0][0], 1);

    What exactly are you trying to do here, and why do you use a two dimensional array for your received bytes? The last argument you pass indicates that you buffer is length 1, which might not be what you were trying to do.

    I try to change the buffer size by the above function, but it did not work.

    Have you seen the API Reference for the function?
    I suspect that I do not understand you fully on what you mean when you say "change the buffer size", could you elaborate for me what you are trying to do?
    Are you attempting to increase the buffer size? If so, then you need to allocate more space to the m_rx_buf when it is initialized, and change the length inputted to nrf_drv_spis_buffers_set().

    Best regards,
    Karl

Children
No Data
Related