This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F28379D: Communication with SPI Sensor Slave echos MOSI line and STE stays pulled down

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Hello,

I'm in the process of integrating an SPI encoder  (IC-Haus MU150) to the Launchpad-F28379D

I downloaded C2000Ware and modified the SPI Example project 3 "spi_ex3_external_loopback_fifo_interrupts.c"

Both in debug-console and Oscilloscope measurements, I see the encoder SOMI (Yellow) echoing in the SIMO line and not sending any useful data back

Also, the SPISTEB pin seems to stay pulled down not making any signals.

Here is the code I am using

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "driverlib.h"
#include "device.h"
/* MU150 masks */
#define MU150_OP_SDAD 0xA6
#define MU150_OP_REG_STATUS_DATA 0xAD
#define MU150_OP_WRITE_REG 0xD2
#define MU150_STATUS_VALID 0x01
#define MU150_SDAD_VALID 0x00
#define MU150_OP_READ_REG 0x97
#define MU150_ADDR_ACC_STAT 0x0D
#define MU150_ACC_STAT_BIT (0x01 << 7U)
#define MU150_ADDR_STATUS0 0x76
#define MU150_AM_MIN_BIT (0x01 << 0U)
#define MU150_AM_MAX_BIT (0x01 << 1U)
#define MU150_AN_MIN_BIT (0x01 << 2U)
#define MU150_AN_MAX_BIT (0x01 << 3U)
#define MU150_NON_CTR_BIT (0x01 << 3U)
#define MU150_EPR_ERR (0x01 << 6U)
#define MU150_ADDR_STATUS1 0x77
#define SPI_PACKET_SIZE (4U)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Can someone help me spot error in this? Perhaps incorrect logic flow with interrupts?

Thanks

Hansol

  • I downloaded C2000Ware and modified the SPI Example project 3 "spi_ex3_external_loopback_fifo_interrupts.c"

    Both in debug-console and Oscilloscope measurements, I see the encoder SOMI (Yellow) echoing in the SIMO line and not sending any useful data back

    I suspect that the internal loopback functionality maybe enabled for the SPI.  That is the first thing I suggest checking. 

    Best regards

    Lori

  • Hi Lori,

    The example code was for the external loopback, so the internal loopback function was disabled from the beginning. (line 158 SPI_disableLoopback())

    Another concern that I have is that the STE(chip select pin) is not enabled even when it is configured at Line 217. The osciliscope reading shows that it is constantly low. I suspect this might be causing some issues. Any idea why this would happen?

    Thanks

    Hansol

  • Another concern that I have is that the STE(chip select pin) is not enabled even when it is configured at Line 217. The osciliscope reading shows that it is constantly low. I suspect this might be causing some issues

    The SPI will automatically control the SPISTE pin. It will drive the SPISTE pin low during a transfer, and drive it high after the transfer is done.  Are you observing the pin low, even after a transfer is complete?

      If this pin never goes high (inactive) then first check that nothing on the board is holding it low.  Can you toggle the pin it if it is a GPIO? 

  • One thing to note - If your code keeps data in the TXFIFO. As long as there is data to transmit, SPISTE will stay low. If you want to force SPISTE to return high after each 16-bit word, you can disable the FIFO and send one word at a time until the SPI_INT bit is set, indicating that 16 bits have been transmitted.