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

Related