首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AVR微基TFT ILI9325液晶变形器模拟

AVR微基TFT ILI9325液晶变形器模拟
EN

Stack Overflow用户
提问于 2015-12-12 13:05:44
回答 1查看 2.3K关注 0票数 0

如果有人与诺基亚N96液晶显示与ILI9325显示控制器,请让我知道。

我正在编写基本代码,帮助在屏幕上显示字符。屏幕为320乘240像素矩阵。控制器提供了一个图形RAM(Graphics)存储器,我们在其中写入数据以显示相应的字符。

我找到了用于TFT ILI9325的Proteus库,形成了以下链接:变形杆菌ILI9325 GLCD的dll文件基于bascom的Proteus仿真

因此,当我想用下面的代码将其转换为mirobasic软件时,LCD不显示任何东西!

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

代码语言:javascript
复制
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

EN

回答 1

Stack Overflow用户

发布于 2015-12-14 17:51:02

没有回答!因此,我找到了正确的答案和适当的代码与MikroC的AVR在这里:

C.主要:

代码语言:javascript
复制
    //================================ 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模拟

在这个文件中使用Proteus模拟的其他文件:

http://filepi.com/i/VlZM9PN

供下载的文件

真诚的您: Soheil sabz

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34240154

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档