{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

LCD - Care - Example Initialization Program void...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Example Initialization Program /*************************************************************/ /*************************************************************/ void write_command(unsigned char datum) { A0=0; /*Instruction register*/ E=1; /*Read inactive*/ bus=datum; /*put data on port 1*/ CSB=0; /*Chip select active*/ RW=0; /*Write active*/ RW=1; /*Write inactive; latch in data*/ CSB=1; /*Chip select inactive*/ } /*************************************************************/ void write_data(unsigned char datum) { A0=1; /*DDRAM data register*/ E=1; bus=datum; CSB=0; RW=0; RW=1; CSB=1; } /*************************************************************/ void lcd_init(void){ Const unsigned char lcd_rs2[] = { 0xa2, // ICON OFF; 0xae, // Display OFF 0x48, // Set Duty ratio 0x80, // No operation 0xa0, // Set scan direction 0xc8, // SHL select 0x40, 0x00, // Set START LINE 0xab, // OSC on 0x64, 0xff, // 3x 0x65, 0xff, // 4x 0x66, 0xff, // 5x 0x67, 0xff, // 6x Ra_Rb, // RESISTER SET 0x81, // Set electronic volume register vopcode, // n=0~3f 0x57, // 1/12bias 0x92, // FRC and pwm 0x2C, 0xff, 0x2E, 0xff, 0x2F, 0xff, 0x92, // frc and pwm 0x38, // external mode 0x75, /*** start settings for 16‐level grayscale ***/ 0x97, // 3frc,45pwm 0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, 0x00, 0x84, 0x06, 0x85, 0x06,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
0x86, 0x06, 0x87, 0x06, 0x88, 0x0b, 0x89, 0x0b, 0x8a, 0x0b, 0x8b, 0x0b, 0x8c, 0x10, 0x8d, 0x10, 0x8e, 0x10, 0x8f, 0x10, 0x90, 0x15, 0x91, 0x15, 0x92, 0x15, 0x93, 0x15, 0x94, 0x1a, 0x95, 0x1a, 0x96, 0x1a,
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}