Page 2 - ii; Copyright; Printed in Taiwan
PCM-3780 User Manual ii Copyright The documentation and the software included with this product are copy-righted 2006 by Advantech Co., Ltd. All rights are reserved. Advantech Co., Ltd. reserves the right to make improvements in the products described in this manual at any time without notice. No pa...
Page 3 - iii; Two Years Product Warranty
iii Two Years Product Warranty Advantech warrants to you, the original purchaser, that each of its prod-ucts will be free from defects in materials and workmanship for two years from the date of purchase. This warranty does not apply to any products which have been repaired or altered by persons oth...
Page 4 - iv; CE Notification; Visit the Advantech web site at
PCM-3780 User Manual iv CE Notification The PCM-3780, developed by Advantech Co., Ltd., has passed the CE test for environmental specifications when shielded cables are used for external wiring. We recommend the use of shielded cables. This kind of cable is available from Advantech. Please contact y...
Page 5 - Packing List
v Packing List Before setting up the system, check that the items listed below are included and in good condition. If any item does not accord with the table, please contact your dealer immediately. The package should contain the following items:• 1 x PCM-3780 DA&C card• 1 x PCM-3780 User Manual...
Page 7 - vii; Contents; Features; Chapter; Figure 2.1:The Setup Screen of Advantech Automation; Chapter
vii Contents Chapter 1 Introduction ..................................................... 2 1.1 Features ..................................................................... 2 Table 1.1:PCM-3780 Counter Mode ............................. 3 Table 1.2:PCM-3780 Counter Mode ..............................
Page 8 - viii
PCM-3780 User Manual viii 3.6.2 Using Direct I/O ........................................................... 24Figure 3.5:Frequency Measurement ............................ 24 Appendix A Specifications ................................................. 26 A.1 Programmable Counter .......................
Page 9 - Introduction
2 CHAP T ER 1 Introduction This chapter provides an introduction to the PCM-3780.Sections include: • Introduction• Features• Applications• Installation Guide• Accessories
Page 10 - Chapter 1 Introduction
PCM-3780 User Manual 2 Chapter 1 Introduction Thank you for buying the Advantech PCM-3780. The PCM-3780 is a general purpose multiple channel counter/timer card for the PC/104 bus. It targets the AM9513 to implement the counter/timer function by CPLD. It provides two 16-bit counter channels and 24-c...
Page 11 - Chapter 1; Counter Modes; Level gate control,
3 Chapter 1 Counter Modes (N: No gate control, L: Level gate control, E: Edge gate control ) Table 1.1: PCM-3780 Counter Mode Counter Mode A B C D E F G H I J K L Special Gate (CM6) 0 0 0 0 0 0 0 0 0 0 0 0 Reload Source (CM5) 0 0 0 0 0 0 1 1 1 1 1 1 Repetition (CM4) 0 0 0 1 1 1 0 0 0 1 1 1 Gate Cont...
Page 12 - For detailed; specifications; Appendix A Specifications
PCM-3780 User Manual 4 Note: For detailed specifications of the PCM-3780, please refer to Appendix A Specifications . Table 1.2: PCM-3780 Counter Mode Counter Mode M N O P Q R S T U V W X Special Gate (CM6) 0 0 0 0 0 0 0 0 0 0 0 0 Reload Source (CM5) 0 0 0 0 0 0 1 1 1 1 1 1 Repetition (CM4) 0 0 0 1 ...
Page 13 - Installation Guide; Driver software; Advantech DLL drivers (included in the companion; Wiring cable; ware packages
5 Chapter 1 1.2 Applications • Event counting• One shot output• Programmable frequency output• Frequency measurement• Pulse width measurement• PWM output• Periodic interrupt generation• Time-delay generation 1.3 Installation Guide Before you install your PCM-3780 card, please make sure you have the ...
Page 14 - Read examples & driver manual
PCM-3780 User Manual 6 Figure 1.1: Installation Flow Chart Install Driver from CD-ROM Install Hardware on PC Use driver utility to configure hardware Use test utility to test hardware Read examples & driver manual Start to write your own application
Page 15 - Software Overview
7 Chapter 1 1.4 Software Overview Advantech offers a rich set of DLL drivers, third-party driver support and application software to help fully utilize the functions of your PCM-3780 card: 1.4.1 Device Drivers (on the companion CD-ROM) • LabVIEW driver• Advantech ActiveDAQ• Advantech GeniDAQ Program...
Page 16 - Device Drivers Programming Roadmap
PCM-3780 User Manual 8 1.5 Device Drivers Programming Roadmap This section will provide a roadmap to demonstrate how to build an appli-cation from scratch using Advantech Device Drivers with your favorite development tools such as Visual C++, Visual Basic, Delphi and C++ Builder. The step-by-step in...
Page 17 - Programming with Device Drivers Function Library; tion Overview; Troubleshooting Device Drivers Error; Device Drivers Error Codes
9 Chapter 1 1.5.2 Programming with Device Drivers Function Library Advantech Device Drivers offers a rich function library to be utilized in various application programs. This function library consists of numerous APIs that support many development tools, such as Visual C++, Visual Basic, Delphi and...
Page 19 - Hardware Installation; hardware
2 CHAP T ER 2 Hardware Installation This chapter provides a packaged items checklist, proper instructions about unpacking and step-by-step procedures for card hardware installation.
Page 20 - Chapter 2 Hardware Installation; static discharge
PCM-3780 User Manual 12 Chapter 2 Hardware Installation 2.1 Unpacking After receiving your PCM-3780 package, please inspect its contents first. The package should contain the following items:• PCM-3780 card• Companion CD-ROM (DLL driver included)• User ManualThe PCM-3780 card has electronic componen...
Page 21 - Chapter 2; Driver Installation; The Setup program will be launched automatically if you have the
13 Chapter 2 2.2 Driver Installation We recommend you to install the driver before you install the PCM-3780 card into your system, since this will guarantee a smooth installation pro-cess.The Advantech Device Drivers Setup program for the PCM-3780 card is included on the companion CD-ROM that is shi...
Page 23 - Hardware Installation; Attach any accessories to the PCM-3780 card using 20 pin cables.
15 Chapter 2 2.3 Hardware Installation For more information about the driver installation, configuration and removal procedures for Windows 2000 and Windows XP, please see the corresponding help file: After the DLL driver installation is completed, you can go on to install the PCM-3780 card in one o...
Page 26 - Signal Connections
PCM-3780 User Manual 18 Chapter 3 Pin Assignments & Jumper Settings 3.1 Overview Maintaining signal connections is one of the most important factors in ensuring that your application system is sending and receiving data cor-rectly. A good signal connection can avoid unnecessary and costly dam-ag...
Page 27 - Chapter 3; Switch and Jumper Settings; Label; Counter Interface Connector
19 Chapter 3 3.3 Switch and Jumper Settings We designed PCM-3780 with ease-of-use in mind. It has one address switch and one interrupt jumper setting. The following section describes how to configure the card. Interrupt Level (IRQ) Setting (JP1) Select an IRQ which is not already in use by another c...
Page 28 - HEX Value
PCM-3780 User Manual 20 Base Address Setting (SW1) Select an address which is not already in use by another card in the sys-tem. If you are installing more than one PCM-3780 card in your system, set the cards to different base addresses. The base address configuration switch SW1 controls each card's...
Page 29 - Connectors Pin Assignment; CN4: Counter Interface Connector
21 Chapter 3 3.4 Connectors Pin Assignment CN3: I/O Port Connector Figure 3.2: I/O Port Connector CN4: Counter Interface Connector Figure 3.3: Counter Interface Connector
Page 30 - I/O Connector Signal Description; Signal Name; Reference Direction Description
PCM-3780 User Manual 22 I/O Connector Signal Description Table 3.3: I/O Connector Signal Descriptions Signal Name Reference Direction Description GND - - DC ground +5V GND Output +5 VDC source FOUT<0..1> GND Output Frequency output chan- nels C_OUT<0..1> GND Output Counter output channel...
Page 31 - Period Measurement
23 Chapter 3 3.5 Period Measurement 3.5.1 Using Advantech 32-bit DLL Driver This approach is for a low frequency signal. We recommend you to perform period measurement through our 32-bit DLL driver because it is the simplest way for both programming and wiring. Just connect the unknown single to Gat...
Page 32 - Frequency Measurement
PCM-3780 User Manual 24 3.6 Frequency Measurement 3.6.1 Using Advantech 32-bit DLL Driver This approach is for a high frequency signal. Measuring pulse frequency is simple by using the Advantech 32-bit DLL driver. Just connect the unknown single to Gate and the pulse frequency will be measured by th...
Page 33 - Specifications
2 AP PENDIX A Specifications This appendix provides detailed speci-fications for PCM-3780.
Page 34 - Appendix A Specifications; A.1 Programmable Counter; TTL level
PCM-3780 User Manual 26 Appendix A Specifications A.1 Programmable Counter A.2 Digital Input/Output Channels 2 Resolution 16-bit Compatibility TTL level Max. Input Frequency 20 MHz Clock Input Low 0.8 V max. High 2.0 V min. Gate Input Low 0.8 V max. High 2.0 V min. Counter Output Low 0.4 V max.@ +8....
Page 37 - Block Diagram
2 AP PENDIX B Block Diagram This chapter provides information on the block diagram for PCM-3780.
Page 38 - Appendix B Block Diagram
Page 40 - Appendix C Register Structure & Format
PCM-3780 User Manual 32 Appendix C Register Structure & Format C.1 Overview PCM-3780 is delivered with an easy-to-use 32-bit DLL driver for user programming under the Windows 2000/XP operating system. We advise users to program the PCM-3780 using the 32-bit DLL driver provided by Advantech to av...
Page 41 - Appendix C
33 Appendix C C.2.1 Register Format Table C.1: Register Offset Address Table Base Address + HEX PCM-3780 Register Format15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 00h W Counter 0 Mode Register CM 15 CM 14 CM1 3 CM1 2 CM1 1 CM1 0 CM 9 CM 8 CM 7 CM 6 CM 5 CM 4 CM 3 CM 2 CM 1 CM 0 R N/A 02h W Counter 0 Load...
Page 46 - C.7 Counter Command Enable Register
PCM-3780 User Manual 38 C.6 Counter 0/1 Command Register 1. C2 to C0 : Command Code000 = Disarm counter 001 = Load counter from LOAD 010 = Disarm and Save counter 100 = Arm counter 101 = Load and Arm counter 110 = Save counter to HOLD 111 = Reset counter C.7 Counter Command Enable Register 1. CE1 to...
Page 47 - C.8 Interrupt Control Register
39 Appendix C C.8 Interrupt Control Register 1. C1 to C0: Counter Interrupt enable Bit0 = Not enable interrupt for this counter 1 = Enable interrupt for this counter 2. DIA, DIB and DIC: DI Interrupt enable Bit0 = Not enable interrupt for DI 1 = Enable interrupt for DI C.9 Interrupt Status Register ...
Page 48 - C.10 Interrupt Clear Register; Write any data to these two bytes to clear the interrupt.
PCM-3780 User Manual 40 C.10 Interrupt Clear Register Write any data to these two bytes to clear the interrupt. C.11 I/O Direction Control Register 1. I/O Direction Control Bit:0 = Output 1 = Input C.12 Port A/B/C Interrupt Status Register 1. Bit7 to Bit0: Port A/B/C Interrupt Status Register0 = No ...
Page 52 - Appendix D Waveform of Each Mode; D.1 Counter Mode Descriptions; Load
PCM-3780 User Manual 44 Appendix D Waveform of Each Mode D.1 Counter Mode Descriptions Counter Mode register bits CM15-CM12 and CM6-CM4 select the oper-ating mode for each counter (see Table D-1). To simplify references to a particular mode, each mode is assigned a letter from A through X . Repre- s...
Page 53 - Appendix D
45 Appendix D (N: No gate control, L: Level gate control, E: Edge gate control ) Table D.1: PCM-3780 Counter Mode Counter Mode A B C D E F G H I J K L Special Gate (CM6) 0 0 0 0 0 0 0 0 0 0 0 0 Reload Source (CM5) 0 0 0 0 0 0 1 1 1 1 1 1 Repetition (CM4) 0 0 0 1 1 1 0 0 0 1 1 1 Gate Control (CM15~CM...
Page 55 - D.2 Mode A Waveforms; Software-Triggered Strobe with No Hardware Gating
47 Appendix D D.2 Mode A Waveforms Software-Triggered Strobe with No Hardware Gating Mode A is one of the simplest operating modes. The counter will be available for counting source edges when it is issued an ARM command. On each TC the counter will reload from the Load register and automati-cally d...
Page 56 - D.3 Mode B Waveforms; Software-Triggered Strobe with Level Gating; register and automatically disarm
PCM-3780 User Manual 48 D.3 Mode B Waveforms Software-Triggered Strobe with Level Gating Mode B is identical to Mode A except that source edges are counted only when the assigned gate is active. The counter must be armed before counting can occur. Once armed, the counter will count all source edges ...
Page 57 - D.4 Mode C Waveforms; Hardware-Triggered Strobe; register and automatically disarm itself. Counting
49 Appendix D D.4 Mode C Waveforms Hardware-Triggered Strobe Mode C is identical to Mode A, except that counting will not begin until a gate edge is applied to the armed counter. The counter must be armed before application of the triggering gate edge, while gate edges applied to a disarmed counter ...
Page 58 - D.5 Mode D Waveforms; Rate Generator with No Hardware Gating
PCM-3780 User Manual 50 D.5 Mode D Waveforms Rate Generator with No Hardware Gating Mode D is typically used in frequency generation applications. In this mode, the gate input does not affect counter operation. Once armed, the counter will count to TC repetitively. On each TC the counter will reload...
Page 59 - D.6 Mode E Waveforms; Rate Generator with Level Gating
51 Appendix D D.6 Mode E Waveforms Rate Generator with Level Gating Mode E is identical to Mode D, except the counter will only count those source edges that occur while the gate input is active. This feature allows the counting process to be enabled and disabled under hardware control. A square wav...
Page 60 - D.7 Mode F Waveforms
PCM-3780 User Manual 52 D.7 Mode F Waveforms Non-Retriggerable One-Shot Mode F provides a non-retriggerable, one-shot, timing function. The counter must be armed before it will function. Application of a gate edge to the armed counter will enable counting. When the counter reaches TC, it will reload...
Page 61 - D.8 Mode G Waveforms; Software-Triggered Delayed Pulse One-Shot; register and automatically disarm itself,; Hold; register contents control the pulse duration.
53 Appendix D D.8 Mode G Waveforms Software-Triggered Delayed Pulse One-Shot In Mode G, the gate does not affect the counter's operation. Once armed, the counter will count to TC twice and then automatically disarm itself. For most applications, the counter will initially be loaded from the Load reg...
Page 62 - D.9 Mode H Waveforms; Software-Triggered Delayed Pulse One-Shot with Hardware Gating
PCM-3780 User Manual 54 D.9 Mode H Waveforms Software-Triggered Delayed Pulse One-Shot with Hardware Gating Mode H is identical to Mode G except that the gate input is used to qual-ify which source edges are to be counted. The counter must be armed for counting to occur. Once armed, the counter will...
Page 63 - D.10 Mode I Waveforms; Hardware-Triggered Delayed Pulse Strobe
55 Appendix D D.10 Mode I Waveforms Hardware-Triggered Delayed Pulse Strobe Mode I is identical to Mode G, except that counting will not begin until a gate edge is applied to an armed counter. The counter must be armed before application of the triggering gate edge. Gate edges applied to a dis-armed...
Page 64 - D.11 Mode J Waveforms; Variable Duty Cycle Rate Generator with No Hardware Gating
PCM-3780 User Manual 56 D.11 Mode J Waveforms Variable Duty Cycle Rate Generator with No Hardware Gating Mode J will find the greatest usage in frequency generation applications with variable duty cycle requirements. Once armed, the counter will count continuously until it is issued a DISARM command...
Page 65 - D.12 Mode K Waveforms; Variable Duty Cycle Rate Generator with Level Gating
57 Appendix D D.12 Mode K Waveforms Variable Duty Cycle Rate Generator with Level Gating Mode K is identical to Mode J except that source edges are only counted when the Gate is active. The counter must be armed for counting to occur. Once armed, the counter will count all source edges that occur wh...
Page 66 - D.13 Mode L Waveforms; Hardware-Triggered Delayed Pulse One-Shot
PCM-3780 User Manual 58 D.13 Mode L Waveforms Hardware-Triggered Delayed Pulse One-Shot Mode L is similar to Mode J except that counting will not begin before a gate edge is applied to an armed counter. The counter must be armed before application of the triggering gate edge; gate edges applied to a...
Page 67 - D.14 Mode O Waveforms; Hardware-Triggered Strobe with Edge Disarm
59 Appendix D D.14 Mode O Waveforms Hardware-Triggered Strobe with Edge Disarm Mode O, shown in Figure O, is identical to Mode C except that the counter will be disarmed while an inactive-going gate edge is applied to the counter. And the counter will hold the count value until it is issued a LOAD c...
Page 68 - D.15 Mode R Waveforms; Non-Retriggerbale One-Shot with Edge Disarm
PCM-3780 User Manual 60 D.15 Mode R Waveforms Non-Retriggerbale One-Shot with Edge Disarm Mode R is identical to Mode F except that the counter will be disarmed while an inactive-going gate edge is applied to the counter. The counter will hold the count value until it is issued a LOAD command or RES...
Page 69 - D.16 Mode U Waveforms; Hardware-Triggered Delayed Pulse Strobe with Edge Disarm
61 Appendix D D.16 Mode U Waveforms Hardware-Triggered Delayed Pulse Strobe with Edge Disarm Mode U is identical to Mode I except that the counter will be disarmed while the gate and inactive-going gate edge is applied to the counter. The counter will hold the count value until it is issued a LOAD c...
Page 70 - D.17 Mode X Waveforms; Hardware-Triggered Delayed Pulse One-Shot with Edge Disarm
PCM-3780 User Manual 62 D.17 Mode X Waveforms Hardware-Triggered Delayed Pulse One-Shot with Edge Disarm Mode X is identical to Mode L except that the counter will be disarmed while an inactive-going gate edge is applied to the counter. The counter will hold the count value until it is issued a LOAD...