SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By kincaid05
#54936
I have setup communications with the LIS3LV02DQ via SPI on the GM862-GPS chip (python).

I wired the chip as described in the PIC example.

When I read the WHO_AM_I register, I always get 0x30 back, instead of the expected 0x3A. Other registers seem to be affected by these missing bits as well.

I've tried two different methods of sending and receiving the bytes to eliminate the chance of some funny clock pulse screwing up the bits. But either way that doesnt sound plausible. I don't see how I could lose have of the byte. *Exactly* half.

I've tried spi.sendbyte(0x80 | 0xF); val = spi.readbyte()
which returns 0x30

I've also tried val = spi.readwrite(chr(0x80 | 0xF) + '\x00'), 2)
which returns '\xFF' + '\x30' (the first byte is expected to be garbage)

Very confusing, has anyone had this issue?

(i'm not near the project right now so all hex values were written from memory. I will verify them as soon as I get home)