cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F334 & SPI Modes

Manu Abraham
Senior

Hi,

The ILI9341 display https://cdn-shop.adafruit.com/datasheets/ILI9341.pdf

as on Page #35/233, is it using SPI MODE:3 ? Can someone clarify ?

Slightly confused with the timing diagram for the 4 line Serial interface and hence my question.

I am trying to debug an issue that I am facing on the STM32F334 using it with the ILI9341.

Attaching a logic capture of the waveform, on the SPI bus, writing 0x02:

0690X00000AARJOQA5.jpg

The code that was used to create the waveform:

	/* SPI configuration */
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);	/* Enable Clock */
	SPI_I2S_DeInit(SPI1);
	SPI_StructInit(&spi_state);
	spi_state.SPI_Mode	= SPI_Mode_Master;
	spi_state.SPI_CPOL	= SPI_CPOL_High;
	spi_state.SPI_CPHA	= SPI_CPHA_2Edge;
	spi_state.SPI_NSS	= SPI_NSS_Soft;
	spi_state.SPI_BaudRatePrescaler	= SPI_BaudRatePrescaler_256;
	spi_state.SPI_FirstBit	= SPI_FirstBit_MSB;
	SPI_DataSizeConfig(SPI1, SPI_DataSize_8b);
	SPI_Init(SPI1, &spi_state);
	SPI_Cmd(SPI1, ENABLE);
 
	for (i = 0; i < 255; i++) {
		SPI_SendData8(SPI1, i);	/* Send Command byte */
		SPI_Wait();				/* Wait for transmission */
		delay(5);
	}

Any thoughts ?

Thanks,

Manu

0 REPLIES 0