2015-07-29 11:12 AM
I'm trying to talk to a LSM6D3 over PCI. Everything's connected according to the datasheet in mode 1 (3.3v to VDD and VDDIO, SCx and SDx tied to GND) . I'm starting slow, so here's clock (SPC) and chip select (CS):
https://drive.google.com/file/d/0B979a_DgADKmUFNhOGtFdXR0bDg/view?sp=sharing
Here's clock and MOSI (SDI/SDA):https://drive.google.com/file/d/0B979a_DgADKmVkl2SlpSOXRPTWs/view?usp=sharing
As you can see, the clock polarity and phase are good, the bits on the rising edge of clock are clearly 10001111, or 0x8F, which indicate a read of register 0x0F (''WHO_AM_I''). But then there's MISO (SDO):https://drive.google.com/file/d/0B979a_DgADKma1o0eTV6OTROcFE/view?usp=sharing
That looks more like a 0x40 than a 0x69.There's a section in the data sheet that implies that the SDO hold time is a maximum of 50ns. This is *way* too fast, so I cranked up the speed to as fast as I could (2MHz), and now MISO looks like this:https://drive.google.com/file/d/0B979a_DgADKmRTV4YXlMa1FZbTQ/view?usp=sharing
I can kind of visualize that this might be trying to send a 0x69 (01101001), but the bits begin on the falling edge of clock and are not present at the rising edge when they should be sampled, and the two isolated bits are too short for anything to grab onto.What do I have to do to get the chip to speak valid SPI at a reasonable rate?