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.

SPI-B spurious pulses on CLK signal

Other Parts Discussed in Thread: ADS8688

Hey,

I use the TI TMS320F28377SPZ with the c2000 Launchpad XL ver:1.0

The cpu works on 200Mhz, the low speed clk, that goes to the spi, works also on 200Mhz.

I use spi-B to interface with an external adc, the ADS8688 on a custom board. Below is the code to setup the spi-B module:

   EALLOW;

   //spi-b gpio configuration
   // pullup enable
   GpioCtrlRegs.GPBPUD.bit.GPIO63 = 0;
   GpioCtrlRegs.GPCPUD.bit.GPIO64 = 0;
   GpioCtrlRegs.GPCPUD.bit.GPIO65 = 0;
   GpioCtrlRegs.GPCPUD.bit.GPIO66 = 0;
   // async
   GpioCtrlRegs.GPBQSEL2.bit.GPIO63 = 3;
   GpioCtrlRegs.GPCQSEL1.bit.GPIO64 = 3;
   GpioCtrlRegs.GPCQSEL1.bit.GPIO65 = 3;
   GpioCtrlRegs.GPCQSEL1.bit.GPIO66 = 3;
   // spi configuration
   GpioCtrlRegs.GPBGMUX2.bit.GPIO63 = 3;
   GpioCtrlRegs.GPCGMUX1.bit.GPIO64 = 3;
   GpioCtrlRegs.GPCGMUX1.bit.GPIO65 = 3;
   GpioCtrlRegs.GPCGMUX1.bit.GPIO66 = 3;

   GpioCtrlRegs.GPBMUX2.bit.GPIO63 = 3;
   GpioCtrlRegs.GPCMUX1.bit.GPIO64 = 3;
   GpioCtrlRegs.GPCMUX1.bit.GPIO65 = 3;
   GpioCtrlRegs.GPCMUX1.bit.GPIO66 = 3;

   EDIS;
  
   //SPI-B
   SpibRegs.SPICCR.bit.SPISWRESET = 0;

   SpibRegs.SPICCR.bit.HS_MODE = 1;
   SpibRegs.SPICCR.bit.SPICHAR = 0xF;

   SpibRegs.SPICTL.bit.MASTER_SLAVE = 1;
   SpibRegs.SPICTL.bit.TALK = 1;

   SpibRegs.SPIBRR.bit.SPI_BIT_RATE = 5;//17;

   //fifo
   SpibRegs.SPIFFTX.all = 0xE040;
   SpibRegs.SPIFFRX.all = 0x2044;
   SpibRegs.SPIFFCT.all = 0x0;

   SpibRegs.SPICCR.bit.SPISWRESET = 1;

If I check the signal on the scope, there are spurious pulses at the clk line that incorrectly trigger the ADS8688. These signals are visible without connection of the external board as well as on a different Launchpad board. spi-A and spi-C, with the same configuration, doen't show these spikes. Enclosed a figure of the scope:

Only if I reduce the speed, by setting SPI_BIT_RATE to around 100, the spikes disappear. What should I do to establish a reliable connection with the ADS8688?

Thank you for considering this issue,

Tom

  • Tom,

    Most of the C2000 team is out of office this week due to the U.S. Thanksgiving Holiday and responses may be delayed. Thanks for being patient.

    Elizabeth
  • Tom,
    We appreciate your patience.

    Your configuration code appears to be correct. Typically in this situation, there are other things in the hardware that cause these pulses. I have a few questions that might help you narrow it down.

    If you do not do any SPI transactions, do you see this pulse? Is it periodic?
    If you do not configure any of IOs to SPI pins, do the pulses still appear?
    Try removing other portions of your code, do the pulses go away?

    It looks like GPIO63, GPIO64, and GPIO65 are connected to the on board level shifter U2 (TXB0106PWR). Is there an external connection to the corresponding channel on U2? It would be Channel B6, or EQEP21 on QEP_B header, pin 3.
    You could try to pull the OE signal on U2 to gnd to disable the levelshifter as well.

    -Mark
  • Hey Mark,

    Thank you for the suggestions.

    Some options I already tried:
    - The pulses appear both while transmitting and while not transmitting. It seems they are periodic but not equal to the spi period as they are not always visible if occurring during the spi high clk.
    - The code I used was minimal. I configured only spi-b and measured the development board while nothing was connected to it. I repeated the experiment for spi-a and spi-c (same code, only different registers and output pins). The other two modules don't show the pulses.

    I'll check the influence of the level shifter and keep you updated. This seems the only difference between the 3 spi channels.

    Tom
  • Tom,

    One more question/suggestion.
    Are you running from Flash? Is the USB connected?
    If you can run your program from Flash and supply 5V externally, with USB disconnected, do the pulses still appear?

    Thanks,
    Mark
  • Additionally, If you just put a scope on that pin while the SPI is not running at all, do you see the pulses on the pin?
  • Tom,

    I have tried out some code on the bench.  I see the same thing. At Frequencies faster than ~1.47MHz, these pulses would start to appear even when the SPI is not actively transmitting. I modified my board to tie OE to Ground by removing R2, then wiring the OE pin to the GND side of R31. This resolved the issue.

    While this fixes the problem, for now, it does not explain why toggling the level shifter would cause a continuous train of runt pulses. I should note that I also saw it on the SPISIMO pin as well.

    I will file a bug on the Launchpad and we will investigate the root cause and fix on the next revision.

    Regards,

    Mark

    (Here is an image of the modification)

  • Thank you for tacking down the issue. I'll apply the same fix.

    Regards,
    Tom
  • Tom,
    Glad to help. If you have any other issues, please do not hesitate to create a new post.

    Regards,
    Mark