BCC Microprocessors Class- How To Use An LCD Screen

BCC Microprocessors Class- How To Use An LCD Screen


Today we’re going to show you how to plug
in an LCD screen. These screens have 4 lines, 20 characters per line. You can display text
and other ASCII characters. To start, you want to check your board, make sure that it’s
set to 5V. What you can do- this piece comes off, if it’s on the right 2 pins, it’ll be
3.3V, if it’s on the left two pins, it’ll be 5V. You want this to be 5V to run the screen.To
plug the screen in, look on the bottom, you got a set of pins here, and on the board,
you’ve got a bank there to plug them in to. So plug it in so that the cord comes off the
bottom of the board. As you can see, the screen is showing blank characters. Once you program
the chip, you’ll be able to output data to it. When you plug the screen in, keep in mind
that it’s going to use up port D, pins 7-14, and it’s going to use bits 4 and 5 on port
C. So you’ll have to program around that; you won’t be able to use those ports when
the screen is plugged in. We’re going to take a look at some coding so you know how to program
this screen. So when you want to start programming your LCD screen, open AVR Studio and create
a C programming file. You need to include the “lcd_text_driver328.h”. Download that
from Angel Microprocessors Class. Put that file in the same folder as your C file. Once
it’s there, you can access the file and use it for whatever you need. Here is a list of
commands below the include. You can do things like clear the screen, output ASCII data,
move the cursor back home. Below that is an example of how to output a simple line of
text. Whenever you use this screen, you’ll have to use the “lcd_init”. That initializes
the screen. You have to use it whenever you program with the screen. Once you have the
init down, you can start doing whatever you want. In this example, I showed you the command
to output the text, “Hello World” As you can see in the list of commands above, there are
plenty of commands you can use in order to utilize this screen

Leave a Reply

Your email address will not be published. Required fields are marked *