如果有人与诺基亚N96液晶显示与ILI9325显示控制器,请让我知道。
我正在编写基本代码,帮助在屏幕上显示字符。屏幕为320乘240像素矩阵。控制器提供了一个图形RAM(Graphics)存储器,我们在其中写入数据以显示相应的字符。
我找到了用于TFT ILI9325的Proteus库,形成了以下链接:变形杆菌ILI9325 GLCD的dll文件和基于bascom的Proteus仿真
因此,当我想用下面的代码将其转换为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的代码在这里
www.filepi.com/i/1pnpxUD
其结果与这幅图片相同:
www.i.stack.imgur.com/7xsR2.jpg
发布于 2015-12-14 17:51:02
没有回答!因此,我找到了正确的答案和适当的代码与MikroC的AVR在这里:
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模拟的其他文件:
http://filepi.com/i/VlZM9PN
供下载的文件
真诚的您: Soheil sabz
https://stackoverflow.com/questions/34240154
复制相似问题