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.

TMS570LC4357: Issues communicating with DAC81416 over mibSPI

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN, USB2ANY

We're trying to read the DeviceID, and we are not getting back the correct value. On the read access cycle, we see the correct register address but the data is all zeroes.

    mibspiInit();

    txBuffer[0] = 129; // 10000001
    txBuffer[1] = 0xff;   
    txBuffer[2] = 0xff;   

    rxBuffer[0] = 0b00000000;
    rxBuffer[1] = 0b00000000;
    rxBuffer[2] = 0b00000000;

    rxBuffer0[0] = 0b00000000;
    rxBuffer0[1] = 0b00000000;
    rxBuffer0[2] = 0b00000000;

    mibspiSetData(mibspiREG2, 0, txBuffer);

    mibspiTransfer(mibspiREG2, 0);

    while (!(mibspiIsTransferComplete(mibspiREG2, 0)));

    mibspiGetData(mibspiREG2, 0, rxBuffer);

    // send NOP
    txBuffer[0] = 0;
    txBuffer[1] = 0;
    txBuffer[2] = 0;

    mibspiSetData(mibspiREG2, 0, txBuffer);
    mibspiTransfer(mibspiREG2, 0);
    while (!(mibspiIsTransferComplete(mibspiREG2, 0)));

    mibspiGetData(mibspiREG2, 0, rxBuffer0);

We can read the values without issue using the USB2Any, the EVM board should be fine. We're not sure if it's our code or the HalCoGen settings.

Note: When the USB2Any is plugged into the board, we get the correct values when running code on the Launchpad.

Below is the read access cycle and write access cycle images from scope. Probe1=CLK, Probe2=CS, Probe3=MOSI, Probe4=MISO

Read Request:

Read:

  • Hello Chris,

    On SDO bus, the first byte is correct which is echo R/W and address from the previous access cycle. 

    Is the device configured properly by programming SPICONFIG register? 

    From your waveform, the data (129) is transferred without any issue. What is the value of the 1st byte in your received buffer? If it is 129, the SPI receive is fine.

  • I came across a quote -- "We prefer SPI mode 1 and 2, not 0 and 3". We ended up changing the clock polarity and it started working.