USB + Serial RGB Backlight Character LCD Backpack

Similar documents
Character LCDs. Created by Ladyada. Last updated on :45:29 PM EDT

Arduino Lesson 0. Getting Started

LCD I 2 C/Serial RX Backpack. Data Sheet. LCD to I2C/Serial RX Backpack I2C or Serial RX communication with Standard 16 Pin LCD modules

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

Parallax Serial LCD 2 rows x 16 characters Non-backlit (#27976) 2 rows x 16 characters Backlit (#27977) 4 rows x 20 characters Backlit (#27979)

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Table 1 below is a complete list of MPTH commands with descriptions. Table 1 : MPTH Commands. Command Name Code Setting Value Description

2.2" TFT Display. Created by Ladyada. Last updated on :15:09 PM EDT

How to Make a Pogo Pin Test Jig. Created by Tyler Cooper

Adafruit's Raspberry Pi Lesson 5. Using a Console Cable

IOIO for Android Beginners Guide Introduction

Cart Interface Installation & Control Board Manual for M38 XP and RX Carts and Legacy M39 Carts

Adafruit's Raspberry Pi Lesson 5. Using a Console Cable. Created by Simon Monk

STIM202 Evaluation Kit

Arduino Lesson 1. Blink

Introducing the Adafruit Bluefruit LE Sniffer

Virtual Integrated Design Getting started with RS232 Hex Com Tool v6.0

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

Adafruit's Raspberry Pi Lesson 5. Using a Console Cable

DS1307 Real Time Clock Breakout Board Kit

Lab Experiment 1: The LPC 2148 Education Board

User Guide Reflow Toaster Oven Controller

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate With the Eagle System

Getting started with the O Watch

How to setup a serial Bluetooth adapter Master Guide

Rapid Assessment Key User Manual

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

XBee USB Adapter Board (#32400)

Animated Lighting Software Overview

Matrix and 7-Segment LED Backpack with the Raspberry Pi

[F/T] [5] [KHz] [AMP] [3] [V] 4 ) To set DC offset to -2.5V press the following keys [OFS] [+/-] [2] [.] [5] [V]

Arduino Due Back. Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum. Overview

CAN-Bus Shield Hookup Guide

Building a Basic Communication Network using XBee DigiMesh. Keywords: XBee, Networking, Zigbee, Digimesh, Mesh, Python, Smart Home

PM1122 INT DIGITAL INTERFACE REMOTE

KTA-223 Arduino Compatible Relay Controller

Lizard Standalone Mode Guide Version 1.0:

Adafruit ATWINC1500 WiFi Breakout

TSL2561 Luminosity Sensor

Setup Manual and Programming Reference. RGA Ethernet Adapter. Stanford Research Systems. Revision 1.05 (11/2010)

Waspmote. Quickstart Guide

The $25 Son of a cheap timer This is not suitable for a beginner. You must have soldering skills in order to build this kit.

NHD-0420D3Z-FL-GBW-V3

Your Multimeter. The Arduino Uno 10/1/2012. Using Your Arduino, Breadboard and Multimeter. EAS 199A Fall Work in teams of two!

B&K Precision 1785B, 1786B, 1787B, 1788 Power supply Python Library

Arduino Lesson 14. Servo Motors

Application & Quick-Start Guide

RGB LED Strips. Created by lady ada. Last updated on :00:18 PM EST

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

Warnings: This manual is intended to guide a technicians or customers who would like to repair DBL's

MS830 / MS833 Barcode Reader v1.0 9-December-2014

Getting Started Guide with WIZ550web

PolyBot Board. User's Guide V1.11 9/20/08

RN-WIFLY-EVAL-UM. WiFly Evaluation Kit Roving Networks. All rights reserved. RN-WIFLY-EVAL-UM Version 1.32r 10/9/2012 USER MANUAL

TP- 051 GPS RECEIVER

AR1100 Resistive Touch Screen Controller Guide

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Microprocessor Project Laboratory

Adafruit's Raspberry Pi Lesson 1. Preparing an SD Card for your Raspberry Pi

TUTORIAL FOR INITIALIZING BLUETOOTH COMMUNICATION BETWEEN ANDROID AND ARDUINO

TPG MOBILE BROADBAND QUICK SETUP GUIDE

TekBots TM Oregon State University. usb_cam User Guide. Version 1.0 By Adriaan Smit OSU EE Graduate Student

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

DSO138 oscilloscope program upgrade method

LDG Electronics External Meter Serial Communications Protocol Specification

Arduino Lesson 5. The Serial Monitor

INTRODUCTION TO SERIAL ARM

USB - FPGA MODULE (PRELIMINARY)

#include <Gamer.h> Gamer gamer; void setup() { gamer.begin(); } void loop() {

TOSR0X-D. USB/Wireless Timer Relay Module. User Manual. Tinysine 2013 Version 1.0

RN-131-PICTAIL & RN-171-PICTAIL Web-Server Demo Application

Adafruit BME280 Humidity + Barometric Pressure + Temperature Sensor Breakout

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Programming the BetaBrite Classic LED electronic sign

UM0853 User manual. 1 Introduction. M24LRxx application software user guide

How to connect to a Class II router using a mobile-phone data cable specifically for Solwise & Safecom routers

SYMETRIX SOLUTIONS: TECH TIP August 2015

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

File Management Windows

Virtual Serial Port over USB For PD & PC Series Printers

8 by 8 dot matrix LED displays with Cascadable Serial driver B32CDM8 B48CDM8 B64CDM8 General Description

TEECES DOME LIGHTING SYSTEMS

Model: LD1000 Series. USB Interface Customer Displays. 2 by 20 character display USER MANUAL. Rev 1.0

Tutorial for MPLAB Starter Kit for PIC18F

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

Tiny Arduino Music Visualizer

ee-quipment.com ee203 RTCM USB Quick-Start Guide

RS232 Board datasheet

Building A Computer: A Beginners Guide

SOLAROX RGB-Master Pro LAN. RGB-Master Pro LAN. Network-compatible RGBW Controller -

Adafruit SHT31-D Temperature & Humidity Sensor Breakout

RN-131-PICTAIL & RN-171-PICTAIL Evaluation Boards

TX3 Series TELEPHONE ACCESS SYSTEMS. Configurator Quick Start. Version 2.2 Mircom Copyright 2014 LT-973

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board

Intro to Intel Galileo - IoT Apps GERARDO CARMONA

ENTTEC Pixie Driver API Specification

CM HOST CM CardTransporter Fuel Communication and Management Software Software version up to 3.1

Current Cost Data Cable User Guide. Installing and configuring the data cable

Transcription:

USB + Serial RGB Backlight Character LCD Backpack Created by Tyler Cooper Last updated on 2015-11-30 02:10:10 PM EST

Guide Contents Guide Contents Overview USB or TTL Serial Assembly Sending Text Testing with USB Testing with TTL Serial Command Reference Downloads Drivers Support Forums 2 3 5 7 13 14 17 21 23 23 25 Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 2 of 25

Overview Adding a character display to your project or computer has never been easier with the new Adafruit USB or TTL serial backpack! This custom-designed PCB sits on the back of any 'standard' character LCD (16x2 or 20x4 sized) (http://adafru.it/ais) and does everything you could want: printing text, automatic scrolling, setting the backlight, adjusting contrast, making custom characters, turning on and off the cursor, etc. It can even handle our RGB backlight LCDs with full 8-bit PWM control of the backlight. That means you can change the background color to anything you want - red, green, blue, pink, white, purple yellow, teal, salmon, chartreuse, or just leave it off for a neutral background. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 3 of 25

Inside the backpack is an USB-capable AT90USB162 chip that listens for commands both a mini-b USB port and a TTL serial input wire. The USB interface shows up as a COM/serial port on Windows/Mac/Linux. The backpack will automatically select data from whichever input is being used. For the USB connection, it will work at any baud rate. For the TTL connection, the default baud rate is 9600 but you can send it a command to set the baud rate to 2400, 4800, 9600, 19200, 28800, or 57600 baud. (The baud rate is flashed on the LCD during powerup). Any customizations such as baud rate, backlight color, brightness, splash screen, etc. are stored permanently EEPROM. The command interface is compatible with the popular "Matrix Orbital" specifications so this backpack will work perfectly with computer applications or libraries that are expecting a "Matrix" LCD. We added a few extra commands for the RGB backlight and setting the LCD size. If you don't want to use the commands, you can just start sending ASCII to the LCD and it will magically appear as typed. Pick up one from the Adafruit shop today! (http://adafru.it/ais) Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 4 of 25

USB or TTL Serial There are two interfaces for transmitting data to the backpack: USB and Serial. USB is the easiest: simply plug a mini-b cable from the backpack to a computer to power and connect. The backpack will appear as a "USB Serial Port" to Windows, Mac and Linux computers. An INF file is required for windows, no driver is required for Mac or Linux. Windows computers will create a COM port, Mac/Linux will create a device under /dev/cu.usbserialxx or similar, run dmesg right after plugging in to see what the device is called. With USB, use any terminal progam to connect at any baud rate to the port and send text and command data. The baud rate is not used for USB so just connect at 9600 or whichever is easiest. You can also connect with the TTL serial input. This is the red/black/white cable. Power is provided by connecting the black wire to ground and the red wire to +5V. The white cable is the 5V TTL serial input. By default, the backpack is configured for 9600 baud, 8 bit, no parity, 1 stop bit. You can configure the baud rate if you need faster/slower TTL interface. When powered, the backpack will blink the baud rate onto the display for 100 milliseconds so if you're ever really confused, connect while watching the display. You can always connect with USB (baud rate is not used for USB) and reset the baud rate there. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 5 of 25

For hard-wiring the USB connection, there is a USB breakout in the standard '5x1' pinout for red, black, white, and green USB wires. For hardwiring the TTL connection, there are breakouts for the RX and TX pin. along the edge of the PCB. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 6 of 25

Assembly The first step is to solder a character LCD display onto the backpack. Remember that only character type displays are supported, and they can be up to 20x4 in size but no larger. All Adafruit character displays work (http://adafru.it/ais)but we can't guarantee any others will work! If you buy a kit from adafruit you may get an extra blue 10K potentiometer. This part isn't required for this kit so you can use it for another project! The backpack comes with a piece of header you can use to fit the display on. Its handy to have a solderless breadboard to attach the header on straight. Your kit may also come with a blue 3-pin potentiometer, this part is not required, you can simply recycle it into another project. Break off the header so that it matches the number of pins on your LCD. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 7 of 25

Place the header with the long side down into a breadboard. then place the LCD on top. If you're using an LCD with two rows available, make sure you're using the row that matches the image below. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 8 of 25

Solder all the headers on with your iron. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 9 of 25

Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 10 of 25

Next, align the backpack so that it matches up with the corner of the LCD, the hole in the backpack should be in the same location. Solder the backpack on completely. Thats it! Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 11 of 25

Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 12 of 25

Sending Text To display text, just send ASCII characters! There are a few special characters to note: New line character (0x0A or '\n') will fill the rest of the current row with spaces (to blank it) and move to the next line Carriage return (0x0D or '\r') is not listened to Backspace (0x08) will back up the character one space and replace the last character with a space to erase it. There are also a bunch of special commands, see below for how to send those commands below. The only character that is 'special' is 0xFE which is the 'command start' character. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 13 of 25

Testing with USB The easiest way to test the LCD and backpack is to connect to it to your computer and send data with a terminal program. Use any mini-b USB cable to connect to the backpack. If you're using windows, you'll need to point it to an INF driver file. See below in the download section for that INF file. Mac and Linux do not require a driver. After the backpack is plugged in, it will create a serial port. Under windows this is called a COM port. You can look in the Device Manager Ports to see what the name of the COM port created is. You should see an entry appear/disappear when connecting the USB cable. For mac/linux, once you have plugged in the cable, run dmesg to see what the name of the port is, probably something like /dev/cu.usbmodem-xxxx or similar. You can also type ls /dev/cu.* into a Termnal window and see what items appear/disappear when the cable is connected and unplugged. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 14 of 25

Now that the port is known, you can use your favorite terminal program to connect. For this example, we'll use the basic terminal built into Arduino. The only downside of the serial port monitor is that you can only send a full string at a time and there's a new line at the end. If you are using a more powerful monitor such as CoolTerm (mac) or RealTerm (Windows) you can watch as each character is entered Start by selecting the same COM serial port that belongs to the backpack. Open the serial port monitor and type Hello World! into the text box. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 15 of 25

Once you hit Send it will transfer the text to the backpack, and it will appear. Thats it! For more commands, check the github repository (see the Downloads tab) for a python script that will test all commands on the display. Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 16 of 25

Testing with TTL Serial Next we will demonstrate how to send text and commands using an Arduino microcontroller. You can of course use any microcontroller that has a serial output you can configure for 9600 baud. This demo will show how to set the display size, RGB backlight and create a custom character. For more commands, see below for the full list of supported commands Grab an Arduino and connect the JST cable to the backpack as follows: Red wire goes to +5V, Black wire goes to Ground, White data wire goes to digital #2. You can change the digital pin later, but stick with #2 for this example and adjust later as desired. You can download this example from this Github repository (http://adafru.it/jhb). #include "Arduino.h" #if defined(arduino_arch_samd) defined( SAM3X8E ) // use pin 18 with Due, pin 1 with Zero or M0 Pro #define lcd Serial1 #else #include <SoftwareSerial.h> // Create a software serial port! SoftwareSerial lcd = SoftwareSerial(0,2); #endif // for ESP8266 use this SoftwareSerial library: https://github.com/plerup/espsoftwareserial void setup() { lcd.begin(9600); // set the size of the display if it isn't 16x2 (you only have to do this once) lcd.write(0xfe); lcd.write(0xd1); lcd.write(16); // 16 columns lcd.write(2); // 2 rows delay(10); // we suggest putting delays after each command to make sure the data // is sent and the LCD is updated. // set the contrast, 200 is a good place to start, adjust as desired lcd.write(0xfe); lcd.write(0x50); lcd.write(200); delay(10); Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 17 of 25

// set the brightness - we'll max it (255 is max brightness) lcd.write(0xfe); lcd.write(0x99); lcd.write(255); delay(10); // turn off cursors lcd.write(0xfe); lcd.write(0x4b); lcd.write(0xfe); lcd.write(0x54); // create a custom character lcd.write(0xfe); lcd.write(0x4e); lcd.write((uint8_t)0); // location #0 lcd.write((uint8_t)0x00); // 8 bytes of character data lcd.write(0x0a); lcd.write(0x15); lcd.write(0x11); lcd.write(0x11); lcd.write(0x0a); lcd.write(0x04); lcd.write((uint8_t)0x00); delay(10); // we suggest putting delays after each command // clear screen lcd.write(0xfe); lcd.write(0x58); delay(10); // we suggest putting delays after each command // go 'home' lcd.write(0xfe); lcd.write(0x48); delay(10); // we suggest putting delays after each command lcd.print("we "); lcd.write((uint8_t)0); lcd.println(" Arduino!"); lcd.print(" - Adafruit"); // to print the custom character, 'write' the location } delay(1000); uint8_t red, green, blue; void loop() { // adjust colors Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 18 of 25

// adjust colors for (red = 0; red < 255; red++) { lcd.write(0xfe); lcd.write(0xd0); lcd.write(red); lcd.write((uint8_t)0); lcd.write(255 - red); delay(10); // give it some time to adjust the backlight! } for (green = 0; green < 255; green++) { lcd.write(0xfe); lcd.write(0xd0); lcd.write(255-green); lcd.write(green); lcd.write((uint8_t)0); delay(10); // give it some time to adjust the backlight! } for (blue = 0; blue < 255; blue++) { lcd.write(0xfe); lcd.write(0xd0); lcd.write((uint8_t)0); lcd.write(255-blue); lcd.write(blue); delay(10); // give it some time to adjust the backlight! } } You should see the following, with a color-changing background: Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 19 of 25

Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 20 of 25

Command Reference The command set is based on the Matrix Orbital specification. We added a few commands to support the RGB backlight and to adjust the size of the display (so one firmware can support 16x2 or 20x4) If you're using software that support Matrix Orbital displays, this backpack should work identically (if not, please let us know!) All commands start with the special character 0xFE (in hex) which tells the backpack to watch for a special command next. Basic commands: Display On - 0xFE 0x42 - This command turns the display backlight on. The argument is how many minutes to stay on, the command is supported but we don't handle the timeout so that number is ignored Display On - 0xFE 0x46 - turn the display backlight off Set Brightness - 0xFE 0x99 - set the overall brightness of the backlight (the color component is set separately - brightness setting takes effect after the color is set). Setting is saved to EEPROM Set & Save Brightness - 0xFE 0x98 - same as above Set Contrast - 0xFE 0x50 - set the display contrast. In general, around 180-220 value is what works well. Setting is saved to EEPROM Set & Save Contrast - 0xFE 0x91 - same as above Autoscroll on - 0xFE 0x51 - this will make it so when text is received and there's no more space on the display, the text will automatically 'scroll' so the second line becomes the first line, etc. and new text is always at the bottom of the display Autoscroll off - 0xFE 0x52 - this will make it so when text is received and there's no more space on the display, the text will wrap around to start at the top of the display. Clear screen - 0xFE 0x58 - this will clear the screen of any text Change startup splash screen - 0xFE 0x40 - after sending this command, write up to 32 characters (for 16x2) or up to 80 characters (for 20x4) that will appear as the splash screen during startup. If you don't want a splash screen, write a bunch of spacesmoving and changing the cursor: Set cursor position - 0xFE 0x47 - set the position of text entry cursor. Column and row numbering starts with 1 so the first position in the very top left is (1, 1) Go home - 0xFE 0x48 - place the cursor at location (1, 1) Cursor back - 0xFE 0x4C - move cursor back one space, if at location (1,1) it will 'wrap' to the last position. Cursor forward - 0xFE 0x4D - move cursor back one space, if at the last location location it will 'wrap' to the (1,1) position. Underline cursor on - 0xFE 0x4A - turn on the underline cursor Underline cursor off - 0xFE 0x4B - turn off the underline cursor Block cursor on - 0xFE 0x53 - turn on the blinking block cursor Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 21 of 25

Block cursor off - 0xFE 0x54 - turn off the blinking block cursor RGB Backlight and LCD size Set RGB Backlight Color - 0xFE 0xD0 - Sets the backlight to the red, green and blue component colors. The values of can range from 0 to 255 (one byte). This is saved to EEPROM. Each color R, G, and B is represented by a byte following the command. Color values range from 0 to 255. To set the backlight to Red, the command is 0xFE 0xD0 0x255 0x0 0x0. Blue is 0xFE 0xD0 0x0 0x0 0x255. White is 0xFE 0xD0 0x255 0x255 0x255. Set LCD size - 0xFE 0xD1 - You can configure the backpack to what size display is attached. This is saved to EEPROM so you only have to do it once.custom Characters Create custom character - 0xFE 0x4E - this will create a custom character in spot. can be between 0 and 7 (8 spots). 8 bytes are sent which indicate how the character should appear Save custom character to EEPROM bank - 0xFE 0xC1 - this will save the custom character to EEPROM bank for later use. There are 4 banks and 8 locations per bank. Load custom characters from EEPROM bank - 0xFE 0xC0 - this will load all 8 characters saved to an EEPROM bank into the LCD's memorygeneral Purpose Output The general purpose outputs are 4 pins that are not used by the backpack, you can set these pins high or low.gpo1 is labeled PB0, GPO2 is labeled PC2, GPO3 is labeled PC4 and GPO4 is PC7 GPO Off - 0xFE 0x56 - set the general purpose pin to LOW (0V) GPO On - 0xFE 0x57 - set the general purpose pin to HIGH (5V) GPO Start State - 0xFE 0xC3 - sets the 'initial' stae of the GPO pin Not handled! Set auto-line-wrap on - 0xFE 0x43- and Set auto-line-wrap off - 0xFE 0x44- are not supported. We found that having auto-line wrap off was just not very useful so its automatically on all the time. Initialize/Place Medium & Large Numbers, Horizontal bar and vertical bar -this is not supported Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 22 of 25

Downloads Drivers Here's INF driver for windows XP/7/Vista. Unzip and navigate to the folder in the New Hardware Wizard. Click here: usb_serial_backpack-driver.zip http://adafru.it/d4r We also have Windows 8 signed drivers - they're beta so please try! Download USB-Serial RGB LCD Backpack Signed Drivers http://adafru.it/dic Firmware and USB testing software (http://adafru.it/axm) @ github. The backpack uses the Teensy v1.0 framework, we don't have tutorials or support for modifying the firmware but it is available for your hacking pleasure should you want to customize the backpack firmware! We also broke out the unused At90USB162 pins into an extra header - see the schematic for the unused/used pins. You can launch the bootloader (AT90USB162 chip) by touching reset pin to ground. It is an av109-compatible bootloader over USB, avrdude supports it but we don't have arduino IDE support at this time (and no ETA) LCD Smartie (http://adafru.it/axn) - a popular character LCD driving program Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 23 of 25

Adafruit Industries https://learn.adafruit.com/usb-plus-serial-backpack Page 24 of 25

Support Forums Support Forums (http://adafru.it/forums) Adafruit Industries Last Updated: 2015-11-30 02:10:11 PM EST Page 25 of 25