3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Connecting Nokia 3310 LCD to USB using AVR

Step 6Understanding the LCD

Understanding the LCD
The Nokia 3310 display works in a pretty strange way, so we will cover how it works in this step.

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 StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
7
Followers
1
Author:wkter