tft彩屏如何調(diào)試出來_第1頁
tft彩屏如何調(diào)試出來_第2頁
tft彩屏如何調(diào)試出來_第3頁
tft彩屏如何調(diào)試出來_第4頁
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、#include<avr/io.h> #include <util/delay.h> #define F_CPU 8000000 /CS:PA0 /RS:PA1 /WR:PA2 /RD:PA3 /RST:PA4 /8λģʽPC¡¾0-7¡¿ void writecom(unsigned int ch)/дָÁî PORTA=0XFF; PORTA=0B11111101;/RSµÍ P

2、ORTA=0B11111100;/CSµÍ PORTC=ch>>8;/¸³Öµ¸ß°Ëλ PORTA=0B11111000;/WRµÍ asm("nop");/Õâ¸öÓÐûÓж¼¿ÉÒÔ£¬·ÂÕæ&

3、#181;ÄʱºòÓõġ£ PORTA=0B11111100;/WR¸ß PORTC=ch&0x00ff;/¸³ÖµµÍ°Ëλ PORTA=0B11111000;/WRµÍ asm("nop"); PORTA=0B11111100;/WR¸ß PORTA=0B11111101;/CS¸

4、;ß PORTA=0XFF; void writedata(unsigned int dh)/дÊý¾Ý PORTA=0XFF; PORTA=0B11111111;/RS¸ß PORTA=0B11111110;/CSµÍ PORTC=dh>>8; PORTA=0B11111010;/WRµÍ asm("nop"); PORTA=0B11111110;/WR¸ß PORTC=dh&0x00ff; PORTA

5、=0B11111010;/WRµÍ asm("nop"); PORTA=0B11111110;/WR¸ß PORTA=0B11111111;/CS¸ß void main_w_c_d(unsigned int com1, unsigned int data)/дָÁî&Êý¾Ý writecom(com1); writedata(data); void addset(unsigned int x1,uns

6、igned int y1,unsigned x2,unsigned y2) main_w_c_d(0x0020,x1);/ÉèÖÃX×ø±êλÖà main_w_c_d(0x0021,y1);/ÉèÖÃY×ø±êλÖà main_w_c_d(0x0050,x1); /¿ªÊ¼X main_w_c_d(0x0052,

7、y1);/¿ªÊ¼Y main_w_c_d(0x0051,x2); /½áÊøX main_w_c_d(0x0053,y2); /½áÊøY writecom(0x0022); void init() PORTA=0B11101111;/RST¸´Î» _delay_ms(10); PORTA=0B11111111; _delay_ms(200); /* Start Initial Sequence */ writecom(0x00E5

8、); writedata(0x78F0); / set SRAM internal timing writecom(0x0001); writedata(0x0100); / set SS and SM bit writecom(0x0002); writedata(0x0700); / set 1 line inversion writecom(0x0003); writedata(0x1030); / set GRAM write direction and BGR=1. writecom(0x0004); writedata(0x0000); / Resize register writ

9、ecom(0x0008); writedata(0x0207); / set the back porch and front porch writecom(0x0009); writedata(0x0000); / set non-display area refresh cycle ISC3:0 writecom(0x000A); writedata(0x0000); / FMARK function writecom(0x000C); writedata(0x0000); / RGB interface setting writecom(0x000D); writedata(0x0000

10、); / Frame marker Position writecom(0x000F); writedata(0x0000); / RGB interface polarity /*Power On sequence */ writecom(0x0010); writedata(0x0000); / SAP, BT3:0, AP, DSTB, SLP, STB writecom(0x0011); writedata(0x0007); / DC12:0, DC02:0, VC2:0 writecom(0x0012); writedata(0x0000); / VREG1OUT voltage w

11、ritecom(0x0013); writedata(0x0000); / VDV4:0 for VCOM amplitude writecom(0x0007); writedata(0x0001); _delay_ms(200); / Dis-charge capacitor power voltage writecom(0x0010); writedata(0x1090); / 1490/SAP, BT3:0, AP, DSTB, SLP, STB writecom(0x0011); writedata(0x0227); / DC12:0, DC02:0, VC2:0 _delay_ms(

12、50); / Delay 50ms writecom(0x0012); writedata(0x001F); /001C/ Internal reference voltage= Vci; _delay_ms(50); / Delay 50ms writecom(0x0013); writedata(0x1500); /0x1000/1400 Set VDV4:0 for VCOM amplitude 1A00 writecom(0x0029); writedata(0x0027); /0x0012 /001a Set VCM5:0 for VCOMH /0x0025 0034 writeco

13、m(0x002B); writedata(0x000D); / Set Frame Rate 000C _delay_ms(50); / Delay 50ms writecom(0x0020); writedata(0x0000); / GRAM horizontal Address writecom(0x0021); writedata(0x0000); / GRAM Vertical Address / - Adjust the Gamma Curve -/ writecom(0x0030); writedata(0x0000); writecom(0x0031); writedata(0

14、x0707); writecom(0x0032); writedata(0x0307); writecom(0x0035); writedata(0x0200); writecom(0x0036); writedata(0x0008);/0207 writecom(0x0037); writedata(0x0004);/0306 writecom(0x0038); writedata(0x0000);/0102 writecom(0x0039); writedata(0x0707);/0707 writecom(0x003C); writedata(0x0002);/0702 writecom

15、(0x003D); writedata(0x1D04);/1604 /- Set GRAM area -/ writecom(0x0050); writedata(0x0000); / Horizontal GRAM Start Address writecom(0x0051); writedata(0x00EF); / Horizontal GRAM End Address writecom(0x0052); writedata(0x0000); / Vertical GRAM Start Address writecom(0x0053); writedata(0x013F); / Vert

16、ical GRAM Start Address writecom(0x0060); writedata(0xA700); / Gate Scan Line writecom(0x0061); writedata(0x0001); / NDL,VLE, REV writecom(0x006A); writedata(0x0000); / set scrolling line /- Partial Display Control -/ writecom(0x0080); writedata(0x0000); writecom(0x0081); writedata(0x0000); writecom

17、(0x0082); writedata(0x0000); writecom(0x0083); writedata(0x0000); writecom(0x0084); writedata(0x0000); writecom(0x0085); writedata(0x0000); /- Panel Control -/ writecom(0x0090); writedata(0x0010); writecom(0x0092); writedata(0x0600); writecom(0x0007); writedata(0x0133); / 262K color and display ON void pant(unsigned int color)/µ¥Ò&#

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論