ABLE OF ONTENTS About This Manual Chapter 1: Overview Chapter 2: Getting Started Chapter 3: Input/Output Configuration Chapter 4: System Development PK2300 Table of Contents s iii...
Page 4
Chapter 5: Software Reference Appendix A: Troubleshooting iv s Table of Contents PK2300...
Page 5
Appendix B: Specifications Appendix C: Serial Interface Board 2 Appendix D: Sinking vs. Sourcing Drivers Appendix E: Power Management Appendix F: Enclosure Mounting Appendix G: Nonvolatile Storage Appendix H: I/O Map and Interrupt Vectors PK2300 Table of Contents s v...
Page 6
Appendix I: Battery Index Schematics vi s Table of Contents PK2300...
Page 7
BOUT ANUAL ® ® Assumptions The C Programming Language C: A Reference Manual Z180 MPU User's Manual Z180 Serial Communication Controllers Z80 Microprocessor Family User's Manual PK2300 About This Manual s vii...
Real-Time Clock Serial Interface Board SRAM Static Random Access Memory UART Universal Asynchronous Receiver Transmitter Icons Table 2. Icons Icon Meaning Icon Meaning Note Refer to or see Please contact Caution High Voltage Factory Default viii s About This Manual PK2300...
Page 9
< > Angle brackets occasionally enclose classes of terms. a | b | c A vertical bar indicates that a choice should be made from among the items listed. Pin Number 1 Pin 1 Measurements PK2300 About This Manual s ix...
Page 12
The Real Time Clock is not included. The Resistive Measurement Input is not included. As shown in Figure 1-1, the PK2300 is housed in a rugged enclosure that has multiple mounting options including DIN rail. Figure 1-1. PK2300 Enclosure, Side View (Left Side) See Appendix F, Enclosure Mounting,...
Page 13
I/O Board Voltage Regulator Driver Battery User LED Run LED Optional CMOS Outputs (Run/Program) Real- CM7200 Time Board Clock 8-pin Z180 Programming unde de) Header SRAM Flash EPROM Figure 1-2. PK2300 Component Layout (Top View, Case Removed) PK2300 Overview s 13...
Page 14
Features Figure 1-3. PK2300 Top View Showing Screw Terminal Locations 14 s Overview PK2300...
Page 15
Flexibility and Customization Flexibility Level 1 Out of the Box Flexibility Level 2 Customization exact Optional Accessories PK2300 Overview s 15...
Page 16
Development Kit PK2300 Users Manual Software Development and Evaluation Tools CE Compliance 16 s Overview PK2300...
ETTING TARTED HAPTER PK2300 Getting Started s 17...
Page 18
Connecting the PK2300 to Your PC To connect the PK2300 to a PC: PK2300 Red Shrink Wrap Power Supply Leads Figure 2-1. Power Supply Connection 18 s Getting Started PK2300...
Page 19
Run/Program RJ-12 Jumper Connector Figure 2-2. Run/Program Jumper Location PK2300 Programming Cable To PC's Port Adapter Figure 2-3. Programming Connections PK2300 Getting Started s 19...
Page 20
Running Dynamic C Target Not Responding Communication Error <Ctrl Y> Selecting Communications Rate, Port, and Protocol Serial Options OPTIONS 20 s Getting Started PK2300...
Page 21
6-conductor To PC COM RJ-12 Cable Port RJ12-to-DB9 Adapter Blue Conductor I/O Board to Pin 1 Top View CM7200 Pin 1 Board Run/Program Jumper Figure 2-4. Programming Connections to Serial Interface Board PK2300 Getting Started s 21...
Page 22
OPTIONS Running a Sample Program Compile Compile Target Not Responding Communication Error <Ctrl Z> 22 s Getting Started PK2300...
Page 23
// Turn on LED D1 // Delay .4 seconds // Turn off LED D1 // Delay .55 seconds // Turn on LED D2 // Delay .6 seconds // Turn off LED D2 // Delay.38 seconds PK2300 Getting Started s 23...
HAPTER NPUT UTPUT ONFIGURATION PK2300 Input/Output Configuration s 25...
Page 26
OUT-02 IN-04 OUT-03 IN-05 OUT-04/IN-16 IN-06 OUT-05/IN-15 IN-07 OUT-06/IN-14 IN-08/RMI+ OUT-07/IN-13 IN-09/RMI OUT-08/IN-12 IN-10/485+ IN-11/485 User LED Run LED Optional CMOS Outputs RS-232 (Run/Program) Figure 3-1. PK2300 Pin and Header Layout (Top View, Case Removed) 26 s Input/Output Configuration PK2300...
Page 27
Flexible Input/Output Summary Table 3-1. PK2300 I/O Functions J4 Pins 1 through 12 Function 1 Function 2 Label (user assignable) Ground IN-01 Protected Digital Input 1 IN-02 Protected Digital Input 2 IN-03 Protected Digital Input 3 IN-04 Protected Digital Input 4...
Page 28
Table 3-1. PK2300 I/O Functions J1 Pins 1 through 12 Function 1 Function 2 Label (user assignable) Power supply input (9 V to 24 V DC) High-current driver supply Ground (power supply) OUT-01 High-Current Output 1 OUT-02 High-Current Output 2...
Page 29
Configuration “I” One 3-wire RS-232 (no hand- shaking) and one RS-485. RS-232 RS-485 Configuration “II” One 5-wire RS-232 (RTS/CTS handshaking) and one RS-485. RS-232 RS-485 Configuration “III” Two 3-wire RS-232 (no hand- shaking). RS-232 RS-485 PK2300 Input/Output Configuration s 29...
Page 30
Configuring Inputs and Outputs Selecting IN-08 and IN-09, or RMI Input + and - IN-08, IN-09 Resistive Protected Digital Measurement Inputs Input Figure 3-2. Header H4 Configurations 30 s Input/Output Configuration PK2300...
Page 33
Selecting IN-10 and IN-11 or RS-485+ and RS-485 IN-10, IN-11 Protected Digital RS-485 Inputs Figure 3-5. Header H4 Settings for RS-485 and IN-10, IN-11 PK2300 Input/Output Configuration s 33...
Page 34
CMOS Outputs CMOSOUT01 CMOSOUT02 CMOSOUT03 CMOSOUT04 Driver CMOSOUT05 CMOSOUT06 CMOSOUT07 CMOSOUT08 Figure 3-6. Configuration of Driver IC Socket for CMOS Outputs 34 s Input/Output Configuration PK2300...
YSTEM EVELOPMENT HAPTER PK2300 System Development s 35...
Page 36
Dynamic C. The PK2300 must be in this mode when you attempt to compile a program to the PK2300 or debug a program. In Program mode, the PK2300 matches the baud rate of the PC COM port up to 57,600 bps. Baud rates of 9600 bps, 19,200 bps, 28,800 bps, and 57,600 bps are possible.
Page 37
Run a program without “polling.” See your Dynamic C manuals for a description of program polling. Run Mode Removed Run program (in your application). Changing the PK2300s Operating Mode Run/Program RJ-12 Jumper Connector Figure 4-2. Location of Run/Program Jumper at H2...
Page 38
Running a Program Compile Compile 38 s System Development PK2300...
Page 39
Using the Digital Inputs/Outputs Protected Digital Inputs PK2300 System Development s 39...
Page 40
How to Read the Inputs int eioBrdDI( unsigned chanNum ) Input Demonstration Program // Use the PK2300 I/O // library // Assign INPUT1 protected // digital input IN-01 // Create integer I // Initialize the PK2300 // Assign integer I the...
Page 41
Save File Compile Compile STDIO STDIO STDIO STDIO PK2300 System Development s 41...
Page 42
High-Current Outputs How to Use the Outputs int eioBrdDO( unsigned chanNum, char state ) 42 s System Development PK2300...
Page 43
Output Demonstration Program Use the PK2300 I/O library Assign OUTPUT1 high- current output OUT-01 Assign ON the logic value 1 Assign OFF the logic value 0 initialize the PK2300 Turn-off OUT-01 Turn-on OUT-01 Turn-off OUT-01 End of program Save Compile...
Page 45
Resistance Measurement Input (RMI) Ω Ω Resistive Measurement Input Figure 4-4. Header H4 Settings for RMI PK2300 System Development s 45...
Page 46
How to Use the Resistance Measurement Input float eioBrdAI( unsigned chanNum ) chanNum chanNum chanNum chanNum eioErrorCode EIO _ NODEV (eioErrorCode & EIO _ NODEV) 46 s System Development PK2300...
Page 47
RMI Demonstration Program // Use the PK2300 I/O // library // Assign RINPUT RMI // Channel 1 // Create floating point // variable f // Initialize PK2300 // Initialize RMI Channel // Assign f the value // of RINPUT // Print the value of the...
Page 48
Ω Ω different value STDIO STDIO 48 s System Development PK2300...
Page 49
5 V DC 5 kΩ Request (R42) "Timer" Monostable Z180 Multivibrator 5 kΩ (R56) External resistor 470 nF Timer to be Reset (C11) measured Figure 4-5. PK2300 Resistance Measurement Input Circuit PK2300 System Development s 49...
Page 50
(Configuration II) (Configuration I or III) RTS RS-232 (0) Transmit RS-232 (1) Transmit RS-232 (0) Transmit RS-232 (0) Receive RS-232 (0) Receive RS-232 (0) CTS RS-232 (0) Receive RS-232 (1) +5 V regulated +5 V regulated 50 s System Development PK2300...
Page 51
RS-485 Communication Network J1:1 Master Termination Resistor: Required J4:1 J1:1 Slave n Termination Resistor: Not Required J4:1 J1:1 "End" Slave Termination Resistor: Required J4:1 Figure 4-6. Multidrop Network PK2300 System Development s 51...
Page 52
Termination and Bias Resistors Ω 52 s System Development PK2300...
Page 53
Ω Ω Figure 4-7. Enabling Termination Resistor (PK2300 Top View, Cover Removed) Ω PK2300 System Development s 53...
Page 54
Additional Features PWM Outputs How to Use the PWM Feature 54 s System Development PK2300...
Page 55
= 13.33 ms (256 - n )480/9.216 MHz = 52.08 µs Next Possible Transisition x 480/9.216 MHz = 52.08 µs Chan 0 Chan1 Chan 2 Chan 3 480/9.216MHz = 52.08 µs Figure 4-9. DMA Timing PK2300 System Development s 55...
Page 56
int eioBrdAO( unsigned chanNum, unsigned state ) 56 s System Development PK2300...
Page 57
A01.C // PK2300 specific defns // define output channel // initialize general I/O // initialize PWM // duty cycle starts at 0 // ramp up // do this forever // change cycle // refresh OK? // reverse // reverse // ramp...
Page 58
User-Programmable LEDs Memory 58 s System Development PK2300...
Page 59
Real-Time Clock (RTC) DRIVERS.LIB Table 4-3. Real Time Clock Functions Function Description Read time and date values from the RTC. tm_rd Write time and date values into the RTC. tm_wr Dynamic C Function Reference PK2300 System Development s 59...
Page 60
Power Supervisor 60 s System Development PK2300...
Page 61
Resetting the Processor Program/Run Reset Processor Figure 4-10. Header H1 Configurations to Reset Processor PK2300 System Development s 61...
Page 62
+5 V Regulator Serial 0 RS-232 Z180 Serial 1 RS-485 Timers LED1 LED2 Reset Resistive Measurement Flash Input EPROM VRAM VBAT Supervisor Internal Battery Protected Inputs +5 V High- Current Outputs Configurable Figure 4-11. PK2300 Subsystems 62 s System Development PK2300...
Page 63
OFTWARE EFERENCE HAPTER PK2300 Software Reference s 63...
Page 64
Supplied Software EZIOPK23.LIB #use eziopk23.lib EZIOPK23.LIB void eioBrdInit( int param ) param _ eioSetupAI1st _ eioSetupAI1st _ eioSetupAO1st _ eioSetupAO1st long int eioErrorCode eioBrdInit EIO _ NODEV 64 s Software Reference PK2300...
Page 67
DIO1.C // general I/O definitions // pk2300 specific defns // define input channel // define output channel // do this indefinitely // hit watchdog PK2300 Software Reference s 67...
Page 68
Level-Sensitive Interrupts +5 V +5 V 0 Ω /INT Line to Z180 10 kΩ High Impedance To Z180 Input Interrupt Lines 2.2 kΩ CMOS 100 nF Input Figure 5-1. IN-06 and IN-07 Connection for /INT0 68 s Software Reference PK2300...
Page 69
Interrupt Service Routines (ISR) Z80180/Z180 MPU Users Manual PK2300 Software Reference s 69...
Page 70
Resistance Measurement Input EZIOPK23.LIB void _ eioSetupAI1st() eioBrdAI eioBrdAI int eioBrdACalib( int chanNum, int d1, int d2, float f1, float f2 ) eioBrdAI chanNum eioBrdInit chanNum 70 s Software Reference PK2300...
Page 71
EIO_NODEV (eioErrorCode & EIO_NODEV) SAMPLES\PK23XX AI1.C #use eziopk23.lib // pk2300 specific defns main() { eioBrdInit(0); // initialize general I/O _eioSetupAI1st(); // initialize RMI while (1) { // do this forever printf(reading %f\n,eioBrdAI(1)); hitwd(); // hit the watchdog...
Page 72
PWM Outputs void _ eioSetupAO1st() int eioBrdAO( unsigned chanNum, unsigned state ) int _ eioBrdAORf() 72 s Software Reference PK2300...
Page 73
A01.C // PK2300 specific defns // define output channel // initialize general I/O // initialize PWM // duty cycle starts at 0 // ramp up // do this forever // change cycle // refresh OK? // reverse // reverse // ramp...
Page 74
Additional Software Feature References For 74 s Software Reference PK2300...
Page 75
Advanced Input/Output Programming Table 5-3. PK2300 Device I/O Map I/O Address Description Comments Read to start charging and 0x40c0 (read) /TRIGGER of 555 turns /OUTPUT of 555 high Bit 0 indicates on/off, 1 to 0x4140 (write) RS-485 Driver turn on, 0 to turn off...
Page 81
PWM Addressing Detail The driver of the PWM on the PK2300 is fairly complicated. This is because it uses the clock output from communication port 1 (CKA1) to drive the request line DMA Channel 0 in edge detection mode. The simple...
Page 82
I/O address 0x4160 as follows. CT1: 0x80, 0x81 CT2: 0x07, 0x07 CT3: 0x07, 0x07 CT4: 0x00, 0x07 CT5: 0x07, 0x07 CT6: 0x07, 0x07 CT7: 0x07, 0x01 CT8: 0x07, 0x07 go back to CT1 82 Software Reference PK2300...
Page 83
If so, both the counter and the source address registers must be “rewound” to a previous state (a larger counter value and a correspond- ing lower source address). PK2300 Software Reference 83...
Page 84
≥ f ≥ Set up the waveform 84 s Software Reference PK2300...
Page 89
ROUBLESHOOTING PPENDIX PK2300 Troubleshooting s 89...
Page 90
Out of the Box will not work PK2300 90 s Troubleshooting...
Page 91
Dynamic C Will Not Start Target Not Responding Communication Error Wrong Baud Rate Wrong Communication Mode Wrong COM Port Target Setup Wrong Operating Mode Dynamic C Loses Serial Link PK2300 Repeatedly Resets Common Programming Errors PK2300 Troubleshooting s 91...
Page 92
Function Types Type Range –32,768 (–2 ) to +32,767 (2 – 1) −2,147,483,648 ( − 2 long int ) to +2147483647 (2 – 1) float 1.18 × 10 3.40 × 10 char 0 to 255 Ω PK2300 92 s Troubleshooting...
Page 93
PECIFICATIONS PPENDIX PK2300 Specifications s 93...
Page 94
Electrical and Mechanical Specifications Table B-1. PK2300 Specifications Parameter Specification Enclosure Size 2.96"W × 5.00L" × 1.81"H (75 mm × 127 mm × 46 mm) ″ × ″ × ″ Board Size 2.82 3.75 1.50 (71.2 mm × 95.2 mm × 38.1 mm) −...
Page 95
PK2300 External Dimensions Screw Mounting Up to #10 4-40 0.31 0.315 typ (7.9) (8.0) 2.96 1.81 (75) (46) 1.275 (32.4) 1.15 (29.2) 1.69 (42.9) Figure B-1. PK2300 External Dimensions PK2300 Specifications s 95...
Page 96
Factory Default Jumper Positions Driver Battery User LED Run LED (Run/Program) Figure B-2. Locations of PK2300 Headers Table B-2. PK2300 Jumper Connections Header Pins Description Factory Default Connect pins 1–2 and pins 3–4 for sinking driver Pins 1–2 and pins 3–4 1–4...
Page 97
Table B-2. PK2300 Jumper Connections (concluded) Header Pins Description Factory Default Run/program jumper: connect 1–2 for Program mode, disconnect Connected for Run mode 1–2 Connect for 3-wire RS-232 on Not connected 7–8 Z0 and 3-wire RS-232 on Z1 1–3 Connect for 5-wire RS-232 Not connected 5–7...
Page 98
Frequency Response for IN-01 to IN-05, and IN-08 to IN-16 π π +5 V +5 V 0 Ω 10 kΩ High Impedance To Z180 Input Data 22 kΩ CMOS 10 nF Input Figure B-3. Protected Digital Inputs IN-01 to IN-05, and IN-08 to IN-16 98 s Specifications PK2300...
Page 99
+5 V 0 Ω /INT Line to Z180 10 kΩ High Impedance To Z180 Input Data 2.2 kΩ CMOS 100 nF Input Figure B-4. Level-Sensitive Inputs IN-06 and IN-07 Customization Frequency Response and Input Range Ω Ω PK2300 Specifications s 99...
Page 100
Max. Collector-Emitter 1.6 V 1.6 V Voltage (V ° ° ° ° Derating 18 mW/ C (55 C/W) 18 mW/ C (55 C/W) Output Flyback Diode (K) Max. Diode-Drop Voltage 2 V DC 2 V DC 100 s Specifications PK2300...
Page 101
Table B-5. High-Current Driver Safe Operating Range at 60°C No. Outputs ON Current/Channel Duty Cycle 75 mA 100% 150 mA 100% 300 mA 100% 150 mA 300 mA 500 mA Function of K PK2300 Specifications s 101...
Page 102
To Load Power To PK2300 (+DC Source) (pin 2 on J1) Sinking To PK2300 High-Current Output Figure B-5. PK2300 K Connection (Sinking Configuration) To PK2300 To Load Power (pin 2 on J1) (+DC Source) To PK2300 High-Current Output Sourcing Figure B-6. PK2300 K Connection (Sourcing Configuration) K...
Page 103
PPENDIX ERIAL NTERFACE OARD PK2300 Serial Interface Board 2 s 103...
Page 104
Introduction Reset Target 104 s Serial Interface Board 2 PK2300...
Page 105
External Dimensions 2.25 (57.2) Top View 12.0 3.60 (305) (91.4) (20) 1.525 1.625 (38.7) (41.3) Side View Figure C-1. Serial Interface Board 2 External Dimensions PK2300 Serial Interface Board 2 s 105...
Page 106
Blank 106 s Serial Interface Board 2 PK2300...
Page 107
PPENDIX INKING VS OURCING RIVERS PK2300 Sinking vs. Sourcing Drivers s 107...
Page 108
Figure D-1. PK2300 High-Current Output Driver Chip at U1 SOURCING SINKING Figure D-2. PK2300 Header H7 Jumper Configurations 108 s Sinking vs. Sourcing Drivers PK2300...
Page 109
Selecting Sourcing or Sinking Drivers Sinking Driver (Low-Side Drive) + DC Fly-back Load Current Path (OUT-01 to OUT-08) 1.6 V DC ULN2803 Sinking High-Current Driver Figure D-3. ULN2803 Sinking Driver PK2300 Sinking vs. Sourcing Drivers s 109...
Page 110
Sourcing Driver (High-Side Drive) 1.6 V DC (OUT-01 to OUT-08) Load ULN2985 Sourcing High-Voltage Driver Figure D-4. ULN2985 Sourcing Driver Linear Data Books 110 s Sinking vs. Sourcing Drivers PK2300...
Page 111
OWER ANAGEMENT PPENDIX PK2300 Power Management s 111...
Page 112
(Switching) 51 kΩ VBAT VRAM /NMI 4.7 V 22 pF 10 kΩ /RESET RAM /CS Power Management Figure E-1. PK2300 Power-failure Detection Circuitry Power Failure Sequence of Events Power Fails Unregulated Regulated +5 V Dropout Voltage TIME Asserts Asserts Ceases...
Page 118
Mounting Controllers on DIN Rails Controller Modular PC Board Holders DIN Rail Figure F-6. Mounting PK2300 on DIN Rail 118 s Enclosure Mounting PK2300...
Page 119
ONVOLATILE TORAGE PPENDIX PK2300 Nonvolatile Storage s 119...
Page 120
Table G-1. PK2300 Flash EPROM Constants Address Definition Startup mode. If 1, enter program mode. If 8, execute loaded program at startup. Programming baud rate in multiples of 1200 bps. The factory value is 16 (19,200 bps). RMI calibration constant.
Page 121
PPENDIX I/O M AP AND NTERRUPT ECTORS PK2300 I/O Map and Interrupt Vectors s 121...
Page 123
0x37 — Reserved 0x38 mon Base Register 0x39 MMU Bank Base Reg 0x3A CBAR MMU C mon/Bank Area Register 0x3B–3D — Reserved 0x3E OMCR Operation Mode Control Register 0x3F I/O Control Register PK2300 I/O Map and Interrupt Vectors s 123...
Page 124
0–9 0x418B D0–D7 YEAR10 10 years 0–9 0x418C D0–D7 WEEK week days. 0–6 0x418D D0–D7 TREGD Register D — 0x418E D0–D7 TREGE Register E — 0x418F D0–D7 TREGF Register F — 124 s I/O Map and Interrupt Vectors PK2300...
Page 125
1 to turn on, 0 to turn off 0x4161 IN-09 to IN-16 Bit x for state of Inx+1 Bit 0 indicates whether power 0xA000 Power failure is failing: 1 power is failing, 0 if not PK2300 I/O Map and Interrupt Vectors s 125...
Page 126
PRT Channel 1 PRT1_VEC 0x08 DMA Channel 0 DMA0_VEC 0x0A DMA Channel 1 DMA1_VEC 0x0C Clocked Serial I/O CSI/O_VEC 0x0E Asynchronous Serial Port Channel 0 SER0_VEC 0x10 Asynchronous Serial Port Channel 1 SER1_VEC 126 s I/O Map and Interrupt Vectors PK2300...
Page 127
INT 2 (Maskable interrupts, Level 2) PRT Channel 0 PRT Channel 1 DMA Channel 0 DMA Channel 1 Clocked Serial I/O Asynchronous Serial Port 0 (Lowest Priority) Asynchronous Serial Port 1 PK2300 I/O Map and Interrupt Vectors s 127...
Page 128
Blank 128 s I/O Map and Interrupt Vectors PK2300...
Need help?
Do you have a question about the PK2300 and is the answer not in the manual?
Questions and answers