SPI1 doesn't work

Hi, 

I am trying to initializing a ST7789 controller built in a LCD in SPI mode. To do that I use SPI1 from BF706 kit board. Signals are connected as:

BF706 kit board LCD, ST7789
SPI1_CLK DCX
SPI1_MOSI SDA
SPI1_MISO SDO
SPI1_SS CSX

In system.svc I set PPI and SPI1 as follow: 

and I use adi_initpinmux() function to initialize the SPI1 registers. 

int32_t adi_initpinmux(void) {
    /* PORTx_MUX registers */
    *pREG_PORTA_MUX = PPI0_FS1_PORTA_MUX | PPI0_FS2_PORTA_MUX
     | PPI0_FS3_PORTA_MUX | PPI0_CLK_PORTA_MUX | PPI0_D08_PORTA_MUX
     | PPI0_D09_PORTA_MUX | PPI0_D10_PORTA_MUX | PPI0_D11_PORTA_MUX
     | SPI1_CLK_PORTA_MUX | SPI1_MISO_PORTA_MUX | SPI1_MOSI_PORTA_MUX
     | SPI1_SEL1_PORTA_MUX;
    *pREG_PORTB_MUX = PPI0_D00_PORTB_MUX | PPI0_D01_PORTB_MUX
     | PPI0_D02_PORTB_MUX | PPI0_D03_PORTB_MUX | PPI0_D04_PORTB_MUX
     | PPI0_D05_PORTB_MUX | PPI0_D06_PORTB_MUX | PPI0_D07_PORTB_MUX
     | PPI0_D16_PORTB_MUX | PPI0_D17_PORTB_MUX;
    *pREG_PORTC_MUX = PPI0_D12_PORTC_MUX | PPI0_D13_PORTC_MUX
     | PPI0_D14_PORTC_MUX | PPI0_D15_PORTC_MUX;

    /* PORTx_FER registers */
    *pREG_PORTA_FER = PPI0_FS1_PORTA_FER | PPI0_FS2_PORTA_FER
     | PPI0_FS3_PORTA_FER | PPI0_CLK_PORTA_FER | PPI0_D08_PORTA_FER
     | PPI0_D09_PORTA_FER | PPI0_D10_PORTA_FER | PPI0_D11_PORTA_FER
     | SPI1_CLK_PORTA_FER | SPI1_MISO_PORTA_FER | SPI1_MOSI_PORTA_FER
     | SPI1_SEL1_PORTA_FER;
    *pREG_PORTB_FER = PPI0_D00_PORTB_FER | PPI0_D01_PORTB_FER
     | PPI0_D02_PORTB_FER | PPI0_D03_PORTB_FER | PPI0_D04_PORTB_FER
     | PPI0_D05_PORTB_FER | PPI0_D06_PORTB_FER | PPI0_D07_PORTB_FER
     | PPI0_D16_PORTB_FER | PPI0_D17_PORTB_FER;
    *pREG_PORTC_FER = PPI0_D12_PORTC_FER | PPI0_D13_PORTC_FER
     | PPI0_D14_PORTC_FER | PPI0_D15_PORTC_FER;
    return 0;
}

and then using Init_SPI1() to define rest of SPI1 registers:

void Init_SPI(void)
{
	*pREG_SPI1_CLK	 = 24;
	*pREG_SPI1_DLY	 = 0;	//((1 << BITP_SPI_DLY_STOP) & BITM_SPI_DLY_STOP) ;
	*pREG_SPI1_SLVSEL= ENUM_SPI_SLVSEL_SSEL1_HI | ENUM_SPI_SLVSEL_SSEL1_EN;

	*pREG_SPI1_CTL 	 = ENUM_SPI_CTL_MASTER;
	*pREG_SPI1_TXCTL = ENUM_SPI_TXCTL_TTI_EN | ENUM_SPI_TXCTL_TWC_EN | ENUM_SPI_TXCTL_ZERO ;
	*pREG_SPI1_RXCTL = ENUM_SPI_RXCTL_OVERWRITE;
	*pREG_SPI1_TFIFO = ENUM_SPI_TXCTL_TDR_EMPTY;

	*pREG_SPI1_TXCTL |= ENUM_SPI_TXCTL_TX_EN;	//	enable Tx SPI
	*pREG_SPI1_RXCTL |= ENUM_SPI_RXCTL_RX_EN;	//	enable Rx SPI
	*pREG_SPI1_CTL 	 |= ENUM_SPI_CTL_EN;
}

When I enable the SPI1 by calling "*pREG_SPI1_CTL |= ENUM_SPI_CTL_EN;", there is no signal for SPI1 clock on scope. 

void Configure_LCD(void)
{
	Init_SPI();
	*pREG_SPI1_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL1_HI ;			// select device
	*pREG_SPI1_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL1_HI ;			// select device
	*pREG_SPI1_CTL 	 |= ENUM_SPI_CTL_EN;
	//------------ST7789V SPI Initialization--------------------//
	device_access_short(0x01);									// Command ID
	delay(200);
	//----------------------------------------------------------//
	*pREG_SPI1_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL1_LO ;			// select device
	*pREG_SPI1_SLVSEL &= ~ENUM_SPI_SLVSEL_SSEL1_LO ;			// select device
	*pREG_SPI1_CTL 	 |= ENUM_SPI_CTL_EN;
	device_access_short(0x11);									// Command ID
	delay(120);													// 120ms
    .......
}

I am trying also to write data and command after ENUM_SPI_SLVSEL_SSEL1 is high or low. But still SPI1 is not clocking. 

Anyone could please have a look at the code and explain to me what I am doing wrong. 

Thank you



The data's will be write when SCL (DCX) is High and the commands will be write when DCX (SCL) is Low. How can I separate the CLK to be H and L?
[edited by: SVA at 8:31 AM (GMT -4) on 21 Sep 2020]