STM32F4
Discovery
+ HY32D TFT LCD
The STM32F4 Discovery board has an FSMC ( Flexible Static Memory Controller ) which supports the connection of an LCD in parallel mode. I have 3 STM32F4 Discovery boards, so I decided to use one to control the HY32D TFT LCD I bought off Ebay, with absolutely useless example code for an 8051 type microcontroller
----------------------------------------------
메모리를 사용하는 TFT LCD제어 - FSMC 사용
https://sites.google.com/site/miguelmoreto/home-eng/projects/stm32f4-adapter-board
LCD Pin Name | STM32F407 pin name | Function |
D0 | PD14 (FSMC-D0) | Data bit 0 |
D1 | PD15 (FSMC-D1) | Data bit 1 |
D2 | PD0 (FSMC-D2) | Data bit 2 |
D3 | PD1 (FSMC-D3) | Data bit 3 |
D4 | PE7 (FSMC-D4) | Data bit 4 |
D5 | PE8 (FSMC-D5) | Data bit 5 |
D6 | PE9 (FSMC-D6) | Data bit 6 |
D7 | PE10 (FSMC-D7) | Data bit 7 |
D8 | PE11 (FSMC-D8) | Data bit 8 |
D9 | PE12 (FSMC-D9) | Data bit 9 |
D10 | PE13 (FSMC-D10) | Data bit 10 |
D11 | PE14 (FSMC-D11) | Data bit 11 |
D12 | PE15 (FSMC-D12) | Data bit 12 |
D13 | PD8 (FSMC-D13) | Data bit 13 |
D14 | PD9 (FSMC-D14) | Data bit 14 |
D15 | PD10 (FSMC-D15) | Data bit 15 |
CS | PD7 (FSMC-NE1) | Chip-select |
RS | PD11 (FSMC-A16) | Register/RAM select |
WR | PD5 (FSMC-NWE) | Write signal |
RD | PD4 (FSMC-NOE) | Read signal |
BLCNT | PC6 (TIM3_CH1) | LCD BackLight control (PWM) |
TP_IRQ | PD6 | Touch Panel interrupt signal |
TP_CS | PA15 (SPI3_NSS) | Touch Panel SPI chip-select |
TP_SCK | PC10 (SPI3_SCK) | Touch Panel SPI clock |
TP_SI | PC12 (SPI3_MOSI) | Touch Panel SPI Slave Input |
TP_SO | PC11 (SPI3_MISO) | Touch Panel SPI Slave Output |
----------------------------------------------------------
------------------------------------------------------------
buzlecleir 2013. 12. 5 오전 5:07 (다음에 대한 응답 erix_kl)
Hello Eriks,
Maybe I'm too late.
There are two types of data to send to the display:
- data to configure registers (the pin RS must be at low level)
- data to fill SRAM buffer (the pin RS must be at high level)
If you go to line 568 of SSD1289.c, you can see:
GPIO_PinAFConfig(GPIOD, GPIO_PinSource11, GPIO_AF_FSMC); | // A16 -> RS |
So the signal RS of display depends of the bit 16 of FSMC address.
When you write LCD_REG = x, (@0x600000000) you send a data to the register of display because for FSMC the address 0x600000000 means pin A16 must be at low level
When you write LCD_RAM = x, (@0x600200000) you send a data to the SRAM buffer of display because for FSMC the address 0x600200000 means pin A16 must be at high level
Tell me if it's not clear.=
=========================================
=========================================
Understanding STM32F4 FSMC Hello, I am new to STM32F4 and I have been digging into documentation for the lasts two weeks. My application uses a 320x240 LCD display and is managed through the FSMC bus. If I have understood correctly the FSMC manages four banks of memory and each one is divided in four memory regions. I am only interested in Bank1, which is the NOR/PSRAM memory, but I have some questions.
As you can see I am pretty lost. Any help would be appreciated. Thanks in advance, Edgar. | |
Tags: #fsmc #stm32
|
Hello,
I use stm32f4discovery with HY32D display. Can someone explain me, how data is sent to HY32D with this code:
#define LCD_REG (*((volatile unsigned short *) 0x600000000))
#define LCD_RAM (*((volatile unsigned short *) 0x600200000))
...
void LCD_WriteReg(uint8_t LCD_Reg, uint16_t LCD_RegValue)
{
LCD_REG = LCD_Reg;
LCD_RAM = RegValue;
}
How this code is connected with FSMC?
0x600000000 is STM32F4 register address?
Thanks