今晚捣鼓了一下LCD12232。
代码如下:
/*
* File: main.c
* Author: Administrator
*
* Created on November 25, 2019, 7:48 PM
*/
// CONFIG1L
#pragma config FEXTOSC = ECH // External Oscillator mode Selection bits (EC (external clock) above 8 MHz; PFM set to high power)
#pragma config RSTOSC = EXTOSC // Power-up default value for COSC bits (EXTOSC operating per FEXTOSC bits (device manufacturing default))
// CONFIG1H
#pragma config CLKOUTEN = OFF // Clock Out Enable bit (CLKOUT function is disabled)
#pragma config CSWEN = ON // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed)
#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor enabled)
// CONFIG2L
#pragma config MCLRE = EXTMCLR // Master Clear Enable bit (MCLR pin (RE3) is MCLR)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (Power up timer disabled)
#pragma config LPBOREN = OFF // Low-power BOR enable bit (Low power BOR is disabled)
#pragma config BOREN = SBORDIS // Brown-out Reset Enable bits (Brown-out Reset enabled , SBOREN bit is ignored)
// CONFIG2H
#pragma config BORV = VBOR_190 // Brown Out Reset Voltage selection bits (Brown-out Reset Voltage (VBOR) set to 1.90V)
#pragma config ZCD = OFF // ZCD Disable bit (ZCD disabled. ZCD can be enabled by setting the ZCDSEN bit of ZCDCON)
#pragma config PPS1WAY = ON // PPSLOCK bit One-Way Set Enable bit (PPSLOCK bit can be cleared and set only once; PPS registers remain locked after one clear/set cycle)
#pragma config STVREN = ON // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
#pragma config XINST = OFF // Extended Instruction Set Enable bit (Extended Instruction Set and Indexed Addressing Mode disabled)
// CONFIG3L
#pragma config WDTCPS = WDTCPS_31// WDT Period Select bits (Divider ratio 1:65536; software control of WDTPS)
#pragma config WDTE = OFF // WDT operating mode (WDT Disabled)
// CONFIG3H
#pragma config WDTCWS = WDTCWS_7// WDT Window Select bits (window always open (100%); software control; keyed access not required)
#pragma config WDTCCS = SC // WDT input clock selector (Software Control)
// CONFIG4L
#pragma config WRT0 = OFF // Write Protection Block 0 (Block 0 (000800-003FFFh) not write-protected)
#pragma config WRT1 = OFF // Write Protection Block 1 (Block 1 (004000-007FFFh) not write-protected)
#pragma config WRT2 = OFF // Write Protection Block 2 (Block 2 (008000-00BFFFh) not write-protected)
#pragma config WRT3 = OFF // Write Protection Block 3 (Block 3 (00C000-00FFFFh) not write-protected)
#pragma config WRT4 = OFF // Write Protection Block 4 (Block 4 (010000-013FFFh) not write-protected)
#pragma config WRT5 = OFF // Write Protection Block 5 (Block 5 (014000-017FFFh) not write-protected)
#pragma config WRT6 = OFF // Write Protection Block 6 (Block 6 (018000-01BFFFh) not write-protected)
#pragma config WRT7 = OFF // Write Protection Block 7 (Block 7 (01C000-01FFFFh) not write-protected)
// CONFIG4H
#pragma config WRTC = OFF // Configuration Register Write Protection bit (Configuration registers (300000-30000Bh) not write-protected)
#pragma config WRTB = OFF // Boot Block Write Protection bit (Boot Block (000000-0007FFh) not write-protected)
#pragma config WRTD = OFF // Data EEPROM Write Protection bit (Data EEPROM not write-protected)
#pragma config SCANE = ON // Scanner Enable bit (Scanner module is available for use, SCANMD bit can control the module)
#pragma config LVP = ON // Low Voltage Programming Enable bit (Low voltage programming enabled. MCLR/VPP pin function is MCLR. MCLRE configuration bit is ignored)
// CONFIG5L
#pragma config CP = OFF // UserNVM Program Memory Code Protection bit (UserNVM code protection disabled)
#pragma config CPD = OFF // DataNVM Memory Code Protection bit (DataNVM code protection disabled)
// CONFIG5H
// CONFIG6L
#pragma config EBTR0 = OFF // Table Read Protection Block 0 (Block 0 (000800-003FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR1 = OFF // Table Read Protection Block 1 (Block 1 (004000-007FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR2 = OFF // Table Read Protection Block 2 (Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks)
#pragma config EBTR3 = OFF // Table Read Protection Block 3 (Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks)
#pragma config EBTR4 = OFF // Table Read Protection Block 4 (Block 4 (010000-013FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR5 = OFF // Table Read Protection Block 5 (Block 5 (014000-017FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR6 = OFF // Table Read Protection Block 6 (Block 6 (018000-01BFFFh) not protected from table reads executed in other blocks)
#pragma config EBTR7 = OFF // Table Read Protection Block 7 (Block 7 (01C000-01FFFFh) not protected from table reads executed in other blocks)
// CONFIG6H
#pragma config EBTRB = OFF // Boot Block Table Read Protection bit (Boot Block (000000-0007FFh) not protected from table reads executed in other blocks)
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
#include <xc.h>
#include <pic18f47q10.h>
#define uint unsigned int
#define uchar unsigned char
#define CS RD7
#define SCK RD5
#define SID RD6
#define KEY RE2
uchar i=0,j=0;
uchar yemiancount=0;
uchar const bmp1[]=
{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x83,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x83,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x83,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x83,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x20,0x83,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x3F,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x3F,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x3F,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x3F,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xF8,0x3F,0x82,0x0F,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x30,0x00,0x18,0x01,0x80,0x0C,0x00,0x18,0x60,0x0F,0x00,0x7F,0xC0,0x01,0x81,
0x80,0x18,0x00,0x18,0x00,0xC0,0x07,0xFC,0x7F,0xFC,0xF8,0x30,0x60,0xC0,0xFF,0xC1,
0x87,0xFF,0xC0,0x18,0x0F,0xFC,0x18,0x0C,0x3C,0x60,0x7B,0x60,0x60,0xC0,0xC1,0x81,
0x80,0x30,0x0F,0xFF,0x80,0x18,0x1B,0xEC,0x19,0xF8,0x36,0xC0,0x7F,0xC0,0xFF,0x81,
0x80,0x30,0x00,0x18,0x00,0x30,0x1B,0x6C,0x7E,0x60,0x18,0x18,0x66,0x00,0xC1,0x81,
0x80,0x3F,0x03,0x18,0x00,0x60,0x1B,0x6C,0x1B,0xFC,0xFF,0xB0,0x63,0x00,0xFF,0x81,
0x80,0x33,0x01,0x98,0x00,0xC0,0x1B,0xEC,0x3D,0x98,0x18,0x60,0x79,0x80,0x36,0x01,
0x80,0x63,0x00,0xD8,0x01,0x80,0x1B,0x6C,0x3F,0xF8,0x3D,0xD8,0x6C,0xC1,0xB6,0xC1,
0x80,0x63,0x00,0x18,0x03,0x00,0x1B,0xEC,0x79,0x98,0x7E,0x30,0xC6,0x70,0xF7,0x81,
0x80,0xC3,0x00,0x18,0x07,0x00,0x1B,0x6C,0x79,0xF8,0xDB,0x61,0xB8,0x00,0x77,0x01,
0x81,0x9E,0x00,0x18,0x1D,0xC0,0x18,0x0C,0x19,0x98,0x18,0xC0,0x0E,0x00,0x36,0xC1,
0x83,0x0C,0x00,0x38,0x00,0x7F,0x18,0x1C,0x19,0xB8,0x1B,0x80,0x03,0x03,0xFF,0xE1,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
uchar const bmp2[]=
{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,
0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0xC0,0x00,0x00,0x00,0x00,0x1C,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0xF1,0xFF,0xFF,0xFC,0x00,0xFE,0x00,0x0D,0xE1,0xFF,0xFF,0xE0,0x00,0x00,0x00,
0x0F,0xFF,0xFF,0xFF,0xFF,0xC3,0xFF,0x00,0x0C,0x7F,0xFF,0xBF,0xFC,0x00,0x00,0x00,
0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x0C,0x00,0x00,0x00,0x1F,0x80,0x00,0x00,
0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x0C,0x00,0x00,0x00,0x03,0xE0,0x00,0x00,
0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x1C,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,
0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x36,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,
0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x62,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,
0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0xC3,0x00,0x00,0x00,0x00,0x07,0x00,0x00,
0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x80,0x00,0x00,0x00,0x00,0x03,0x80,0x00,
0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x01,0x80,0x00,0x00,0x00,0x00,0x01,0x80,0x00,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,
0x7F,0xE3,0xFF,0xFF,0xFF,0xFF,0xFE,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,
0x7F,0xC1,0xFF,0xFF,0xFF,0x83,0xFE,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,
0x7F,0xE1,0xF8,0x00,0x0F,0x83,0xFE,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,
0x7F,0xE3,0xF0,0x00,0x03,0x87,0xFF,0x80,0x18,0x00,0x00,0x00,0x00,0x00,0x18,0x00,
0x7F,0xFF,0xE0,0x40,0x81,0xFF,0xFF,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x18,0x00,
0x7F,0xFF,0xE0,0xE1,0xC1,0xFF,0xFF,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x18,0x00,
0x7F,0xFF,0xE0,0xC1,0xC1,0xFF,0xFF,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,
0x7F,0xFF,0xE0,0x00,0x81,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,
0xFF,0xFF,0xF0,0x00,0x03,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,
0xFF,0xFF,0xFC,0x00,0x0F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,
0xFF,0xFF,0xFF,0x81,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0xFE,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0xFE,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x60,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0x60,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0xE0,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x80,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,
0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,
0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,
0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0xC0,0x00,0x00,0x00,0x00,0x01,0x80,0x00,
0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x60,0x00,0x00,0x00,0x00,0x03,0x80,0x00,
0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x70,0x00,0x00,0x00,0x00,0x03,0x00,0x00,
0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x38,0x00,0x00,0x00,0x00,0x06,0x00,0x00,
0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x18,0x1F,0x7F,0xFB,0xFE,0x0E,0x00,0x00,
0x07,0xFF,0xFF,0xFF,0xFF,0xE7,0xF8,0x00,0x0C,0x3F,0xFF,0xFF,0xFE,0x18,0x00,0x00,
0x07,0xF8,0x0E,0x00,0x08,0x03,0xF0,0x00,0x0C,0x60,0x00,0x00,0x06,0x30,0x00,0x00,
0x03,0xF8,0x00,0x00,0x00,0x03,0xF0,0x00,0x0E,0x60,0x00,0x00,0x03,0xF0,0x00,0x00,
0x01,0xF0,0x00,0x00,0x00,0x01,0x80,0x00,0x03,0xC0,0x00,0x00,0x01,0xC0,0x00,0x00,
0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
uchar const bmp3[]=
{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,0x7F,0x0F,0xC0,0x01,0x81,0xF0,0xF8,0x3C,0x06,0x00,0x0F,0x9E,0xF0,0x00,0x00,
0x00,0x31,0x98,0xC0,0x07,0x83,0x19,0x8C,0x6C,0x0E,0x00,0x18,0xCC,0x60,0x00,0x00,
0x00,0x36,0x18,0xC0,0x01,0x83,0x19,0x8C,0xC0,0x1E,0x00,0x18,0xCC,0x60,0x00,0x00,
0x00,0x36,0x30,0x00,0x01,0x83,0x19,0x8C,0xC0,0x36,0x00,0x18,0xCC,0x60,0x00,0x00,
0x00,0x3E,0x30,0x00,0x01,0x80,0x30,0xD8,0xF8,0x36,0x00,0x01,0x8C,0x60,0x00,0x00,
0x00,0x36,0x30,0x0F,0xF1,0x80,0x30,0x70,0xEC,0x66,0x3F,0xC1,0x8F,0xE0,0x00,0x00,
0x00,0x36,0x30,0x00,0x01,0x80,0x60,0xD8,0xC6,0x66,0x00,0x03,0x0C,0x60,0x00,0x00,
0x00,0x30,0x30,0x00,0x01,0x80,0xC1,0x8C,0xC6,0x7F,0x00,0x06,0x0C,0x60,0x00,0x00,
0x00,0x30,0x18,0xC0,0x01,0x81,0x81,0x8C,0xC6,0x06,0x00,0x0C,0x0C,0x60,0x00,0x00,
0x00,0x30,0x19,0x80,0x01,0x83,0x19,0x8C,0x6C,0x06,0x00,0x18,0xCC,0x60,0x00,0x00,
0x00,0x78,0x0F,0x00,0x07,0xE3,0xF8,0xF8,0x38,0x1F,0x00,0x1F,0xDE,0xF0,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,0x03,0x66,0x00,0x60,0x00,0x18,0x03,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0x66,0x00,0x30,0x00,0x0C,0x01,0x83,0x00,0x7F,0xF0,0x00,0x00,0x00,
0x00,0x00,0x1F,0xFF,0xC7,0xFF,0xC3,0xFF,0xF1,0xBF,0xF8,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0x66,0x06,0x00,0xC3,0x18,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0x66,0x0C,0x01,0x83,0x18,0x06,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1F,0xFF,0xC3,0xFE,0x03,0xFF,0xE3,0xC3,0x01,0xFF,0xFC,0x00,0x00,0x00,
0x00,0x00,0x18,0x61,0x80,0x0C,0x03,0x36,0x00,0xDF,0xE0,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x63,0x00,0x18,0x03,0x66,0x01,0x9B,0x60,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x07,0xFE,0x00,0x30,0x03,0xFF,0xE1,0x9F,0xE0,0x66,0xC0,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x0F,0xFF,0xE3,0x66,0x01,0x9B,0x60,0x66,0x60,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x00,0x30,0x03,0x06,0x07,0x1B,0x60,0xC6,0x30,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x00,0x30,0x03,0xFF,0xF3,0x1F,0xE1,0x86,0x38,0x00,0x00,0x00,
0x00,0x00,0x06,0x7E,0x00,0x30,0x03,0x06,0x03,0x00,0x03,0x06,0x18,0x00,0x00,0x00,
0x00,0x00,0x06,0x6C,0x00,0x30,0x06,0x06,0x03,0x0C,0xC0,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x00,0xF0,0x06,0x06,0x03,0x0C,0x60,0x1E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x00,0x60,0x0C,0x06,0x03,0x18,0x60,0x0C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x01,0x83,0x80,0x00,0x03,0xFF,0xF8,0xCD,0x80,0x00,0x00,0x00,
0x00,0x00,0x07,0xFE,0x00,0xE3,0x03,0xFF,0xC0,0x00,0x60,0x6D,0x80,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x00,0xC6,0x03,0x00,0xC0,0x00,0x60,0x6F,0xF0,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x0F,0xFF,0xC3,0x00,0xC0,0xFE,0x60,0x19,0x80,0x00,0x00,0x00,
0x00,0x00,0x07,0xFE,0x00,0xC6,0x03,0x00,0xC0,0xC6,0x60,0x01,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x00,0xC6,0x03,0x00,0xC0,0xC6,0x63,0xFF,0xF8,0x00,0x00,0x00,
0x00,0x00,0x0F,0xFF,0x00,0xC6,0x03,0x00,0xC0,0xC6,0x60,0x66,0xC0,0x00,0x00,0x00,
0x00,0x00,0x0C,0x63,0x0F,0xFF,0xE3,0x00,0xC0,0xC6,0x60,0x66,0xC0,0x00,0x00,0x00,
0x00,0x00,0x0C,0x63,0x00,0xC6,0x03,0x00,0xC0,0xFE,0x60,0x6C,0xD8,0x00,0x00,0x00,
0x00,0x00,0x0C,0x63,0x00,0xC6,0x03,0x00,0xC0,0xC6,0x60,0x6C,0xD8,0x00,0x00,0x00,
0x00,0x00,0x0F,0xFF,0x00,0xC6,0x03,0xFF,0xC0,0x00,0x60,0x78,0x78,0x00,0x00,0x00,
0x00,0x00,0x0C,0x63,0x01,0x86,0x03,0x00,0xC0,0x03,0x60,0x60,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x01,0x86,0x03,0x00,0xC0,0x01,0xE0,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x03,0x06,0x00,0x00,0x00,0x00,0xC1,0x9F,0xFC,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x06,0x06,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,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};
uchar const bmp4[]=
{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,0x7F,0x0F,0xC0,0x01,0x81,0xF0,0xF8,0x3C,0x06,0x00,0x0F,0x9E,0xF0,0x00,0x00,
0x00,0x31,0x98,0xC0,0x07,0x83,0x19,0x8C,0x6C,0x0E,0x00,0x18,0xCC,0x60,0x00,0x00,
0x00,0x36,0x18,0xC0,0x01,0x83,0x19,0x8C,0xC0,0x1E,0x00,0x18,0xCC,0x60,0x00,0x00,
0x00,0x36,0x30,0x00,0x01,0x83,0x19,0x8C,0xC0,0x36,0x00,0x01,0x8C,0x60,0x00,0x00,
0x00,0x3E,0x30,0x00,0x01,0x80,0x30,0xD8,0xF8,0x36,0x00,0x07,0x0C,0x60,0x00,0x00,
0x00,0x36,0x30,0x0F,0xF1,0x80,0x30,0x70,0xEC,0x66,0x3F,0xC1,0x8F,0xE0,0x00,0x00,
0x00,0x36,0x30,0x00,0x01,0x80,0x60,0xD8,0xC6,0x66,0x00,0x00,0xCC,0x60,0x00,0x00,
0x00,0x30,0x30,0x00,0x01,0x80,0xC1,0x8C,0xC6,0x7F,0x00,0x00,0xCC,0x60,0x00,0x00,
0x00,0x30,0x18,0xC0,0x01,0x81,0x81,0x8C,0xC6,0x06,0x00,0x18,0xCC,0x60,0x00,0x00,
0x00,0x30,0x19,0x80,0x01,0x83,0x19,0x8C,0x6C,0x06,0x00,0x19,0x8C,0x60,0x00,0x00,
0x00,0x78,0x0F,0x00,0x07,0xE3,0xF8,0xF8,0x38,0x1F,0x00,0x0F,0x1E,0xF0,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,0x03,0x66,0x00,0x60,0x00,0x18,0x03,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0x66,0x00,0x30,0x00,0x0C,0x01,0x83,0x00,0x7F,0xF0,0x00,0x00,0x00,
0x00,0x00,0x1F,0xFF,0xC7,0xFF,0xC3,0xFF,0xF1,0xBF,0xF8,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0x66,0x06,0x00,0xC3,0x18,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0x66,0x0C,0x01,0x83,0x18,0x06,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1F,0xFF,0xC3,0xFE,0x03,0xFF,0xE3,0xC3,0x01,0xFF,0xFC,0x00,0x00,0x00,
0x00,0x00,0x18,0x61,0x80,0x0C,0x03,0x36,0x00,0xDF,0xE0,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x30,0x63,0x00,0x18,0x03,0x66,0x01,0x9B,0x60,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x07,0xFE,0x00,0x30,0x03,0xFF,0xE1,0x9F,0xE0,0x66,0xC0,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x0F,0xFF,0xE3,0x66,0x01,0x9B,0x60,0x66,0x60,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x00,0x30,0x03,0x06,0x07,0x1B,0x60,0xC6,0x30,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x00,0x30,0x03,0xFF,0xF3,0x1F,0xE1,0x86,0x38,0x00,0x00,0x00,
0x00,0x00,0x06,0x7E,0x00,0x30,0x03,0x06,0x03,0x00,0x03,0x06,0x18,0x00,0x00,0x00,
0x00,0x00,0x06,0x6C,0x00,0x30,0x06,0x06,0x03,0x0C,0xC0,0x06,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x00,0xF0,0x06,0x06,0x03,0x0C,0x60,0x1E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x00,0x60,0x0C,0x06,0x03,0x18,0x60,0x0C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x01,0x83,0x80,0x00,0x03,0xFF,0xF8,0xCD,0x80,0x00,0x00,0x00,
0x00,0x00,0x07,0xFE,0x00,0xE3,0x03,0xFF,0xC0,0x00,0x60,0x6D,0x80,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x00,0xC6,0x03,0x00,0xC0,0x00,0x60,0x6F,0xF0,0x00,0x00,0x00,
0x00,0x00,0x06,0x66,0x0F,0xFF,0xC3,0x00,0xC0,0xFE,0x60,0x19,0x80,0x00,0x00,0x00,
0x00,0x00,0x07,0xFE,0x00,0xC6,0x03,0x00,0xC0,0xC6,0x60,0x01,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x00,0xC6,0x03,0x00,0xC0,0xC6,0x63,0xFF,0xF8,0x00,0x00,0x00,
0x00,0x00,0x0F,0xFF,0x00,0xC6,0x03,0x00,0xC0,0xC6,0x60,0x66,0xC0,0x00,0x00,0x00,
0x00,0x00,0x0C,0x63,0x0F,0xFF,0xE3,0x00,0xC0,0xC6,0x60,0x66,0xC0,0x00,0x00,0x00,
0x00,0x00,0x0C,0x63,0x00,0xC6,0x03,0x00,0xC0,0xFE,0x60,0x6C,0xD8,0x00,0x00,0x00,
0x00,0x00,0x0C,0x63,0x00,0xC6,0x03,0x00,0xC0,0xC6,0x60,0x6C,0xD8,0x00,0x00,0x00,
0x00,0x00,0x0F,0xFF,0x00,0xC6,0x03,0xFF,0xC0,0x00,0x60,0x78,0x78,0x00,0x00,0x00,
0x00,0x00,0x0C,0x63,0x01,0x86,0x03,0x00,0xC0,0x03,0x60,0x60,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x01,0x86,0x03,0x00,0xC0,0x01,0xE0,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x03,0x06,0x00,0x00,0x00,0x00,0xC1,0x9F,0xFC,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x06,0x06,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,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};
void delayus(void)
{
uchar i;
for(i=0;i<5;i++);
}
void SendByte(uchar Dbyte)
{
uchar i;
for(i=0;i<8;i++)
{
SCK = 0;
delayus();
if((Dbyte&0x80)==0x80)
SID = 1;
else
SID = 0;
Dbyte=Dbyte<<1;
delayus();
SCK = 1;
delayus();
}
}
uchar ReceiveByte()
{
uchar i,temp1,temp2;
temp1=temp2=0;
TRISD=0X40;
for(i=0;i<20;i++);
for(i=0;i<8;i++)
{
temp1=temp1<<1;
SCK = 0;
delayus();
SCK = 1;
delayus();
if(SID==1) temp1++;
delayus();
}
for(i=0;i<8;i++)
{
temp2=temp2<<1;
SCK = 0;
delayus();
SCK = 1;
delayus();
if(SID==1) temp2++;
delayus();
}
TRISD=0;
for(i=0;i<20;i++);
return ((0xf0&temp1)+(0x0f&temp2));
}
void busy( )
{
do SendByte(0xfc); //11111,RW(1),RS(0),0
while(0x80&ReceiveByte());
}
void write_cmd( uchar Cbyte )
{
CS = 1;
delayus();
busy();
SendByte(0xf8); //11111,RW(0),RS(0),0
SendByte(0xf0&Cbyte);
SendByte(0xf0&Cbyte<<4);
CS = 0;
delayus();
}
void write_data( uchar Dbyte )
{
CS = 1;
delayus();
busy();
SendByte(0xfa); //11111,RW(0),RS(1),0
SendByte(0xf0&Dbyte);
SendByte(0xf0&Dbyte<<4);
CS = 0;
delayus();
}
uchar ReadData( )
{
busy();
SendByte(0xfe); //11111,RW(1),RS(1),0
return ReceiveByte();
}
void delay(uint MS)
{
uint i,j;
for (i=0;i<MS;i++)
for(j=0;j<10;j++);
}
void LcmInit( )
{
write_cmd(0x30);
delay(100);
write_cmd(0x03);
delay(100);
write_cmd(0x0C);
delay(100);
write_cmd(0x01);
delay(100);
write_cmd(0x06);
delay(100);
}
void LcmClearTXT( )
{
uchar i;
write_cmd(0x30);
write_cmd(0x80);
for(i=0;i<64;i++)
write_data(0x20);
}
void LcmClearBMP()
{
uchar i,j;
write_cmd(0x34);
write_cmd(0x36);
for(i=0;i<32;i++)
{
write_cmd(0x80+i);
write_cmd(0x80);
for(j=0;j<32;j++)
write_data(0);
}
}
void PUTstring(uchar row,uchar col,uchar *puts)
{
write_cmd(0x30);
switch(row)
{
case 0: write_cmd(0x80+col);break;
case 1: write_cmd(0x90+col);break;
case 2: write_cmd(0x88+col);break;
case 3: write_cmd(0x98+col);break;
}
while(*puts != '\0')
{
write_data(*puts);
puts++;
}
}
void PUTZIZAO(uchar row,uchar col,uchar *puts)
{
uchar i=0,j=0,k=0;
write_cmd(0x34);
write_cmd(0x36);
for(i=0;i<16;i++)
{
write_cmd(0x80+i+row);
write_cmd(0x80+col);
write_data(puts[2*k]);
write_data(puts[2*k+1]);
k++;
}
}
void PUTBMP(uchar *puts)
{
uint x=0,y=0;
uchar i,j;
write_cmd(0x34);
write_cmd(0x36);
for(i=0;i<32;i++)
{
write_cmd(0x80+i);
write_cmd(0x80);
for(j=0;j<8;j++)
{
write_data(puts[2*x]);
write_data(puts[2*x+1]);
x++;
}
write_cmd(0x80+i);
write_cmd(0x88);
for(j=0;j<8;j++)
{
write_data(puts[2*y+512]);
write_data(puts[2*y+513]);
y++;
}
}
}
void oshuxian()
{
write_cmd(0x34);
write_cmd(0x36);
for(i=0;i<32;i++)
{ //write_cmd(0x36);
write_cmd(0x80+i);
write_cmd(0x80);
//write_cmd(0x30);
for(j=0;j<32;j++)
write_data(0xCC);
}
write_cmd(0x32);
}
void jishuxian()
{
write_cmd(0x34);
write_cmd(0x36);
for(i=0;i<32;i++)
{
//write_cmd(0x36);
write_cmd(i+0x80);
write_cmd(0x80);
//write_cmd(0x30);
for(j=0;j<32;j++)
write_data(0x33);
}
write_cmd(0x32);
}
void ohengxian()
{
LcmClearTXT();
write_cmd(0x34);
write_cmd(0x36);
for(i=0;i<16;i++)
{
//write_cmd(0x36);
write_cmd(0x80+2*i);
write_cmd(0x80);
//write_cmd(0x30);
for(j=0;j<32;j++)write_data(0xFF);
//write_cmd(0x36);
write_cmd(0x80+2*i+1);
write_cmd(0x80);
//write_cmd(0x30);
for(j=0;j<32;j++)write_data(0);
}
write_cmd(0x32);
}
void dianxian()
{
LcmClearTXT();
write_cmd(0x34);
write_cmd(0x36);
for(i=0;i<16;i++)
{ //write_cmd(0x36);
write_cmd(0x80+2*i);
write_cmd(0x80);
//write_cmd(0x30);
for(j=0;j<32;j++)write_data(0XAA);
//write_cmd(0x36);
write_cmd(0x80+2*i+1);
write_cmd(0x80);
//write_cmd(0x30);
for(j=0;j<32;j++)write_data(0x55);
}
write_cmd(0x32);
}
void hanzi()
{
LcmClearBMP();
write_cmd(0x30);
PUTstring(0,0,"深圳方寸电子有限");
PUTstring(1,0,"公司南山区西丽南");
PUTstring(2,0,"湾工业区10栋4 楼");
PUTstring(3,0,"方寸之间精彩尽显");
}
void jihengxian()
{
write_cmd(0x34);
write_cmd(0x36);
for(i=0;i<16;i++)
{
//write_cmd(0x36);
write_cmd(0x80+2*i);
write_cmd(0x80);
//write_cmd(0x30);
for(j=0;j<32;j++)write_data(0);
//write_cmd(0x36);
write_cmd(0x80+2*i+1);
write_cmd(0x80);
//write_cmd(0x30);
for(j=0;j<32;j++)write_data(0xFF);
}
write_cmd(0x32);
}
void main(void)
{
uint k;
ANSELE=0X02;
ANSELD=0;
WPUE=0X04;
TRISE=0X04;
TRISD=0;
LcmInit();
LcmClearTXT();
LcmClearBMP();
hanzi();
while(1)
{
if(KEY==0)
{
for(k=0;k<2000;k++);
if(KEY==0)
{
while(KEY==0);
yemiancount++;
if(yemiancount>=9)
yemiancount=0;
RE0^=1;
}
}
/*switch(yemiancount)
{
case 0: PUTBMP(bmp4);break;
case 1: PUTBMP(bmp1);break;
case 2: hanzi();break;
case 3: dianxian();break;
case 4: ohengxian();break;
case 5: jihengxian();break;
case 6: oshuxian();break;
case 7: jishuxian();break;
case 8: PUTBMP(bmp2);break;
}*/
}
return;
}
效果图:
|
共1人点赞
|