cancel
Showing results for 
Search instead for 
Did you mean: 

FMC config in STM32L4

Anand A
Associate III
Posted on September 20, 2017 at 13:37

I am trying to configure STM32L4 with an 8-bit monochrome LCD using FMC using CubeMx Tool. I have configured the timing parameters. I could see that the LCD Command and Data are to be written in a particular address location. How is this derived?

3 REPLIES 3
Posted on September 20, 2017 at 23:17

Hello

When you choose the Bank 1 for LCD interface the highlited address is the base address.

0690X00000608JPQAY.png

At ''LCD Register Select'' field you choose an address bit that is connected to an  external pin also.(connected to command/data pin on your LCD)

0690X00000608K3QAI.png

For this example we use BANK1 PSRAM1 and A0 as LCD reg select bit

The  Address for data access, can be  0x60000000 (or generaly 0b0000yyxxxxxxxxxxxxxxxxxxxxxxxxx0 in binary form).  The address for register(command) access can be  0x60000001 (or generaly 0b0000yyxxxxxxxxxxxxxxxxxxxxxxxxx1  in binary form)  

Another  example is  BANK1 PSRAM1  and A16 as LCD reg select bit

The  Address for data access, can be  0x60000000 (or generaly 0b0000yyxxxxxxxxx0xxxxxxxxxxxxxxxx in binary form).  The address for register(command) access can be  0x60010000 (or generaly 0b0000yyxxxxxxxxx1xxxxxxxxxxxxxxxx  in binary form) 

x  ->can be 0 or 1

yy is the bank 1 PSRAM 1 or 2 or 3 or 4 according to table 62

0690X00000608JeQAI.png

When you write an address with A0 set, the external pin connected to your LCD ''register select pin'', goes at HI state.

Regards

vf

Anand A
Associate III
Posted on September 21, 2017 at 07:18

Hello,

   Thanks for the reply.

But, Is the LCD Register select bit(Ax) is the only criteria for the Address?.. Because, I am using 2 variants of LCD. STM32F3 with 16-bit TFT display and STM32L4 with 8-bit Monochrome display. In the TFT case, I am using A16 as register select with Bank 1. So, expecting the address to be 0x60010000, but it works only with 0x60020000. But, in Monochrome case, I am using A18 as register select and the address 0x60040000 works fine as expected.

Posted on September 21, 2017 at 09:29

Hi

>>>''But, Is the LCD Register select bit(Ax) is the only criteria for the Address?.'' 

For LCDs that have one pin for selecting between Data and Register (or Data and Command), named CD, RS, whatever, yes is the only criterion.

>>>''expecting the address to be 0x60010000, but it works only with 0x60020000''

My above post concerns 8bit wide  FMC

I didn't write for 16 bit access.

16 bit access uses for addressing  bits 25:1  not  25:0  so it is normal to have command address 0x60020000. It is writen in remarks of table 63.

0690X00000608JUQAY.png