Hi,
I am trying to connect an ST Micro accelerometer (LSM6DSM) to the 1310. The problem I am seeing is that the command gets clocked
out by the master (1310) but I never see the clocks provided to the slave for it to clock it's response back. Here is a shot of the scope
trace showing the command 0x8F being sent to the accelerometer but no clocks to return the response which should happen immediately
after the command is sent. You can see the 8 clocks for the command itself. There should be 8 more clocks allowing the accelerometer
to respond on the MISO (pink trace). The chip select (green trace) for the accelerometer is tied low. The blue trace is data and the yellow
is the clock coming from the 1310.
I used the lcd display example code as a starting point. The SPI initialization code looks like this:
/* Open SPI as master (default) */ SPI_Params_init(&spiParams); spiParams.frameFormat = SPI_POL1_PHA1; spiParams.dataSize = 8; masterSpi = SPI_open(Board_SPI_MASTER, &spiParams); if (masterSpi == NULL) { printf("Error initializing master SPI\n"); while (1); } else { printf("Master SPI initialized\n"); }
The polarity and phase were selected based on the datasheet for the accelerometer.
I looked in the 1310 reference manual and did not see anything that enable/disable the clocks for the incoming slave->master response.
The accelerometer does not support master/slave negotiation so I just commented-out that part of the initialization. Is there some other
initialization I need to do in order to force the 1310 to be the master?
Victor