cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 -FMC - LCD INTEFACE - A19 AS REGISTER SELECT

Asantos
Senior

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?

4 REPLIES 4

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 Venmo
Up vote any posts that you find helpful, it shows what's working..
Asantos
Senior

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.

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 Venmo
Up vote any posts that you find helpful, it shows what's working..

typedef struct

{

 __IO uint16_t REG;

__IO uint16_t LARGEVOID[(1 << 19)-1]; // already described one word

 __IO uint16_t RAM;

}LCD_CONTROLLER_TypeDef;

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