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: configuring spi5 CS[1] as GIO (output)

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi I am trying to configure spi5 CS[1] as GIO (output) with other SPI functionality as it is.

Halcogen is configured as shown.

I am just using the following code part in the main to set the gio pin.

gioInit();
spiInit();

gioSetDirection(spiPORT5,0x40);
gioSetBit(spiPORT5,14,1);

gioSetBit(spiPORT5,14,0);

I do not see any change on the pin.

Please help me resolving the problem. An example code help a lot.3678.SPI_GPIO.zip

Chandra

  • Hello Chandra,

    The CS1 is bit 1 of the registers (PC1, PC2, PC3,..). 

    To set CS1 direction: gioSetDirection(spiPORT5, 0x02)

    To Set CS1 bit:  gioSetBit(spiPORT5,1,1);

    To clear this bit:  gioSetBit(spiPORT5,1,0);

    Under HALCoGen "Driver Enable" panel, please check "Enable SPI5 Driver"