//LCD12864: KS0107 KS0108
//keilc51
#include <\atmel\AT89x52.H>
#define lcd_reset P3_3
#define lcd_cs1 P3_4
#define lcd_cs2 P3_2
#define lcd_di P3_7
#define lcd_rw P3_6
#define lcd_e P3_5
#define lcd_dp P0
#define delay_time 0x10
const unsigned char code chr1[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xC0,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0xE0,0x00,0x0F,0xF0,0x00,
0x00,0x00,0x00,0xF0,0x00,0x0F,0xF0,0x00,0x00,0x00,0x00,0xFC,0x00,0x1F,0xF8,0x00,
0x00,0x10,0x00,0xFC,0x00,0x3F,0xF0,0x00,0x00,0x1C,0x00,0x7E,0x00,0xFF,0xC0,0x00,
0x00,0x1E,0x00,0x7E,0x01,0xFE,0x00,0x00,0x00,0x1F,0x00,0x3E,0x07,0xF8,0x00,0x00,
0x00,0x1F,0x80,0x1C,0x0F,0xE0,0x00,0x00,0x00,0x0F,0xC0,0x00,0x3F,0x00,0x00,0x00,
0x00,0x0F,0xC0,0x00,0x7C,0x00,0x00,0x00,0x00,0x0F,0xC0,0x00,0xF0,0x00,0x0C,0x00,
0x00,0x03,0xC0,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x03,0x00,0x00,0x3E,0x00,0xF0,0x00,
0x00,0x03,0xFF,0xFF,0xFF,0x03,0xE0,0x00,0x00,0x03,0xFF,0xFF,0xFF,0x87,0xC0,0x00,
0x00,0x03,0xFF,0xFF,0xFF,0x1F,0x80,0x00,0x00,0x03,0xC3,0x06,0x07,0xFF,0x00,0x00,
0x00,0x03,0x03,0x06,0x07,0xFE,0x00,0x00,0x00,0x03,0x03,0x06,0x0F,0xFC,0x00,0x00,
0x00,0x03,0x07,0x06,0x0F,0xF8,0x00,0x00,0x00,0x06,0x07,0x0E,0x0E,0xF0,0x00,0x00,
0x00,0x06,0x07,0x0E,0x0E,0xE0,0x00,0x00,0x00,0x06,0x07,0x0E,0x0E,0x00,0x00,0x00,
0x00,0x06,0x0F,0x0E,0x1E,0x30,0x00,0x00,0x00,0x0E,0x0E,0x0E,0x1E,0x38,0x00,0x00,
0x00,0x0F,0xFE,0x0C,0x1E,0x1C,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0x9F,0x00,0x00,
0x00,0x07,0xFF,0xFF,0xFF,0x8F,0x80,0x00,0x00,0x07,0xFF,0xFF,0xFF,0x8F,0xC0,0x00,
0x00,0x03,0xFF,0xFF,0xFE,0x07,0xE0,0x00,0x00,0x03,0x80,0x00,0x00,0x07,0xF0,0x00,
0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0x1E,0x00,0x00,0x00,
0x00,0x00,0x0F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0x80,0x18,0x00,
0x00,0x00,0x0F,0xFF,0xFF,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,
0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x03,0xC0,0x00,0x00,0x00,0x00,0x1F,0xE0,
0x03,0xFF,0xF8,0x0F,0xFF,0xFF,0xFF,0xF0,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,
0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,
0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,
0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
const unsigned char code chr2[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0F,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0xF0,0x00,0x00,
0x00,0x00,0x0E,0x08,0x20,0x7E,0x00,0x00,0x00,0x00,0x1E,0x0C,0x30,0x7F,0xE0,0x00,
0x00,0x00,0x1E,0x0C,0x30,0x7F,0xF8,0x00,0x00,0x60,0x1E,0x1C,0x30,0x67,0xF8,0x00,
0x00,0x78,0x1C,0x1C,0x70,0x60,0x70,0x00,0x00,0x3E,0x1C,0x1C,0x70,0xE0,0x70,0x00,
0x00,0x3F,0xBC,0x38,0x70,0xE0,0x60,0x00,0x00,0x3F,0xFC,0x38,0x70,0xC0,0x60,0x00,
0x00,0x1F,0xF8,0x38,0xE0,0xC0,0xE0,0x00,0x00,0x0F,0xF8,0x78,0xE1,0xC3,0xE0,0x00,
0x00,0x03,0xB8,0x78,0xE1,0xFF,0xE0,0x00,0x00,0x00,0x78,0x38,0xE1,0xFF,0xE0,0x00,
0x00,0x00,0x78,0x30,0x61,0xFF,0x60,0x00,0x00,0x00,0x70,0x00,0x41,0xF8,0x00,0x00,
0x00,0x00,0x70,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x04,0x00,0x00,
0x00,0x00,0x30,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x10,0xC0,0x20,0x07,0x00,0x00,
0x00,0x00,0x00,0xC0,0x30,0x07,0x80,0x00,0x00,0x00,0x00,0xE0,0x30,0x07,0x80,0x00,
0x00,0x00,0x00,0xE0,0x30,0x07,0x80,0x00,0x00,0x00,0x01,0xE0,0x70,0x07,0x80,0x00,
0x00,0x00,0x01,0xE0,0x7C,0x0F,0x00,0x00,0x00,0x00,0x01,0xE0,0x7F,0xFF,0x00,0x00,
0x00,0x00,0x01,0xE0,0x7F,0xFE,0x00,0x00,0x00,0x00,0x01,0xC0,0xFF,0xFE,0x00,0x00,
0x00,0x00,0x03,0xC0,0xEE,0x1C,0x00,0x00,0x00,0x00,0x03,0xC1,0xE0,0x1C,0x00,0x00,
0x03,0x00,0x03,0x81,0xE0,0x38,0x00,0x00,0x03,0xE0,0x03,0x81,0xE0,0x38,0x00,0x00,
0x03,0xFF,0x87,0x80,0xC0,0x38,0x00,0x00,0x03,0xFF,0xFF,0x80,0xC0,0x70,0x00,0x00,
0x01,0xFF,0xFF,0xF8,0x00,0x60,0x00,0x00,0x01,0xFF,0xFF,0xFF,0x80,0x60,0x00,0x00,
0x00,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0x80,0x00,0x00,
0x00,0x00,0x0F,0x07,0xFF,0xE0,0x00,0x00,0x00,0x00,0x0F,0x00,0x7F,0xF8,0x00,0x00,
0x00,0x00,0x0F,0x00,0x03,0xFE,0x00,0x00,0x00,0x30,0x0F,0x00,0x00,0xFF,0x00,0x00,
0x00,0x3C,0x1F,0x00,0x00,0x1F,0xE0,0x00,0x00,0x1E,0x1F,0x00,0x00,0x07,0xF0,0x00,
0x00,0x1F,0x8F,0x00,0x00,0x03,0xF8,0x00,0x00,0x1F,0xCF,0x00,0x00,0x00,0xFC,0x00,
0x00,0x1F,0xC7,0x00,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC6,0x00,0x00,0x00,0x3F,0x00,
0x00,0x07,0xC0,0x00,0x00,0x00,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xC0,
0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xC0,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
const unsigned char code chr3[]=
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,
0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,
0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0xF8,0x78,0x78,0x01,0x80,
0x00,0x00,0x07,0xF8,0x78,0x78,0x01,0x80,0x00,0x00,0x1F,0xF8,0x78,0x78,0x01,0x80,
0x00,0x00,0x3F,0xF8,0x78,0x78,0x01,0x80,0x00,0x00,0x7E,0x18,0x07,0x80,0x01,0x80,
0x00,0x00,0xF8,0x18,0x07,0x80,0x01,0x80,0x00,0x00,0xF0,0x18,0x07,0x80,0x01,0x80,
0x00,0x00,0xE0,0x18,0x78,0x79,0xE1,0x80,0x00,0x01,0xE0,0x18,0x78,0x79,0xE1,0x80,
0x00,0x01,0xE0,0x18,0x78,0x79,0xE1,0x80,0x00,0x01,0xE0,0x18,0x78,0x79,0xE1,0x80,
0x00,0x01,0xE0,0x18,0x7F,0xF9,0xE1,0x80,0x00,0x01,0xE0,0x18,0x07,0x81,0xE1,0x80,
0x00,0x00,0xE0,0x18,0x07,0x81,0xE1,0x80,0x00,0x00,0xE0,0x18,0x07,0x81,0xE1,0x80,
0x00,0x00,0xE0,0x18,0x07,0x81,0xE1,0x80,0x00,0x00,0xF0,0x18,0x78,0x79,0xE1,0x80,
0x00,0x00,0xF0,0x18,0x78,0x79,0xE1,0x80,0x00,0x00,0xF0,0x18,0x78,0x79,0xE1,0x80,
0x00,0x00,0x70,0x18,0x78,0x79,0xE1,0x80,0x00,0x00,0x70,0x18,0x07,0x81,0xE1,0x80,
0x00,0x00,0x70,0x18,0x07,0x81,0xE1,0x80,0x00,0x00,0x70,0x18,0x07,0x81,0xE1,0x80,
0x00,0x00,0xF0,0x18,0x07,0x81,0xE1,0x80,0x00,0x00,0xF0,0x18,0x7F,0xF9,0xE1,0x80,
0x00,0x00,0xE0,0x18,0x78,0x79,0xE1,0x80,0x00,0x01,0xE0,0x18,0x78,0x79,0xE1,0x80,
0x00,0x03,0xE0,0x18,0x78,0x79,0xE1,0x80,0x00,0x0F,0xC0,0x18,0x7F,0xF9,0xE1,0x80,
0x00,0x1F,0x80,0x18,0x07,0x81,0xE1,0x80,0x00,0x3F,0x00,0x18,0x07,0x81,0xE1,0x80,
0x00,0x3C,0x00,0x18,0x78,0x79,0xE1,0x80,0x00,0x00,0x00,0x18,0x78,0x79,0xE1,0x80,
0x00,0x00,0x00,0x18,0x78,0x79,0xE1,0x80,0x00,0x00,0x00,0x18,0x78,0x79,0xE1,0x80,
0x00,0x00,0x00,0x18,0x7F,0xF9,0xE1,0x80,0x00,0x00,0x00,0x18,0x07,0x80,0x01,0x80,
0x00,0x00,0x00,0x18,0x07,0x80,0x01,0x80,0x00,0x00,0x00,0x18,0x07,0x80,0x01,0x80,
0x00,0x00,0x00,0x18,0x78,0x78,0x01,0x80,0x00,0x00,0x00,0x18,0x78,0x78,0x01,0x80,
0x00,0x00,0x00,0x18,0x78,0x78,0x01,0x80,0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,
0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,
0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,
0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,
0x00,0x00,0x00,0x18,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x03,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
const unsigned char code chr4[]=
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x00,0x00,
0x00,0x00,0x00,0x00,0x73,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x60,0x7D,0xF8,0x00,
0x00,0x00,0x00,0x00,0x60,0x1C,0x3C,0x00,0x00,0x00,0x00,0x0F,0xF0,0x06,0x0E,0x00,
0x0F,0x00,0x00,0x0F,0xFC,0x02,0x07,0xF0,0x3F,0xF0,0x00,0x1C,0x3F,0x82,0x01,0xF0,
0x39,0xFE,0x00,0x18,0x03,0xE6,0x00,0x38,0x30,0x7F,0xE0,0x1C,0x01,0xFE,0x00,0x38,
0x30,0x07,0xFF,0x0E,0x00,0x78,0x00,0x18,0x30,0x00,0x7F,0xCF,0x80,0x38,0x00,0x18,
0x38,0x00,0x07,0xFF,0xE0,0x18,0x00,0x18,0x1F,0x00,0x03,0xFF,0xFC,0x18,0x00,0x18,
0x0F,0xF0,0x00,0x1B,0xFF,0xF8,0x00,0x18,0x03,0xFE,0x00,0x18,0xE7,0xF0,0x00,0x18,
0x00,0x1F,0xE0,0x18,0x70,0x00,0x00,0x18,0x00,0x07,0xFE,0x18,0x70,0x00,0x00,0x18,
0x00,0x00,0x3F,0xD8,0x30,0x00,0x00,0x18,0x00,0x00,0x03,0xDC,0x3F,0x00,0x00,0x18,
0x00,0x00,0x01,0xCC,0x3F,0xC0,0x00,0x18,0x00,0x00,0x0F,0xCC,0x00,0xC0,0x00,0x38,
0x00,0x00,0x7F,0x0C,0x00,0x00,0x00,0x30,0x00,0x01,0xF8,0x0F,0x00,0x00,0x07,0xF0,
0x00,0x0F,0xC0,0x07,0x80,0x00,0x1F,0xF0,0x00,0x7F,0x00,0x03,0xE0,0x00,0x7C,0x00,
0x01,0xF8,0x00,0x00,0xFC,0x01,0xF0,0x00,0x03,0xC0,0x00,0x1F,0xFE,0x07,0xC0,0x00,
0x07,0x80,0x03,0xFF,0xFF,0xFF,0x80,0x00,0x06,0x00,0x1F,0xC0,0x03,0xFC,0x00,0x00,
0x06,0x00,0x7E,0x00,0x00,0x70,0x00,0x00,0x06,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,
0x07,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x03,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
int timer0_count;
//==================================================================
void it_timer0(void) interrupt 1 /* interrupt address is 0x000b */
{
TF0 = 0; /* reset interrupt flag (already done by hardware)*/
TH0 = 0;TL0 = 0;
timer0_count++;
}
//==================================================================
void delay(int count)
{
timer0_count=0;
TMOD &= 0xF0; /* Timer 0 mode 1 counter with SOFtware gate */
TMOD |= 0x05; /* GATE0=0; C/T0#=1; M10=0; M00=1; */
TH0 = 0; /* init values */
TL0 = 0;
ET0=1; /* enable timer0 interrupt */
EA=1; /* enable interrupts */
TR0=1; /* timer0 run */
while(timer0_count<=count)
{
TF0=1;
}
TR0=0;TF0=0;
}
//==================================================================
void lcd_write_command(unsigned char cmd)
{
lcd_di=0;
lcd_rw=0;
lcd_dp=cmd;
lcd_e=1;
lcd_e=0;
lcd_di=0;
lcd_rw=1;
lcd_di=0;
lcd_e=1;
while(0x80==(lcd_dp&0x80)){;}
lcd_e=0;
lcd_rw=0;
//delay(0x1f);
}
//===================================================================
void lcd_write_data(unsigned char dat)
{
lcd_di=1;
lcd_rw=0;
lcd_dp=dat;
lcd_e=1;
lcd_e=0;
lcd_rw=1;
lcd_di=0;
lcd_e=1;
while(0x80==(lcd_dp&0x80)){;}
lcd_e=0;
lcd_rw=0;
//delay(0x1f);
}
//===============================================================
/*void lcd_init(void)
{
lcd_reset=0;
delay(0x2f);
lcd_reset=1;
lcd_cs1=1;
lcd_cs2=0;
lcd_cs3=0;
lcd_write_command(0x39);
lcd_write_command(0xc0);
lcd_write_command(0x3b);//up mode
lcd_write_command(0x3e);//start page 0
}*/
//===============================================================
void test1(void)
{
unsigned char county=0;
lcd_cs1=1;
lcd_cs2=1;
//--------------------------------------
lcd_write_command(0xb8);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0x0);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xb9);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0x0);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xba);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0x0);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbb);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0x0);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbc);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0x0);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbd);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0x0);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbe);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0x0);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbf);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0x0);
delay(delay_time);
}
}
//===============================================================
void test2(void)
{
unsigned char county=0;
lcd_cs1=1;
lcd_cs2=1;
//--------------------------------------
lcd_write_command(0xb8);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xb9);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xba);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbb);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbc);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbd);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbe);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
//--------------------------------------
lcd_write_command(0xbf);//set y start 0
for(county=0;county<=63;county++)
{
lcd_write_data(0xff);
delay(delay_time);
}
}
//===============================================================
void test3(void)
{
unsigned char row;
unsigned char col;
lcd_cs1=0;
lcd_cs2=1;
for(col=0;col<8;col++)
{
lcd_write_command(0xb8+(7-col));
for(row=0;row<64;row++)
{
lcd_write_data(chr1[col+((63-row)*8)]);
}
}
}
//===============================================================
void test4(void)
{
unsigned char row;
unsigned char col;
lcd_cs1=1;
lcd_cs2=0;
for(col=0;col<8;col++)
{
lcd_write_command(0xb8+(7-col));
for(row=0;row<64;row++)
{
lcd_write_data(chr2[col+((63-row)*8)]);
}
}
}
//===============================================================
//===============================================================
void test5(void)
{
unsigned char row;
unsigned char col;
lcd_cs1=1;
lcd_cs2=0;
for(col=0;col<8;col++)
{
lcd_write_command(0xb8+(7-col));
for(row=0;row<64;row++)
{
lcd_write_data(chr3[col+((63-row)*8)]);
}
}
}
//===============================================================
//===============================================================
void test6(void)
{
unsigned char row;
unsigned char col;
lcd_cs1=0;
lcd_cs2=1;
for(col=0;col<8;col++)
{
lcd_write_command(0xb8+(7-col));
for(row=0;row<64;row++)
{
lcd_write_data(chr4[col+((63-row)*8)]);
}
}
}
//===============================================================
void main(void)
{
unsigned char count=0;
//unsigned char temp1;
//lcd_init();
lcd_reset=0;
lcd_reset=1;
lcd_write_command(0x3f);//turn lcd
lcd_write_command(0xc0);//set x start 0
//lcd_write_command(0xba);//set y start 0
lcd_write_command(0x40);//set y start page 0
//----------------------------
//lcd_write_command(0x39);//display on
while(1)
{
test1();
delay(0x2000);
test3();
delay(0x2000);
test4();
delay(0x2000);
test2();
delay(0x2000);
test5();
delay(0x2000);
test6();
delay(0x2000);
}
}
上一篇:TLC0831示例程序
下一篇:12864液晶显示源程序汇编程序
推荐阅读最新更新时间:2024-03-16 15:52