cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting FSMC to LCD - CD pin not working, STM32F407VG

Peter Mather
Associate III

I've configured bank1 FSMC to drive a LCD using CubeMx copying the various example code. I've set up FSMC-A18 to be the pin driving the Control/Data selection on the LCD. All data lines + OE and WR work perfectly but A18 sits continuously low whether I write to REG or RAM. I can't see in the examples how this is supposed to work as I can't find any code that sets whether it should be high for data/low for control or visa versa. The pin itself works fine if I drive it direct.

This is my first use of FSMC and I'm clearly missing something - help appreciated

I can attach code and CubeMX images if that helps diagnose

1 ACCEPTED SOLUTION

Accepted Solutions

" copying the various example code"

Various example codes may use different C/D (Control/Data) pin than A18 (usually A16)

For example if use Bank 1 of NOR/SRAM

and A16, then LCD_Ram Address is 0x60020000 and LCD_Reg addr is 0x60000000

If use A18, then LCD_Ram Address is 0x60080000 and LCD_Reg addr is 0x60000000

View solution in original post

3 REPLIES 3

> A18 sits continuously low whether I write to REG or RAM

What is "write to REG or RAM"?

Also check in respective GPIO registers if the given bit is set properly to AF and to proper AF (and maybe also its speed and type).

JW

" copying the various example code"

Various example codes may use different C/D (Control/Data) pin than A18 (usually A16)

For example if use Bank 1 of NOR/SRAM

and A16, then LCD_Ram Address is 0x60020000 and LCD_Reg addr is 0x60000000

If use A18, then LCD_Ram Address is 0x60080000 and LCD_Reg addr is 0x60000000

Thanks - that was the bit I was missing