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

nRF52832's SPI & ADS7042

I need to interface an nRF52832 with ADS7042, hence the following questions:

1) as ADS7042 requires 14 clock cycles per read cycle, is the nRF52832 SPI API applicable in this case, or we will be forced to prepare our custom code to control the SCLK and SDO lines of ADS7042 ?

2) in case we need to control the SCLK and SDO lines by custom code, we treat the corresponding lines of the nRF52832 as GPIO; could we rely that nrf_drv_spi_init function will initialise the SPI lines as inputs/outputs properly, so we don't need to care about that later, even if we drive the corresponding lines (SPI_SCK; SPI_MOSI; and SPI_MISO) by custom code?

Parents
  • Hi,

    1. The SPI peripheral of nRF52832 can be configured to read a number of bytes. The datasheet of ADS7042 say the SDO line will be keept low after 14 SCKs. You simply ignore the additional bits read by the nRF.
    2. There is no need to bit-bang the SPI protocol, any SPI device should be supported by the nRF52832. In case you want to control the lines manually, you need to configure the GPIOs as well. The SPI driver will not configure GPIOs for you, as it connects the pins to the SPI peripheral and not drive the pins manually.

    Best regards,
    Jørgen

Reply
  • Hi,

    1. The SPI peripheral of nRF52832 can be configured to read a number of bytes. The datasheet of ADS7042 say the SDO line will be keept low after 14 SCKs. You simply ignore the additional bits read by the nRF.
    2. There is no need to bit-bang the SPI protocol, any SPI device should be supported by the nRF52832. In case you want to control the lines manually, you need to configure the GPIOs as well. The SPI driver will not configure GPIOs for you, as it connects the pins to the SPI peripheral and not drive the pins manually.

    Best regards,
    Jørgen

Children
No Data
Related