Hello -
A bit of a red face asking this question, but I've been spinning my wheels looking for a cause but unable to find one. I am using the ADXL313/SEN-17241 from Sparkfun. Connected to this is a NUCLEO-L452RE-P development board. One I am familiar with and used many times.I have verified that all 4 lines (6 with pwr/Gnd) are connected correctly.
I used CubeMX to configure the SPI3 interface to meet the specification for CPOL to HIGH and CPHA to 1 edge. Data is set to 8 bits, MSB first. Baud rate is 250kbits. Here is the read ID function - I've created this specifically for an ID read (although I do have a general read function)
uint8_t ADXL313_ReadID( void )
{
uint8_t spiData;
uint8_t reg = ADXL313_REG_DEVID | 0x80; // Set MSB for read operation
ACC_CS_ASSERT(); //sets LOW
HAL_SPI_Transmit(&hspi3, ®, 1, HAL_MAX_DELAY);
HAL_SPI_Receive(&hspi3, &spiData, 1, HAL_MAX_DELAY);
ACC_CS_DEASSERT(); //sets HIGH
return spiData;
}
I have checked the CS pin on the target board and it is HIGH when I breakpoint at the ACC_CS_ASSERT. Yet, I can only get back a value of 0xD6. Now with the exception of register addresses this code is pretty much identical to code I am using on an ST part, the LIS331DLH, and it works just fine.
So...what in the world might the problem be? Anyone seen this before? (next will be dragging out the scope)
Thanks! Gary.