Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

3 Wire serial lcd [ 74HC595 and LCD]

Status
Not open for further replies.

Jestin_cubetech

Advanced Member level 1
Advanced Member level 1
Joined
Jun 24, 2012
Messages
499
Helped
76
Reputation
152
Reaction score
73
Trophy points
1,328
Activity points
3,697
3 Wire serial LCD [ 74HC595 and 20X4 LCD]

3 wire lcd.PNG


Code:
                   //4bit lcd mode  

#define L_SCK RD0   //LATCH CK
#define S_SCK RD1  //SHIFT CK
#define SDO   RD2  //DATA OUTPUT

#define LATCH  L_SCK=1;  L_SCK=0;    
#define SHIFT  S_SCK=1;  S_SCK=0;


void serial_lcd(unsigned char val)
{
for(char i=0;i<8;i++)
{
 SDO=(val&0X80)>>7; val<<=1;   //LSB  lcd control pins    and   MSB Lcd data pins  
 SHIFT;
}
 LATCH;
}


void lcd_send(unsigned char type,unsigned char val)	  //type 0=command 1=data  lcd value  	 
{

   serial_lcd(type|(val&0xf0));            //Set RS  and Data 
   serial_lcd(0x04|(val&0xf0));            // EN=1   and Data 
   serial_lcd(type|(val&0xf0));            //EN=0    and Data 

   serial_lcd(type|((val<<4)&0xf0));    //Set RS  and Data 
   serial_lcd(0x04|(val<<4)&0xf0);      // EN=1   and Data 
   serial_lcd(type|((val<<4)&0xf0));    //EN=0    and Data 

}
 

Jestin_cubetech, please send the all code of your 3 Wire serial LCD [ 74HC595 and 20X4 LCD]!!!

Thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top