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.

4 bit mode of PIC to LCD intefacing

Status
Not open for further replies.

bangunprayogi

Newbie level 5
Joined
May 19, 2005
Messages
9
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Bandung, Indonesia
Activity points
1,361
lcd 4 bit mode

Hi, I have quetion about The PIC to LCD interfacing in 4 bit mode,
If I use the equivalent of the HD447780 LCD module to PIC16F84A interfacing in 4 bit mode(there are DB4-DB7 connect to the pins of PIC) and I use the PICbasic Compiler , Do I must be setting the software/program for this purpose or this way is enough? (I read from a paper that something must be set in that program because the default of the LCD module is 8 bit mode, but it was'nt explained). Please, somebody help me.
 

hd447780

hi

you need to tell picbasic that you are using a 4bit interface.

for more information about picbasic you can check the forum at:

picbasic.co.uk

its a great site dedicated for picbasic users.


best regards
ferds
 

programming pic 4 bit mode

Look at datasheet below, mainly in page 26. It's give the procedures for initialization in a 4 bits mode. But for LCDs works well, you have to send a nibble (with 0x3) value, three times, before you send commands request on page 26 of datasheet.

Example:

bit_clear(RS); // RS = 0;
delay(d100us);
bit_clear(RW); // RW = 0;
delay(d100us);
bit_set(ENABLE); // E = 1;

delay(d50ms);
for(i=1;i<=3;++i)
{
lcd_send_nibble(3); // Send it 3 times
delay(d5ms);
}

// Here start datasheet procedures
lcd_send_nibble(2);
delay(d5ms);


// 1º byte FUNCTION SET
lcd_send_byte(0,0x28); // 0 0 1 DL N F X X

delay(d5ms); // consta no datasheet KS0066 da Samsung

// 2º byte DISPLAY ON/OFF CONTROL
lcd_send_byte(0,0x0F); // 0 0 0 0 1 D C B

delay(d5ms); // consta no datasheet KS0066 da Samsung

// 3º byte Display Clear
lcd_send_byte(0,0x01); // 0 0 0 0 0 0 0 1

delay(d5ms); // consta no datasheet KS0066 da Samsung

// 4º byte Entry Mode Set
lcd_send_byte(0,0x0C); // 0 0 0 0 0 1 I/D SH
 

ks0066 samsung

Se also HD44780
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top