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

SPI AND SPIM READING ISSUES

hi all i am trying to read data from a sensor in burst mode i can"t able to read all datas from the register .I tried to read the data in both spi and spim(with easydma) . spim is more better it reads data from 2 register(i am trying to read data of 3 register using burst mode).how can i solve this issues.

Parents
  • This is the problem, I think:

    spi_config.ss_pin = SPI_MOUSE_CSN_PIN;

    This causes the SPIM driver to de-activate NCS between the first byte and the next 3 bytes, which terminates the burst transfer. Change this to manually drive NCS low before and after the transfers, not between.

    From the data sheet "After sending the register address, the microcontroller must wait tSRAD and then begin reading data. All data bits can be read with no delay between bytes by driving SCLK at the normal rate." tSRAD is 4uSecs, so for the "burst" read you are using the first byte is sent without removing NCS the three bytes are read in in the next SPI transfer, So send two commands and do not allow the spim handler to drive NCS and ensure there is at least 4 usec delay between 1st and second commands.

  • sir how "spi_config.ss_pin = SPI_MOUSE_CSN_PIN;" causes the SPIM driver to de-activate NCS between the first byte and the next 3 bytes, which terminates the burst transfer.

    i  am changeing  manually NCS low before and after the transfers( and not between look at the code i posted at the beginning)

    adns_ncs_assert(i_spi_address,1); //disable ncs
    adns_ncs_assert(i_spi_address,0); //enable ncs

    look this

Reply
  • sir how "spi_config.ss_pin = SPI_MOUSE_CSN_PIN;" causes the SPIM driver to de-activate NCS between the first byte and the next 3 bytes, which terminates the burst transfer.

    i  am changeing  manually NCS low before and after the transfers( and not between look at the code i posted at the beginning)

    adns_ncs_assert(i_spi_address,1); //disable ncs
    adns_ncs_assert(i_spi_address,0); //enable ncs

    look this

Children
No Data
Related