Other Parts Discussed in Thread: CONTROLSUITE
Hi, I don't have very musch experience working with SPI. I had a project with Arduino and an ADXL355 sensor. I used the Arduino SPI library. From the ADXL355 datasheet
To access the ID register, the register address is shifted to the left by 1 and ORed with 1. Then the ID is sent. Is this correct?
Is it a 16 bit interface or 8 bit? When I try this code with adapted from the SPI no interrupt example from controlSuite:
sdata = 0x01; SPI_write(mySpi, sdata); while(SPI_getRxFifoStatus(mySpi) == SPI_FifoStatus_Empty) { } rdata = SPI_read(mySpi);
rdata is 1.
If change
SPI_setCharLength(mySpi, SPI_CharLength_16_Bits);
to
SPI_setCharLength(mySpi, SPI_CharLength_8_Bits);
and make sdata and rdata uint8_t, rdata is 0x100 accroding to the debugger which doesn't make sense because it is 8 bits. What am I doing wrong?