Nokia 3310 LCD Interfacing

In this tutorial we will interface Nokia 3310 LCD with AT89C51.The Nokia 3310 LCD is based on a PCD8544 48x84 pixels matrix LCD controller.

Pin Diagram

Circuit Diagram

NOTE:Nokia 3310 LCD works on voltage level of 3.3v.To get this voltage level 10K resistor array, LED, diodes are used.

Few details

Display Data RAM (DDRAM)

The DDRAM is a 48x84 bit static RAM which stores the display data. The RAM is divided into six banks of 84 bytes (6x8x84 bits). During RAM access, data is transferred to the RAM through the serial interface. There is a direct correspondence between the X-address and the column output number.

Addressing

The columns are addressed by the address pointer. The address ranges are:

X 0 to 83 (1010011)

Y 0 to 5 (101)

Addresses outside these ranges are not allowed.

Horizontal addressing mode:

In the horizontal addressing mode, the X address increments after each byte. After the last X address (X = 83), X wraps around to 0 and Y increments to address the next row. After the very last address (X = 83 and Y = 5), the address pointers wrap around to address (X = 0 and Y = 0).

Lcd command list

21H: Activate Chip and H=1.

90H: Set Vop voltage (contrast)

13H: Adjust voltage bias.

20H: Horizontal addressing and H=0

09H: Activate all segments.

08H: Blank the Display.

0CH: Display Normal.

0DH: Inverse video mode

Y-ram address: 40H or (y and 07H)

X-ram address: 80H or (y and 7FH)

Serial Bus Protocol

Serial interface maximum 4.0 Mbits/s

The MSB of a byte is transmitted first.

The serial interface is initialized when SCE is HIGH. In this state, SCLK clock pulses have no effect and no power is consumed by the serial interface.

A negative edge on SCE enables the serial interface and indicates the start of a data transmission.

SDIN is sampled at the positive edge of SCLK. The level of the D/C signal is read during the last bit of data byte.

Convert BMP to HEX

1. Create bitmap image using MS Paint.

2. Go to Image/Attribute option

Set width: 88 and height: 48

Select unit: Pixels color: Black and white

3. Invert color

4. Rotate 270 degree.

5. Save as image.bmp

6. In command prompt go to directory where z_bmptohex.exe is saved.

7. In command prompt type z_bmptohex image.bmp

8. You will see that image_bmp.inc file is created having hex array of [88] [6]

9. Open image_bmp.inc file in notepad and delete first four rows of array so that you get [84] [6] matrix.

10. Copy this array and convert this file according to your assembler syntax and paste into your main program code.

Source code : Nok3310_code.asm

Output

0 comments:

Post a Comment

 
Mobile Phones Blog | Features,Concepts,Applications and Prices © 2012 | Designed by Cheap TVS, in collaboration with Vegan Breakfast, Royalty Free Images and Live Cricket Score