SlideShare a Scribd company logo
1 of 18
Download to read offline
aitendoの正方形LCDをmbedで駆動させる 
! 
ZY-FGD1442701V1(ST7735S搭載版) 
Kei Yoshimura (@9SQ)
ZY-FGD1442701V1 (ST7735S) 
• 1.44インチTFT液晶モジュール 
• 解像度:128x128 
• コントローラチップ:ST7735S 
• 表示領域:26.496×25.4976mm 
• 接続インターフェース:8bitパラレル 
• 0.8mmピッチ27ピンFPC 
• http://www.aitendo.com/product/1621 
→データシート、初期化コード あり! 
! 
ST7735搭載版は販売終了! 
→非S版とS版でコマンドに変更あり
LCD_Write_CMD(0xE0); // Gamma Adjustment (+Polarity) 
LCD_Write_Data(0x03); 
LCD_Write_Data(0x1B); 
LCD_Write_Data(0x09); 
LCD_Write_Data(0x0E); 
LCD_Write_Data(0x32); 
LCD_Write_Data(0x2D); 
LCD_Write_Data(0x28); 
LCD_Write_Data(0x2C); 
LCD_Write_Data(0x2B); 
LCD_Write_Data(0x29); 
LCD_Write_Data(0x30); 
LCD_Write_Data(0x3B); 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x01); 
LCD_Write_Data(0x02); 
LCD_Write_Data(0x10); 
LCD_Write_CMD(0xE1); // Gamma Adjustment (-Polarity) 
LCD_Write_Data(0x03); 
LCD_Write_Data(0x1B); 
LCD_Write_Data(0x09); 
LCD_Write_Data(0x0E); 
LCD_Write_Data(0x32); 
LCD_Write_Data(0x2E); 
LCD_Write_Data(0x28); 
LCD_Write_Data(0x2C); 
LCD_Write_Data(0x2B); 
LCD_Write_Data(0x28); 
LCD_Write_Data(0x31); 
LCD_Write_Data(0x3C); 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x02); 
LCD_Write_Data(0x10); ! 
LCD_Write_CMD(0x3A); // Interface Pixel Format 
LCD_Write_Data(0x05); // 16-bit/pixel ! 
LCD_Write_CMD(0x2A); // Column Address Set 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x02); 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x81); 
LCD_Write_CMD(0x2B); // Row Address Set 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x01); 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x80); ! 
wait_ms(100); 
LCD_Write_CMD(0x2C); // Memory Write 
} 
aitendoが公開している初期化コードを 
ベースに若干の変更・追加 (+コメント) 初期化 
void LCD_Init(void) 
{ 
LCD_Reset(); ! 
LCD_Write_CMD(0xB1); // In Normal Mode(Full Colors) Frame rate 80Hz 
LCD_Write_Data(0x02); 
LCD_Write_Data(0x35); 
LCD_Write_Data(0x36); ! 
LCD_Write_CMD(0xB2); // In Idle Mode(8-colors) 
LCD_Write_Data(0x02); 
LCD_Write_Data(0x35); 
LCD_Write_Data(0x36); ! 
LCD_Write_CMD(0xB3); // In Partial Mode + Full Colors 
LCD_Write_Data(0x02); 
LCD_Write_Data(0x35); 
LCD_Write_Data(0x36); 
LCD_Write_Data(0x02); 
LCD_Write_Data(0x35); 
LCD_Write_Data(0x36); ! 
LCD_Write_CMD(0xB4); // Dot Inversion Control 
LCD_Write_Data(0x03); // Inversion setting in Idle mode and full Colors partial mode ! 
LCD_Write_CMD(0xC0); // Power Control Setting (GVDD Voltage) 
LCD_Write_Data(0xA2); // AVDD=5, GVDD=4.6 
LCD_Write_Data(0x02); // VGCL=-4.6 
LCD_Write_Data(0x84); // MODE=AUTO ! 
LCD_Write_CMD(0xC1); // Power Control Setting (VGH/VGL Voltage) 
LCD_Write_Data(0xC5); // VGH and VGL supply power level = 2.4, VGL=-10, VGH=3*AVDD-0.5 ! 
LCD_Write_CMD(0xC2); // In Normal Mode(Full Colors) APA/DCA 
LCD_Write_Data(0x0D); // SAP=Small, AP=Large 
LCD_Write_Data(0x00); // Clock frequency for Booster circuit/1,/3,/1,/1,/1 ! 
LCD_Write_CMD(0xC3); // In Idle Mode(8-colors) APA/DCA 
LCD_Write_Data(0x8D); 
LCD_Write_Data(0xEA); ! 
LCD_Write_CMD(0xC4); // In Partial Mode(Full Colors) APA/DCA 
LCD_Write_Data(0x8D); 
LCD_Write_Data(0xEE); ! 
LCD_Write_CMD(0xC5); // VCOM 
LCD_Write_Data(0x05); // -0.55 ! 
LCD_Write_CMD(0x36); // Memory Data Access Control 
LCD_Write_Data(0x48); // MX, RGB mode (Row Address Order, RGB color filter panel)
コマンド・データ送信、リセット 
void LCD_Write_CMD(unsigned char cmd) 
{ 
CS0=0; 
RD=1; 
CD=0; 
P1=cmd; 
WR=0; 
WR=1; 
CS0=1; 
} 
! 
void LCD_Write_Data(unsigned char d) 
{ 
CS0=0; 
RD=1; 
CD=1; 
P1=d; 
WR=0; 
WR=1; 
CS0=1; 
} 
! 
void LCD_Reset(void) 
{ 
RSTB=1; 
wait_ms(1); 
RSTB=0; 
wait_ms(1); 
RSTB=1; 
wait_ms(120); 
LCD_Write_CMD(0x11); // Sleep Out and Booster On 
wait_ms(120); 
} 
RSTB 
CS0 
CD 
RD 
WR 
RSTB
8-bit Data Bus for 16-bit/Pixel! 
(RGB 5-6-5-bit Input)! 
65535色 (16bitカラー) 
128px 
128px
LCD_Write_CMD(0x3A); // Interface Pixel Format 
LCD_Write_Data(0x05); // 16-bit/pixel 
LCD_Write_CMD(0x2A); // Column Address Set 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x02); 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x81); 
LCD_Write_CMD(0x2B); // Row Address Set 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x01); 
LCD_Write_Data(0x00); 
LCD_Write_Data(0x80); 
※図は132×132ドットの場合 
Y:02h,81h = 128列! 
X:01h,80h = 128行
• BusOut (pin10-17) 
main.cpp 
BusOut P1(p17, p16, p15, p14, p13, p12, p11, p10); 
DigitalOut CS0(p21); 
DigitalOut CD(p22); 
DigitalOut RD(p23); 
DigitalOut WR(p24); 
DigitalOut RSTB(p25); 
! 
LocalFileSystem local("local"); 
描画速度:669ms → 遅い 
 →LocalFileSystem(内蔵Flash)からのfreadが遅い
SD追加 
SDHC 8GB 
(Class10)
MicroSDを買ったら付いてくる 
アダプタにL型ピンヘッダをはんだづけ
• BusOut (pin10-17) 
main.cpp 
BusOut P1(p17, p16, p15, p14, p13, p12, p11, p10); 
DigitalOut CS0(p21); 
DigitalOut CD(p22); 
DigitalOut RD(p23); 
DigitalOut WR(p24); 
DigitalOut RSTB(p25); 
! 
SDFileSystem sd(p5, p6, p7, p8, "sd"); 
! 
SDHCFileSystem.cpp #230 
_spi.frequency(32000000); //32MHz 
描画速度:230ms → 3倍くらい高速化 
 →SDFileSystem(SDカード)からのfreadが高速 
  (SPI 32MHz)
もっと高速に描画したい 
1. アクセス回数と処理を減らす 
2. RAMに画像を全て展開して書き込み 
Bitmap画像のサイズ=32KBくらい 
mbed1768のRAMサイズ=32KB 
(USB/Ethernetの予約分まで拡張すると64KB) 
3. ポートレジスタに直接アクセス 
ちょっと 
厳しい?
アクセス回数と処理を減らして描画高速化 
・1Byte(8bit)ずつ bmp555形式 128×128×2=32768回アクセス235ms 
unsigned short pixel; 
! 
for (i=0; i<128*128; i++) { 
fread(&pixel, 2, 1, fp); 
LCD_Write_Data((unsigned char)((pixel & 0xFFFF) >> 8)); 
LCD_Write_Data((unsigned char)pixel); 
} 
unsigned short pixel[128]; 
! 
for (i=0; i<128; i++) { 
fread(&pixel, 2, 128, fp); 
for(j=0; j<128; j++) { 
LCD_Write_Data((unsigned char)((pixel & 0xFFFF) >> 8)); 
LCD_Write_Data((unsigned char)pixel); 
} 
} 
約91% 
215ms 
185ms 
・1pixel(16bit)ずつ bmp565形式 128×128=16384回アクセス 
・1行(16bit×128=256Byte)ずつ bmp565形式 128回アクセス 
約86% 
↓コントローラの形式に合わせることで処理を減らす
• PortOut (pin30,29,8,7,6,5,28,27) 
• port0の使用! 
http://developer.mbed.org/users/nxp_ip/notebook/parallel-bus-access/ 
PortOut P0(Port0, 0x00000FF0); 
さらに高速化するために 
ポートレジスタを直接叩く※ 
8bit連続で出ている 
31 15 0 
27 28 5 6 7 8 29 30 
※厳密にはPortOutでも間に処理入ってるので“直接”ではない
void LCD_Write_CMD(unsigned char a) 
{ 
CS0=0; 
RD=1; 
CD=0; 
P0=(unsigned)a<<4; 
WR=0; 
WR=1; 
CS0=1; 
} 
! 
void LCD_Write_Data(unsigned char b) 
{ 
CS0=0; 
RD=1; 
CD=1; 
P0=(unsigned)b<<4; 
WR=0; 
WR=1; 
CS0=1; 
} 
unsigned char(8bit) 
31 15 0 
unsigned(32bit) 
27 28 5 6 7 8 29 30
• PortOut (pin30,29,8,7,6,5,28,27) 
SPI 2 SPI 1 
PortOut port0使用宣言 
 →2つのSPIがport0に存在 
  →SPIが使えない 
   →SDカード接続不可 
→LPCXpresso NXP LPC1769なら可能?! 
(Port0~2すべてのピンが表に出ている)

More Related Content

What's hot

Raspberry pi-2 b-v1.2-schematics
Raspberry pi-2 b-v1.2-schematicsRaspberry pi-2 b-v1.2-schematics
Raspberry pi-2 b-v1.2-schematicshacguest
 
Aditech innodisk-flash disk technology
Aditech innodisk-flash disk technologyAditech innodisk-flash disk technology
Aditech innodisk-flash disk technologyVilas Fulsundar
 
Computer repair hand book
Computer repair hand bookComputer repair hand book
Computer repair hand bookRoth Tithvisal
 
Interface - Specialized -Integrated Circuits (ICs) - componentship.com
Interface - Specialized -Integrated Circuits (ICs) - componentship.comInterface - Specialized -Integrated Circuits (ICs) - componentship.com
Interface - Specialized -Integrated Circuits (ICs) - componentship.com燕 欧
 
Atmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileAtmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileABHISHEK MAURYA
 
Fit pc-product-line-overview
Fit pc-product-line-overviewFit pc-product-line-overview
Fit pc-product-line-overviewabenitop
 
ကြန္ ျပုျပင္ စီမံ
ကြန္ ျပုျပင္ စီမံကြန္ ျပုျပင္ စီမံ
ကြန္ ျပုျပင္ စီမံPhyo Lay
 
Getting started with digital modes
Getting started with digital modesGetting started with digital modes
Getting started with digital modesskutaboot
 
Apple A10 Series Application Processor
Apple A10 Series Application ProcessorApple A10 Series Application Processor
Apple A10 Series Application ProcessorJJ Wu
 
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup
 
Compare between FPGA , ARDUINO , ASIC ..
Compare between FPGA , ARDUINO , ASIC ..Compare between FPGA , ARDUINO , ASIC ..
Compare between FPGA , ARDUINO , ASIC ..Mohamed Youssery
 
Introducing LG G Watch
Introducing LG G WatchIntroducing LG G Watch
Introducing LG G WatchJJ Wu
 

What's hot (19)

Raspberry pi-2 b-v1.2-schematics
Raspberry pi-2 b-v1.2-schematicsRaspberry pi-2 b-v1.2-schematics
Raspberry pi-2 b-v1.2-schematics
 
59. 5800EV+.PDF
59. 5800EV+.PDF59. 5800EV+.PDF
59. 5800EV+.PDF
 
Aditech innodisk-flash disk technology
Aditech innodisk-flash disk technologyAditech innodisk-flash disk technology
Aditech innodisk-flash disk technology
 
Muda Proposal
Muda ProposalMuda Proposal
Muda Proposal
 
Computer repair hand book
Computer repair hand bookComputer repair hand book
Computer repair hand book
 
Vga Pinout
Vga PinoutVga Pinout
Vga Pinout
 
Spec00467
Spec00467Spec00467
Spec00467
 
Interface - Specialized -Integrated Circuits (ICs) - componentship.com
Interface - Specialized -Integrated Circuits (ICs) - componentship.comInterface - Specialized -Integrated Circuits (ICs) - componentship.com
Interface - Specialized -Integrated Circuits (ICs) - componentship.com
 
Copy of price sck sby 25 maret
Copy of price sck sby 25 maretCopy of price sck sby 25 maret
Copy of price sck sby 25 maret
 
Electronic SoC
Electronic SoCElectronic SoC
Electronic SoC
 
Atmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileAtmega lcd programing_with_header_file
Atmega lcd programing_with_header_file
 
vidéosurveillance IP et HD a Marrakech
vidéosurveillance  IP et HD a Marrakech vidéosurveillance  IP et HD a Marrakech
vidéosurveillance IP et HD a Marrakech
 
Fit pc-product-line-overview
Fit pc-product-line-overviewFit pc-product-line-overview
Fit pc-product-line-overview
 
ကြန္ ျပုျပင္ စီမံ
ကြန္ ျပုျပင္ စီမံကြန္ ျပုျပင္ စီမံ
ကြန္ ျပုျပင္ စီမံ
 
Getting started with digital modes
Getting started with digital modesGetting started with digital modes
Getting started with digital modes
 
Apple A10 Series Application Processor
Apple A10 Series Application ProcessorApple A10 Series Application Processor
Apple A10 Series Application Processor
 
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
Athens IoT Meetup #3 - Introduction to ESP8266 (Pavlos Isaris)
 
Compare between FPGA , ARDUINO , ASIC ..
Compare between FPGA , ARDUINO , ASIC ..Compare between FPGA , ARDUINO , ASIC ..
Compare between FPGA , ARDUINO , ASIC ..
 
Introducing LG G Watch
Introducing LG G WatchIntroducing LG G Watch
Introducing LG G Watch
 

Viewers also liked

拡張ライブラリ作成による高速化
拡張ライブラリ作成による高速化拡張ライブラリ作成による高速化
拡張ライブラリ作成による高速化Kazunori Jo
 
セプキャン参加者の個性
セプキャン参加者の個性セプキャン参加者の個性
セプキャン参加者の個性Kazunori Jo
 
プッシュ通知サービスを利用した 火山活動情報配信の試み
プッシュ通知サービスを利用した 火山活動情報配信の試みプッシュ通知サービスを利用した 火山活動情報配信の試み
プッシュ通知サービスを利用した 火山活動情報配信の試みKei Yoshimura
 
Innovation, how to make it
Innovation, how to make itInnovation, how to make it
Innovation, how to make itOsaka University
 
トイレにRESTfulなAPIを実装してみた
トイレにRESTfulなAPIを実装してみたトイレにRESTfulなAPIを実装してみた
トイレにRESTfulなAPIを実装してみたKei Yoshimura
 

Viewers also liked (6)

卒研発表
卒研発表卒研発表
卒研発表
 
拡張ライブラリ作成による高速化
拡張ライブラリ作成による高速化拡張ライブラリ作成による高速化
拡張ライブラリ作成による高速化
 
セプキャン参加者の個性
セプキャン参加者の個性セプキャン参加者の個性
セプキャン参加者の個性
 
プッシュ通知サービスを利用した 火山活動情報配信の試み
プッシュ通知サービスを利用した 火山活動情報配信の試みプッシュ通知サービスを利用した 火山活動情報配信の試み
プッシュ通知サービスを利用した 火山活動情報配信の試み
 
Innovation, how to make it
Innovation, how to make itInnovation, how to make it
Innovation, how to make it
 
トイレにRESTfulなAPIを実装してみた
トイレにRESTfulなAPIを実装してみたトイレにRESTfulなAPIを実装してみた
トイレにRESTfulなAPIを実装してみた
 

Similar to how to use ZY-FGD1442701V1 with mbed

VGA VHDL RTL design tutorial
VGA  VHDL   RTL design tutorialVGA  VHDL   RTL design tutorial
VGA VHDL RTL design tutorialNabil Chouba
 
Expanding The Micro Blaze System
Expanding  The Micro Blaze  SystemExpanding  The Micro Blaze  System
Expanding The Micro Blaze Systemiuui
 
Quanta ze7 r1b_schematics
Quanta ze7 r1b_schematicsQuanta ze7 r1b_schematics
Quanta ze7 r1b_schematicsDATACORP
 
Point Of Sale Systems Latest Products And Its Features
Point Of Sale Systems Latest Products And Its FeaturesPoint Of Sale Systems Latest Products And Its Features
Point Of Sale Systems Latest Products And Its FeaturesYelena point of sales system
 
MicroLab2 2011.pptx
MicroLab2 2011.pptxMicroLab2 2011.pptx
MicroLab2 2011.pptxHebaEng
 
An Overview of Arm-9 32-bit MCU TMPA910 Series
An Overview of Arm-9 32-bit MCU TMPA910 Series An Overview of Arm-9 32-bit MCU TMPA910 Series
An Overview of Arm-9 32-bit MCU TMPA910 Series Premier Farnell
 
Jade SoC Graphics Controllers
Jade SoC Graphics ControllersJade SoC Graphics Controllers
Jade SoC Graphics ControllersPremier Farnell
 
Displaying Animated Images on GLCD display with LPC2148 Microcontroller
Displaying Animated Images on GLCD display with LPC2148 MicrocontrollerDisplaying Animated Images on GLCD display with LPC2148 Microcontroller
Displaying Animated Images on GLCD display with LPC2148 MicrocontrollerOmkar Rane
 
SeaPort Systems Rugged 4U HPC Workstation - System Data Sheet
SeaPort Systems Rugged 4U HPC Workstation - System Data SheetSeaPort Systems Rugged 4U HPC Workstation - System Data Sheet
SeaPort Systems Rugged 4U HPC Workstation - System Data SheetDarin George
 
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT ApplicationsMYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT ApplicationsLinda Zhang
 

Similar to how to use ZY-FGD1442701V1 with mbed (20)

VGA VHDL RTL design tutorial
VGA  VHDL   RTL design tutorialVGA  VHDL   RTL design tutorial
VGA VHDL RTL design tutorial
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
A2 Video Streamer
A2 Video StreamerA2 Video Streamer
A2 Video Streamer
 
S5L2010 datasheet
S5L2010 datasheetS5L2010 datasheet
S5L2010 datasheet
 
Expanding The Micro Blaze System
Expanding  The Micro Blaze  SystemExpanding  The Micro Blaze  System
Expanding The Micro Blaze System
 
report cs
report csreport cs
report cs
 
Dv3
Dv3Dv3
Dv3
 
Microcontroller part 4
Microcontroller part 4Microcontroller part 4
Microcontroller part 4
 
Quanta ze7 r1b_schematics
Quanta ze7 r1b_schematicsQuanta ze7 r1b_schematics
Quanta ze7 r1b_schematics
 
Pic16 c7x
Pic16 c7xPic16 c7x
Pic16 c7x
 
Point Of Sale Systems Latest Products And Its Features
Point Of Sale Systems Latest Products And Its FeaturesPoint Of Sale Systems Latest Products And Its Features
Point Of Sale Systems Latest Products And Its Features
 
MicroLab2 2011.pptx
MicroLab2 2011.pptxMicroLab2 2011.pptx
MicroLab2 2011.pptx
 
An Overview of Arm-9 32-bit MCU TMPA910 Series
An Overview of Arm-9 32-bit MCU TMPA910 Series An Overview of Arm-9 32-bit MCU TMPA910 Series
An Overview of Arm-9 32-bit MCU TMPA910 Series
 
Jade SoC Graphics Controllers
Jade SoC Graphics ControllersJade SoC Graphics Controllers
Jade SoC Graphics Controllers
 
Utft
UtftUtft
Utft
 
Displaying Animated Images on GLCD display with LPC2148 Microcontroller
Displaying Animated Images on GLCD display with LPC2148 MicrocontrollerDisplaying Animated Images on GLCD display with LPC2148 Microcontroller
Displaying Animated Images on GLCD display with LPC2148 Microcontroller
 
SeaPort Systems Rugged 4U HPC Workstation - System Data Sheet
SeaPort Systems Rugged 4U HPC Workstation - System Data SheetSeaPort Systems Rugged 4U HPC Workstation - System Data Sheet
SeaPort Systems Rugged 4U HPC Workstation - System Data Sheet
 
Dx diag
Dx diagDx diag
Dx diag
 
Real
RealReal
Real
 
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT ApplicationsMYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
MYS-6ULX Single Board Computer for Industry 4.0 and IoT Applications
 

Recently uploaded

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Recently uploaded (20)

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

how to use ZY-FGD1442701V1 with mbed

  • 2. ZY-FGD1442701V1 (ST7735S) • 1.44インチTFT液晶モジュール • 解像度:128x128 • コントローラチップ:ST7735S • 表示領域:26.496×25.4976mm • 接続インターフェース:8bitパラレル • 0.8mmピッチ27ピンFPC • http://www.aitendo.com/product/1621 →データシート、初期化コード あり! ! ST7735搭載版は販売終了! →非S版とS版でコマンドに変更あり
  • 3.
  • 4. LCD_Write_CMD(0xE0); // Gamma Adjustment (+Polarity) LCD_Write_Data(0x03); LCD_Write_Data(0x1B); LCD_Write_Data(0x09); LCD_Write_Data(0x0E); LCD_Write_Data(0x32); LCD_Write_Data(0x2D); LCD_Write_Data(0x28); LCD_Write_Data(0x2C); LCD_Write_Data(0x2B); LCD_Write_Data(0x29); LCD_Write_Data(0x30); LCD_Write_Data(0x3B); LCD_Write_Data(0x00); LCD_Write_Data(0x01); LCD_Write_Data(0x02); LCD_Write_Data(0x10); LCD_Write_CMD(0xE1); // Gamma Adjustment (-Polarity) LCD_Write_Data(0x03); LCD_Write_Data(0x1B); LCD_Write_Data(0x09); LCD_Write_Data(0x0E); LCD_Write_Data(0x32); LCD_Write_Data(0x2E); LCD_Write_Data(0x28); LCD_Write_Data(0x2C); LCD_Write_Data(0x2B); LCD_Write_Data(0x28); LCD_Write_Data(0x31); LCD_Write_Data(0x3C); LCD_Write_Data(0x00); LCD_Write_Data(0x00); LCD_Write_Data(0x02); LCD_Write_Data(0x10); ! LCD_Write_CMD(0x3A); // Interface Pixel Format LCD_Write_Data(0x05); // 16-bit/pixel ! LCD_Write_CMD(0x2A); // Column Address Set LCD_Write_Data(0x00); LCD_Write_Data(0x02); LCD_Write_Data(0x00); LCD_Write_Data(0x81); LCD_Write_CMD(0x2B); // Row Address Set LCD_Write_Data(0x00); LCD_Write_Data(0x01); LCD_Write_Data(0x00); LCD_Write_Data(0x80); ! wait_ms(100); LCD_Write_CMD(0x2C); // Memory Write } aitendoが公開している初期化コードを ベースに若干の変更・追加 (+コメント) 初期化 void LCD_Init(void) { LCD_Reset(); ! LCD_Write_CMD(0xB1); // In Normal Mode(Full Colors) Frame rate 80Hz LCD_Write_Data(0x02); LCD_Write_Data(0x35); LCD_Write_Data(0x36); ! LCD_Write_CMD(0xB2); // In Idle Mode(8-colors) LCD_Write_Data(0x02); LCD_Write_Data(0x35); LCD_Write_Data(0x36); ! LCD_Write_CMD(0xB3); // In Partial Mode + Full Colors LCD_Write_Data(0x02); LCD_Write_Data(0x35); LCD_Write_Data(0x36); LCD_Write_Data(0x02); LCD_Write_Data(0x35); LCD_Write_Data(0x36); ! LCD_Write_CMD(0xB4); // Dot Inversion Control LCD_Write_Data(0x03); // Inversion setting in Idle mode and full Colors partial mode ! LCD_Write_CMD(0xC0); // Power Control Setting (GVDD Voltage) LCD_Write_Data(0xA2); // AVDD=5, GVDD=4.6 LCD_Write_Data(0x02); // VGCL=-4.6 LCD_Write_Data(0x84); // MODE=AUTO ! LCD_Write_CMD(0xC1); // Power Control Setting (VGH/VGL Voltage) LCD_Write_Data(0xC5); // VGH and VGL supply power level = 2.4, VGL=-10, VGH=3*AVDD-0.5 ! LCD_Write_CMD(0xC2); // In Normal Mode(Full Colors) APA/DCA LCD_Write_Data(0x0D); // SAP=Small, AP=Large LCD_Write_Data(0x00); // Clock frequency for Booster circuit/1,/3,/1,/1,/1 ! LCD_Write_CMD(0xC3); // In Idle Mode(8-colors) APA/DCA LCD_Write_Data(0x8D); LCD_Write_Data(0xEA); ! LCD_Write_CMD(0xC4); // In Partial Mode(Full Colors) APA/DCA LCD_Write_Data(0x8D); LCD_Write_Data(0xEE); ! LCD_Write_CMD(0xC5); // VCOM LCD_Write_Data(0x05); // -0.55 ! LCD_Write_CMD(0x36); // Memory Data Access Control LCD_Write_Data(0x48); // MX, RGB mode (Row Address Order, RGB color filter panel)
  • 5. コマンド・データ送信、リセット void LCD_Write_CMD(unsigned char cmd) { CS0=0; RD=1; CD=0; P1=cmd; WR=0; WR=1; CS0=1; } ! void LCD_Write_Data(unsigned char d) { CS0=0; RD=1; CD=1; P1=d; WR=0; WR=1; CS0=1; } ! void LCD_Reset(void) { RSTB=1; wait_ms(1); RSTB=0; wait_ms(1); RSTB=1; wait_ms(120); LCD_Write_CMD(0x11); // Sleep Out and Booster On wait_ms(120); } RSTB CS0 CD RD WR RSTB
  • 6. 8-bit Data Bus for 16-bit/Pixel! (RGB 5-6-5-bit Input)! 65535色 (16bitカラー) 128px 128px
  • 7. LCD_Write_CMD(0x3A); // Interface Pixel Format LCD_Write_Data(0x05); // 16-bit/pixel LCD_Write_CMD(0x2A); // Column Address Set LCD_Write_Data(0x00); LCD_Write_Data(0x02); LCD_Write_Data(0x00); LCD_Write_Data(0x81); LCD_Write_CMD(0x2B); // Row Address Set LCD_Write_Data(0x00); LCD_Write_Data(0x01); LCD_Write_Data(0x00); LCD_Write_Data(0x80); ※図は132×132ドットの場合 Y:02h,81h = 128列! X:01h,80h = 128行
  • 8.
  • 9. • BusOut (pin10-17) main.cpp BusOut P1(p17, p16, p15, p14, p13, p12, p11, p10); DigitalOut CS0(p21); DigitalOut CD(p22); DigitalOut RD(p23); DigitalOut WR(p24); DigitalOut RSTB(p25); ! LocalFileSystem local("local"); 描画速度:669ms → 遅い  →LocalFileSystem(内蔵Flash)からのfreadが遅い
  • 10. SD追加 SDHC 8GB (Class10)
  • 12. • BusOut (pin10-17) main.cpp BusOut P1(p17, p16, p15, p14, p13, p12, p11, p10); DigitalOut CS0(p21); DigitalOut CD(p22); DigitalOut RD(p23); DigitalOut WR(p24); DigitalOut RSTB(p25); ! SDFileSystem sd(p5, p6, p7, p8, "sd"); ! SDHCFileSystem.cpp #230 _spi.frequency(32000000); //32MHz 描画速度:230ms → 3倍くらい高速化  →SDFileSystem(SDカード)からのfreadが高速   (SPI 32MHz)
  • 13. もっと高速に描画したい 1. アクセス回数と処理を減らす 2. RAMに画像を全て展開して書き込み Bitmap画像のサイズ=32KBくらい mbed1768のRAMサイズ=32KB (USB/Ethernetの予約分まで拡張すると64KB) 3. ポートレジスタに直接アクセス ちょっと 厳しい?
  • 14. アクセス回数と処理を減らして描画高速化 ・1Byte(8bit)ずつ bmp555形式 128×128×2=32768回アクセス235ms unsigned short pixel; ! for (i=0; i<128*128; i++) { fread(&pixel, 2, 1, fp); LCD_Write_Data((unsigned char)((pixel & 0xFFFF) >> 8)); LCD_Write_Data((unsigned char)pixel); } unsigned short pixel[128]; ! for (i=0; i<128; i++) { fread(&pixel, 2, 128, fp); for(j=0; j<128; j++) { LCD_Write_Data((unsigned char)((pixel & 0xFFFF) >> 8)); LCD_Write_Data((unsigned char)pixel); } } 約91% 215ms 185ms ・1pixel(16bit)ずつ bmp565形式 128×128=16384回アクセス ・1行(16bit×128=256Byte)ずつ bmp565形式 128回アクセス 約86% ↓コントローラの形式に合わせることで処理を減らす
  • 15. • PortOut (pin30,29,8,7,6,5,28,27) • port0の使用! http://developer.mbed.org/users/nxp_ip/notebook/parallel-bus-access/ PortOut P0(Port0, 0x00000FF0); さらに高速化するために ポートレジスタを直接叩く※ 8bit連続で出ている 31 15 0 27 28 5 6 7 8 29 30 ※厳密にはPortOutでも間に処理入ってるので“直接”ではない
  • 16. void LCD_Write_CMD(unsigned char a) { CS0=0; RD=1; CD=0; P0=(unsigned)a<<4; WR=0; WR=1; CS0=1; } ! void LCD_Write_Data(unsigned char b) { CS0=0; RD=1; CD=1; P0=(unsigned)b<<4; WR=0; WR=1; CS0=1; } unsigned char(8bit) 31 15 0 unsigned(32bit) 27 28 5 6 7 8 29 30
  • 17.
  • 18. • PortOut (pin30,29,8,7,6,5,28,27) SPI 2 SPI 1 PortOut port0使用宣言  →2つのSPIがport0に存在   →SPIが使えない    →SDカード接続不可 →LPCXpresso NXP LPC1769なら可能?! (Port0~2すべてのピンが表に出ている)