LCD - Care

LCD - Care - Example Initialization Program

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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...
View Full Document

This document was uploaded on 02/08/2012.

Page1 / 3

LCD - Care - Example Initialization Program

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online