Skip to main content
Asantos
Associate III
December 4, 2018
Question

STM32H7 -FMC - LCD INTEFACE - A19 AS REGISTER SELECT

  • December 4, 2018
  • 2 replies
  • 1020 views

Hi,

When A0 is used as Register select in the FMC LCD interface, ST uses the code below:

typedef struct

{

 __IO uint16_t REG;

 __IO uint16_t RAM;

}LCD_CONTROLLER_TypeDef;

/* We use BANK1 as we use FMC_NE1 signal */

#define FMC_BANK1_BASE ((uint32_t)(0x60000000 | 0x00000000))  

#define FMC_BANK1    ((LCD_CONTROLLER_TypeDef *) FMC_BANK1_BASE)

FMC_BANK1->RAM = Data; //Write Data

FMC_BANK1->REG = cmd; ///write CMD

How to do it when the Register select is A19?

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
December 4, 2018

Sure you can mapped it any way the pins permit. Depending on the data width the address bit number will shift on the external pins.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Asantos
AsantosAuthor
Associate III
December 4, 2018

Clive,

I would like to know how to change the code to work when A19 is the Register select. ST example only works for A0 as Register selec.

Tesla DeLorean
Guru
December 4, 2018

On an 8-bit interface FMC_BANK1_BASE vs (FMC_BANK1_BASE + (1 << 19))

ie

uint8_t *RAM = (uint8_t *)(FMC_BANK1_BASE + (1 << 19)); // 8-bit one-to-one mapping

uint16_t *RAM = (uint16_t *)(FMC_BANK1_BASE + (1 << (19 + 1))); // A19 externally A20 internally

*RAM = Data;

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..