TMS320F28377S: SPIB spurious clock pulses

Part Number: TMS320F28377S


Tool/software:

Hello TI Support,

I observe spurious clock pulses (glitches) on the SPIB module of my LAUNCHXL-F28377S board, while SPIA works fine with identical settings.

Setup:

  • Device: TMS320F28377S, LSPCLK = 50 MHz

  • Mode: 16-bit master, Mode 0, CS hardware, FIFO disabled

Observations:

  • SPIA: Stable clock, no extra pulses at 1, 2, and 5 MHz

  • SPIB:

    • At 5 MHz → extra pulses on both CLK and MOSI (groups of 2–4)

    • At 2 MHz → extra pulses on CLK only

    • At 1 MHz → no glitches observed

  • When SPIB pins are configured as GPIO, glitches disappear. Re-enabling SPI mux brings glitches back.

  • Tested with different logic analyzer channels to rule out measurement artifacts.

Additional test:

  • Mapping SPIB clock to GPIO65 (SPICLKB) → glitches appear

  • Mapping SPIB clock to GPIO58 (SPICLKB) → glitches disappear

  • However, GPIO58 is also required for SPIA MOSI in my application, so this workaround cannot be used directly.

Attachments:

  1. Logic analyzer screenshot (SPIA vs SPIB)

  2. Board photo with Dupont wiring (for setup clarity)

  3. Minimal test code

Could you please confirm if this is expected hardware behavior (due to pin mux routing) or a configuration issue?
Any recommended workaround would be greatly appreciated.

Thank you,
Mr. Orhan Gürbüz




#include "driverlib.h"
#include "device.h"
#include "pin_map.h"

void SPIA_init(void);
void SPIB_init(void);

int main(void)
{
    Device_init();
    Device_initGPIO();

    // === SPIA ===
    GPIO_setPinConfig(GPIO_58_SPISIMOA);
    GPIO_setPinConfig(GPIO_59_SPISOMIA);
    GPIO_setPinConfig(GPIO_60_SPICLKA);
    GPIO_setPinConfig(GPIO_61_SPISTEA);

    // === SPIB ===
    GPIO_setPinConfig(GPIO_63_SPISIMOB);
    GPIO_setPinConfig(GPIO_64_SPISOMIB);
	GPIO_setPinConfig(GPIO_65_SPICLKB); // GPIO_58_SPICLKB
    GPIO_setPinConfig(GPIO_66_SPISTEB);

    SPIA_init();
    SPIB_init();

    while(1)
    {
        SPI_writeDataNonBlocking(SPIB_BASE, 0xAAAA);
        SPI_writeDataNonBlocking(SPIA_BASE, 0x5555);
        DEVICE_DELAY_US(20);
    }
}

void SPIA_init(void)
{
    SPI_disableModule(SPIA_BASE);
    SPI_setConfig(SPIA_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA0, SPI_MODE_MASTER, 5000000, 16);
	SPI_disableFIFO(SPIA_BASE);
    SPI_disableInterrupt(SPIA_BASE, SPI_INT_RXFF | SPI_INT_TXFF | SPI_INT_RX_OVERRUN | SPI_INT_RXFF_OVERFLOW | SPI_INT_RX_DATA_TX_EMPTY);
    SPI_clearInterruptStatus(SPIA_BASE, SPI_INT_RXFF | SPI_INT_TXFF | SPI_INT_RX_OVERRUN | SPI_INT_RXFF_OVERFLOW | SPI_INT_RX_DATA_TX_EMPTY);
    SPI_enableModule(SPIA_BASE);
}

void SPIB_init(void)
{
    SPI_disableModule(SPIB_BASE);
    // GPIO_setPinConfig(GPIO_65_GPIO65);
    SPI_setConfig(SPIB_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA0, SPI_MODE_MASTER, 5000000, 16);
	SPI_disableFIFO(SPIB_BASE);
    SPI_disableInterrupt(SPIB_BASE, SPI_INT_RXFF | SPI_INT_TXFF | SPI_INT_RX_OVERRUN | SPI_INT_RXFF_OVERFLOW | SPI_INT_RX_DATA_TX_EMPTY);
    SPI_clearInterruptStatus(SPIB_BASE, SPI_INT_RXFF | SPI_INT_TXFF | SPI_INT_RX_OVERRUN | SPI_INT_RXFF_OVERFLOW | SPI_INT_RX_DATA_TX_EMPTY);
    SPI_enableModule(SPIB_BASE);
    // GPIO_setPinConfig(GPIO_65_SPICLKB);
}

  • Orhan,

    That's an odd issue. Looking through our documentation of known issues, I don't see anything resembling it.

    • Your GPIO configuration does not include the "GPIO_setPadConfig()" and "GPIO_setQualificationMode()" functions that are called in our examples. I don't think it's likely to resolve the issue, but can you add them just to be certain?
    • Can you also add GPIO_setControllerCore() for each of the glitching pins?
    • Finally, add the appropriate call to GPIO_setDirectionMode() for each of the glitching pins.

    None of these should cause the issue you're seeing, but these kinds of checks/verifications are very important.

    Regards,
    Jason Osborn

  • I have checked the GPIO settings as suggested.

    • SPIB pins were configured with GPIO_QUAL_ASYNC, which is the correct option for high-speed communication.

    • For verification, I also tried other qualification modes (SYNC, 3SAMPLE, 6SAMPLE), but the behavior did not change.

    • The spurious pulses on SPIB (both clock and MOSI) remain unchanged regardless of the selected qualification mode.

    Therefore, it seems the issue is not related to the GPIO settings.

    Thank you,
    Mr. Orhan Gürbüz

    GPIO_setPinConfig(GPIO_63_SPISIMOB);
    GPIO_setPadConfig(63U, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(63U, GPIO_QUAL_ASYNC);
    GPIO_setControllerCore(63U, GPIO_CORE_CPU1);
    GPIO_setDirectionMode(63U, GPIO_DIR_MODE_OUT);
    
    GPIO_setPinConfig(GPIO_64_SPISOMIB);
    GPIO_setPadConfig(64U, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(64U, GPIO_QUAL_ASYNC); // Checked
    GPIO_setControllerCore(64U, GPIO_CORE_CPU1);
    GPIO_setDirectionMode(64U, GPIO_DIR_MODE_IN);
    
    GPIO_setPinConfig(GPIO_65_SPICLKB);
    GPIO_setPadConfig(65U, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(65U, GPIO_QUAL_ASYNC);
    GPIO_setControllerCore(65U, GPIO_CORE_CPU1);
    GPIO_setDirectionMode(65U, GPIO_DIR_MODE_OUT);
    
    GPIO_setPinConfig(GPIO_66_SPISTEB);
    GPIO_setPadConfig(66U, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(66U, GPIO_QUAL_ASYNC);
    GPIO_setControllerCore(66U, GPIO_CORE_CPU1);
    GPIO_setDirectionMode(66U, GPIO_DIR_MODE_OUT);

  • Thank you for showing that.

    The reason I mentioned IO configuration here is because it seems like something other than the SPI is trying to drive these signals. Are you able to monitor these pins when you're NOT configuring them as SPI, to see if you still see similar behavior?

    Also, just as a note, there is a specific bit you're supposed to enable in the SPI to enable high-speed more, but the speeds you're describing are not high enough that that should be relevant. The driverlib function should be something like SPI_enableHighSpeedMode() or similar.

    Beyond these ideas, I'm not certain what could be causing this. I'm currently attempting to replicate the issue.

    Regards,
    Jason Osborn

  • Hi Jason,

    As mentioned earlier, I tested the SPIB pins as GPIO (toggling) and observed no glitches. The spurious pulses only appear when the SPI mux is enabled. I also tried enabling the SPI high-speed mode, but the glitches remain the same.

    This confirms that the issue is specific to SPIB on this board/configuration at the tested SPI clock rates. Based on my testing, the glitches appear only when SPIB is routed through its default SPICLKB pin (GPIO_65). Routing SPIB clock through a different available GPIO pin via the mux eliminates the glitches. This points to a potential pin mux routing issue rather than a software configuration problem.

    Best regards,
    Orhan

  • Hi Orhan,

    Apologies for the late reply, I will be taking over support on this thread. Since it has been some time, can you update me on the current status of your issue: are you still seeing the issue? Do you have any other questions you'd like addressed?

    Best Regards,

    Delaney