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.

TMS320F2800157: SPI Debug

Part Number: TMS320F2800157
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Dears,

Customer feedback that F2800157SPN below issue,pls kindly help to check it.

1. SPI cannot be configured successfully, and the routine provided by TI (C2000ware) "spi_ex1_loopback" is modified to the SPI main mode on the TI development board, and it is found that the CLK pin has been low and the SIMO pin has been high. Could not actually send data. Please help check, or even better, mention the SPI routine that has been successfully configured.

2, EEPROM debugging also encountered problems, directly transplanted or using routines (C2000ware) can not read and write successfully. Whether there is a relevant success routine provided.

3, 28034 chip program transplant to 2800157 chip whether there are relevant guidance documents

Thanks

  • Dears,

    The routine provided by TI (C2000ware) "spi_ex1_loopback" is modified to the SPI main mode on the TI development board. The following is the code modification, whether it is correct,below is the modify code:

    1.Void InitSpi (void) function of the modified code "SpiaRegs. SPICCR. Bit. SPILBK = 0;

    2.Modify the GPIO

    void InitSpiaGpio(void)
    {
    EALLOW;

    //
    // Enable internal pull-up for the selected pins
    //
    // Pull-ups can be enabled or disabled by the user.
    // This will enable the pullups for the specified pins.
    //
    GpioCtrlRegs.GPAPUD.bit.GPIO8 = 0; // Enable pull-up on GPIO16 (SPIPICOA)
    GpioCtrlRegs.GPAPUD.bit.GPIO10 = 0; // Enable pull-up on GPIO17 (SPIPOCIA)
    GpioCtrlRegs.GPAPUD.bit.GPIO9 = 0; // Enable pull-up on GPIO18 (SPICLKA)
    GpioCtrlRegs.GPAPUD.bit.GPIO19 = 0; // Enable pull-up on GPIO19 (SPIPTEA)

    //
    // Set qualification for selected pins to asynch only
    //
    // This will select asynch (no qualification) for the selected pins.
    //
    GpioCtrlRegs.GPAQSEL1.bit.GPIO8 = 3; // Asynch input GPIO16 (SPIPICOA)
    GpioCtrlRegs.GPAQSEL1.bit.GPIO10 = 3; // Asynch input GPIO17 (SPIPOCIA)
    GpioCtrlRegs.GPAQSEL1.bit.GPIO9 = 3; // Asynch input GPIO18 (SPICLKA)
    GpioCtrlRegs.GPAQSEL2.bit.GPIO19 = 3; // Asynch input GPIO19 (SPIPTEA)

    //
    // Configure SPI-A pins
    //
    // This specifies which of the possible GPIO pins will be SPI functional
    // pins.
    //
    GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 7; // Configure GPIO16 as SPIPICOA
    GpioCtrlRegs.GPAMUX1.bit.GPIO10 = 7; // Configure GPIO17 as SPIPOCIA
    GpioCtrlRegs.GPAMUX1.bit.GPIO9 = 7; // Configure GPIO18 as SPICLKA
    GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 1; // Configure GPIO19 as SPIPTEA

    EDIS;
    }

    Thanks

  • Hi Ning,

    1. SPI cannot be configured successfully, and the routine provided by TI (C2000ware) "spi_ex1_loopback" is modified to the SPI main mode on the TI development board, and it is found that the CLK pin has been low and the SIMO pin has been high. Could not actually send data. Please help check, or even better, mention the SPI routine that has been successfully configured.

    When using bitfield control, both GPxMUXy & GPxGMUXy need to be configured to select the required pinmux mode. For example, use code below to select pinmux mode 15 (1111b). 

    GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 7;  // Configure GPIO8  as SPI PICOA
    GpioCtrlRegs.GPAGMUX1.bit.GPIO8 = 7;  // Configure GPIO8 as SPI PICOA

    If using C2000ware driverlib, this is done automatically by GPIO_setPinConfig() API.

    GPIO_setPinConfig(mySPI0_SPIPICO_PIN_CONFIG);
    GPIO_setPadConfig(mySPI0_SPIPICO_GPIO, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(mySPI0_SPIPICO_GPIO, GPIO_QUAL_ASYNC);

    Ensure that you are looking at the spi_ex1_loopback example that was created for F280015x. Along with driverlib functions, we also highly recommend using SysConfig which is a GUI tool used to facilitate software development for our Gen3 devices. This will take care of the muxing specific code from above automatically, clocking, and other peripheral configurations as well. Attaching the video series here that details what it is and how to easily use it for your reference. 

    2, EEPROM debugging also encountered problems, directly transplanted or using routines (C2000ware) can not read and write successfully. Whether there is a relevant success routine provided.

    In C2000Ware, for F280015x, there is the spi_ex6_eeprom example which showcases how to write and read 8 bytes using the EEPROM. This can be modified accordingly.

    3, 28034 chip program transplant to 2800157 chip whether there are relevant guidance documents

    On the 'Migration Resources' page of C28x Academy linked here, we have migration guides, peripheral reference guides, and other resources that can be used for migration.

    Aishwarya