Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN
Hello
I need to program a 4-wire SPI3 (CLK, SIMO, SOMI, SCS[0] in master mode, clock Polarity 0 and clock Phase 0 and baudrate 8 MHz, 16-bit shift register.
I want to program it through HalCoGen. Could you review my steps?
1) In Halcogen select tab "Driver Enable" and select "Enable SPI3 driver"
2) Select tab "SPI3"
3) Select tab "SPI3 Global" and set "Master mode" and "Internal clock"
4) Select tab "SPI3 Data Formats" and set baudrate as 8000, charlen = 16, unset clock polarity and unset clock phase
5) Select SPI3 port and set SOMI, SIMO CLK and SC[0] pin Mode as SPI; set all the other pins as GIO; set SIMO, CLK and SC[0] with write direction.
6) I'M NOT SURE ABOUT THIS STEP: do I have to select tab PINMUX, tab Pin Muxing and set MIBSPI3? Since I have to use other pin (GIOA and HET1), I was wondering if I have to go through the conflict resolution. If it is the case, In the box Enable/Disable Peripheral I do not see SPI3 but only MIBSPI3. Do I have to set MibSPI3? In general, do SPI34 and MibSPI3 share the same SIMO, SOMI, CLK and CS?
7) Include "spi.h" and write the code. For example:
...
uint16_t data[2] = {0x2000, 0x0003}; //just an example
spiDAT1_t dataconfig1_t;
dataconfig1_t.CS_HOLD = TRUE;
dataconfig1_t.WDEL = TRUE;
dataconfig1_t.DFSEL = SPI_FMT_0;
dataconfig1_t.CSNR = 0xFD;
spiTransmitdata(spiREG3, &dataconfig1_t, 2, data);
...
Is that correct? Could you please double check point 6) ?
Regards,