AVR Microbasic TFT ILI9325 LCD Proteus仿真

时间:2015-12-12 13:05:45

标签: basic lcd

如果有人使用带有ILI9325显示控制器的诺基亚N96液晶显示器,请告诉我。

我正在编写有助于在屏幕上显示字符的基本代码。屏幕是320×240像素矩阵。控制器提供GRAM(图形RAM)存储器,我们在其中写入数据以显示相应的字符。

我发现TFT ILI9325的Proteus库形成了这个链接: dll file of ILI9325 GLCD for proteusProteus simulation on bascom

所以当我想用下面的代码将它改成mirobasic软件时,LCD不显示任何东西!!!

基于ILI9325的微生物代码数据表:

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.

Proteus的代码是[Here]:

www.filepi.com/i/1pnpxUD

,结果与此图片相同:

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

1 个答案:

答案 0 :(得分:0)

没有答案! 所以我在这里找到了正确的答案和适用于AVR的MikroC代码:

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