Document Number: | E-M-0110-00 |
Issue Date: | 05/18/2012 |
Noritake Co., Inc. Electronics Division Headquarter 2635 Clearbrook Drive Arlington Heights, IL 60005 Toll free: (800) 779 - 5846 Phone: (847) 439 - 9020 support.ele@noritake.com www.noritake-elec.com |
East Coast New Jersey Branch 15-22 Fair Lawn Ave. Fair Lawn, NJ 07410 Toll free: (888) 296 - 3423 Phone: (201) 475 - 5200 Fax: (201) 796 - 2269 |
Midwest, Canada, and Mexico Chicago Branch 2635 Clearbrook Dr. Arlington Heights, IL 60005 Toll free: (800) 779 - 5846 Phone: (847) 439 - 9020 Fax: (847) 593 - 2285 |
West Coast Los Angeles Branch 21081 S. Western Ave. Ste 180 Torrance, CA 90501 Toll free: (888) 795 - 3423 Phone: (310) 320 - 1700 Fax: (310) 320 - 2900 |
You must agree this terms and conditions. This software is provided by Noritake Co., Inc "AS IS" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or sort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
If this document is distributed with software that includes an end user agreement, this document, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no part of this document may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Noritake Co., Inc. Please note that the content in this document is protected under copyright law even if it is not distributed with software that includes an end user license agreement.
The content of this document is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Noritake Co., Inc. Noritake Co., Inc. assumes no responsibility or liability for any errors or inaccuracies that may appear in the informational content contained in this document.
Any references to company names in sample codes are for demonstration purposes only and are not intended to refer to any actual organization.
Noritake and Itron are either registered trademarks or trademarks of Noritake Co., Inc. in the United States and/or other countries.
© 2012 Noritake Co., Inc. All rights reserved
Noritake Co., Inc., 2635 Clearbrook Drive, Arlington Heights, IL 60005, USA.
The GU-U100 is a graphic vacuum fluorescent display module meant to replace graphic LCDs based on the KS0108 chipset.
On top of supporting all of the common KS0108 commands, GU-U100 adds the unique features of screen brightness and power save mode.
Code written for KS0108 can be used to control the GU-U100.
Depending on the LCD being replaced, slight modifications may be necessary.
The direction of chip select (CS) or slave select (SS) may be different. The GU-U100's parallel interface chip select is active high, meaning the device accepts commands only when CS is 1. Some LCDs expect chip select to be active low, meaning the device is active only when CS is 0.
The number of display segment driver chips may be different. If the code was written for more chips than is available on the GU-U100, only the left-most or top-most portions of the expected screen image will be visible.
The display is divided into 64×64-dot segments arranged horizontally in horizontal mode and vertically in vertical mode. Each of these segments is controlled by a separate chip. GU128x64E-U100 has two chips.
These chips do not communicate information such as the display memory or current x and y position. These must be set specifically for each chip. However, screen brightness and power save mode affect the whole module and are shared.
The first chip controls the left side of the screen in horizontal mode and the top half in vertical mode. The second chip controls the right side in horizontal mode and the bottom half in vertical mode. Both chips cannot be accessed simultaneously.
The address and bit value are calculated:
page = y/8 bit = 1 << y%8 addr = page*64 + x
Each controller has a 64×64-dot memory buffer representing half of the image on the screen.
The address and bit value are calculated:
page = x/8 bit = 1 << x%8 addr = page*64 + y
Each controller has a 64×64-dot memory buffer representing half of the image on the screen.
Each chip keeps track of the current X and Y values (called the cursor).
After every memory read or write is executed, the X counter increments. After X is 63, the counter wraps back around to 0. The Y counter is not changed.
The library increments and wraps the value of Y after wrapping in the X direction.
This library is written for Atmel AVR microcontrollers.
Demo projects use AVR Studio 4 and Atmel Studio 6.
The library is configured by setting preprocessor values in the config.h file in the src directory of the library.
The library provides support for using the module in
either of two modes: horizontal or vertical.
Define NORITAKE_VERTICAL
to match
the mode:
GU-U100 offers parallel and serial interfaces.
The interface is controlled by NORITAKE_INTERFACE
.
NORITAKE_SERIAL
must be set to
the correct serial interface type:
1
- Type 1: CU-UW
2
- Type 2: SPI
3
- Type 3: Signal Separate
The library must be told which pins connect the host to the module.
Each signal has a preprocessor variable ending with
_PORT
and _PIN
.
E.g. for the chip select 1 pin:
#define CS1_PIN 3 #define CS1_PORT PORTA
#define DATA_PORT PORTD #define RS_PIN 0 #define RS_PORT PORTA #define RW_PIN 1 #define RW_PORT PORTA #define E_PIN 2 #define E_PORT PORTA #define CS1_PIN 3 #define CS1_PORT PORTA #define CS2_PIN 4 #define CS2_PORT PORTA #define RESET_PIN 5 #define RESET_PORT PORTA
Parallel is the fastest interface but uses the most pins. Each signal is controlled by a separate pin.
Code that was written for LCDs will use the parallel interface. Minor modifications may be necessary as discussed in the Replacing LCDs section.
DATA
- data bits 0 - 7 (must be on pins 0 - 7 of given port)
RS
- command (0) / data (1) signal
RW
- write (0) / read (1) signal
E
- enable signal
CS1
- chip select 1 (left side or top)
CS2
- chip select 2 (right side or bottom)
RST
- reset module, active low
#define SIO_PIN 4 #define SIO_PORT PORTG #define CS_PIN 7 #define CS_PORT PORTB #define SCK_PIN 3 #define SCK_PORT PORTG #define RESET_PIN 0 #define RESET_PORT PORTA
This interface uses the minimum number of pins, but requires up to two bytes to be sent per data item or command. Data is input and output over the same line.
SI/SO, CS, SCK, and RST lines are used.
The CS (chip select) here is for the entire module. It is not the same as CS1 or CS2.
A status byte must be sent when CS is lowered. This status byte sets the state of CS1, CS2, RW, and RS. Commands and data may be sent continuously without re-sending this status byte until CS is raised or the status of CS1, CS2, RW, or RS needs to change. After this, commands and data bytes are sent or received.
SIO
- I/O pin
CS
- module chip select
(not to be confused with CS1 and CS2)
SCK
- synchronous serial clock
RST
- reset module, active low
#define SO_PIN 4 #define SO_PORT PORTG #define SCK_PIN 3 #define SCK_PORT PORTG #define RESET_PIN 0 #define RESET_PORT PORTA #define CS2_PIN 1 #define CS2_PORT PORTA #define CS1_PIN 2 #define CS1_PORT PORTA #define SI_PIN 3 #define SI_PORT PORTA
This interface allows you to use the module on an SPI bus as two slave devices selected by CS1 and CS2. Data is sent to the module on a separate line from data received from the module.
SO, SCK, RST, CS1, CS2, and SI lines are used.
A status byte similar to the Type 1 interface must be sent to change RW and RS.
SO
- output (data/status) sent from the module to the host
SCK
- synchronous serial clock
RST
- reset module, active low
CS1
- chip select 1 (left side or top), active low
CS2
- chip select 2 (right side or bottom), active low
SI
- input (data/commands) sent to the module from the host
#define RS_PIN 7 #define RS_PORT PORTB #define SCK_PIN 3 #define SCK_PORT PORTG #define RESET_PIN 0 #define RESET_PORT PORTA #define CS2_PIN 1 #define CS2_PORT PORTA #define CS1_PIN 2 #define CS1_PORT PORTA #define SI_PIN 3 #define SI_PORT PORTA
This has the potential to be the fastest serial interface since no status byte ever need be sent.
Since there is no pin to output from the module, many methods may be restricted in use since they rely on reading the display memory.
This interface is primarily useful for simple or pre-rendered high-speed animation with fewer pins than the parallel interface.
RS, SCK, RST, CS1, CS2, and SI lines are used.
RS
- command (0) / data (1) signal
SCK
- synchronous serial clock
RST
- reset module, active low
CS1
- chip select 1 (left side or top), active high
CS2
- chip select 2 (right side or bottom), active high
SI
- input (data/commands) sent to the module from the host
Align a value to the next highest 8-dot block (i.e. values that are not divisible by 8 are rounded up).
In horizontal mode, y values need to be aligned; x values need to be aligned in vertical mode.
v | value to align |
Returns: Aligned value.
Align a value to the previous 8-dot block (i.e. values that are not divisible by 8 are rounded down).
In horizontal mode, y values need to be aligned; x values need to be aligned in vertical mode.
v | value to clip |
Returns: Clipped value.
Get the font width including the gutter space. The cursor will be moved horizontally by this amount when working with text-based methods.
Returns:
Advance width of the font: fontWidth + fontGutter
Initialize the module.
This must be called after reset()
.
Module State:
Reset the module.
After a reset, call init()
before any other method.
Send a command to the module. The command's bit patterns are detailed in the module's specification.
The library does not attempt to understand commands. If a setting on the module is changed, the member variables of the library should be updated to reflect those changes.
bits | command to send |
chip | chip to send the command to |
Set the cursor to (x, y).
If (x, y) is beyond the limits of the screen, the request is ignored.
In horizontal mode, the cursor in the module only
accepts y values aligned to 8-dot blocks;
x values must be aligned in vertical mode.
In either case, if not divisible by 8, the value is
rounded down when used with writeData()
and
readData()
.
Other methods compensate for the misalignment.
x | x coordinate: 0 ≤ x < WIDTH |
y | y coordinate: 0 ≤ y < HEIGHT |
Write to the display memory at the cursor position.
In horizontal mode, if the cursor y was not divisible by 8, then it is rounded down to the previous 8-dot block and all 8 dots of the block will be overwritten.
This increments the x counter and causes wrapping. If x was 127, then x will be 0 and y will be y+8. If y is greater than 64, y wraps to 0.
In vertical mode, if the cursor x was not divisible by 8, then it is rounded down to the previous 8-dot block and all 8 dots of the block will be overwritten.
This increments the y counter and causes wrapping. If y was 127, then x will be 0 and x will be x+8. If x is greater than 64, x wraps to 0.
data | data to write to the display memory |
Read from the display memory at the cursor position.
In horizontal mode, if the cursor y was not divisible by 8, then it is rounded down to the previous 8-dot block and all 8 dots of the block will be overwritten.
This increments the x counter and causes wrapping. If x was 127, then x will be 0 and y will be y+8. If y is greater than 64, y wraps to 0.
In vertical mode, if the cursor x was not divisible by 8, then it is rounded down to the previous 8-dot block and all 8 dots of the block will be overwritten.
This increments the y counter and causes wrapping. If y was 127, then x will be 0 and x will be x+8. If x is greater than 64, x wraps to 0.
Returns: Data read from the display memory.
Read from the display memory at the given
position. setCursor(x, y)
is
called before and after readData()
.
Returns: The data read from the display memory at the given position.
Read the status of the chip.
Returns: Chip status as a combination of:
Set screen brightness.
percent | brightness value: 13% ≤ percent < 100%.
Percentages are rounded up to the next selectable value:
|
Turn the display off.
powerSave | true enables power save mode;
false disables power save mode |
Turn the display on after it has been turned off. This will also disable power save mode.
fontAdvance()
.
Move the cursor back by one character width in the current font. If the cursor is within one character width of the start of a line, the cursor moves to the end of the previous line. If the cursor was within one character width of (0, 0), it is moved to (0, 0).
This can also be used by printing '\b'
.
Move the cursor to the beginning of the current line.
This can also be used by printing '\r'
.
Move the cursor to the beginning of the next line
as though carriageReturn()
and
lineFeed()
were called.
This can also be used by printing "\r\n"
.
fontAdvance()
.
Move the cursor forward by one character width in the current font. If the cursor is within one character width of the right edge of the screen, the cursor is moved to the beginning of the next line. If the cursor is at the end of the display, the cursor is moved to (0, 0).
This can also be used by printing '\t'
.
Move the cursor to (0, 0).
This can also be used by printing '\x0b'
.
Move the cursor to the next line. If on the last line of the display, the cursor is moved to (0, 0).
This can also be used by printing '\n'
.
This sets the current font, its width, and its height.
drawImage()
.
Each character is a width×height bitmap.
The bitmaps for each character defined must come
one after another (aligned to bytes) in
Flash ROM (program ROM).
Characters from 0x20
to 0xff
may be defined.
data | data for characters in bitmap format in Flash ROM (program ROM) |
width | width of each character not including gutter space |
height | height of each character |
gutter | the width of empty space between characters |
void setFont(const uint8_t *data, uint8_t width, uint8_t height);
void setFont(const uint8_t *data, uint8_t width, uint8_t height, uint8_t gutter);
There are many variations of the print method.
Variations that end with _p
print from the Flash ROM (program ROM) of the host.
Variations that end with ln
print and then go to the next line as if
carriageReturn()
and
lineFeed()
had been called.
The background the size of fontAdvance()×fontHeight is cleared before drawing the character. The bottom dots of the bottom group of 8 vertical dots are preserved if the font height is not a multiple of 8. E.g. if the font is defined to be 10 dots high, the top 10 dots are cleared, and the bottom 6 are left untouched.
fontAdvance()
.
When the cursor is within one character width
of the end of the screen, text is wrapped to
the next line as though crlf()
was
called.
clearScreen()
.
Characters below 0x20
are
control characters. Any control character that
is not defined is ignored.
void print(char c);
void print(const char *buffer, size_t size);
void print(const char *str);
void print_p(const char *buffer, size_t size);
void print_p(const char *str);
void println(char c);
void println(const char *buffer, size_t size);
void println(const char *str);
void println_p(const char *buffer, size_t size);
void println_p(const char *str);
Print a number max
characters long.
The fill
character is inserted
on the left if the number has less than
max
digits.
' '
(Space) right-aligns
'0'
prefixes the number with zeroes
0
prints only the necessary digits
bool numberString(char buf[10], unsigned long number, uint8_t max, char fill);
bool print(int number, uint8_t max, char fill);
bool print(long number, uint8_t max, char fill);
bool print(unsigned long number, uint8_t max, char fill);
bool print(unsigned number, uint8_t max, char fill);
Returns: false and does not print any characters if:
max
is > 10
number
requires more than max
digits
Print a number in the given base.
number | number to print |
base | base to print in; 2 ≤ base ≤ 36 |
bool print(int number, uint8_t base);
bool print(long number, uint8_t base);
bool print(unsigned long number, uint8_t base);
bool print(unsigned number, uint8_t base);
Clear the screen and move the cursor to (0, 0).
This can also be used by printing '\x0c'.
void invertOn()
void invertOff();
Invert the colors of drawing methods.
Only dots written after this call are affected. The existing screen image does not change.
Set the dot at (x, y).
If (x, y) is beyond the limits of the screen, the request is ignored.
x | x coordinate: 0 ≤ x < WIDTH |
y | y coordinate: 0 ≤ y < HEIGHT |
Draw a circle centered at (cx, cy) with the given radius.
Dots beyond the limits of the screen are ignored.
cx | x coordinate: 0 ≤ cx < WIDTH |
cy | y coordinate: 0 ≤ cy < HEIGHT |
radius | radius of the circle: 0 ≤ cx-radius ≤ WIDTH 0 ≤ cx+radius ≤ WIDTH 0 ≤ cy-radius ≤ HEIGHT 0 ≤ cy+radius ≤ HEIGHT |
on | true lights dots;
false turns dots of the circle off |
Draw an image from (x, y) to (x+width, y+height).
data
is a pointer to Flash ROM (program ROM) image data.
In horizontal mode,
the width
must be less than or
equal to the image width in memory, stride
.
The height may be less than the total image height in memory.
Dots beyond the limits of the screen are ignored.
In vertical mode,
the height
must be less than or
equal to the image height in memory, stride
.
The width may be less than the total image width in memory.
Dots beyond the limits of the screen are ignored.
Dots in the same 8-dot group but not inside the specified rectangle are preserved when the image is drawn so that its y values are not divisible by 8.
void drawImage(const uint8_t *data, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t stride);
void drawImage(const uint8_t *data, uint8_t x, uint8_t y, uint8_t width, uint8_t height);
data | Image data in the same format as display memory |
x | x coordinate: 0 ≤ x < WIDTH |
y | y coordinate: 0 ≤ y < HEIGHT |
width | width to draw to screen: 0 ≤ x+width ≤ stride ≤ WIDTH |
height | height to draw to screen: 0 ≤ y+height ≤ HEIGHT |
stride | the width of the bitmap in memory in horizontal mode the height of thebitmap in memory in vertical mode |
Draw a line from (x1, y1) to (x2, y2).
Dots beyond the limits of the screen are ignored.
x1 | start x coordinate: 0 ≤ x1 < WIDTH |
y1 | start y coordinate: 0 ≤ y1 < HEIGHT |
x2 | end x coordinate: 0 ≤ x2 < WIDTH |
y2 | end y coordinate: 0 ≤ y2 < HEIGHT |
on | true lights dots;
false turns dots of the line off |
Draw the outline of a rectangle from (x1, y1) to (x2, y2).
Dots beyond the limits of the screen are ignored.
x | x coordinate: 0 ≤ x < WIDTH |
y | y coordinate: 0 ≤ y < HEIGHT |
width | width: 0 ≤ x+width ≤ WIDTH |
height | height: 0 ≤ y+height ≤ HEIGHT |
on | true lights dots;
false turns dots of the rectangle off |
Fill the rectangle from (x1, y1) to (x2, y2).
Dots beyond the limits of the screen are ignored.
x | x coordinate: 0 ≤ x < WIDTH |
y | y coordinate: 0 ≤ y < HEIGHT |
width | width: 0 ≤ x+width < WIDTH |
height | height: 0 ≤ y+height < HEIGHT |
on | true lights dots;
false turns dots of the rectangle off |