OP7100 Serial Graphic Display User’s Manual 019–0065 • 070831–O
OP7100 User’s Manual Part Number 019-0065 • 070831-O • Printed in U.S.A. © 1999–2007 Rabbit Semiconductor Inc. • All rights reserved. Rabbit Semiconductor reserves the right to make changes and improvements to its products without providing notice. No part of the contents of this manual may be reproduced or transmitted in any form or by any means without the express written permission of Rabbit Semiconductor.
TABLE OF CONTENTS About This Manual vii Chapter 1: Overview 11 Introduction .......................................................................................... 12 Features ................................................................................................ 13 Options ............................................................................................ 13 Development and Evaluation Tools ..................................................... 14 Software ..........................
Digital I/O ............................................................................................ 35 Serial Communication .......................................................................... 36 RS-232 Communication .................................................................. 38 Receive and Transmit Buffers ....................................................... 38 CTS/RTS Control ......................................................................... 39 Modem Communication .............
Dynamic C 32 Libraries ....................................................................... 56 OP71HW.LIB .................................................................................. 56 Keypad Programming ..................................................................... 65 Using Dynamic C v. 5.xx ..................................................................... 66 EZIOOP71.LIB ............................................................................... 66 GLCD.LIB .......................
Appendix B: Specifications 93 Electrical and Mechanical Specifications ............................................ 94 LCD Dimensions ............................................................................. 94 Bezel Dimensions ........................................................................... 94 General Specifications .................................................................... 95 Header and Jumper Configurations .....................................................
ABOUT THIS MANUAL This manual provides instructions for installing, testing, configuring, and interconnecting the Rabbit Semiconductor OP7100 touchscreen operator interface. Instructions are also provided for using Dynamic C functions. Assumptions Assumptions are made regarding the user's knowledge and experience in the following areas. • Ability to design and engineer the target system that interfaces with the OP7100.
Acronyms Table 1 lists and defines the acronyms that may be used in this manual. Table 1.
Conventions Table 3 lists and defines the typographical conventions that may be used in this manual. Table 3. Typographical Conventions Example Description while Courier font (bold) indicates a program, a fragment of a program, or a Dynamic C keyword or phrase. // IN-01… Program comments are written in Courier font, plain face. Italics Indicates that something should be typed instead of the italicized words (e.g., in place of filename, type a file's name).
x About This Manual OP7100
CHAPTER 1: OVERVIEW Chapter 1 provides an overview and a brief description of the OP7100 features.
Introduction The OP7100 is a serial graphic display in a compact, easy to integrate module. The OP7100 features an LCD that has a white background with blue images. The LCD has pixel graphics and provides two-color (monochrome) displays. Five standard fonts are included in the supplied software. Additional custom fonts are easily created to meet the needs of an application. The OP7100 can operate with Rabbit Semiconductor single-board computers or other serial displays over an RS-485 network.
Features The OP7100 includes the following features.
Development and Evaluation Tools The OP7100 is supported by a Tool Kit that include everything you need to start development with the OP7100. The Tool Kit includes these items. • Serial cable • 24 V DC power supply capable of delivering 1.1 A • User’s manual with schematics An optional Serial Interface Board (SIB) is available to program the OP7100 when a second RS-232 serial port is needed by the application being developed.
CE Compliance The OP7100 has been tested and was found to be in conformity with applicable EN immunity and emission standards. Note the following requirements for incorporating the OP7100 into your application to comply with CE requirements. • The power supply provided with the Tool Kit is for development purpose only. It is the customer’s responsibility to provide a CE compliant power supply for their end-product application. • The OP7100 has been tested to meet the following immunity standards.
Overview OP7100
CHAPTER 2: GETTING STARTED Chapter 2 provides instructions for connecting the OP7100 to a host PC and running a sample program.
Initial OP7100 Setup Parts Required • 24 V unregulated DC power supply capable of delivering up to 1.1 A • Serial cable The necessary parts are supplied with the Tool Kit. Setting Up the OP7100 1. Remove the green power connector shown in Figure 2-1 from the back of the OP7100. 2. Attach the bare leads from the power supply to the terminals on the power connector as shown in Figure 2-1. 3. Plug the connector back into the power connection header at the back of the OP7100.
OP7100 SERIES DISPLAY/CONTROLLER Menu SUPPORT FEATR Z-WORLD TECHNICAL SUPPORT 15307573737 DEMO SUPRT www.zworld.com EXIT EXIT Clock Bklit Exit Display Bitmaps Exit Press Keys Before Tiimeout Ctrst Beep EXIT +Yr Yr 1999 +Mon Mon Dec +Day Day 31 23 : 59 : 59 +Hr +Min Hr Set Min +Sec Sec Exit Figure 2-2.
Connecting the OP7100 to a Host PC 1. Unplug any power supply connected to the OP7100 and remove the back cover from the OP7100 assembly. The back cover is attached with the two screws shown in Figure 2-3. CAUTION: High-Voltage Transformer. Only qualified persons may open this case. CONTRAST RS232 n.c. 1 TXA 2 RXA 3 n.c. 4 GND 5 6 n.c. 7 232_RX1 / CT 8 232_TX1 / RT 9 PWR_DE9 DCIN (1230 VDC) GND 485+ 485 GND 5 4 3 2 1 S/N: Figure 2-3. OP7100 Back Cover 2. Establish a serial communication link.
Pin 1 J4 PRGM PORT Marked Conductor to Pin 1 Figure 2-4. SIB Programming Connection To PC J4 SIB2 7 5 3 1 8 6 4 2 J4 Figure 2-5. Direct Programming Connection Option 2 uses an RS-232 serial port to program the OP7100. If this serial port is needed in your application, use the SIB as described in Option 1. See Chapter 3, “Hardware,” for more information on the serial ports.
Running Dynamic C Double-click the Dynamic C icon to start the software. Note that the PC attempts to communicate with the OP7100 each time Dynamic C is started. No error messages are displayed once communication is established. The communication rate, port, and protocol are all selected by choosing Serial Options from Dynamic C’s OPTIONS menu.
CHAPTER 3: HARDWARE Chapter 3 describes how to use the OP7100. Sections are included to describe the following features.
OP7100 Subsystems Overview The OP7100 consists of several subsystems, including a computing module, serial communication channels, lquid crystal display (LCD), a buzzer, and a keypad interface. Figure 3-1 provides a block diagram of the OP7100. 8 8 Digital I/O Z180 SRAM Batt. Flash2 RTC ’691 super.
Power Management The OP7100 was designed to operate from a 12 V to 30 V DC source, and consumes about 4.5 W with the backlight on, 1.5 W with the backlight off. To allow for a surge current when the OP7100 is first turned on, the power supply used must be able to handle at least four times this power (for example, 800 mA at 24 V). The OP7100 power supply is converted internally to supply three voltages. 1. A switching regulator outputs VCC (+ 5 V). 2. A linear regulator outputs VEE (approximately –20 V). 3.
ADM691 Supervisor Chip A voltage divider consisting of R29 and R30 across the DC input provides a PFI signal to the ADM691 watchdog supervisor. The ADM691 chip performs the following services. • Watchdog timer resets the microprocessor if software “hangs.” • Power-failure shutdown and reset. • Generates an “early warning” power-failure interrupt (PFI) that lets the system know when power is about to fail. • Memory protection feature prevents writes to RAM when power is low.
main(){ ... } ... char dummy[24]; ...
watchdog timer is hitwd. To hold the watchdog timer at bay, make a call to hitwd in a routine that runs periodically at the lowest software priority level. A program can read the state of the WDO line with a call to wderror. This makes it possible to determine whether a watchdog timeout occurred. The following sample program shows how to do this when a program starts or restarts. main(){ if( wderror() ) wd_cleanup(); hitwd(); ... } Power Shutdown and Reset When VCC (+5 V) drops below VMIN (between 4.
U28 Reg. DCIN VIN VCC VCC VOUT U12 Supervisor VOUT C44 47 µF RN2 10 kW VBAT R30 29.4 kW PFI to supervisor R29 4.99 kW WDI WDO PFI PFO RST RST INT1 R34 220 kW Figure 3-3. OP7100 Power-Failure Detection Circuit ⎡ ⎛ R30 ⎞ ⎛ R30(5 V - 1.3 V) ⎞⎤ ⎟⎟⎥ VL = 1.3 V ⎢1 + ⎜ ⎟ − ⎜⎜ ⎢⎣ ⎝ R29 ⎠ ⎝ 1.3 V(R34 + RN2) ⎠⎥⎦ ⎡ ⎛ R30 ⎞ ⎛ R30 ⎞⎤ VH = 1.3 V ⎢1 + ⎜ ⎟⎥ ⎟+⎜ ⎣ ⎝ R29 ⎠ ⎝ R34 ⎠⎦ Since R34 >> RN2, the difference between VH and VL, the hysteresis voltage, would be 5 V × (R30/R34).
Liquid Crystal Display (LCD) The 240 × 320 ¼ VGA LCD supports both graphics and text. Automatic contrast control is built in so that the contrast, once set, does not drift as the OP7100 warms up or is moved. Figure 3-4 provides a block diagram of the LCD control and RAM circuits. U3 A0 D[0–7] VA[0–14] VD[0–7] U2 FRAME ON/OFF /RESET XD[0–3] /INT0 U1 A[0–14] D[0–7] SED1335F LCD Control VRAMCS1 VCC /CS A[0–14] D[0–7] RAM VCC VRAMCS2 VCC /CS RAM VCC FRAME ON/OFF VCC XD[0–3] R26 10 kΩ R31 2.
Figure 3-6 shows the jumper settings for the contrast control options. Software Contrast Adjustment Manual Contrast Adjustment 3 3 2 2 1 JP2 JP2 1 FD OP7110 FD OP7100 Figure 3-6. Contrast Control Jumper Configurations Background The OP7100 comes factory-configured to display blue characters on a white (positive) background. The jumpers on header JP1 may be rearranged as shown in Figure 3-7 to display white characters on a blue (negative) background.
Coordinate Systems Figure 3-8 shows the coordinate systems for the touchscreen and the LCD. LCD Touchscreen 7,0 7,7 0,0 320,0 landscape landscape 0,0 0,7 0,7 7,7 portrait 7,0 0,240 320,240 240,0 0,0 portrait 0,0 0,320 240,320 Figure 3-8. Coordinate Systems (row, column) LCD Controller Chip The LCD controller chip provides support for the LCD module. The controller chip is attached to the data bus on the OP7100, and is mapped to the I/O address space.
Other functions support the LCD module to adjust its contrast and to turn the white CCFL backlight on and off. A variable resistor between two of the LCD module’s terminals sets the contrast, which is set either by software or manually, depending on the jumper setting on header JP2. Once a contrast value is set, it will be maintained. A single programmed I/O bit is used to turn the backlight on or off. The controller chip used in OP7100’s sold before 2006 supported either 32K or 64K of SRAM.
Keypad Interface The OP7100 has a touchscreen, which is connected to the circuit board at header J5. Header J6 is available for a customer-supplied keypad for the OP7110. Table 3-1 lists the pinouts for headers J5 and J6. The pinout for header J5 is identical to the pinout for header J6. Table 3-1.
Digital I/O The OP7100 has eight CMOS/TTL-level digital inputs and eight CMOS/ TTL-level digital outputs. The digital inputs are provided with pullup resistors, shown in Figure 3-12, to provide a known state before a digital input is applied.. +5 V +5 V 10 kΩ To Z180 Data Bus DIN[07] CMOS Input Figure 3-12.
Serial Communication Two serial channels support asynchronous communication at baud rates from 300 bps to 57,600 bps. Serial communication provides a simple and robust means for networking controllers and other devices. Figure 3-14 illustrates the configuration of the OP7100 serial channels. VCC U24 TXA1 RXA1 EN485 D A R DE 485 RE to J11 B U26 TXA0 TX1/RTS TXA0 RTS0 RXA0 CTS0 RXA0 RX1/CTS T1IN T1OUT T2IN R1OUT R2OUT T2OUT R1IN R2IN to J10 (DE9) and J8 232A Figure 3-14.
The jumpers on header JP4 may be reconfigured so that header J11 carries the Z180 Port 1 TX1 and RX1 RS-232 signals on pins 2 and 3 instead of the factory-default RS-485+ and RS-485– signals. Figure 3-16 shows the header JP4 jumper configurations and the location of headers JP3 and JP4. JP4 JP4 JP5 1 2 1 2 3 4 3 4 5 6 5 6 7 8 7 8 RS-485 on header J11 RS-232 on header J11 JP4 JP3 FD Figure 3-16.
RS-232 Communication 2 4 6 RTS/TX1 CTS/RX1 Figure 3-17 shows the RS-232 signals on header J8 and header J10 (the DE-9 connector). 8 10 9 J8 8 6 7 9 5 4 3 2 1 RX0 TX0 7 GND 5 CTS/RX1 3 RTS/TX1 1 GND J10 Figure 3-17. RS-232 Signals Pin 9 on header J10, the DE-9 connector, may be configured to carry DCIN, the input voltage, by adding a 0 Ω resistor at R32. Be careful when connecting other devices to header J10 when R32 is installed since not all devices can handle DCIN.
A program sends data by writing characters into the transmit buffer. If the serial port is not already transmitting, the write functions will automatically initiate transmission. Once the last character of the buffer is sent, the transmit interrupt is turned off. A high-level application can write data one character at a time or in a string. CTS/RTS Control The Z180’s hardware constrains its Port 0 to have the CTS (clear to send) pulled low by the RS-232 device to which it is talking.
RS-485 Communication Figure 3-19 shows the RS-485 signals on header J11. DCIN (1230 V DC) GND 485+ 485 GND Developing an RS-485 Network The 2-wire RS-485 serial-communication port and Dynamic C network software are used to develop an RS-485 network.
Any Rabbit Semiconductor controller or the OP7100 can be a master or a slave. A network can have up to 255 slaves, but only one master. A multidrop network requires termination/bias resistors to minimize reflections (echoing) and to keep the network line active during an idle state. The OP7100 termination resistors are already installed, and by default are enabled by having jumpers installed on header J9.
Use of the Serial Ports If you plan to use the serial ports extensively, or if you intend to use synchronous communications, Rabbit Semiconductor recommends that you obtain copies of the following Zilog technical manuals, available from Zilog, Inc, in Campbell, California. Z180 MPU User’s Manual Z180 SIO Microprocessor Family User’s Manual Each serial port appears to the CPU as a set of registers.
Z180 Serial Ports The Z180’s two independent, full-duplex asynchronous serial channels have a separate baud-rate generator for each channel. The baud rate can be divided down from the microprocessor clock, or from an external clock for either or both channels. The serial ports have a multiprocessor communications feature. When enabled, this feature adds an extra bit to the transmitted character (where the parity bit would normally go).
The serial ports can be polled or interrupt-driven. A polling driver tests the ready flags (TDRE and RDRF) until a ready condition appears (transmitter data register empty or receiver data register full). If an error condition occurs on receive, the routine must clear the error flags and take appropriate action, if any. If the /CTS line is used for flow control, transmission of data is automatically stopped when /CTS goes high because the TDRE flag is disabled.
Asynchronous Serial Communication Interface The Z180 incorporates an asynchronous serial communication interface (ACSI) that supports two independent full-duplex channels. ASCI Status Registers A status register for each channel provides information about the state of each channel and allows interrupts to be enabled and disabled.
CTS1E (CTS Enable, Channel 1) The signals RXS and CTS1 are multiplexed on the same pin. A 1 stored in this bit makes the pin serve the CTS1 function. A 0 selects the RXS function. (The pin RXS is the CSI/O data receive pin.) When RXS is selected, the CTS line has no effect. RIE (Receiver Interrupt Enable) A 1 enables receiver interrupts and 0 disables them.
ASCI Control Register A Control Register A affects various aspects of the asynchronous channel operation. CNTLA0 (00H) 7 6 5 4 3 2 1 0 MOD2 MOD1 MOD0 MPE RE TE /RTS0 MPBR/ EFR R/W R/W R/W R/W R/W R/W R/W R/W 5 4 3 2 1 0 MOD2 MOD1 MOD0 R/W R/W R/W CNTLA1 (01H) 7 6 MPE RE TE R/W R/W R/W MPBR/ CKA1D EFR R/W R/W MOD0–MOD2 (Data Format Mode Bits) MOD0 controls stop bits: 0 ⇒ 1 stop bit, 1 ⇒ 2 stop bits. If 2 stop bits are expected, then 2 stop bits must be supplied.
RE (Receiver Enable) This bit controls the receiver: 1 ⇒ enabled, 0 ⇒ disabled. When this bit is cleared, the processor aborts the operation in progress, but does not disturb RDRF or the error flags. MPE (Multiprocessor Enable) This bit (1 ⇒ enabled, 0 ⇒ disabled) controls multiprocessor communication mode which uses an extra bit for selective communication when a number of processors share a common serial bus. This bit has effect only when MP in Control Register B is set to 1.
The prescaler (PS), the divide ratio (DR), and the SS bits form a baud-rate generator, as shown in Figure 3-23. Processor Clock Prescaler (PS) ÷10 Divider 1 2 or ... ÷30 64 External Clock Divide Ratio (DR) 16 or 64 Figure 3-23. Z180 Baud-Rate Generator DR (Divide Ratio) This bit controls one stage of frequency division in the baud-rate generator. If 1 then divide by 64. If 0 then divide by 16. This is the only control bit that affects the external clock frequency.
Table 3-5 relates the Z180’s ASCI Control Register B to the baud rate. Table 3-5. Baud Rates for ASCI Control Register B Baud Rate at 9.216 MHz Baud Rate at 18.432 MHz (bps) (bps) 00 57,600 115,200 01 28,800 57,600 02 or 08 14,400 28,800 ASCI B Value Baud Rate at 9.216 MHz Baud Rate at 18.
CHAPTER 4: SOFTWARE Chapter 4 describes the Dynamic C functions used with the OP7100.
Supplied Software Software drivers for controlling the OP7100 are provided with Dynamic C. Depending on the version of Dynamic C you are using, the OP71L.LIB/ OP71P.LIB or the EZIOOP71.LIB libraries provide drivers specific to the OP7100. In order to use the OP71L.LIB/OP71P.LIB and other libraries, it is necessary to include the appropriate Dynamic C libraries in your appplication program. These libraries are listed in Table 4-1. Table 4-1. OP7100 Software Libraries Library Application AASCZ0.
Digital I/O No specific drivers have been written for the OP7100 digital I/O. The inport and outport functions in the Dynamic C BIOS.LIB library can be used to read the inputs and write the outputs. The eight digital inputs (DIN0–DIN7) are bitmapped bits 0 through 7 of the input at 0x4140. Each digital output (OUT0–OUT7) is controlled by bit 0 at 0x4140 through 0x4147. For example, OUT2 can be turned on using the following statement.
The sample program OP71.C below cycles through through the outputs with one bit high at a time while it displays the state of the digital inputs. OP71.C void delay( unsigned wDelay ){ for(;--wDelay;hitwd()); } void main( void ){ unsigned wAddr; for (;;) for(wAddr=0x4140;wAddr<0x4148;++wAddr){ outport( wAddr,0x01 ); printf( "%04x%02x\n",wAddr,inport(0x4140) ); delay( 0x8000 ); outport( wAddr,0x00 ); } } Real-Time Clock (RTC) The OP7100 has an Epson 72423 chip.
Display Flash EPROM The WriteFlash function in the Dynamic C DRIVERS.LIB library is used to write data to the program flash EPROM. • int WriteFlash( unsigned long physical_addr, char *buf, int count ) Writes count number of bytes pointed to by buf to the program flash EPROM absolute data location physical_adr. Allocate data location by declaring the byte arrays as initialized arrays or declare an initialized xdata array.
Dynamic C 32 Libraries When you are using Dynamic C 32, you must first #use op71l.lib or #use op71p.lib before the #use op71hw.lib line as shown below. #use op71l.lib or #use op71p.lib #use op71hw.lib Call the #use op71p.lib line to use your OP7100 in a portrait orientation, or call the #use op71l.lib line to use your OP7100 in a landscape orientation. OP71HW.LIB • void op71Init( void ); This call must be used to initialize the OP7100 software and hardware.
• void op71BrdOff485( void ); Disables the OP7100's RS-485 driver. • void op71BrdOn485( void ); Enables the OP7100's RS-485 driver. • void op71Beep( int onOff ); Controls the OP7100's beeper. PARAMETER: onOff is non-zero to beep, zero to stop beep. • void op71BuffLock( void ); Increments the OP7100 LCD screen locking counter. Graphics calls are recorded in the LCD memory buffer, but are not transferred to the LCD if the counter is non-zero.
• void op71Left1( int left, int top, int cols, int rows ); Scrolls byte-aligned window left one pixel, right column is filled by current pixel type (color). PARAMETERS: left is the left edge of the window, must be evenly divisible by 8. top is the top edge of the window. cols is the number of columns in the window, must be evenly divisible by 8. rows is the number of rows in the window.
• void op71Down1( int left, int top, int cols, int rows ); Scrolls byte-aligned window down one pixel, top column is filled by current pixel type (color). PARAMETERS: left is the left edge of the window, must be evenly divisible by 8. top is the top edge of the window. cols is the number of columns in the window, must be evenly divisible by 8. rows is the number of rows in the window.
• void op71XPutBitmap( int left, int top, int width, int height, unsigned long bitmap ); Draws bitmap in the specified space. The data for the bitmap are stored in xmem. Automatically calls op71XPutFastmap if bitmap is bytealigned (left-edge and width each evenly divisible by 8). PARAMETERS: left is the left edge of the bitmap. top is the top edge of the bitmap. width is the width of the bitmap. height is the height of the bitmap. bitmap is the address of the bitmap in xmem.
• void op71XGetFastmap( int x, int y, int bmWidth, int bmHeight, unsigned long xBm ); Gets a bitmap from the LCD page buffer and stores it in xmem RAM. This function is like op71XGetBitmap, except that it is faster. The restriction is that the bitmap must be byte-aligned. PARAMETERS: x is the left edge of the bitmap (in pixels), and must be evenly divisible by 8. y is the top edge of the bitmap (in pixels). bmWidth is the width of the bitmap (in pixels), and must be evenly divisible by 8.
• void op71PlotCircle( int xc, int yc, int rad ); Draws a circle in the LCD page buffer, and on the LCD if the buffer is unlocked. PARAMETERS: x is the x-coordinate of the center. y is the y-coordinate of the center. rad is the radius of the circle (in pixels). • void op71FillCircle( int xc, int yc, int rad ); Draws a filled circle in the LCD page buffer, and on the LCD if the buffer is unlocked. PARAMETERS: x is the x-coordinate of the center. y is the y-coordinate of the center.
• void op71FillPolygon( int n, int x1, int y1, int x2, int y2, ... ); Fills a polygon in the LCD page buffer, and on the LCD if the buffer is unlocked. PARAMETERS: n is the number of vertices. (x1,y1) are the (x,y) coordinates of the first vertex. (x2,y2) are the (x,y) coordinates of the first vertex...
• void op71PutFont( int x, int y, struct _fontInfo *pInfo, char code ); Puts an entry from the font table to the page buffer, and on the LCD if the buffer is unlocked. Each font character's bitmap is column major and byte-aligned. PARAMETERS: x is the left edge (in pixels). y is the top edge (in pixels). pInfo is a pointer to the font descriptor. code is the code (character) to display. • int op71GetPfStep( void ); Gets the current op71Printf printing step direction.
• void op71Printf( int x, int y, struct _fontInfo *pInfo, char *fmt, ... ); Prints a formatted string (much like printf) on the LCD screen. Only character codes that exist in the font are printed, others are skipped over. For example, '\b', '\t', '\n', and '\r' (ASCII backspace, tab, new line and carriage return, respectively) print if they exist in the font, but have no effect as control characters. Use op71SetPfStep to control or use op71GetPfStep to examine the current x and y printing step direction.
Using Dynamic C v. 5.xx EZIOOP71.LIB • void op71BackLight( int onOff ) Turns the backlight of the OP7100 on or off. PARAMETER: onOff is non-zero to turn the backlight on, zero to turn the backlight off. • void op71SetContrast( unsigned contrast ) Controls the contrast of the LCD. PARAMETER: contrast values range from 0 to 127, 0 for the least contrast (minimum VEE), 127 for the most contrast (maximum VEE). • void eioBeep( int onOff ) Turns the buzzer on or off.
• glXFontInit( struct _fontInfo *pInfo, char pixWidth, char pixHeight, unsigned startChar, unsigned endChar, unsigned long xmemBuffer ) Initializes a font descriptor that has the bitmap defined in xmem. For bitmaps defined in root memory, use glFontInit. PARAMETERS: pInfo is a pointer to the font descriptor to be initialized. pixWidth is the width of each font item (pixWidth must be uniform for all items). pixHeight is the height of each font item (pixHeight must be uniform for all items).
• int glInit() Initializes the LCD module (software and hardware). RETURN VALUE: the status of the LCD. If the initialization was successful, this function returns 0. Otherwise, the returned value indicates the LCD status. • int glPlotDot( int x, int y ) Plots one pixel on the screen at coordinate (x,y). PARAMETERS: x is the x coordinate of the pixel to be drawn. y is the y coordinate of the pixel to be drawn. RETURN VALUE: Status of the LCD after the operation.
• void glPlotVPolygon( int n, int *pFirstCoord ) Plots a filled-in polygon. PARAMETERS: n is the number of vertices. *pFirstCoord is an array of vertex coordinates (x1,y1), (x2,y2), … • void glPlotPolygon( int n, int x1, int y1, int x2, int y2,... ) Plots the outline of a polygon. PARAMETERS: n is the number of vertices. x1 is the x coordinate of the first vertex. y1 is the y coordinate of the first vertex. x2 is the x coordinate of the second vertex. y2 is the y coordinate of the second vertex.
• void glXPutBitmap( int x, int y, int bmWidth, int bmHeight, unsigned long bmPtr ) Displays a bitmap stored in xmem on the LCD. For bitmaps stored in root memory, use glPutBitmap. PARAMETERS: x is the x coordinate of the bitmap left edge. y is the y coordinate of the bitmap top edge. bmWidth is the width of the bitmap. bmHeight is the height of the bitmap. bmPtr is a pointer to the bitmap. The bitmap format is a column with the major byte aligned for each column. KP_OP71.
• int kpDefStChgFn( char *curState, char *changed ) This is the default state change function for the default get key function kpDefGetKey. This function is called back by kpScanState when there is a change in the keypad state. If the current key is not read by kpDefGetKey, the new key pressed will not be registered. PARAMETERS: curState points to an array that reflects the current state of the keypad (bitmapped, 1 indicates key is not currently pressed).
SYS.LIB • int sysChk2ndFlash( struct _flashInfo *pInfo ) Checks for the existence and configuration of the second flash EPROM mapped to memory space. PARAMETER: pInfo is a pointer to struct _flashInfo, which stores the configuration of the flash. RETURN VALUE: 0 is returned if the second flash EPROM exists and the configuration is valid; otherwise, a negative number is returned.
Upgrading Dynamic C Dynamic C patches that focus on bug fixes are available from time to time. Check the Web site • www.rabbit.com/support/downloads/ for the latest patches, workarounds, and bug fixes. You may need to download upgraded libraries to run an OP7100 purchased after June, 2006. When downloading the libraries from the Web site, click on the productspecific links until you reach the links for the OP7100 download you require.
Software OP7100
CHAPTER 5: GRAPHICS PROGRAMMING Chapter 5 provides helpful guidelines for drawing graphics on the OP7100.
Initialization The OP7100, unlike most other Rabbit Semiconductor controllers, uses the maximum I/O and memory wait states when main() gets control. The wait states can be reduced to improve performance. The following statement sets up the proper wait states for the standard OP7100 (using a 90 ns flash memory).
Plot a Line • void op71PlotLine(int x1, int y1, int x2, int y2); (x1,y1) and (x2,y2) are the endpoints of the line. Plot a Circle • void op71PlotCircle(int xc, int yc, int rad); (xc,yc) is the center of the circle, rad is the radius. Plot a Polygon • void op71PlotPolygon(int n, int x1, int y1,...); n is the number of vertices, (x1,y1) is the first vertex, followed by the other vertices in the x-first order.
Font and Bitmap Conversion Customers are encouraged to design their own fonts and bitmaps. These restrictions must be followed. • Save bitmaps as Windows bitmaps ( .bmp), not OS/2 bitmaps. • The bitmap can only have two colors. Color 0 is the background, and color 1 is the foreground. This is the reverse of most bitmap editors. • Fonts must be bitmapped (not true type) and must be of fixed pitch. • Save font files as .fnt (version 3). The OP7100 uses a "vertical stripe" display logic format.
last character is for code 0xff. make call to glFontInit(&fi, 6, 8, 32, 127, fontBitMap) to initialize table*/ char fontBitMap[] = { /* char 0x20 of width 6 at 0x5da */ '\x0', '\x0', '\x0', '\x0', '\x0', '\x0', ... '\x0' }; The first task is to rename the array so that it is unique. Then you can decide whether the font/bitmap should be stored in root memory or in extended memory.
To initialize a font information structure (of type struct _fontInfo), you can call op71XFontInit for a font stored in xmem. To display a bitmap, call op71XPutBitmap to display a bitmap stored in xmem. Printing Text Printing text involves setting the font information structures. Call void op71XFontInit(struct _fontInfo *pInfo, char pixWidth, char pixHeight, unsigned startChar, unsigned endChar, unsigned long xmemBuffer); to initialize a font information structure if the font is stored in xmem.
Keypad Programming The sample program KPDEFLT.C in the Dynamic C SAMPLES\QVGA subdirectory demonstrates how to read the keypad. Add the following directives at the top of the program to make it possible to use the keypad routines. #use op71l.lib (landscape orientation) OR #use op71p.lib (portrait orientation) #use op71hw.lib #use kp_op71.lib Initialization To initialize the keypad driver, call kpDefInit(). This must be performed before other keypad operations.
Graphics Programming OP7100
CHAPTER 6: INSTALLATION Chapter 6 provides installation and protective grounding guidelines for the OP7100.
Grounding Many of the OP7100 ICs are sensitive to static. Use extra caution when handling units in high-static areas. To meet electromagnetic compatibility requirements, and in particular to prevent misoperation or damage from electrostatic discharges, the bezel must be connected to a protective ground via a low-impedance path. A protective building ground is recommended once the OP7100 is installed at the location where it will be used.
Figure 6-1 shows the location of header JP5. FD JP5 1 0 V/GND JP5 2 FGND External Ground JP4 Bezel/Casing to Power Supply GND JP5 1 0 V/GND 2 FGND JP3 External Ground Bezel/Casing to External Ground Figure 6-1. Location of Header JP5 Installation Guidelines When possible, following these guidelines when mounting an OP7100. 1. Leave sufficient ventilation space 2.
Mounting A bezel and a gasket are included with the OP7100. When properly mounted in a panel, the bezel of the OP7100 is designed to meet NEMA 4 specifications for water resistance. Since the OP7100 employs an LCD display, the viewing angle must be considered when mounting the display. Install the OP7100 at a height and angle that makes it easy for the operator to see the screen.
3. Fasten the unit with the eight 4-40 hex nuts that were removed in Step 2. Carefully tighten the nuts equally until the gasket is compressed to approximately 75% of its uncompressed thickness of 0.125" (3.2 mm). Do not tighten each nut fully before moving on to the next nut since this risks distorting either the panel or the bezel (or both). Apply only one or two turns to each nut in sequence until all are tightened to the required amount.
Installation OP7100
APPENDIX A: TROUBLESHOOTING Appendix A provides procedures for troubleshooting system hardware and software. The sections include the following topics.
Out of the Box Check the items mentioned in this section before starting development. • Verify that the OP7100 runs in standalone mode before connecting any devices. • Verify that the entire host system has good, low-impedance, separate grounds for analog and digital signals. The OP7100 might be connected between the host PC and another device. Any differences in ground potential from unit to unit can cause serious problems that are hard to diagnose.
Dynamic C Will Not Start In most situations, when Dynamic C will not start, an error message announcing a communication failure will be displayed. The following list describes situations causing an error message and possible resolutions. • Wrong Communication Mode — Both sides must be talking RS-232. • Wrong COM Port — A PC generally has two serial ports, COM1 and COM2. Specify the one being used in the Dynamic C “Target Setup” menu. Use trial and error, if necessary.
Common Programming Errors • Values for constants or variables out of range. Table A-1 lists acceptable ranges for variables and constants. Table A-1. Ranges of Dynamic C Function Types Type Range int –32,768 (–215) to +32,767 (215 – 1) long int −2,147,483,648 (−231) to +2147483647 (231 – 1) float 1.18 × 10-38 to 3.40 × 1038 char 0 to 255 • Mismatched “types.” For example, the literal constant 3293 is of type int (16-bit integer). However, the literal constant 3293.0 is of type float.
APPENDIX B: SPECIFICATIONS Appendix B provides comprehensive physical, electronic, and environmental specifications for the OP7100.
Electrical and Mechanical Specifications 5.551 (101) (109) 4.291 (92) (8.5) (122) 6.579 (167) (11) (160) 0.433 max 6.299 (6.5) (25) 4.803 0.256 (141) 0.984 (4) 3.976 (152) (4.0) 0.433 (11.0) 0.157 typ 5.984 0.157 typ 0.335 320 x 240 pixel matrix 115.17 mm x 86.37 mm (4.534" x3.400") 3.622 LCD Dimensions Figure B-1. OP7100 LCD Dimensions Bezel Dimensions 0.125R typ. (3.18) (137) 5.400 (61) (101) (124) 4.900 2.400 (91) 3.
General Specifications Table B-1 presents the physical, electronic and environmental specifications. Table B-1. OP7100 General Specifications Parameter Module Size Bezel Size Specification 6.63" × 4.40" × 1.36" (168 mm × 112 mm × 35 mm) 8.00" × 5.4" × 0.156" (203 mm × 137 mm × 4.0 mm) with gasket Package Size 8.0" × 5.4" × 1.
Header and Jumper Configurations Figure B-3 shows the locations of the configurable headers on the OP7100. J5 KEYPAD J6 JP2 J2 J9 DANGER! HIGH VOLTAGE JP5 RS485 TERM. U1 JP4 J10 JP3 J8 J1 LCD RS232 J3 JP1 J11 J7 LCD J4 PRGM PORT DIGITAL I/O Figure B-3. OP7100 Headers Table B-2 lists the headers that carry signals. Table B-2.
Table B-3 lists the jumper configurations. Table B-3.
Specifications OP7100
MEMORY, I/O MAP, AND INTERRUPT VECTORS APPENDIX C: Appendix C provides detailed information on memory and an I/O map. The interrupt vectors are also listed.
OP7100 Memory Figure C-1 shows the memory map of the 1M address space. 1024K Socket U8 RAM 512K 0x80000 Socket U7 EPROM 0x00000 Figure C-1. Memory Map of 1M Address Space Figure C-2 shows the memory map within the 64K virtual space. 64K XMEM XMEM UNITIALIZED DATA UNITIALIZED DATA STACK RAM STACK UNUSED UNUSED USER CODE USER CODE RAM ROM LIBRARY ROM LIBRARY 0 RAM-Based ROM-Based Figure C-2.
Execution Timing The times reported in Table C-1 were measured using Dynamic C and they reflect the use of Dynamic C libraries. The time required to fetch the arguments from memory, but not to store the result, is included in the timings. The times are for a 9.216 MHz clock with 0 wait states. Table C-1. CM7000 Execution Times for Dynamic C Execution Time (µs) Operation DMA copy (per byte) 0.73 Integer assignment (i=j;) 3.4 Integer add (j+k;) 4.
Memory Map Input/Output Select Map The Dynamic C library functions IBIT, ISET, and IRES in the BIOS.LIB library allow bits in the I/O registers to be tested, set, and cleared. Both 16-bit and 8-bit I/O addresses can be used. Z180 Internal Input/Output Registers Addresses 00-3F The internal registers for the I/O devices built into to the Z180 processor occupy the first 40 (hex) addresses of the I/O space. These addresses are listed in Table C-2. Table C-2.
Table C-2.
Epson 72423 Timer Registers 0x4180–0x418F Table C-3 lists the Epson 72423 timer registers. Table C-3.
Other Registers Table C-4 lists the other registers. Table C-4. Other I/O Addresses Address Name Data Bits Description 4000–403F CS1 Chip Select 1 4040–407F CS2 Chip Select 2 4080–40BF CS3 Chip Select 3 40C0–40FF CS4 Chip Select 4 4100–413F COLUMN Chip Select 5 4140–417F I/O Chip Select 6 41C0–41FF WDOG 8000 FSHWE A000 INT1 C000 WDO OP7100 D0 Watchdog Flash EPROM write enable D0 Bit 0 is the power-failure state.
Interrupt Vectors Table C-5 presents a suggested interrupt vector map. Most of these interrupt vectors can be altered under program control. The addresses are given here in hex, relative to the start of the interrupt vector page, as determined by the contents of the I-register. These are the default interrupt vectors set by the boot code in the Dynamic C EPROM. Table C-5. Interrupt Vectors for Z180 Internal Devices Address Name Description — INT0 Available for use.
Power-Failure Interrupts The INT1 line is connected to the power-failure output of the ADM691 supervisor. A power-failure interrupt occurs when PFI falls to 1.25 V ± 0.05 V. This advanced warning allows the program to perform some emergency processing before an unwanted power-down occurs. The following example shows how to handle a power-failure interrupt.
Memory, I/O Map, and Interrupt Vectors OP7100
APPENDIX D: SERIAL INTERFACE BOARD Appendix D provides technical details and baud rate configuration data for Rabbit Semiconductor’s Serial Interface Board (SIB).
Introduction The SIB is an interface adapter used to program the OP7100. The SIB is contained in an ABS plastic enclosure, making it rugged and reliable. The SIB enables the OP7100 to communicate with Dynamic C via the Z180’s clocked serial I/O (CSI/O) port, freeing the OP7100’s serial ports for use by the application during programming and debugging.
External Dimensions Figure D-1 illustrates the external dimensions for the SIB. 2.25 (57.2) 12.0 (305) Top View 3.60 (91.4) 0.8 (20) 1.525 (38.7) 1.625 (41.3) Side View Figure D-1.
Serial Interface Board 2 OP7100
APPENDIX E: OP7100 BACKUP BATTERY Backup Battery 113
Battery Life and Storage Conditions The battery on the OP7100 will provide approximately 9,000 hours of backup time for the onboard real-time clock and static RAM. However, backup time longevity is affected by many factors including the amount of time the OP7100 is unpowered. Most systems are operated on a continuous basis, with the battery supplying power to the real-time clock and the SRAM during power outages and/or during routine maintenance.
Battery Cautions Caution (English) There is a danger of explosion if battery is incorrectly replaced. Replace only with the same or equivalent type recommended by the manufacturer. Dispose of used batteries according to the manufacturer’s instructions. Warnung (German) Explosionsgefahr durch falsches Einsetzen oder Behandein der Batterie. Nur durch gleichen Typ oder vom Hersteller empfohlenen Ersatztyp ersetzen. Entsorgung der gebrauchten Batterien gemäb den Anweisungen des Herstellers.
Backup Battery OP7100
INDEX Symbols use .......................................... 92 691 supervisor ............ 26–29, 107 system reset ............................ 29 backup battery ..................... 26, 29 cautions ................................ 114 replacing .............................. 114 battery-backed RAM ................. 13 baud rates ..................... 36, 49, 50 bezel dimensions ............................. 94 bitmap conversion ...................... 78 block diagram internal power regulators .......
common problems programming errors ............... 92 communication RS-232 ............... 13, 36, 38–40 RS-485 ..................... 13, 36, 40 serial ................. 13, 36, 38–40, 42–45, 47, 48, 50, 102 interrupts ............................ 38 computing module ..................... 24 contrast control ................... 13, 30 CSI/O (clocked serial I/O) ......... 46 CTS .............................. 38, 39, 46 CTS enable ................................ 46 CTS1 .....................................
H handshaking RS-232 ................................... 38 Hayes Smart Modem ................. 39 headers ....................................... 96 J1 ........................................... 96 J10 ......................................... 96 J11 ................................... 40, 96 J2 ........................................... 96 J3 .................................... 30, 96 J4 .................................... 96, 97 J5 .................................... 34, 96 J6 ......................
libraries ...................................... 52 literal (C term) use .......................................... 92 lithium battery .......................... 114 M memory ............................... 12, 13 application program ............... 12 battery-backed ....................... 30 random access ................. 26, 29 screen bitmaps ....................... 12 memory cycles execution timing .................. 101 memory map ............................ 100 MOD0 ................................
RDR ........................................... 46 RDRF ........................... 44, 46, 48 RE .............................................. 48 read data register full ................. 46 read-only memory ...................... 13 real-time clock (RTC) .. 13, 29, 54 receive buffer ...................... 38, 39 receiver data register .................. 46 receiver data register full ........... 46 receiver enable ........................... 48 receiver interrupt enable ............
software (continued) KP_OP71.LIB kpDefGetKey ............ 71, kpDefInit ................. 71, kpDefStChgFn ................. kpInit .............................. kpScanState ............ 70, 81 81 71 70 81 LCD ................................ 66, 72 libraries .................................. 52 AASCZ0.LIB ..................... 52 AASCZ1.LIB ..................... 52 BIOS.LIB .......................... 52 DRIVERS.LIB ............ 54, 55 EZIOOP71.LIB .......... 52, 66 GLCD.LIB ..........................
T V TDR ..................................... 44, TDRE ........................... 44, 45, TE .............................................. TIE ............................................. VBAT ......................................... 29 VEE ........................................... 25 VMIN ........................................ 28 VRAM ....................................... 29 47 47 47 45 time/date clock .................... 13, 54 registers ................................ 104 timer watchdog .
Index OP7100
SCHEMATICS 090-0071 OP7100 Schematic www.rabbit.com/documentation/schemat/090-0071.pdf You may use the URL information provided above to access the latest schematic directly.
Schematics XX0000