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.

PGA970EVM: SPI interface giving erroneous values to Hercules microcontroller

Part Number: PGA970EVM
Other Parts Discussed in Thread: PGA970, USB2ANY

I'm trying to read the Micro_Interface_Control register of the PGA970 using the Hercules microcontroller. I copied the waveform for the USB2ANY board, and both the waveforms from my o-scope are below. The USB2ANY board appears to correctly display the value of the register (should be set by the Hercules to 0x03), but the Hercules gets a different response. Not just different bits at the beginning and end, but a different value for the data as well.

Can anybody explain why there are the differences? Especially if someone could explain why the Hercules microcontroller gets sent a bit before it's finished the address part of the SPI message?

Differences in SPI:

  • Hercules is communicating at ~10x the frequency of the USB2ANY
  • Hercules auto-code generator cant add delay between pulse. Or at least I cant figure out how to make it generate one.
  • There is a second read command generated by the USB2ANY following the first which is identical. However, the response to both of them is not always the same, the second always having a correct response and the first sometimes having a correct response.

CH1 (yellow) is the SPI clock

CH2 (cyan) is the command, or MOSI

CH3 (magenta) is the response, or SIMO

CH4 (green) is chip select

  • Doubling up the calls allows the Hercules to correctly obtain the right value:
    mibspiSetData(mibspiREG3, 0, read_digital_interface_register); //read the Micro_interface_control register
    mibspiTransfer(mibspiREG3, 0); //Send data out over the SPI bus
    mibspiGetData(mibspiREG3, 0, TG_RX_DATA_0); //Copy received into the SPI buffer to this variable.
    -> this data is invalid the first call
    mibspiSetData(mibspiREG3, 0, read_digital_interface_register); //Redo the call over SPI for some reason?
    mibspiTransfer(mibspiREG3, 0);
    mibspiGetData(mibspiREG3, 0, TG_RX_DATA_0); //This data will now be accurate, the previous data was not.

    It seems like SPI calls are one call out of date or something? Does that make sense?
  • Required to make the call twice before the data transferred will be correct.