Other Parts Discussed in Thread: HALCOGEN
Dear all,
the hardware used for this issue is TI Launchpad XL2-TMS57012, 144pin PGE version.
Below code was used to test to toggle SPI4ncs_0 when set as gpio. Code reference from thread "How to us HET pins as GPIO?".
The signal output of the pin from SPI4ncs_0 did not toggle although it worked when SPI4ncs_0 is set as SPI4ncs_0.
1)How to set SPI4 port as GPIOs? when SPI4ncs_0 set to GIO in Halcogen SPI4 port block setting, the generated pinmux.c for pin 24 SPI4nCS_0 is set to HET1_03.
"pinMuxReg->PINMMR4 = PINMUX_PIN_22_GIOA_7 | PINMUX_PIN_23_HET1_01 | PINMUX_PIN_24_HET1_03;"
in pinmux.h
#define PINMUX_PIN_24_HET1_03 ((uint32)((uint32)0x1U << PINMUX_PIN_24_SHIFT))
#define PINMUX_PIN_24_SPI4NCS_0 ((uint32)((uint32)0x2U << PINMUX_PIN_24_SHIFT))
#define PINMUX_PIN_24_HET2_10 ((uint32)((uint32)0x10U << PINMUX_PIN_24_SHIFT))
#define PINMUX_PIN_24_EQEP2B ((uint32)((uint32)0x20U << PINMUX_PIN_24_SHIFT))
Which of these #define ports setting of SPI4ncs_0 pin is consider to be the GPIO mode as mentioned in TI datasheet Table 4-11??
2)Is there any difference between MibSPI1 and SPI4 port to be used as GPIOs?
as the pinmux.c for pin 105 will set to PINMUX_PIN_105_MIBSPI1NCS_0 when select as GIO in Halcogen.
void Spi_gpio_toggle()
{
spiREG4->GCR0 = 0U;
spiREG4->GCR0 = 1U;
gioSetDirection(spiPORT4,(1<<SPI_PIN_CS0));
gioSetBit(spiPORT4, SPI_PIN_CS0, 1);
while(1)
{
//spiPORT4->DSET= 0x01;
gioSetBit(spiPORT4, SPI_PIN_CS0, 1);
//manually wait with breakpoint to toggle
//spiPORT4->DCLR = 0x01;
gioSetBit(spiPORT4, SPI_PIN_CS0, 0);
}
}
thank you,
benjamin