原创 STM32F1 with 1.5inch CSTN Color LCD

2013-8-23 10:14 2925 30 34 分类: MCU/ 嵌入式 文集: DIY

First of all, happy new year and happy Valentine's day!

Life has been very busy over the past few months... My first post is now released!

Acknowledgement:
http://www.powermcu.com - for STM32 RTC Library

Some time ago, I bought two 1.5" CSTN Color LCD panels from Taobao.
To my surprise, the price for each of them was only RMB$7.5!

sany0060_800x599.jpg
Fig.1 The 1.5" CSTN Color LCD
The resolution of the LCD is 128x128.
The controller used in it belongs to Samsung's S6B33B6 family.
Each pixel supports displaying in 16-bit color (R5G6B5) or in 12-bit (R4G4B4) color.
The nominal voltage for the LED backlight is 6.4V.
The panel supports 8-bit or 16-bit parallel bus, 3-Pin or 4-Pin SPI. It is suitable for any microcontrollers.
 
I got the datasheet from the vendor. I have printed it out to assist the writing of the LCD driver.
sany0061 (2)_800x599.jpg
Fig.2 Datasheet of the controller
 
Using a in-house made STM32 evaluation board and also a in-house made DC-DC converter to generate 6.4V for LED backlight from 5V, the hardware parts and connections are done.
 
sany0065_800x599.jpg
Fig.3 An in-house made STM32 eval. board with RTC backup battery
 
sany0069_800x599.jpgsany0070_800x599.jpg
Fig. 4&5 In-house made DC-DC supply (using LM2577)
 
The LCD panel is fixed on a PCB and some soldering works are done.
sany0073_800x599.jpg
Fig. 6 The LCD panel fixed on a PCB to form a LCD module (LCM)
 
sany0075_800x599.jpg
Fig. 7 Back view of the LCM
 
sany0076_800x599.jpg
Fig. 8 The hardware part is done
 
The LCD driver program has been written, it mainly consists of:
1. LCDS_Init(void) - init the LCD panel
2. LCDS_DrawPixel(x,y,color) - set the pixel (x,y) to color
3. LCDS_DrawLine(x0,y0,x1,y1,color) - draw a line (x0,y0) to (x1,y1) to color
4. LCDS_DrawRect(x0,y0,x1,y1,color,style) - draw a rectangle in color with style (solid border/filled)
5. LCDS_DrawChar(x,y,ch,color) - draw a character with fonts.h (written by ST) at position (x,y)
6. LCDS_DispChar(line,char_pos,ch,color) - display a character at line (0-7), char_pos(0-15)
7. LCDS_DispString(line,start_pos,string,foreColor,backColor) - display a series of string
 
0002-1138x659_800x463.jpg
Fig. 9 Using Keil uVision 4 as the IDE
 
0003-1138x659_800x463.jpg
Fig. 10 Developing the LCD driver library
 
0001-869x580_800x534.jpg
Fig. 11 Debug information is displayed though Hyper Terminal with UART
 
With the RTC library, the time is display on the LCM at an interval of 1s (by RTC interrupt).
 
sany0093_800x599.jpg
Fig. 12 RTC Date and Time shown on LCM
 
sany0081_800x599.jpg
Fig. 13 Overall view

Attached are the full project source code and the datasheet of the LCD controller S6B33B6.
Special notes:
Libraries not written by MarioTech belong to their original owners.
Libraries written by MarioTech is released under GPL license.

PARTNER CONTENT

文章评论4条评论)

登录后参与讨论

用户1720514 2014-7-1 21:03

非常不错的。感谢分享。

用户436037 2013-5-12 22:52

請各位多多指教!

用户862262 2013-2-26 10:08

不错

用户403664 2013-2-19 10:29

so nice to have you here,thanks for sharing
相关推荐阅读
用户436037 2014-09-10 23:58
我的手机
苹果发布了iPhone6​​,再次掀起了一鼓追「疯」潮...没有留意苹果产品的我,也听到了不少消息...虽然我是一名电子爱好者,但是到2009年尾才拥有第一部智能手机。那是一部的Windows M...
用户436037 2014-09-01 00:53
Updates from Me
Hi, long time no see! This September will be a different one for me, since I am not a student an...
用户436037 2014-01-25 18:44
Reusing Card Reader from a Canon inkjet Printer
Inspired from Charlieb000: http://icrontic.com/discussion/93568/reusing-card-reader-from-mp180-can...
用户436037 2013-12-30 14:22
Power? Energy? Electronics?
Electricity has brought numerous benefits to our daily life. But we should be aware of the energy ...
用户436037 2013-11-29 20:19
Device is not powered on? Replacing the capacitors may help!
Hi! Long time no see! Life has been busy over the past few months... Students' lives are busy... ...
EE直播间
更多
我要评论
4
30
关闭 站长推荐上一条 /3 下一条