2015-12-12 28 views
0

如果有人使用帶有ILI9325顯示控制器的諾基亞N96液晶顯示器,請告訴我。AVR Microbasic TFT ILI9325 LCD Proteus仿真

我正在寫基本代碼,可以幫助在屏幕上顯示一個字符。屏幕是320×240像素的矩陣。該控制器提供了一個GRAM(圖形RAM)存儲器,我們在這裏寫入數據以顯示相應的字符。

我發現Proteus的庫TFT ILI9325形成此鏈接: dll file of ILI9325 GLCD for proteusProteus simulation on bascom

這樣,我想將它與下面的代碼更改爲mirobasic軟件,LCD不顯示任何東西!

基於ILI9325數據表的Microbasic代碼:

program MyProject 

'******************************************************************************* 
'----- Color LCD CONFIG -------------------------------------------------------- 
'******************************************************************************* 


dim Back_light as sbit at Portg0_bit 
dim Color_lcd_cs as sbit at Porta3_bit 
dim Color_lcd_rs as sbit at PORTa0_bit 
dim Color_lcd_wr as sbit at PORTa1_bit 
dim Color_lcd_rd as sbit at PORTa2_bit 
dim Color_lcd_rst as sbit at PORTa4_bit 


dim Color_lcd_lsb_port as byte at PORTD ' this is where PORTAlias is fully defined 
dim Color_lcd_msb_port as byte at PORTE ' this is where PORTAlias is fully defined 


Dim Entry_mod As Word          'Horizantal=&H1028,Vertical=&H1030 
Dim Color_lcd_index As Byte         'Index Variable 
Dim Color_lcd_data As Word         'Data Variable 
Dim Lcd_buff As String [ 25] 
Dim xX As Word 
Dim Yy As Word 
Dim O As Word 
Dim X_c As Word 
Dim Y_c As Word 





'******************************************************************************* 
'******************************************************************************* 
'----- COLOR LCD SUBROUTINES --------------------------------------------------- 
'******************************************************************************* 
'******************************************************************************* 
Sub procedure Triger_color_lcd() 
Color_lcd_rst=0 
delay_ms(60) 
Color_lcd_rst=1 
delay_ms(200)Color_lcd_index = 0xE3 '' Write_color_lcd_index 
Color_lcd_data = 0x3008 '' Write_color_lcd_data 
Color_lcd_index = 0x00E7 '' Write_color_lcd_index 
Color_lcd_data = 0x0000 '' Write_color_lcd_data 
End Sub 


Sub procedure Write_color_lcd_index() 
Color_lcd_cs=0 
Color_lcd_rs=0 
Color_lcd_rd=1 
Color_lcd_msb_port = 0x00 
Color_lcd_lsb_port = Color_lcd_index 
Color_lcd_wr=0 
Color_lcd_wr=1 
Color_lcd_cs=1 
End Sub 

Sub procedure Write_color_lcd_data() 
Color_lcd_cs=0 
Color_lcd_rs=1 
Color_lcd_rd=1 
Color_lcd_msb_port = Hi(color_lcd_data) 
Color_lcd_lsb_port = Lo(color_lcd_data) 
Color_lcd_wr= 
Color_lcd_wr=1 
Color_lcd_cs=1 
end sub 


'******************************************************************************* 

main: 


Color_lcd_index = 0x13 '' Write_color_lcd_index 
Color_lcd_data = 0x1111 '' Write_color_lcd_data 

Write_color_lcd_index() 
Write_color_lcd_data() 
while True 


wend 
' Main program 
end. 

與變形蟲的代碼是[這裏]:

www.filepi.com/i/1pnpxUD

和結果與此圖相同:

www.i.stack.imgur.com/7xsR2.jpg

回答

0

沒有回答! 所以我找到了正確的答案和正確的代碼與MIKROC用於AVR這裏:

的main.c:

//================================ LCD CONFIGURATIONS ======================================= 
#define PORTRAIT 

#define LCD_CONTROLPORT_DDR DDRA 
#define LCD_CONTROLPORT_PORT PORTA 
#define LCD_CONTROLPORT_PIN PINA 

#define LCD_RST_DDR DDRA 
#define LCD_RST_PORT PORTA 
#define LCD_RST_PIN 4 

#define LCD_RS_DDR DDRA 
#define LCD_RS_PORT PORTA 
#define LCD_RS_PIN 0 

#define LCD_CS_DDR DDRA 
#define LCD_CS_PORT PORTA 
#define LCD_CS_PIN 3 

#define LCD_RD_DDR DDRA 
#define LCD_RD_PORT PORTA 
#define LCD_RD_PIN 2 

#define LCD_WR_DDR DDRA 
#define LCD_WR_PORT PORTA 
#define LCD_WR_PIN 1 

#define LCD_DATAPORT_MSB_DDR DDRE 
#define LCD_DATAPORT_MSB_PORT PORTE 
#define LCD_DATAPORT_MSB_PIN PINE 

#define LCD_DATAPORT_LSB_DDR DDRD 
#define LCD_DATAPORT_LSB_PORT PORTD 
#define LCD_DATAPORT_LSB_PIN PIND 



//================================================================ 

#include "tftlcd_functions.h" 

void main(void) 
{ 
lcd_init(); 
// lcd_background_color(GREEN); 
while (1) 
     { 

     lcd_gotoxy(11,11); 
     lcd_putsf(" TFT LCD 2.8' ",0x0000,0,RED); 
     lcd_gotoxy(11,11); 
     lcd_putsf(" www.Elasa.ir ",0x0000,0,BLUE); 
     Delay_ms(200); 
     lcd_clear_screen(); 
     lcd_background_color(BLACK); 
     lcd_draw_line(5,5,50,50,0xFFFF); 
     lcd_draw_rectangle(30,30,80,80,0,0XFFFF); 
     lcd_draw_circle(150,150,25,0,0xffff); 
     Delay_ms(200); 
     } 
} 

Proteus Simulation

,並在此文件中的其他文件與Proteus仿真:

http://filepi.com/i/VlZM9PN

Files for Download

此致敬禮: Soheil sabz