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

SPI time between sending the register address and obtaining the data

Hey! I'm writing a program for communicating  the laser sensor pmw 3610 (pixart) with the micro nrf52832. In the sensor datasheet it is said that the time between sending the address to be read and reading the data from the SDIO needs to be 4us. I'm writing my code from spi example so what I understand with nrf_drv_spi_transfer function is that it automatically retrieves data from SDIO without waiting any time. Is there some place where to set the timing between sending and receiving data? or maybe would it be possible to send something like the following? I think it can't be done but just to be sure.

m_tx_buf[0]= addr;
nrf_drv_spi_transfer(&spi, m_tx_buf, 1, null, 0);
nrf_delay_us(4);
nrf_drv_spi_transfer(&spi, null, 0, m_rx_buf, 2);

Thanks for the future help!

Parents
  • I apologize, this comment will not be an answer to your question, but I'm wondering if you were able to get this working? I am currently trying to interface with the pmw 3610 sensor and am unable to find much of any information on it. You mentioned a datasheet you had for it specified 4us between address specification and reading data. Can you provide a link to said datasheet or any other SPI parameters you have configured here? I purchased a module for this sensor online and no information was provided with it. I've tried to search for the relevant datasheets online and the only one that I can find merely states that it is 3-wire SPI and what the registers are, but provides nothing else as far as the communication parameters (SPI mode, MSB vs LSB, timing requirements (ie. 4us above), etc.). I've had a heck of a time trying to get any sort of reading from this module, and unfortunately reaching out to Pixart directly has not been very fruitful either.. Any help is greatly appreciated.

Reply
  • I apologize, this comment will not be an answer to your question, but I'm wondering if you were able to get this working? I am currently trying to interface with the pmw 3610 sensor and am unable to find much of any information on it. You mentioned a datasheet you had for it specified 4us between address specification and reading data. Can you provide a link to said datasheet or any other SPI parameters you have configured here? I purchased a module for this sensor online and no information was provided with it. I've tried to search for the relevant datasheets online and the only one that I can find merely states that it is 3-wire SPI and what the registers are, but provides nothing else as far as the communication parameters (SPI mode, MSB vs LSB, timing requirements (ie. 4us above), etc.). I've had a heck of a time trying to get any sort of reading from this module, and unfortunately reaching out to Pixart directly has not been very fruitful either.. Any help is greatly appreciated.

Children
No Data
Related