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: SPI

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Using :Launchpad TMS570lc43x /RM57Lx, Launchpad XL2

configured, in halcogen:

SPI

basically only SPI1...just want to run that spi bus..

Setup:

MIBSPI1CLK = pin f18 = Booster pak 2 pin j5- 7

MIBSPI1NCS[0] = pin R2 = Booster pak 2 pin j6-3

MIBSPI1SIMO[0] = pin F19 = Booster pak 2 pin j6- 6

MIBSPI1SOMI[0] = pin G18 = Booster pak 2 pin j6-7

set all other NCS pins to GPIO (in halcogen)..only NCS[0]SPI based.

made sure no conflicts in PINMUX....

run code..using this funtion:  uint32 spiTransmitAndReceiveData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * srcbuff, uint16 * destbuff)

run code.

se clk, data...no CS....??????

checking registers while running....

(i.e. DAT1)...I see bit 28=1, I see CSNR = 0x37...(which is confusing based on Table 28-25 in SPNU563A, Herc Ref manual.....why are that many /cs activated for one transfer????)

anyway.....confused...

just trying to do a "simple" send spi data..

Any thoughts/insight/help appreciated.

per SOP, apprectiate any and all responses...

cheers

jy

  • Hi John,

    If CS0 is used to select the SPI device, the CSNR should be 0x3E or 0xFE. 

    What is the value of dataconfig_t in your code?

    dataconfig1_t.CS_HOLD = FALSE;
    dataconfig1_t.WDEL = FALSE;
    dataconfig1_t.DFSEL = SPI_FMT_0;
    dataconfig1_t.CSNR = 0xFE;

  • ok...

    checked that CNSR value...it wasnt 3E or FE...it was x37....

    I'm guessing based on Halcogen setup...(?)......

    i then forced the CSNR to 3E in the function (uint32 spiTransmitAndReceiveData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * srcbuff, uint16 * destbuff)...just as a test...

    still no /CS at R2?...

    I tried various settings for CSNR similarly  (i.e. based on table  in ref manual)..i  probed all CS attached to SPI 1...nothing....?

    heres how I did that (testing)

    uint32 spiTransmitAndReceiveData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * srcbuff, uint16 * destbuff)
    {
    uint16 Tx_Data;
    uint32 Chip_Select_Hold = (dataconfig_t->CS_HOLD) ? 0x10000000U : 0U;
    uint32 WDelay = (dataconfig_t->WDEL) ? 0x04000000U : 0U;
    SPIDATAFMT_t DataFormat = dataconfig_t->DFSEL;
    uint8 ChipSelect = dataconfig_t->CSNR;
    ChipSelect = 0x3EU;

    again, I see clock, dataout, etc....but no cs

    I am sure I am missing something simple...but cant figure out what it is...?

    All i'm doing is trying to write out the spi port, in a while loop..just to see things happen.

    apprecaite your expertise and help in this....per SOP.

    thank you very very much

  • Hi John,

    1. Enabled SPI1 from HALCoGen 'Driver Enable"

    2. Configure CS0 as chip-select rather than GIO:

    3. In HAL pinmux window, Make sure the MibSPI1CS0 is selected for R2: