cancel
Showing results for 
Search instead for 
Did you mean: 

FSMC setup for LCD interface in AN2790

Tom Coates
Associate
Posted on November 29, 2017 at 11:50

I'm trying to set up the LCD interfacing demo from AN2790 on an STM32F417, and have a couple of questions about the FSMC interface configuration:

1. On page 17, ADDSET and DATAST are configured for a cycle time of 100ns. This should work for write access, but violates the longer cycle time of 300ns required for read access. The reason given for this is that 'we only write to the LCD', but in the source code there are also some read accesses. E.g. on line 67 of stm3210e_lcd.c

  /* Check if the LCD is SPFD5408B Controller */

  if(LCD_ReadReg(0x00) == 0x5408)

The code doesn't seem to be using different timings for read and write. Is it just relying on the LCD controller tolerating incorrect read timings, or is there something else I'm missing?

2. Page 14 says

Usually, ModeB is used for LCD interfacing (so the extended mode is not used)

This agrees with the code, which disables extended mode and sets bank 1 to access mode B:

p.FSMC_AccessMode = FSMC_AccessMode_B;

//...

FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;

But the description of the ACCMOD bits in the chip reference manual says that the access mode is ignored when extended mode is disabled. So why do we need to use access mode B when this setting is ignored anyway?

Thanks,

Tom

#fsmc #lcd
1 REPLY 1
Posted on November 29, 2017 at 23:32

I don't go check the details but it may quite well be that reading a LCD controller register may be far faster than reading from its memory (where conflicts with ongoing display process have to be solved).

Also, I would take the demos with a  pinch of salt.

JW