Step 6Understanding the LCD
The Nokia 3310 display addresses it's 84x42 pixels with 0-83 on the X axis, and 0-5 on the Y axis. The display has 6 pixels "Banks" on the Y axis, and these banks are 8 pixels tall and 84 pixels wide. By doing this, we can represent 8 pixels on the Y axis in just 1 byte! As you know, 1 byte is made up of 8 bits. 11111111 is translated to 8 solid pixels on the Y axis. The only downside is that you HAVE to write 8 pixels at a time and overwrite the existing data at the location.
Each time you draw pixels to the display, the display will automatically move to the next byte on the X axis. You will find this very convenient, as you do not have to move manually every time you draw something. If you're on the last byte of a bank, the display will instead send you to the 1st byte on the next bank, and if it is on the bottom of the display, you will continue from the top.
Note that the 1st bit in the byte you draw is the upper pixel, and the 8th bit is the lower pixel!
To write pixels to the display, you use the function LCD_writeData( data ) on the microcontroller. This will draw 8 pixels on the current XY location, overwriting the existing pixels at that location.
You can also send commands to the display, by using the LCD_writeCommand( data ) function. There aren't too many commands you can send to the display that are of interest other than initializing, however, the commands you might want to use are:
* 0b00001000 - Display blank screen ( Does not clear the display )
* 0b00001100 - Normal mode ( Disables invert mode and blank/fill modes )
* 0b00001001 - Display filled screen ( Does not clear the display )
* 0b00001101 - Invert mode ( Inverts the screen )
To move to XY locations, you also use commands, however, we have a function that does it for us: LCD_gotoXY( X, Y ), but in case you need them, they are:
* 0b01000YYY - Moves to 0bYYY on the Y axis (Replace Y with desired binary value)
* 0b1XXXXXXX - Movies to 0bXXXXXXX on the X axis (Replace X with desired value)
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|











































