Rabbit OP7100 User Manual

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.
Rabbit Semiconductor reserves the right to make changes and
improvements to its products without providing notice.
No part of the contents of thi s ma nua l may be reproduced or transmitt ed in an y form or by any means without the express written permission of Rabbit Semiconductor.
Permission is granted to make one or more copies as long as the copyright page con ta in ed therein is included. These copies of the manuals may not be let or sold for any reason without the express written permission of Rabbit Semiconductor.
Trademarks
Dynamic C
Windows
PLCBus
The latest revision of this m an ual is a v aila ble on th e Ra b b it S e mic o nd u cto r Web site ,
www.rabbit.com, for free, unregistered download.
®
is a registered trademark of Rabbit Semiconductor Inc.
®
is a registered trademark of Microsoft Corporation
is a trademark of Rabbit Semiconductor Inc.
Rabbit Semiconductor Inc.
www.rabbit.com
Table of Contents


iiiOP7100
TABLE OF CONTENTS
About This Manual vii
Chapter 1: Overview 11
Introduction..........................................................................................12
Features................................................................................................13
Options ............................................................................................13
Development and Evaluation Tools .....................................................14
Software ..........................................................................................14
CE Compliance ....................................................................................15
Chapter 2: Getting Started 17
Initial OP7100 Setup............................................................................18
Parts Required................................................................................. 18
Setting Up the OP7100 ...................................................................18
Connecting the OP7100 to a Host PC..................................................20
Running Dynamic C.............................................................................22
Chapter 3: Hardware 23
OP7100 Subsystems Overview ............................................................24
Computing Module .........................................................................24
Power Management .............................................................................25
ADM691 Supervisor Chip ..............................................................26
Handling Power Fluctuations........................................................26
Watchdog T imer ...........................................................................27
Power Shutdown and Reset ..........................................................28
PFI “Early Warning”.....................................................................28
Memory Protection .......................................................................29
Battery Backup .............................................................................29
System Reset ...................................................................................29
Liquid Crystal Display (LCD) .............................................................30
Contrast Adjustment........................................................................30
Background ..................................................................................... 31
Coordinate Systems.........................................................................32
LCD Controller Chip ......................................................................32
Keypad Interface..................................................................................34
iv


Table of Contents OP7100
Digital I/O ............................................................................................35
Serial Communication..........................................................................36
RS-232 Communication ..................................................................38
Receive and T ransmit Buffers.......................................................38
CTS/R TS Control .........................................................................39
Modem Communication ...............................................................39
RS-485 Communication ..................................................................40
Developing an RS-485 Network...................................................40
Use of the Serial Ports..................................................................... 42
Z180 Serial Ports ..........................................................................43
Asynchronous Serial Communication Interface...................................45
ASCI Status Registers .....................................................................45
/DCD0 (Data Carrier Detect)........................................................45
TIE (Transmitter Interrupt Enable)...............................................45
TDRE (Transmitter Data Register Empty) ...................................45
CTS1E (CTS Enable, Channel 1) .................................................46
RIE (Receiver Interrupt Enable)................................................... 46
FE (Framing Error) .......................................................................46
PE (Parity Error)...........................................................................46
OVRN (Overrun Error) ................................................................46
RDRF (Receiver Data Register Full)............................................46
ASCI Control Register A ................................................................47
MOD0–MOD2 (Data Format Mode Bits) ....................................47
MPBR/EFR (Multiprocessor Bit Receive/Error Flag Reset)........47
/R TS0 (Request to Send, Channel 0) ............................................47
CKA1D (CKA1 Disable)..............................................................47
TE (Transmitter Enable)............................................................... 47
RE (Receiver Enable) ...................................................................48
MPE (Multiprocessor Enable) ......................................................48
ASCI Control Register B ................................................................48
SS (Source/Speed Select) .............................................................48
DR (Divide Ratio) ........................................................................49
PEO (Parity Even/Odd) ................................................................49
/CTS/PS (Clear to Send/Prescaler) ...............................................49
MP (Multiprocessor Mode) ..........................................................49
MPBT (Multiprocessor Bit Transmit) ..........................................49
Chapter 4: Software 51
Supplied Software................................................................................52
Digital I/O ............................................................................................53
Real-Time Clock (RTC).......................................................................54
Display .................................................................................................55
Flash EPROM .................................................................................55
Table of Contents


vOP7100
Dynamic C 32 Libraries.......................................................................56
OP71HW.LIB..................................................................................56
Keypad Programming .....................................................................65
Using Dynamic C v . 5.xx .....................................................................66
EZIOOP71.LIB...............................................................................66
GLCD.LIB ......................................................................................66
KP_OP71.LIB.................................................................................70
SYS.LIB .......................................................................................... 72
Upgrading Dynamic C .........................................................................73
New LCD Controller Chip ..............................................................73
Chapter 5: Graphics Programming 75
Initialization .........................................................................................76
Drawing Primitives ..............................................................................76
Plot a Pixel ......................................................................................76
Plot a Line .......................................................................................77
Plot a Circle ....................................................................................77
Plot a Polygon .................................................................................77
Fill a Circle .....................................................................................77
Fill a Polygon ..................................................................................77
Draw a Bitmap ................................................................................77
Font and Bitmap Conversion ...............................................................78
Using the Font/Bitmap In Your Program ........................................79
Printing T ext.........................................................................................80
Keypad Programming ..........................................................................81
Initialization ....................................................................................81
Scanning the Keypad.......................................................................81
Reading Keypad Activities..............................................................81
Chapter 6: Installation 83
Grounding ............................................................................................84
Installation Guidelines .........................................................................85
Mounting..............................................................................................86
Bezel-Mount Installation.................................................................86
General Mounting Recommendations.............................................87
Appendix A: Troubleshooting 89
Out of the Box......................................................................................90
Dynamic C W ill Not Start ....................................................................91
Dynamic C Loses Serial Link ..............................................................91
OP7100 Repeatedly Resets..................................................................91
Common Programming Errors.............................................................92
vi


Table of Contents OP7100
Appendix B: Specifications 93
Electrical and Mechanical Specifications ............................................94
LCD Dimensions.............................................................................94
Bezel Dimensions ...........................................................................94
General Specifications ....................................................................95
Header and Jumper Configurations .....................................................96
Appendix C: Memory, I/O Map, and Interrupt Vectors 99
OP7100 Memory ...............................................................................100
Execution Timing ..........................................................................101
Memory Map .....................................................................................102
Input/Output Select Map ...............................................................102
Z180 Internal Input/Output Registers Addresses 00-3F................102
Epson 72423 Timer Registers 0x4180–0x418F............................104
Other Registers..............................................................................105
Interrupt Vectors ................................................................................106
Power-Failure Interrupts ...............................................................107
Interrupt Priorities .........................................................................107
Appendix D: Serial Interface Board 109
Introduction........................................................................................110
External Dimensions .......................................................................... 111
Appendix E: Backup Battery 113
Battery Life and Storage Conditions..................................................114
Replacing the Lithium Battery ........................................................... 114
Battery Cautions ................................................................................115
Index 117
Schematics 125
OP7100 About This Manual


vii
ABOUT T HIS M ANUAL
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.
Understanding the basics of operating a software program and editing files under Windows on a PC.
Knowledge of the basics of C programming.
For a full treatment of C, refer to the following texts. The C Programming Language by Kernighan and Ritchie and/or C: A Reference Manual by Harbison and Steel
Knowledge of basic assembly language and architecture for the Z180 microprocessor.
For documentation from Zilog, refer to the following texts.
Z180 MPU User's Manual Z180 Serial Communication Controllers Z80 Microprocessor Family User's Manual
OP7100viii


About This Manual
Acronyms
Table 1 lists and defines the acronyms that may be used in this manual.
Icons
Table 2 displays and defines icons that may be used in this manual.
Table 1. Acronyms
Acronym Meaning
EPROM Erasable Programmable Read-Only Memory EEPROM Electronically Erasable Programmable Read-Only Memory LCD Liquid Crystal Display LED Light-Emitting Diode NMI Nonmaskable Interrupt PIO Parallel Input/Output Circuit
(Individually Programmable Input/Output)
PRT Programmable Reload Timer RAM Random Access Memory RTC Real-Time Clock SIB Serial Interface Board SRAM Static Random Access Memory UART Universal Asynchronous Receiver Transmitter
Table 2. Icons
Icon Meaning Icon Meaning
Refer to or see
Note
Please con tact
Ti
p
Tip
Caution
High Voltage
FD
Factory Default
OP7100 About This Manual


ix
Conventions
Table 3 lists and defines the typographical conventions that may be used in this manual.
Pin Number 1
A black square indicates pin 1 of all headers.
Measurements
All diagram and graphic measurements are in inches followed by millime­ters enclosed in parenthesis.
J1
Pin 1
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).
Edit
Sans serif font (bold) signifies a menu or menu selection.
. . .
An ellipsis indicates that (1) irrelevant program text is omitted for brevity or that (2) preceding program text may be repeated indefinitely.
[ ]
Brackets in a C function’s definition or program segment indicate that the enclosed direct ive is optional.
< >
Angle brackets occasionall y enclose classes of terms.
a | b | c
A vertical bar indicates that a choice sh ould be made from among the items listed.
OP7100x


About This Manual
OP7100 Overview


11
CHAPTER 1: OVERVIEW
Chapter 1 provides an overview and a brief description of the OP7100 features.
OP710012


Overview
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 (mono­chrome) displays. Five standard fonts are included in the supplied soft­ware. Additional custom fonts are easily created to meet the needs of an application.
The OP7100 can operate with Rabbit Semiconductor single-board comput­ers or other serial displays over an RS-485 network. The OP7100 also supports RS-232 communication.
The OP7100 display terminal uses display technologies that require mini­mal mounting depth and offer maximum viewing angles. The memory allows up to 25 application-screen bitmaps (240 × 320) to be stored with­out compression in a 256K flash EPROM. A further 256K is available for the application in a second flash EPROM.
Figure 1-1 illustrates the standard OP7100 board layout.
C48
R31
0V / GND
JP4
C29
R53
J3
J4
DIGITAL I/O
C104
C106
C101
C95
C96
R62 R61
C102
JP5
BT1
C61
C60
C56
C2
C62
C55
C59
Battery
J9
RS485 TERM.
J11
DCIN
GND
485+
485
GND
C47
D3
D2
C44
J7
PRGM PORT
U20
JP1
LCD
Y1
C4
C7
U4
R2
C51
J1
LCD
U1
R1
Y2
C12
R51
R52
RN2
R14
C13
R15
C34
R13
C31
U17
C32
U18
RN3
C33
U19
U6
U2
RT1
R33 C49
J2
C1
T1
Q3
DANGER! HIGH VOLTAGE
L1
Q2
Q1
KEYPAD
J5
J6
RN1
C14
C15
C16
C17
C18
C19
C20
C21
R43
R44
R45
R48
R50
R42
R41
R40
R39
R38
R37
R36
R35
LS1
R20
R16
R17
R54
U22
R22
R21
R19
R18
JP2
RN4
U11
U12
U10
C27
U9
C23
U8
C22
U7
C24
U13
U14
U5
C50
Flash
U16
U15
C30
U29
C9
R5
R6
R7
C25
C26
R8
R9
R10
R11
R12
C53
C8
C10
R56
MV2
MV1
R24
R23
R25
R26
U24
JP3
C36
C35
C37
U23
U26
D1
U25
C38
C39
C42
U27
C40
C41
R28
R27
C45
U28
C43
J8
D5
R29
R30
RS232
R32
C46
L2
C52
R55
C28
C11
R4
R3
J10
Trans­former
C58
RT2
JP7
JP6
C105
U30
JP10
JP9
JP8
C98
C100
C99
C97
C103
EPLD
R60
R59
R46
R49
R47
R34
C54
PAL
691
U21
D4
RTC
SRAM
Flash
Flash
C3
C57
C6
Z180
LCD
Control
Powe r, RS-485
Contrast Adjustment
RS-232
to
backlight
Figure 1-1. OP7100 Board Layout
OP7100 Overview


13
Features
The OP7100 includes the following features.
240 × 320 ¼ VGA LCD (with touchscreen on OP7100 only)
jumper-selectable background—positive (blue images on white background) or negative (white images on blue background)
software-controlled cold-cathode fluorescent backlighting
software-controlled contrast is enabled/disabled with jumper settting
temperature compensation for LCD contrast changes with temperature
RS-485 and RS-232 serial communication up to 57,600 bps
8 CMOS/TTL-level digital inputs and 8 CMOS/TTL-level digital outputs
18.432 MHz clock with Z180 microprocessor, 9.216 MHz LCD controller
256K flash EPROM for program, 256K flash EPROM for screen bitmaps
switching voltage regulator
Appendix B provides detailed specifications for the OP7100.
The OP7100 also includes battery-backed RAM (128K) and a battery­backed real-time clock a watchdog timer, and power -failure interrupt.
Options
The OP7100 series of serial displays has two versions. Table 1-1 lists their standard features.
Either model may be used in either a portrait or a landscape orientation by using the corresponding software library .
For ordering information, call your Rabbit Semiconuctor Sales Representative.
Table 1-1. OP7100 Series Features
Model Features
OP7100
Serial graphic display, touchscreen, blue and white screen, ¼VGA LCD with bezel mount, software contrast control
OP7110 OP7100 with no touchscreen, manual contrast control
OP710014


Overview
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.
For ordering information, call your Rabbit Semiconductor Sales Representative.
Software
The OP7100 is programmed using Rabbit Semiconductor’s Dynamic C, an integrated development environment that includes an editor, a C compiler, and a debugger. Library functions provide an easy and robust interface to the OP7100.
Rabbit Semiconductor’s Dynamic C reference manuals provide complete software descriptions and programming instructions.
OP7100 Overview


15
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 incorporat­ing 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.
EN61000-4-2 (ESD) EN61000-4-3 (Radiated Immunity) EN61000-4-4 (EFT) EN61000-4-6 (Conducted Immunity)
Additional shielding or filtering may be required for a heavy industrial environment.
The OP7100 has been tested to meet the EN55022 Class A emissions standard with ferrite RFI suppressors on the I/O cables. Additional shielding or filtering may be needed to meet Class B emissions standards.
Since Rabbit Semiconductor products are connected to other devices, good EMC prac-tices should be taken to ensure compliance. CE compliance is eventually the responsibility of the integrator. For more information on tips and technical assistance, visit our Web site at www.rabbit.com/products/ ce_certification/, or contact your local authorized Rabbit Semiconductor distributor.
OP710016


Overview
OP7100 Getting Started


17
CHAPTER 2: GETTING ST A RTED
Chapter 2 provides instructions for connecting the OP7100 to a host PC and running a sample program.
OP710018


Getting Started
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. Watch the polarity of the connection so that the banded wire from the power supply goes to DCIN as shown in Figure 2-1.
Figure 2-1. OP7100 Power Supply Connections
Be careful to connect the power supply wires to the correct screw terminals on header J8. The OP7100 may be destroyed if the power supply is connected to the wrong screw terminal. A protective diode prevents damage to the OP7100 if the power supply polarity is reversed.
4. Plug the power supply into a wall outlet. The display should now light up with the demonstration screens shown in Figure 2-2.
485
+
GND
485 GND
4
3
2
1
DCIN (1230 VDC)
5
to power
supply
DCIN
GND
485+
485
GND
OP7100 Getting Started


19
OP7100 SERIES
DISPLAY/CONTROLLER
Menu
FEATR
EXIT
SUPRT
DEMO
Clock
EXIT
Bklit
Ctrst Beep
Exit
Display Bitmaps
+Yr
Exit
+Day
+Mon
Hr
Sec
Min
+Hr +Min +Sec
Yr
Mon
Day
Set
1999 Dec 31
23 : 59 : 59
Exit
Press Keys Before Tiimeout
EXIT
SUPPORT
Z-WORLD
TECHNICAL SUPPORT
15307573737
www.zworld.com
Figure 2-2. OP7100 Demo Screens
OP710020


Getting Started
5
4
3
2
1
CONTRAST
RS232
485
+
GND
n.c.
485 GND
4
3
2
1
9
8
7
6
232_RX1/ CT 232_TX1/ RT PWR_DE9
TXA RXA
n.c.
GND
n.c.
DCIN (1230 VDC)
5
CAUTION: High-Voltage Transformer. Only qualified persons may open this case.
S/N:
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.
Figure 2-3. OP7100 Back Cover
2. Establish a serial communication link. A PC “communicates” with the OP7100 via Serial Port 0 or the Clocked Serial Input/Output port on the OP7100’s Z180 microprocessor . There are two options for the serial communication link.
Option 1 (via optional SIB)—Connect an RJ-12 cable between the PC and the SIB. An RJ-12 to DB9 adapter is included for DB9 PC COM ports. Remove any jumpers that may be installed on the OP7100’ s header J4 and plug the SIB’ s 8-pin connector onto header J4 as shown in Figure 2-4. Make sure that pin 1 on the ribbon cable connector (on the striped side) matches up with pin 1 on J4 (indicated by a small white circle next to the header).
Option 2 (directly)—Place a jumper across pins 1–2 of header J4 on the OP7100 as shown in Figure 2-5. Connect the PC COM port to the DB9 jack on the OP7100, header J7, using the DB9 to DB9 serial cable supplied with the Tool Kit.
3. The OP7100 is now ready for programming. The power supply may be plugged in and turned on.
OP7100 Getting Started


21
Marked
Conductor
to Pin 1
Pin 1
J4
PRGM PORT
Figure 2-4. SIB Programming Connection
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.
J4 SIB2
To PC
J4
1234567
8
OP710022


Getting Started
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. The SIB and the
OP7100 both set their baud rate automatically to match the communication rate set on the host PC using Dynamic C (9600 bps, 19,200 bps, 28,800 bps, or 57,600 bps). To begin, adjust the communications rate to 19,200 bps.
Make sure that the PC serial port used to connect the serial cable (COM1 or COM2) is the one selected in the Dynamic C OPTIONS menu. Select the 1-stop-bit protocol.
See Appendix A, “Troubleshooting,” if an error message such as Target Not Responding or Communication Error appears.
Once the necessary changes have been made to establish communication between the host PC and the OP7100, use the Dynamic C shortcut <Ctrl Y> to reset the controller and initiate communication.
At this point, the LCD should be blank and the backlight should be off. Once communication is established, load the sample program
DEFDEMOL.C in the Dynamic C SAMPLES\QVGA subdirectory . Compile
and run the program by pressing F9 or by selecting Run from the Run menu.
The OP7100 should now alternately display the large font (17x × 35h) and the small font (6w × 8h). The fonts should scroll across the display.
Compiling and running this sample program will overwrite the demonstration program shown in Figure 2-3.
OP7100 Hardware


23
CHAPTER 3: HARDW ARE
Chapter 3 describes how to use the OP7100. Sections are included to describe the following features.
Subsystems Overview
Power Management
Liquid Crystal Display
Keyboard Interface
Digital I/O
Serial Communication
OP710024


Hardware
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.
Figure 3-1. OP7100 Block Diagram
Computing Module
The OP7100 computing module consists of a Zilog Z180 microprocessor, 128K of battery-backed static RAM, and 512K of flash EPROM. The computing module operates in tandem with a real-time clock and a watchdog timer/microprocessor supervisor .
The Z180 CPU runs at 18.432 MHz, and the LCD controller runs at
9.216 MHz. The watchdog timer/microprocessor chip provides a watchdog timer
function, power-failure detection, RAM protection, and battery backup. The real-time clock provides time and date information to applications
running on the OP7100.
The EEPROM is simulated in flash EPROM for consistency with Rabbit Semiconductor controllers whose software libraries rely on exchanging information with the EEPROM. The simulated EEPROM in the OP7100 is unused at the present time, but addresses 0 and 1 are reserved for furture use. Do not use these addresses in your application.
Flash2SRAM
RTC
Batt.
Z180
Flash1
8
LCD
Control
VRAM2VRAM1
’691
super.
Keypad
Interface
EPLD
Backlight
RS-232
RS-485
LCD
320 x 240
8
Optional Software Contrast Adjustment
Contrast Adjustmen
t
Drive
S
ense
Buzzer
Touchscreen
8
8
Digital
I/O
OP7100 Hardware


25
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. A high-voltage section supplies 300 V rms to drive the cold-cathode fluorescent backlight. The backlight can be turned on or off under software control whereby a high on the gate of Q3 enables Q1 and Q2 to oscillate, and a low turns off Q3, stopping the oscillation of Q1 and Q2.
Figure 3-2 shows these internal power supplies in a block diagram
Figure 3-2. Block Diagram of OP7100 Internal Power Regulators
The DC input source can also be brought out on pin 9 of header J10, the DE-9 connector, by installing a 0 resistor at R32. This option allows power to be supplied to a serial device connected to the OP7100 as long as the serial device’ s RS-232 port can handle the DC input on pin 9.
Be sure to use a power supply with sufficient capacity (for example, 1.1 A at 24 V) to handle surges when the OP7100 and any devices connected to it are first turned on.
VCC
J10:9
1230 V DC
J11:5
1230 V DC
U28
2575
Sw Reg
U27
2951
Lin Power
U25
7662
Sw Reg
U23
7662
Sw Reg
VEE
VCC
2575
Sw Reg
Backlight
Power
from EPLD
300 V rms, 32.7 kHz, to CCFL backlight
Q3
OP710026


Hardware
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 .
Supports battery backup.
Handling Power Fluctuations
During a normal power-down, an interrupt service routine is used in response to a power-failure interrupt to save vital state information for the application for when power recovers. The amount of code that the interrupt service routine can execute depends on how fast the voltage decreases.
Theoretically , a power failure would cause a single power -failure interrupt. Then, the interrupt service routine would restore data from the previous state when the voltage recovers.
However, fluctuations in the DC input line could cause the ADM691 to see multiple crossings of the 1.3 V input power-reset threshold. These multiple negative-edge transitions would, in turn, cause the Z180 to see multiple power-failure interrupts.
The ADM691 generates a power-failure interrupt, INT1. After reset, INT1 must be enabled by a write into the ITC register as well as execution of the EI instruction followed by a RETI instruction. The Z180 will restore saved state information when it executes the RETI instruction.
Ideally, the Z180 should be able to pop the stack and return to the location where the program was first interrupted. Also, depending on the number of fluctuations of the DC input (and hence, the number of stacked power­failure interrupts), the processor’s stack can overflow, possibly into your program’s code or data.
The following sample program shows how to handle a power-failure interrupt.
OP7100 Hardware


27
main(){
...
}
...
char dummy[24];
...
#define INT1_BIT 0 ; bit 0
#INT_VEC INT1_VEC power_fail_isr
#asm
power_fail_isr::
ld sp,dummy+24 ; force stack pointer
; to top of dummy vector ; to prevent overwriting ; code or data
do whatever service, within allowable execution time
loop:
call hitwd ; make sure no watchdog reset
; while low voltage
ld bc,INT1 ; load the read INT1 register
; to bc
in a,(c) ; read the read INT1 register
; for /PFO
bit INT1_BIT, a ; check for status of /PFO jr nz,loop ; wait until the brownout
; clears
timeout: ; then...a tight loop to
; force a watchdog timeout,
jp timeout ; resetting the Z180
#endasm
Of course, if the DC input voltage continues to decrease, then the OP7100 will just power down.
Call the Dynamic C function hitwd during the power-failure service routine to make sure that the watchdog timer does not time out and thereby reset the processor . The controller can continue to run at low voltages, and so it might not be able to detect the low-voltage condition after the watchdog timer resets the processor.
Watchdog T imer
T o increase reliability, the ADM691’ s watchdog timer forces a system reset if a program does not notify the supervisor nominally at least every second. The assumption is that if the program fails to “hit” the watchdog, the program must be stuck in a loop or halted. The Dynamic C function for hitting the
OP710028


Hardware
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 V
MIN
(between 4.5 V and 4.75 V), the ADM691 supervisor asserts /RESET and holds it until VCC goes above V
MIN
and stays that way for at least 50 ms. This delay allows the system’s
devices to power up and stabilize before the CPU starts.
PFI “Early Warning”
When PFI drops below 1.3 V ± 0.05 V (i.e., DCIN drops below ~10 V), the supervisor asserts /NMI (nonmaskable interrupt), and allows the program to clean up and get ready for shutdown. The underlying assump­tion here is that PFI will cause the interrupt during a power failure before the ADM691 asserts /RESET.
In order to improve the performance of the power-failure interrupt circuit, we have added some hysteresis to the power-failure comparator by adding a resistor, R34, between the comparator input and output pins. R34 can be found on the 175-0196 and the 175-0211 versions of the OP7100. The hysteresis prevents the comparator from switching rapidly—and therefore generating multiple interrupts—when the input voltage is falling slowly. Once the comparator switches (DC IN falls to approximately 8.5 V), this feedback holds the input (PFI) low and prevents further interrupts from being generated. At this point, the 5 V regulator still has sufficient voltage to keep the processor operating, so that an interrupt service routine can perform shutdown tasks and “tidying up” before the Vcc line fails. The comparator will not turn the output (PFO) high until DC IN has risen to about 9.2 V. The hysteresis will also help prevent any system oscillation in adverse power supply/loading situations.
The voltage at which the power-failure interrupt occurs may be changed by adjusting the values of R29 and R30, which are shown in Figure 3-3. To calculate the values of these components, let VL be the voltage at which PFO turns off as DC IN falls, and let VH be the voltage at which PFO turns on as DC IN rises.
OP7100 Hardware


29
Figure 3-3. OP7100 Power-Failure Detection Circuit
Since R34 >> RN2, the difference between VH and VL, the hysteresis voltage, would be 5 V × (R30/R34). For a nominal hysteresis voltage of
1.25 V, R
30
= 0.25 × R34.
Memory Protection
When /RESET is active, the ADM691 supervisor disables the RAM chip­select line, preventing accidental writes.
Battery Backup
The backup battery protects data in the RAM and the real-time clock (R TC). VRAM, the voltage supplied to the RAM and R TC, can also protect other devices attached to the system against power failures. The ADM691 super­visor switches VRAM to VBA T or VCC, whichever is greater . (T o prevent “hunting,” the switchover actually occurs when Vcc is 50 mV higher than VBAT.)
The circuit draws no current from the battery once regular power is applied.
System Reset
The ADM691 chip drives the /RESET line. The /RESET line is not pulled up internally .
DCIN
U28 Reg.
VCC
R30
29.4 kW
R29
4.99 kW
PFI to supervisor
VIN VOUT
C44
47 µF
U12 Supervisor
VBAT
WDI
PFI
VOUT
WDO
PFO
RST
INT1
R34
220 kW
RST
VCC
RN2 10 kW
⎥ ⎦
⎢ ⎣
⎟ ⎠
⎜ ⎝
+
⎟ ⎠
⎜ ⎝
+=
⎥ ⎦
⎢ ⎣
⎟ ⎠
⎜ ⎝
+
⎟ ⎠
⎜ ⎝
+=
R34
R30
R29
R30
1V3.1V
RN2)V(R341.3
V)1.3-V5(R30
R29
R30
1V3.1V
H
L
OP710030


Hardware
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.
Figure 3-4. Block Diagram LCD Control and Memory
The LCD is connected to the OP7100 circuit board through header J1 or J3 on the circuit board.
Contrast Adjustment
Figure 3-5 shows the location of the manual contrast adjustment. This con­trast adjustment is the factory default for the OP7110. The OP7100 is configured with software contrast control as the fac­tory default. W ith software contrast con­trol, the contrast level may be set via a software function call. Since it is hard to guess the correct level in software, buttons defined on the OP7100 touch­screen and in software can be used to adjust the contrast. A user-supplied key­pad can facilitate this type of software control for the OP7110.
CONTRAST
Figure 3-5. Location of OP7100
Manual Contrast Adjustment
U2
VCC
VRAMCS1
A[0–14]
/CS VCC
D[0–7]
RAM
U1
VCC
VRAMCS2
A[0–14]
/CS VCC
D[0–7]
RAM
U3
VA[0–14]
VD[0–7]
FRAME
ON/OFF
/RESET
SED1335F LCD Control
XD[0–3]
/INT0
D[0–7]
A0
FRAME
XD[0–3] VCC
ON/OFF
LCD
VEE
ADJUST
VCC
R26
10 k
R31
2.5 k
-
+
Manual
Software Contrast
Adjustment
Loading...
+ 96 hidden pages