I'm reading the register 0x00 (DEVID) of the adxl345 sensor and I've a problem. Most of times it works well and i get 0xE5, but sometimes it returns 0xCB.
Please, can you tell me what I'm doing wrong?
I'm using PIC18F26K22 as microcontroller and the code that I'm using to read it, it's as follows:
setup_spi(SPI_MASTER | SPI_H_TO_L | SPI_CLK_DIV_4 | SPI_XMIT_L_TO_H | SPI_SAMPLE_AT_END);
|int8 dato = spi_read(0x00);|