PIC Experimenter's Board Manual
Built-in LCD
The LCD module combines a serial interface and a 2-line by 16 character display. The LCD module can be set to receive serial data at 300, 1200, 2400 and 9600 baud (true or inverted, switch selectable).To use the built-in LCD, connect a jumper from the desired output pin on the microcontroller to the serial in. It is not necessary to connect the ground line unless the serial data is coming from a source off of the Experimenter’s Board.
The LCD Module has two operational modes: text and instruction. The default is text mode; Data received via the Serial In LINE appears on the screen. Send the string “Images” and “Images” will appear on the LCD. To input instructions to the LCD module, such as clear screen, go to line 2, etc., you must prefix the instruction with ASCII 254 (0xFE). The byte following prefix is seen and treated as a instruction code. After the instruction code, the unit automatically returns to text mode. Every instruction code must be sent with its own 254 prefix.
If your LCD is backlit, you may adjust the backlight contrast to the optimal setting via the “LCD Contrast” control. The contrast control is set fully clockwise (highest contrast) at the factory, but you can adjust the control by hand.
To set the baud rate, there are three sets of jumpers: J1 – J3. Set the jumpers in accordance with the diagram on the board. At all baud rates, serial data is received at 8 data bits, 1 stop bit, no parity. Note that the baud rate setting is only read once at startup, so changing the jumpers while the module is active will not have any affect until the LCD is reset.
Once the LCD module is properly connected and configured to match the baud rate of the computer/program that will be talking to it serially, data sent to it will appear on the display. For example, if you send “Hello” then “Hello” appears on the display. The cursor (printing position) automatically moves from left to right.
You can also send instructions to the LCD module. To identify a particular byte as an instruction, precede it with the instruction prefix character, ASCII 254 (0xFE hex, 11111110 binary). The interface treats the byte immediately after the prefix as an instruction, then automatically returns to data mode. For example: The clear-screen instruction is ASCII 1. To clear the screen, send <254><1> (where the <> symbols mean single bytes set to these values, not text as typed from the keyboard).
LCD Instruction Codes
Instruction
Clear Screen
Home position (move cursor top left of display)
Move cursor one character position left
Move cursor one character position right
Scroll display one character position left
Scroll display one character position right
Set cursor porition (DDRAM address)
Set point in character-generator (CG) Ram
Code (Decimal)
1
2
16
20
24
28
128+addr
64+addr
The LCD module has a self-testing mode that will print the current jumper setting’s baud rate and mode (true/inverted). To enter self-test mode, connect the serial in line to ground (for True) or +5V (for Inverted) upon LCD module startup. NOTE: If serial-in line is improperly connected for Self-Test mode, for instance connected to +5V when jumpers are set for True mode, the LCD display will remain blank. The module stays in self-test mode as long as the serial in line is held either high (inverted mode) or low (true mode). LCD module may be exited from self-test mode on the fly by simply connecting the serial-in line to a serial source.
When you print past the end of a line, the next 24 characters do not show up on the LCD screen. They are not lost; they are in an off-screen memory area. All alphanumeric LCD modules have 80 bytes of memory, arranged appropriately for a 2x40 screen. On LCDs with smaller screens (such as this 2x16), text printed past the end of a visible line goes into memory, but can’t be seen on the screen. Use cursor-positioning instructions to print to a particular location on the display. Or deliberately print in off-screen memory to temporarily hide text, then send scroll-left instructions to reveal it.
LCDs: More Information
More information on the LCD is available in the Serial LCD Module manual.