首页资源分类嵌入式处理器51内核 > ST7565 128*64

ST7565 128*64

已有 445005个资源

下载专区

上传者其他资源

    文档信息举报收藏

    标    签:ST765R128 64

    分    享:

    文档简介

    ST7565R 驱动128*64的点阵屏

    文档预览

    //*ST7565R SPI-4数据传送方式 P1口 d*/// //display 160*132 STN // #include #include #include #include /* sbit cs=P3^3; sbit rs=P3^5; sbit rw=P3^1; sbit reset=P3^4; sbit rd=P3^0; sbit INTP = P3^2; */ sbit cs=P3^3; sbit rs=P3^4; sbit reset=P3^7; sbit scl=P3^5; //sclk=wr sbit sdi=P3^6; //sda=rd sbit INTP = P3^2; bit flag=1; void address_set(); unsigned char code pic1[]; void int0(); void delay10(unsigned int t) { unsigned int i,j,k; for(i=0;i0) { if(flag) { tt--; } else {} } } void d10ms(void) { unsigned char t=200 ; while(t>0) {t--;} } void service_int0()interrupt 0 { d10ms(); if (!INT0) { d10ms(); flag=!flag; while (!INT0) {d10ms(); } d10ms(); while (!INT0) {d10ms(); } } } void instruction(void) //ST7541 128*128 { //////////////////// lcd_com(0x40); // Display start line set 40-ef (0-63) lcd_com(0xb0); // page address set b0-b8 (0-8) lcd_com(0x10); // column address set High bits A7-A4 lcd_com(0x00); // column address set low bits A3-A0 (0-131) lcd_com(0xa0); // ADC select (segment driver direction select) a0(normal) a1(reverse) // lcd_com(0xa6); //display normal/reverse a6/a7 //lcd_com(0xa4); //display all points ON/OFF a4/a5 lcd_com(0xa2); //lcd bias set a2/a3 1/9bias A2 lcd_com(0xc8); //Common output mode select c0/c8 (com0-com63)/(com63-com0) lcd_com(0x2c); //power controller set Booster circuit ON delay10(50); lcd_com(0x2e); //power controller set voltage regulator circuit ON delay10(50); lcd_com(0x2f); //power controller set voltage follower circuit ON delay10(50); lcd_com(0x26); // V0 voltage regulator internal resistor ratio set 20-27 lcd_com(0x81); // lcd_com(0x36); //3e //lcd_com(0xad); //static indicator // lcd_com(0x00); //00-03 lcd_com(0xf8); //Booster ratio select mode set lcd_com(0x00); //00-03 00(2x,3x,4x),01(5x),03(6x) /////////////////// lcd_com(0xAF); // Display ON delay10(10); } void main(void) { //rd=1; reset=1; delay10(20); reset=0; delay10(50); reset=1; delay10(50); // IE=0; INTP=1; EA=1; EX0=1; IT0=1; instruction(); display(0x00,0x00); //white delay10(10); while(1) { display_image1(); delay10(100); delayS(20000); display(0x00,0x00); //white delay10(100); delayS(20000); display(0xff,0xff); //black delay10(100); delayS(20000); display(0xff,0x00); // line delay10(100); delayS(20000); display(0x00,0xff); //line delay10(100); delayS(20000); display(0xaa,0xaa); //line delay10(100); delayS(20000); display(0x55,0x55); //line delay10(100); delayS(20000); display(0xaa,0x55); //dots delay10(100); delayS(20000); display(0x55,0xaa); //dots delay10(100); delayS(20000); } } unsigned char code pic1[]= { // Source file :C:\Documents and Settings\Administrator\桌面\显示图片\点虹电子科技图片.bmp // Bmp size : 128 x 64 Portrait, Reverse. Monochrome mode, 0xff,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0xa1,0xa1,0x21,0x21,0x21,0xe1,0xe1,0x61,0x01,0xe1,0xf9, 0x99,0x81,0x81,0x81,0xc1,0xc1,0x81,0x01,0x01,0x01,0x01,0x01,0x19,0x39,0x31,0x01, 0xe1,0xe1,0x31,0x11,0x19,0xe9,0xe1,0x21,0x21,0xe1,0xe1,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x21,0x61,0xc1,0x81,0x01,0xf9,0xf9,0x09,0x01,0xe1,0xe1,0x21,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0xc1,0xc1,0x01,0xf9,0xf9,0x09,0x01,0xc1,0xf9,0x79,0x49, 0x41,0x41,0x41,0x61,0x61,0x41,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xff, 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x81,0xc3,0x76,0x3c,0x7f,0xf3,0xc4,0x07,0x83,0xf0, 0x7f,0x7f,0xf0,0x83,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x82,0xff,0xff,0x00, 0x7f,0x7f,0x30,0x10,0x00,0xff,0xff,0x40,0x40,0x7f,0x3f,0x00,0x00,0x00,0x00,0x00, 0x04,0x04,0x04,0x04,0xe5,0xfd,0x1c,0x07,0x07,0xfe,0xff,0x05,0x04,0x04,0x86,0x82, 0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0xff,0xff,0x02,0xfb,0xf9,0x10,0x10,0xf1, 0xf7,0x16,0x10,0xf8,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,0xff, 0xff,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x02,0x03,0x01,0x00,0x00,0x08,0x0d,0x05,0x07,0x03,0x00, 0x00,0x00,0x01,0x03,0x06,0x04,0x04,0x00,0x00,0x00,0x02,0x03,0x01,0x80,0x81,0x03, 0x02,0x06,0x04,0x04,0x04,0x05,0x05,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x88, 0x88,0x0c,0x06,0x03,0x01,0x00,0x00,0x00,0x00,0x07,0x07,0x04,0x84,0x84,0x07,0x07, 0x06,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x0f,0x0f,0x00,0x0f,0x0f,0x04,0x04,0x07, 0x07,0x84,0x84,0x07,0x07,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,0xff, 0xff,0x00,0x00,0x00,0x00,0x08,0x38,0xb3,0xf3,0x70,0x93,0x93,0x9d,0x8d,0xe1,0xe5, 0x8d,0x99,0x9b,0x83,0x01,0x00,0x08,0x08,0x08,0xff,0xff,0x08,0xff,0xff,0x00,0xfe, 0xfe,0x00,0x00,0xff,0xff,0x00,0x00,0x02,0x02,0x02,0xf2,0xf2,0x12,0x12,0xff,0xff, 0x12,0x12,0x12,0xf2,0xf2,0x02,0x02,0x00,0x00,0x00,0x00,0xf0,0xf0,0x10,0x10,0x1f, 0x1f,0x12,0x12,0xfa,0xfa,0x12,0x00,0x00,0x00,0xfc,0xfc,0x84,0xff,0xff,0x84,0xfc, 0xfe,0x02,0x02,0xfe,0xfe,0x02,0x02,0x02,0x02,0x00,0x00,0x00,0xfc,0xfc,0x24,0x24, 0x24,0xff,0xff,0x24,0x24,0x24,0xfc,0xfc,0x00,0x00,0x00,0x80,0x80,0x81,0x81,0x81, 0x81,0x81,0xf1,0xf9,0x8d,0x87,0x83,0x81,0xc0,0xc0,0x80,0x00,0x00,0x00,0x00,0xff, 0xff,0x00,0x00,0x00,0x00,0x02,0x7e,0x7f,0x11,0x10,0x18,0x08,0x0c,0x06,0x7f,0x7f, 0x06,0x0c,0x1c,0x18,0x08,0x00,0x04,0x04,0x06,0x23,0x33,0x1e,0x0f,0x03,0x00,0x0f, 0x0f,0x00,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x7f,0x7f, 0x00,0x08,0x18,0x1f,0x0f,0x00,0x00,0x00,0x00,0x20,0x38,0x1b,0x0b,0x39,0x31,0x05, 0x0d,0x39,0x31,0x07,0x0f,0x38,0x30,0x00,0x00,0x21,0x21,0x20,0x3f,0x1f,0x14,0x3d, 0x39,0x20,0x20,0x3f,0x3f,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x07,0x07,0x02,0x02, 0x02,0x1f,0x3f,0x22,0x22,0x22,0x27,0x27,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00, 0x20,0x60,0x7f,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff, 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x02,0xfe,0x02,0x06, 0x00,0x02,0xfe,0x12,0x3a,0x86,0x00,0x02,0xfe,0x02,0x00,0x00,0x80,0x00,0x00,0x08, 0x00,0x00,0x00,0xfc,0x02,0x02,0x02,0xfc,0x00,0x06,0x02,0xf2,0x0e,0x02,0x00,0x9e, 0x12,0x12,0x12,0xe2,0x00,0x9e,0x12,0x12,0x12,0xe2,0x00,0x10,0x10,0x10,0x10,0x10, 0x00,0x8c,0x42,0x22,0x12,0x0c,0x00,0x06,0x02,0xf2,0x0e,0x02,0x00,0xec,0x12,0x12, 0x12,0xec,0x00,0xfc,0x12,0x12,0x16,0xe0,0x00,0x84,0x02,0x12,0x12,0xec,0x00,0x20, 0x58,0x44,0xfe,0x40,0x00,0xec,0x12,0x12,0x12,0xec,0x00,0x8c,0x42,0x22,0x12,0x0c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff, 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xe1,0x21,0xa1,0x60, 0x00,0x01,0x01,0xe1,0x81,0x01,0x00,0x21,0xe1,0x01,0xe1,0x21,0x01,0x00,0x00,0x81, 0x00,0x00,0x00,0xc0,0x21,0x21,0x21,0xc0,0x00,0x60,0x20,0x21,0xe0,0x20,0x00,0xe0, 0x21,0x21,0x21,0x20,0x00,0xe0,0x21,0x21,0x21,0x20,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xc1,0x21,0x21,0x21,0xc1,0x00,0x40,0x20,0x21,0x20,0xc0,0x00,0xc0,0x21,0x21, 0x21,0xc0,0x00,0x00,0x41,0xe1,0x01,0x00,0x00,0x60,0x21,0x21,0xe1,0x20,0x00,0x40, 0x20,0x20,0x21,0xc1,0x00,0xc0,0x21,0x21,0x21,0xc0,0x00,0x41,0x21,0x21,0x21,0xc1, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff, 0xff,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x90,0x9f,0x91,0x83,0x80, 0x80,0x90,0x9f,0x84,0x87,0x9c,0x90,0x90,0x9c,0x83,0x9c,0x90,0x80,0x80,0x80,0x90, 0x80,0x80,0x80,0x8f,0x90,0x90,0x90,0x8f,0x80,0x80,0x80,0x9f,0x80,0x80,0x80,0x89, 0x91,0x91,0x91,0x8e,0x80,0x89,0x91,0x91,0x91,0x8e,0x80,0x81,0x81,0x81,0x81,0x81, 0x80,0x98,0x94,0x92,0x91,0x90,0x80,0x88,0x90,0x91,0x91,0x8e,0x80,0x98,0x94,0x92, 0x91,0x90,0x80,0x80,0x90,0x9f,0x90,0x80,0x80,0x80,0x80,0x9f,0x80,0x80,0x80,0x88, 0x90,0x91,0x91,0x8e,0x80,0x8e,0x91,0x91,0x91,0x8e,0x80,0x88,0x90,0x91,0x91,0x8e, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xff, };

    Top_arrow
    回到顶部
    EEWORLD下载中心所有资源均来自网友分享,如有侵权,请发送举报邮件到客服邮箱bbs_service@eeworld.com.cn 或通过站内短信息或QQ:273568022联系管理员 高员外,我们会尽快处理。