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

nRF52832- why when using nrf_drv_spi with an ADXL362 I need to set the clock in high drive (H0H1)

Hello!

I am working on a project. The goal is to retrieve every seconds some acceleration data from the ADXL362 accelerometer.

I configured the spi in blocking mode by passing NULL as event handler nrf_drv_spi_init(_spi, &_spi_config, NULL);

This method will use the information inside the _spi_config structure to set the pins with this configuration:

PIN_CNF[MOSI] = 0x00000003
direction:output, input: disconnect, pull: disabled, drive: S0S1, sense: disabled

PIN_CNF[MISO] = 0x00000000
direction:input, input: connect, pull: disabled, drive: S0S1, sense: disabled

PIN_CNF[CLK] = 0x00000001
direction:output, input: connect, pull: disabled, drive: S0S1, sense: disabled

PIN_CNF[SS] = 0x00000003
direction:output, input: disconnect, pull: disabled, drive: S0S1, sense: disabled

But when I try a dummy transaction like read (0x0B) the register with the acceleromter ID (0x00), I should have 0xAD.

Instead I have this: image description

S0S1.JPG

I thought that The MISO pin was not really disconnected but after several tries I found that if I modify the clock pin config to work in high drive:

PIN_CNF[CLK] = 0x00000301
direction:output, input: connect, pull: disabled, drive: H0H1, sense: disabled

I have now a good communication transaction with the accelerometer: image description

H0H1.JPG

Any idea why the clock config influence the MISO signal?

My project need to be low power, therefore I should not use the clock pin in high drive mode.

Another guy have the same problem: devzone.nordicsemi.com/.../

Thanks for your help,

Cyril Praz

Parents
  • I have a similar problem: devzone.nordicsemi.com/.../

    I have noticed that if I perform a softreset on ADXL362, next time I restart the nRF52 keeping the UART connected (RX/TX pins @3.3V), the system does not reset properly and reading from any of the ADXL's registers will return 0x00. When I skip the soft reset, the above mentioned problem does not occur on reboot. But another one happens: the ADXL does not trigger any interrupt after rebooting.

    In both cases I can solve the problem by disconnecting UART cable, powering off, reconnecting UART cable and powering on the system.

    I tried forcing H0H1 and NRF_DRV_SPI_MODE_x (x=0,1,2,3), with no luck.

    Does anyone have any idea why this happens?

    Thank you, Marco

Reply
  • I have a similar problem: devzone.nordicsemi.com/.../

    I have noticed that if I perform a softreset on ADXL362, next time I restart the nRF52 keeping the UART connected (RX/TX pins @3.3V), the system does not reset properly and reading from any of the ADXL's registers will return 0x00. When I skip the soft reset, the above mentioned problem does not occur on reboot. But another one happens: the ADXL does not trigger any interrupt after rebooting.

    In both cases I can solve the problem by disconnecting UART cable, powering off, reconnecting UART cable and powering on the system.

    I tried forcing H0H1 and NRF_DRV_SPI_MODE_x (x=0,1,2,3), with no luck.

    Does anyone have any idea why this happens?

    Thank you, Marco

Children
Related