AnsweredAssumed Answered

SPI?

Question asked by crocker.lee on Aug 3, 2015
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):

SPC, CS

Here's clock and MOSI (SDI/SDA):

SPC, MOSI

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):

SPC, MISO

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: 

SPC, MISO @ 2MHz

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?

Outcomes