PK2200 SeriesC-Programmable ControllersUser’s Manual019–0015 • 071126–F
PK2200x s About This ManualBlank
PK2200100 s PLCBusZ-World provides software drivers that access the PLCBus. To allowaccess to bus devices in a multiprocessing environment, the expan
PK2200 PLCBus s 101Digital output devices, such as relay drivers, should be addressed withthree 4-bit addresses followed by a 4-bit data write to the
PK2200102 s PLCBusThere are 4-bit and 8-bit drivers. The 4-bit drivers employ the followingcalls. void eioResetPlcBus()Resets all expansion boards o
PK2200 PLCBus s 103 void set4adr( int adr )Sets the current address for the PLCBus. All read and write operationsaccess this address until a new add
PK2200104 s PLCBus char read4data( int adr )Sets the last four bits of the current PLCBus address using adr bits 811, then reads four bits of data f
PK2200 PLCBus s 105 void set8adr( long address )Sets the current address on the PLCBus. All read and write operationswill access this address until
PK2200106 s PLCBusBlank
PK2200 Backup Battery s 107APPENDIX F: BACKUP BATTERY
PK2200108 s Backup BatteryBattery Life and Storage ConditionsThe ten-year estimated life of a battery on the PK2200 is based on typicaluse. Most syst
PK2200 Backup Battery s 109Battery Cautionsw Caution (English)There is a danger of explosion if battery is incorrectly replaced.Replace only with th
PK2200 Overview s 11CHAPTER 1: OVERVIEWChapter 1 provides a comprehensive overview and description of thePK2200.
PK2200110 s Backup BatteryBlank
PK2200 Index s 111INDEXSymbols#INT_VEC ... 41, 86#JUMP_VEC ... 87/AT ...
PK2200112 s Indexbus (continued)operations4-bit... 97, 98, 1008-bit... 97, 101BUSADR0 ... 91,
PK2200 Index s 113DRIVERS.LIB ... 101dropout voltage ... 80DRV10 ...
PK2200114 s Indexexpansion boardsreset... 102expansion bus ... 86, 87, 91, 961014-bit drivers ...
PK2200 Index 115INT1 ... 87INT1_VEC ... 86INT2 ...
PK2200116 s IndexLCDgraphic (continued)contrast ... 60drawing ... 56, 57, 58, 60font initialization... 58, 59in
PK2200 Index s 117PLCBus (continued)relaysDIP... 96drivers ... 101writing data ...
PK2200118 s IndexSE1100... 96select PLCBus address... 102SER0_VEC ... 41, 86SER1
PK2200 Index s 119troubleshooting (continued)communication mode ... 67expansion boards ... 66grounds ...
PK220012 s OverviewIntroductionThe PK2200 is an inexpensive control computer well suited for a varietyof applications in areas such as packaging, mat
PK2200SCHEMATICS
PK2200 Overview s 13Figure 1-3 illustrates the PK2200 without an enclosure.Figure 1-3. PK2200 Without EnclosureMux MuxRTRS232U7U6Z180U15H.C. DriverL
PK220014 s OverviewStandard FeaturesThe PK2200 series includes the following standard features: Compact size: 4" × 5.5" × 1.34" 16
PK2200 Overview s 15Flexibility and Customization OptionsThe PK2200 is available with either quick-release pluggable terminals orfixed screw terminal
PK220016 s OverviewCE ComplianceThe PK2200 has been tested by an approved competent body,and was found to be in conformity with applicable EN andequi
PK2200 Getting Started s 17CHAPTER 2: GETTING STARTEDChapter 2 provides instructions for connecting the PK2200 to a PC andrunning a sample program.
PK220018 s Getting StartedConnecting the PK2200 to a PCThe PK2200 is programmed with a PC through an RS-232 port using theprogramming cable provided i
PK2200 Getting Started s 19Figure 2-2 illustrates the power supply connections.Figure 2-2. Power Supply Connection4. Plug the power supply into a w
PK2200 User’s ManualPart Number 019-0015 • 071126-F • Printed in U.S.A.© 1999–2007 Rabbit Semiconductor Inc. • All rights reserved.Rabbit Semiconducto
PK220020 s Getting StartedRunning a Sample ProgramTo run a sample program on the PK2200 use the following steps.1. Open the sample program CDEMO_RT.C
PK2200 Subsystems s 21CHAPTER 3: SUBSYSTEMSChapter 3 describes the various PK2200 subsystems and interfaces,software drivers and sample programs.
PK220022 s SubsystemsSubsystem OverviewThe PK2200 is composed of several subsystems. The following list ofsubsystem elements is illustrated in Figu
PK2200 Subsystems s 23Processor CoreThe PK2200s processor core is composed of the CPU, microprocessorsupervisor/watchdog timer, battery-backed stati
PK220024 SubsystemsEven though slightly more expensive than standard EPROM, flashEPROM offers the following benefits.• In-system programmability
PK2200 Subsystems s 25The digital inputs can be pulled up to +5 V or down to GND by installingjumpers on JP2. When jumpered, the digital input line
PK220026 s SubsystemsInputs 1114, in addition to the protected digital input function, have thecapabilities listed in Table 3-2.Inputs 11 and 12 can
PK2200 Subsystems s 27Digital OutputsThe PK2200s 14 digital outputs (HV01 through HV14) provide high-voltage, high-current digital outputs for your
PK220028 s SubsystemsSinking DriversJP1JP1Sourcing Drivers31243412Figure 3-6 illustrates the connection for the UDN2985A sourcing driver.(Note the co
PK2200 Subsystems s 29Serial CommunicationTwo serial ports support asynchronous communication at baud rates from300 bps to 57,600 bps on 9.216 MHz ve
Table of Contents s iiiPK2200TABLE OF CONTENTSAbout This Manual viiChapter 1: Overview 11Introduction...
PK220030 s SubsystemsTable 3-4 lists JP3 jumper settings and Figure 3-10 illustrates jumpersetting configurations for the two serial channels. If on
PK2200 Subsystems s 31Table 3-5. Header Connections and FunctionHeader FunctionH1The LCD connector. Connect a 14-wire ribbon cablefrom the LCD to t
PK220032 s SubsystemsBlank
PK2200 System Development s 33CHAPTER 4: SYSTEM DEVELOPMENTChapter 4 describes system development using the PK2200 interfaces andpresents some sampl
PK220034 System DevelopmentChanging ModesThe operating mode of the PK2200 is determined during power-upinitialization. If a valid program is fo
PK2200 System Development 35Figure 4-2. 3x4 Keypad Mode SettingsFigure 4-3. JP4 Mode SettingsDo not jumper more than one pair of pins to conf
PK220036 s System DevelopmentEPROMEPROMs offer a permanent storage option for programs and data.The PK2200 BIOS is factory installed in the EPROM. Af
PK2200 System Development s 37The following points summarize the counters capabilities: The counter can measure the time at which a negative edge o
PK220038 s System DevelopmentSerial CommunicationDynamic C has serial communication support libraries. For the Z180 portz0 and Z180 port z1, use AASC
PK2200 System Development s 39Echo OptionIf the echo option is turned on during initialization of the serial port (withDinit_z0, Dinit_z1, or Dinit_u
iv s Table of Contents PK2200Digital Inputs ... 36Using the Digi
PK220040 s System DevelopmentLibrary functions for the RS-232 port support communication with aHayes Smart Modem or compatible. Note the following po
PK2200 System Development s 41Interrupt Handling for Z180 Port 0Normally, a serial interrupt service routine would be declared with thecompiler direc
PK220042 s System DevelopmentDeveloping an RS-485 NetworkThe two-wire RS-485 serial-communication port and Dynamic-C networksoftware allow network dev
PK2200 System Development s 43Keypad and LCDThe PK2200 Series supports operator I/O with a keypad and LCD. Twostandard operator I/O configurations ar
PK220044 s System Development0.100.400.300.130.401.130.403.75F1delF4F3F2 addmenuitemhelpdownupfield0.130.10Keypad Insert TemplatesThe keypads are desi
PK2200 System Development s 45Keypad CodesThe PK2200 keypads are supported by Dynamic C functions that returncodes corresponding to the key pressed.
PK220046 s System DevelopmentRow 0Row 1Column 0Column 192x20 Character LCDRow 0Row 63Column 0Column 12764x128 Graphic LCD 7 6
PK2200 System Development s 47ON/OFF - When the ON/OFF bit is set ( 1 ) the display is on, any imageon the screen will be visible. When the bit is re
PK220048 s System DevelopmentBlank
PK2200 Software Reference s 49CHAPTER 5: SOFTWARE REFERENCEChapter 5 covers the software drivers used with the PK2200 seriescontrollers.
Table of Contents s vPK2200 Appendix B: Specifications 69General Specifications ...
PK220050 s Software ReferenceSoftware DriversDrivers are functions that simplify accessing PK2200 hardware and I/O.For the following reasons, Z-World
PK2200 Software Reference s 51EEPROMThe following functions provide access to the EEPROM. The EEPROMis generally used for storing system information,
PK220052 s Software ReferenceDigital Inputs and Outputs DIGIN1, DIGIN2, ..., DIGING16The virtual driver variables DIGIN1, DIGIN2, ... DIGIN16 repre
PK2200 Software Reference s 53The lower eight bits returned by the inport() function represent thestatus of the digital inputs. Bits which are set (
PK220054 s Software ReferenceDigital Output DriversFollowing are the digital output drivers for the PK2200: int up_setout( int channel, int value )Se
PK2200 Software Reference s 55LCD and KeypadThe following functions provide routines for writing to the LCD andreading the keypad.Include the followi
PK220056 s Software Reference int lc_cmd (int cmd)Waits for LCD busy flag to clear, then sends cmd to LCD commandregister.RETURN VALUE: 0, if success
PK2200 Software Reference s 57 int glInit()Initializes the LCD module (software and hardware).RETURN VALUE: returns the status of the LCD. If the i
PK220058 s Software Reference void glXPutBitmap(int x, int y, int bmWidth,int bmHeight, unsigned long bmPtr)Displays a bitmap stored in xmem on the L
PK2200 Software Reference s 59 void glXFontInit(struct _fontInfo *pInfo,char pixWidth, char pixHeight, unsignedstartChar, unsigned endChar, unsigned
vi s Table of Contents PK2200Blank
PK220060 s Software Reference void glPrintf(int x, int y, struct _fontInfo*pInfo, char *fmt,...)Prints a formatted string (much like printf) on the L
PK2200 Software Reference s 61 void kpInit(int (*changeFn)())Initializes the kp module. This function should be called before otherfunctions of this
PK220062 s Software Reference int kpDefGetKey()This is the default get key function. This function returns the keypreviously pressed (i.e., from the
PK2200 Software Reference s 63Table 5-1. PK2200 Sample Programs (concluded)Program Description LADDERC.C Use ladder C for I/O control. LCGRAM.C Il
PK220064 s Software ReferenceTable 5-3. PK2240 Sample Programs Program Description GLPRINTF.C Demonstrates the glprintf function andshows how to pri
PK2200 Troubleshooting s 65Appendix A provides procedures for troubleshooting system hardware andsoftware.APPENDIX A: TROUBLESHOOTING
PK220066 s TroubleshootingOut of the BoxCheck the items mentioned in this section before starting development. Verify that the PK2200 runs in standal
PK2200 Troubleshooting s 67Dynamic C Will Not StartIn most situations, when Dynamic C will not start, an error messageannouncing a communication fai
PK220068 s TroubleshootingCommon Programming Errors Values for constants or variables out of range. Table A-1 lists accept-able ranges for variables
PK2200 Specifications s 69 APPENDIX B: SPECIFICATIONSAppendix B provides comprehensive PK2200 physical, electronic, andenvironmental specifications
PK2200 About This Manual s viiABOUT THIS MANUALThis manual provides instructions for installing, testing, configuring, andinterconnecting the Z-World
PK220070 s SpecificationsGeneral SpecificationsTable B-1 lists the electrical, mechanical, and environmental specifica-tions for the PK2200. Table B-1
PK2200 Specifications s 71Hardware Mechanical DimensionsTop view for models PK2200 and PK2210.Figure B-1. Top View PK2200 and PK2210menusetupitem f
PK220072 s SpecificationsTop view for model PK2240.Figure B-2. Top View PK22400.621(15.8)1.350 (34.3)4.0 (102)0.31 typ (7.9)10-32 clr, 4x0.37 (9.4)3.7
PK2200 Specifications s 730.75 (19.1)1.2 (30.5)1.71 (43.4)0.22 (5.6)0.55 (14.0)0.2 (5.1) 2.95 (75.0) 1.44 (36.6)End view for models PK2200, PK22
PK220074 s Specifications0.030 (0.76) 0.220 (5.59) 5.100 (129.5) 5.320 (135.1) 0.200 (5.1) 0.770 (19.6) 3.230 (82.0) 3.800 (96.5) 4.000 (101.6)0 .470
PK2200 Specifications s 75Table B-2. Sinking Driver SpecificationsParameterAbsolute Maximum Ratingat 25 COutput Voltage 50 V DCOutput Current 500 m
PK220076 s SpecificationsLEDKeypad Conn.H1H2H3JP4PLC BusConnectorLCDInterfaceJP2 JP3JP5JP1CN1 CN2213JP6,14ConnectorsOnly a single, solid conductor sho
PK2200 Specifications 77FD Table B-4. Headers and Jumper Settings Header Pins Description JP1 Sink/source control. The drivers will be da
PK220078 s SpecificationsBlank
PK2200 Power Management s 79 APPENDIX C: POWER MANAGEMENTAppendix C provides information about power management and hardwareand software specific t
PK2200viii s About This ManualAcronymsTable 1 lists and defines the acronyms that may be used in this manual.IconsTable 2 displays and defines icons t
PK220080 s Power ManagementPower Failure Detection CircuitryFigure C-1 shows the power failure detection circuitry of the PK2200. Figure C-1. PK2200 P
PK2200 Power Management s 81The ratio of your power supplys output capacitors value to your circuitscurrent draw determines the actual duration o
PK220082 s Power ManagementRecommended Power Fail RoutineZ-World recommends the following routines to handle an NMI. Theroutines monitor the state of
PK2200 Power Management s 83The watchdog timer should be enabled. However, if the watchdog is notenabled, you can force the processor to restart ex
PK220084 s Power ManagementBlank
PK2200 Interrupts and Addresses s D-85 APPENDIX D: INTERRUPT VECTORS ANDI/O ADDRESSESAppendix D provides a suggested interrupt vector map and infor
PK2200D-86 s Interrupts and AdressesMost of the following interrupt vectors can be altered under programcontrol. The addresses are given in hex, rela
PK2200 Interrupts and Addresses s D-87Jump VectorsThese special interrupts occur in a different manner: instead of loadingthe address of the interru
PK2200D-88 s Interrupts and AdressesEEPROM AddressesThese EEPROM constants apply to the standard PK2200.Table D-3. Z180 I/O Device Register Addresses
PK2200 Interrupts and Addresses s D-89Processor Register AddressesThe Z180s I/O-device registers occupy the first 40H addresses.Table D-4. Z180 In
PK2200 About This Manual s ixTable 3. Typographic ConventionsExample Description whileCourier font (bold) indicates a program, a fragment of aprogram
PK2200D-90 s Interrupts and AdressesTable D-4. Z180 Internal I/O Device Registers (concluded)Address Name Description0x21 SAR0H DMA Source Address, C
PK2200 Interrupts and Addresses s D-91PK2200 Peripheral AddressesThe following addresses control the I/O devices that are external to theZ180 proces
PK2200D-92 s Interrupts and AdressesTable D-5. PK2200 External I/O Device Registers (continued)Address Bit(s) Symbol Function 0x100 0–3 RTALE Real-
PK2200 Interrupts and Addresses s D-93continued . . .Table D-5. PK2200 External I/O Device Registers (continued)Address Bit(s) Symbol Function 0x1
PK2200D-94 s Interrupts and AdressesTable D-5. PK2200 External I/O Device Registers (concluded)Address Bit(s) Symbol Function 0x1C3 5 DRV4 Digital
PK2200 PLCBus s 95APPENDIX E: PLCBUSAppendix E provides the pin assignments for the PLCBus, describes theregisters, and lists the software drivers.
PK220096 s PLCBusPLCBus OverviewThe PLCBus is a general-purpose expansion bus for Z-World controllers.The PLCBus is available on the BL1200, BL1600, B
PK2200 PLCBus s 97Two independent buses, the LCD bus and the PLCBus, exist on the singleconnector.The LCD bus consists of the following lines. LCDX
PK220098 s PLCBusThere are eight registers corresponding to the modes determined by buslines A1X, A2X, and A3X. The registers are listed in Table E-2
PK2200 PLCBus s 99Place an address on the bus by writing (bytes) to BUSADR0, BUSADR1and BUSADR2 in succession. Since 4-bit and 8-bit addressing modes
Comentários a estes Manuais