I am newbie in STM32 (and micro controllers) and I use keil.
I bought Arm Cortex-M3 Mini STM32 Dev Board +2.4" TFT LCD Touchscreen
Not much info for people like me on internet, so I decided to start gathering some data.
There will be many mistakes, for which I apologize.
My hope is that guys like me will add data so that we can all learn.
I use library made by ST.
I bought J-link-ARM segger - they are not expensive and I can not imagine not have it.
I uploaded simple small project of mine.
About Keil and STM32 library.
Click on "Target Option" button and pick Debug Tab -> Pick Cortex/J-link
than add header file info in stm32f10x_conf.h,
How to run LCD
ST made LCD library too complicated in my opinion.
What I understand is that display module is composed of LCD and Touch panel, two completely separate devices.
This particular LCD module act as RAM memory and can be write into by STM32.
RAM takes color of the pixel, and LCD register take info about what to with the pixel. And basically that is it.
To write to LCD RAM micro controller uses FSMC. I attached PDF which explains it.
User has to initiate FSMC, but this was already done by ST in STM3210E_LCD_Init function.
STM32 has to known memory address of LCD, which is address of FSMC
#define LCD_BASE ((uint32_t)(0x60000000 | 0x00000000))
The only modification I had to in library was address of RAM and REGISTERS
#define LCD_BASE ((uint32_t)(0x60000000 | 0x00000000)) - address of registers
__IO uint16_t LCD_RAM;
#define LCD ((LCD_TypeDef *) (LCD_BASE + 0x20000)) - color of pixels
__IO uint16_t LCD_REG;
#define LCDREG ((LCD_TypeDefReg *) (LCD_BASE))
I did this way so I don’t have to modify library too much.
So after initialization one can display pixel by sending data to LCD memory for registers and for data
So if you want make LCD clear with one color:
1. Wright LCD register with position X (LCD_WriteReg(LCD_REG_32, Xpos);)
2. Wright LCD register with position Y (LCD_WriteReg(LCD_REG_32, Ypos);)
3. Tell LCD to get color of pixel (LCDREG->LCD_REG = LCD_REG_34;)
4. Send color of pixel to RAM ( LCD->LCD_RAM = RGB_Code;)
In library following functions
And that is basically it.
All LCD library functions just do above, of course on massive scale. This display has 76800 pixels ,so using already made functions make helps for example in sending characters.
Initialization of LCD:
LCD_CtrlLinesConfig(); - General purpose pins setup
LCD_FSMCConfig(); - controller that communicate with RAM
I only added in function LCD_CtrlLinesConfig(void) ( to have backlight on)
GPIO_SetBits(GPIOE,GPIO_Pin_1); //NO reset
Retrieving data ...