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.

MCT8316ZTEVM: SPI Firmware support for the on board MSP430

Part Number: MCT8316ZTEVM
Other Parts Discussed in Thread: MSP430FR2355, USB2ANY, MCT8316Z

I was looking at the CCS project for the "MCT8316ZTEVM MSP430FR2355 GUI Firmware" and I saw that there was firmware support for SPI commands from the GUI. I found a Serial JSON server script to transmit JSON data to and from the eval over USB and I was able to mimic the GUI command protocol. I tried to write to SPI registers using said protocol but when I tried to read the registers it always returns either 0x00 or 0x01 (I confirmed with an oscilloscope that it does return 0x00/0x01).

Is there anything I am missing?

  • Hi Jerome, 

    I left the SPI commands and driver code in the firmware project, I was working on a separate GUI a while ago to support MCT8316Z0R but it never got completed because there was not enough demand for the SPI variant during device preview to program and release another GUI. The application firmware has SPI code in it that uses the JSON protocol to communicate with the SPI GUI (which is unfinished and not released).

    The easiest way to use SPI using the MCT8316ZTEVM would be to remove the nSCS, SDI, SDO, and SCLK jumpers from the bridge on the EVM and:

    - Use custom firmware from another MCU and use jumper wires to communicate with the MCT8316Z0R
    - Use a USB2ANY to write/read SPI commands 
    - Adapt the JSON interface code or JSON server script to communicate with the GUI command protocol

    Unfortunately I'm not sure how the JSON protocol works, so I would use an external tool that is capable of SPI protocol to interface with the MCT8316Z0R. 

    Thanks,
    Aaron

  • Hi Aaron,

    I guess what I was asking is if that firmware was tested and proven to work with communicating with SPI within your team. I was able to get the JSON protocol working but it just looked like the SPI messages were failing to be acknowledged by the MCT8316Z. The SPI lines looked clean and I confirmed that the SPI transfer format itself looked correct. 

    For now, I will go ahead with using an external MCU. but I have an intuition that it might not work considering that the MSP430 SPI transfers weren't working for some unknown reason. I'll keep you posted.

    Thanks,

    Jerome

  • Hi,

    I still cannot get SPI reads to work even with an external MCU. For the parity bit for a read operation, should the parity check include the set Read bit? I saw in the code, and another code snippet on E2E that it is not included in the check. But, the datasheet states that the parity should check the whole word...

    Which one is the correct method? Although I tried both ways and I couldn't get it working...

    Thanks,
    Jerome

  • Hi Jerome,

    The SPI configuration should be Mode 1 (clock polarity is 0 and clock phase is 1), and SPI words should be 16 bits in length and use 16 clock pulses. Please reference this E2E FAQ is you have questions: https://e2e.ti.com/support/motor-drivers-group/motor-drivers/f/38/t/937258

    The example in the E2E FAQ above is for DRV8316R, so the same SPI driver code can work for MCT8316Z0R. 

    You can also try the unfinished GUI, SPI writes should work correctly by setting each bit to "1" in the register map, pressing Enter, then clicking "Write All": https://dev.ti.com/gallery/view/InternalBLDC/MCT8316Z0REVM_GUI/ver/1.0.0/

    Also, just to double check, make sure the  0-ohm SPI resistors are on the EVM and the H/W resistors are depopulated. This enables SPI communication. 

    Thanks,
    Aaron

  • Hello Aaron,

    So it looks like it was a hardware issue on my end. I resoldered the IC and the SPI communication seems to be working. I tried to use the unfinished GUI and it looks like its working as expected so far!

    Thanks again,

    Jerome