Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Friday, June 27, 2014

INTERFACING OF PIC18F4550 TO LCD IN 8-BIT MODE

INTERFACING OF PIC18F4550 TO LCD IN 8-BIT MODE

All LCD have two mode of working:

1.)           For 8-bit mode => Command is (0x38).

2.)           For 4-bit mode => Command is (0x28).

Interfacing of PIC to LCD in 8-Bit mode with Busy mode.
  • Busy mode is checked using last data pin of LCD display (D7).
  • If D7 is High When en Pin.

  
3 Important Pin of LCD are rs, rw, en.
  • rs = Register Select pin is used to Select Command or Data Register.
  • rw = Read/Write pin is used to Read or Write Data.
  • en = Enable pin is used to latch data into display and to read data from lcd.
rs
0
Command
1
Data
rw
0
Write
1
Read
en
1-> 0
Latch data into LCD
0 -> 1
Latch data out from LCD








PORTD = LCD Data.
STEP1:  1st Set the Last Bit of PORTD i.e. RD7
STEP2:  rs = 0; To Select Command Register.
STEP3:  rw = 1; To Select Read Mode.
STEP4:  en => High to Low. To Latch data out of LCD
STEP5:  Check for Bit Set D7 and if D7 => 1; go to Step4.
                Or else do nothing.


We have to make 3 important Function.
1.) Command Function to send command to LCD
2.) Data Function to send single data to LCD
3.) Initialize LCD to Work in 8-biit Mode.

MODE                             Explanation
0x38       -    LCD as 16 x 2 line in 8-bit mode
0x28       -    LCD as 16 x 2 line in 4-bit mode.
0x0C      -     Cursor ON, Blinking OFF
0x0E      -     Cursor ON, Blinking ON
0x06       -     Auto increment Cursor
0x80       -     1st line and 1st location of LCD
0xC0      -      2nd line and 1st location





Now rest all you will understand by seeing the Code.
Thank You.

Thursday, June 26, 2014

INTERFACING OF PIC18F4550 TO LCD IN 4-BIT MODE

INTERFACING OF PIC18F4550 TO LCD IN 4-BIT MODE

LCD Description:

LCD display has 3 control pin:
       
       1.)  Register Select Pin (rs)
       2.) Read/Write Pin (rw)
       3.) Enable Pin (en)

Register Select Pin used for selecting the Register of LCD i.e.
Command Register or Data Register.
rs = 0; Command Register.
rs = 1; Data Register.

Read /Write Pin used for selecting Read from or Write to LCD i.e.
rw = 0; Write mode.
rw = 1; Read mode.

Enable Pin used for Latching Data into LCD data Register.
When Write Data to LCD en must go High to Low.
And to Read Data from LCD en must go Low to High.




LCD has 8-bit Data Pin:

We are using 4-bit Mode, so we are using only high 4-bit.
i.e. (D7-D4).



Thank You.
Plz Do Share and Subscribe the Video.
Code: Click For Code
For Video on Above Program: Click For Video