ATmega16+LCD12864液晶显示程序技术报告.docVIP

  • 8
  • 0
  • 约8.69千字
  • 约 7页
  • 2016-04-27 发布于湖北
  • 举报
基于CVAVR的12864(ST7920)的应用(参考伟纳实验仪) //12864接法:PA口为数据口(DB7~DB0),RS~PC0,RW~PC1,EN~PC2,PSB即CS1(CS2不用即不接)PC3,RST~PC5。 /***************************************************** This program was produced by the CodeWizardAVR V2.04.4a Advanced Automatic Program Generator ?Copyright 1998-2009 Pavel Haiduc, HP InfoTech s.r.l. Chip type : ATmega16 Program type : Application AVR Core Clock frequency: 4.000000 MHz Memory model : Small External RAM size : 0 Data Stack size : 256 *****************************************************/ #include mega16.h #include delay.h #define uchar unsigned char #define uint unsigned int #define LCD_RS 0 //寄存器选择输入PC0 #define LCD_RW 1 //液晶读/写控制PC1 #define LCD_EN 2 //液晶使能控制PC2 #define LCD_PSB 3 //串/并方式控制PC3 即CS1(CS2不用) #define LCD_RST 5 //液晶复位端口PC5 #define busy 7 //LCD_DB7,PA7 uchar const cdis1[] = {硕飞科技伟纳电子}; uchar const cdis2[] = { WWW.WILLAR.COM }; uchar const cdis3[] = {ME850_开发实验仪}; uchar const cdis4[] = {TEL:077584867757}; /********************************************************** 图形数据 **********************************************************/ uchar flash Photo1[]={//伟纳电子,64行*16字节 }; /*****************************************************************************/ uchar flash Photo2[]={ //海豚戏水,64行*16字节 }; uchar flash Photo3[]={ //美女,64行*16字节 }; /********************************************************** * * * IO口初始化 * * * **********************************************************/ void init_io(void) { DDRA=0xFF; //置PA口输出 PORTA=0xFF; //PA口设置内部上拉电阻 DDRB=0xFF; //置PB口输出 PORTB=0xFF; //PB口设置内部上拉电阻 DDRC=0xFF; //置PC口输出 PORTC=0xFF; //PC口设置内部上拉电阻 DDRD=0xFF; //置PD口输出 PORTD=0xFF; //PD口设置内部上拉电阻 } /*****************

文档评论(0)

1亿VIP精品文档

相关文档