cancel
Showing results for 
Search instead for 
Did you mean: 

Troubles in displaying images on FT801with STM32F4 board

Anna Maria Nestorov
Associate II
Posted on November 25, 2017 at 20:58

Hi all, 

I'm working on a STM32F446E connected to a FTDI FT801 LCD. I am stacked on the commands communication on the SPI between the Micro and the LCD Controller. I have to load a couple of images on the LCD but I didn't found a proper guide on the net. There are a lot of guides for what concern the LCD controller, the ones that I have read don't explain anything about the right sequence of instructions to invoke on the micro. 

Up to now I tried this:

Address_RAM_CMD = 0x908000;

SPI_Send_RAM_CMD(Address_RAM_CMD, DLSTART, 7);

     

SPI_Send_RAM_CMD(Address_RAM_CMD,CLEAR, 7);

            

SPI_Send_RAM_CMD(Address_RAM_CMD, INFLATE, 7);

            

SPI_Send_RAM_CMD(Address_RAM_CMD, 0, 7);

                              

// Destination starting address in Graphics RAM

while (filesize > 0) {

   f_read(&MyFile_R, data, sizeof(data), (UINT*) &bytesread);

   

SPI_Send_RAM_CMD(Address_RAM_CMD, data, 7);

   filesize -= 4;

}

SPI_Send_RAM_CMD(Address_RAM_CMD, BITMAP_HANDLE(0),7);

SPI_Send_RAM_CMD(Address_RAM_CMD, BITMAP_SOURCE(0),7);

SPI_Send_RAM_CMD(Address_RAM_CMD, BITMAP_LAYOUT(0x00, 946, 92) ,7);

SPI_Send_RAM_CMD(Address_RAM_CMD, BITMAP_SIZE(NEAREST,BORDER,BORDER, image_width, image_height),7);

SPI_Send_RAM_CMD(Address_RAM_CMD, BEGIN(BITMAPS), 7);  

SPI_Send_RAM_CMD(Address_RAM_CMD, VERTEX2II(4, 76, 27, 0), 7);

SPI_Send_RAM_CMD(Address_RAM_CMD, END, 7);               

SPI_Send_RAM_CMD(Address_RAM_CMD, DISPLAY, 7);

              

SPI_Send_RAM_CMD(Address_RAM_CMD, SWAP,  7);               

HAL_Delay(1000);

Where:

// This function is used to transmit data with SPI

// Address = address in the FTDI801 memory map

// Data = data to write in the FTDI801 memory map

// Size = number of bytes to write (Address + Data)

void

SPI_Send_RAM_CMD(

uint32_t

Address,

uint32_t

Data,

uint16_t

Size)

{

   

uint8_t

buffer[7];

   

buffer[0] = ((Address >> 16) & 0xFF);

   

buffer[1] = ((Address >> 8) & 0xFF);

   

buffer[2] = (Address & 0xFF);

   

buffer[3] = (Data & 0xFF);

   

buffer[4] = ((Data >> 8) & 0xFF);

   

buffer[5] = ((Data >> 16) & 0xFF);      

   

buffer[6] = ((Data >> 24) & 0xFF);

   

HAL_GPIO_WritePin

(GPIOG, GPIO_PIN_14,

GPIO_PIN_RESET

);

   

HAL_SPI_Transmit

(&spi_handle_structure, buffer, Size, 10000);

   

HAL_GPIO_WritePin

(GPIOG, GPIO_PIN_14,

GPIO_PIN_SET

);

   

Address_RAM_CMD = Address_RAM_CMD + 0x0000004;

   

SPI_Send(0x9024E8,(

uint16_t

)(Address_RAM_CMD-0x00908000),7);

   

// REG_CMD_WRITE

}

void

SPI_Send(

uint32_t

Address,

uint32_t

Data,

uint16_t

Size)

{

   

uint8_t

buffer[7];

   

buffer[0] = ((Address >> 16) & 0xFF);

   

buffer[1] = ((Address >> 8) & 0xFF);

   

buffer[2] = (Address & 0xFF);   

   

buffer[3] = (Data & 0xFF);

   

buffer[4] = ((Data >> 8) & 0xFF);

   

buffer[5] = ((Data >> 16) & 0xFF);   

   

buffer[6] = ((Data >> 24) & 0xFF);

   

HAL_GPIO_WritePin

(GPIOG, GPIO_PIN_14,

GPIO_PIN_RESET

);

   

HAL_SPI_Transmit

(&spi_handle_structure, buffer, Size, 10000);

   

HAL_GPIO_WritePin

(GPIOG, GPIO_PIN_14,

GPIO_PIN_SET

);

}

With this implementation, no image is shown on the LCD.

It seems to me that the image data are not sent to the GPU RAM.

Thanks in advance.

Cheers, 

Anna

This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Anna Maria Nestorov
Associate II
Posted on December 11, 2017 at 22:14

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6pp&d=%2Fa%2F0X0000000bwS%2F3suas_fNg7.ELWODfzBW5jgTHZYPlkacqFaCcKFL2t8&asPdf=false
Posted on December 12, 2017 at 04:25

Are you comfortable porting arduino code to stm32?  If yes, download the sample application source from

http://www.ftdichip.com/Products/ICs/FT801.html

and see how they get an 8bitter to do it.