Ðóêîâîäñòâî ïîëüçîâàòåëÿ MIC-3780

MIC-3780
8-ch Counter/Timer Module
User Manual
Copyright
The documentation and the software included with this product are copyrighted 2003 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 part of this manual may be reproduced, copied, translated or transmitted in any form or
by any means without the prior written permission of Advantech Co., Ltd.
Information provided in this manual is intended to be accurate and reliable. However, Advantech Co., Ltd. assumes no responsibility for its use,
nor for any infringements of the rights of third parties, which may result
from its use.
Acknowledgements
Windows is a trademark of Microsoft Corporation
Inprise Delphi is a registered trademark of Inprise Corporation
CompactPCI is a registered trademark of PICMG
All other product names or trademarks are properties of their respective
owners.
Part No. 2003378000
1st Edition
Printed in Taiwan
April 2004
MIC-3780 User Manual
ii
Two Years Product Warranty
Advantech warrants to you, the original purchaser, that each of its products 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 other than repair personnel authorized by Advantech,
or which have been subject to misuse, abuse, accident or improper installation. Advantech assumes no liability under the terms of this warranty as
a consequence of such events.
Because of Advantech.s high quality-control standards and rigorous testing, most of our customers never need to use our repair service. If an
Advantech product is defective, it will be repaired or replaced at no
charge during the warranty period. For out-of-warranty repairs, you will
be billed according to the cost of replacement materials, service time and
freight. Please consult your dealer for more details.
If you think you have a defective product, follow these steps:
1. Collect all the information about the problem encountered. (For example, CPU speed, Advantech products used, other hardware and software
used, etc.) Note anything abnormal and list any onscreen messages you
get when the problem occurs.
2. Call your dealer and describe the problem. Please have your manual,
product, and any helpful information readily available.
3. If your product is diagnosed as defective, obtain an RMA (return merchandize authorization) number from your dealer. This allows us to process your return more quickly.
4. Carefully pack the defective product, a fully completed Repair and
Replacement Order Card and a photocopy proof of purchase date (such as
your sales receipt) in a shippable container. A product returned without
proof of the purchase date is not eligible for warranty service.
5. Write the RMA number visibly on the outside of the package and ship
it prepaid to your dealer.
iii
CE Notification
The MIC-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 your local supplier for ordering information.
FCC Class A
This equipment has been tested and found to comply with the limits for a
Class A digital device, pursuant to Part 15 of the FCC Rules. These limits
are designed to provide reasonable protection against harmful interferrence when the equipment is operated in a commercial environment. This
equipment generates, uses and can radiate radio frequency energy and, if
not installed and used in accordance with the instruction manual, may
cause harmful interference to radio communications. Operation of this
equipment in a residential area is likely to cause harmful interference in
which case the user will be required to correct the interference at his own
expense.
Technical Support and Assistance
1.
Visit the Advantech web site at www.advantech.com/support
where you can find the latest information about the product.
2.
Contact your distributor, sales representative, or Advantech's customer service center for technical support if you need additional
assistance. Please have the following information ready before you
call:
- Product name and serial number
- Description of your peripheral attachments
- Description of your software (operating system, version, application software, etc.)
- A complete description of the problem
- The exact wording of any error messages
MIC-3780 User Manual
iv
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 MIC-3780 DA&C card
• 1 x MIC-3780 User Manual
• 1 x Advantech DLL Drivers CD-ROM
v
MIC-3780 User Manual
vi
Contents
Chapter1Introduction .............................................................. 2
1.1Features ............................................ 2
Table 1.1:MIC-3780 Counter Mode .............................. 3
Table 1.2:MIC-3780 Counter Mode .............................. 4
1.2Applications.................................................................................... 5
1.3Installation Guide .......................................................................... 5
Figure 1.1:Installation Flow Chart ................................. 6
1.4Accessories .................................................................................... 7
Chapter2Hardware Installation ............................................ 10
2.1Unpacking..................................................................................... 10
2.2Software Installation..................................................................... 11
2.3Hardware Installation .................................................................. 15
2.3.1Installing a Card ....................................................................... 15
2.3.2Removing a Card ...................................................................... 16
2.4Board Layout ................................................................................ 17
2.4.1Connector ................................................................................. 17
Figure 2.1:Board Layout .............................................. 17
Chapter3Pin Assignments & Signals .................................... 20
3.1Overview ...................................................................................... 20
3.2Switch and Jumper Settings.......................................................... 20
Figure 3.1:Card Con., Jumper and Switch Locations .. 20
Table 3.1:Board ID (SW1) ........................................... 21
3.3Signal Connections ....................................................................... 21
Table 3.2:I/O Con. Pin Assignments for MIC-3780 .... 21
Table 3.3:I/O Connector Signal Descriptions .............. 23
3.3.1Period Measurement ................................................................. 23
Figure 3.2:Period Measurement ................................... 23
3.3.2Frequency Measurement .......................................................... 24
Figure 3.3:Frequency Measurement ............................ 24
AppendixASpecifications ....................................................... 26
A.1Programmable Counter................................................................ 26
A.2Digital Input/Output .................................................................... 26
A.3General ........................................................................................ 27
AppendixBBlock Diagram ..................................................... 30
AppendixCRegister Structure
and Format 32
C.1Overview...................................................................................... 32
C.2I/O Port Address Map ................................................................. 33
Table C.1:MIC-3780 Register Format ......................... 33
C.3Counter 0/1/2/3/4/5/6/7 mode ...................................................... 42
Table C.2:MIC-3780 Register for counter ................... 42
C.4Counter 0/1/2/3/4/5/6/7 load ........................................................ 45
vii
Table of Contents
Table C.3:MIC-3780 Register for counter load .......... 45
C.5Counter 0/1/2/3/4/5/6/7 hold........................................................ 46
Table C.4:MIC-3780 Register For Counter Hold ........ 46
C.6Counter 0/1/2/3/4/5/6/7 command ............................................... 47
Table C.5:MIC-3780 Register for Counter Command 47
C.7Command Enable — BASE+40H ............................................... 48
Table C.6:MIC-3780 Register for Command Enable .. 48
C.8Interrupt Control — BASE+42H................................................. 48
Table C.7:MIC-3780 Register for Interrupt Control ... 48
C.9Interrupt status — BASE+42H .................................................... 49
Table C.8:MIC-3780 Register for interrupt status ....... 49
C.10Clear interrupt — BASE+44H................................................... 49
Table C.9:MIC-3780 Register for Clear Interrupt ....... 49
C.11Digital output — BASE+48H.................................................... 50
Table C.10:MIC-3780 Register for digital output ....... 50
C.12Digital input — BASE+48H...................................................... 50
Table C.11:MIC-3780 Register for digital input ......... 50
C.13Board ID — BASE+4EH........................................................... 51
Table C.12:MIC-3780 Register for board ID .............. 51
C.14FOUT 0/1/2/3/4/5/6/7 control — BASE + 50~5FH .................. 52
Table C.13:MIC-3780 Register for FOUT Control ..... 52
AppendixDWaveform of Each Mode.................................... 56
D.1Counter Mode Descriptions......................................................... 56
Table D.1:MIC-3780 Counter Mode ........................... 57
Table D.2:MIC-3780 Counter Mode ........................... 58
D.2Mode A Waveforms ....................................................................
D.3Mode B Waveforms ....................................................................
D.4Mode C Waveforms.....................................................................
D.5Mode D Waveforms ...................................................................
D.6Mode E Waveforms.....................................................................
D.7Mode F Waveforms ....................................................................
D.8Mode G Waveforms ....................................................................
D.9Mode H Waveforms ....................................................................
D.10Mode I Waveforms ....................................................................
D.11Mode J Waveforms....................................................................
D.12Mode K Waveforms ..................................................................
D.13Mode L Waveforms...................................................................
D.14Mode O Waveforms .................................................................
D.15Mode R Waveforms...................................................................
D.16Mode U Waveforms ..................................................................
D.17Mode X Waveforms .................................................................
MIC-3780 User Manual
viii
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
CHAPTER
1
2
Introduction
This chapter provides an introduction
to the MIC-3780.
Sections include:
• Introduction
• Features
• Applications
• Installation Guide
• Accessories
Chapter 1 Introduction
Thank you for buying the Advantech MIC-3780. The MIC-3780 is a general purpose multiple channel counter/timer card for the CompactPCI bus.
It targets the AM9513 to implement the counter/timer function by CPLD.
It provides eight 16-bit counter channels and 8 digital outputs and 8 digital inputs. The powerful Advantech-designed counter functions fulfill
your industrial or laboratory application needs.
The following sections of this chapter will provide further information
about features of the multifunction cards, a quick startup guide for installation, together with some brief information on software and accessories
for the MIC-3780 card.
1.1 Features
• 8 independent 16-bit counters
• 8 programmable clock source
• 8 digital TTL outputs and 8 digital TTL inputs
• Up to 20 MHz input frequency
• Multiple counter clock source selectable
• Counter output programmable
• Counter gate function
• Flexible interrupt source select
• Board ID
The Advantech MIC-3780 offers the following main features:
Flexible Counter Modes
The MIC-3780 features up to 12 programmable counter modes, to provide one shot output, PWM output, periodic interrupt output, time-delay
output, and to measure the frequency and the pulse width. The MIC-3780
is an ideal solution for various counter/timer applications.
Special Shielded Cable for Noise Reduction
The PCL-10168 shielded cable is specially designed for the MIC-3780 to
reduce noise. Its wires are all twisted pairs, with input signals and output
MIC-3780 User Manual
2
signals separately shielded, providing minimal cross talk between signals
and offering the best protection against EMI/EMC problems.
Counter Modes
Table 1.1: MIC-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~CM12)
N L
E
N
L
E
N
L
E
N
L
E
Count to TC once, then
disarm
Y Y
Y
Y
Y
Y
Y
Y
Y
Count to TC twice, then
disarm
Count to TC repeatedly
without disarming
Gate input dose not gate
counter input
Count only during active
gate level
Y
Y
Y
Y
Y
Y
Start count on active gate
edge and stop count on
next TC
Y
Y
Y
Y
Y
Y
Y
Start count on active gate
edge and stop count on
second TC
Y
Y
Start count on active gate
edge and stop count on
inactive gate edge
Reload counter from Load
Register on TC
Y Y
Y
Reload counter on each
TC, alternating reload
source between Load and
Hold Registers
Y
Y
Y
Y
Y
Y
Y
Y
Y
(N: No gate control, L: Level gate control, E: Edge gate control)
3
Chapter 1
Table 1.2: MIC-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
1
1
0
0
0
1
1
1
Gate Control
(CM15~CM12)
N L
E
N
L
E
N
L
E
N
L
E
Count to TC once, then
disarm
Y Y
Y
Y
Y
Y
Y
Y
Y
Count to TC twice, then
disarm
Count to TC repeatedly
without disarming
Gate input dose not gate
counter input
Count only during active
gate level
Y
Y
Y
Y
Y
Y
Start count on active gate
edge and stop count on
next TC
Y
Y
Y
Y
Y
Y
Y
Start count on active gate
edge and stop count on
second TC
Y
Y
Start count on active gate
edge and stop count on
inactive gate edge
Reload counter from Load
Register on TC
Y Y
Y
Reload counter on each
TC, alternating reload
source between Load and
Hold Registers
Y
Y
Y
Y
Y
Y
Y
Note: For detailed specifications of the MIC-3780, please refer to
Appendix A Specifications.
MIC-3780 User Manual
4
Y
Y
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 MIC-3780 card, please make sure you have the
following necessary components:
• MIC-3780 DA&C card
• MIC-3780 User Manual
• Advantech DLL drivers (included on the companion CD-ROM)
• PCL-10168 Wiring cable (optional)
• ADAM-3968 Wiring board (optional)
• CompactPCI computer system (running Windows 2000/95/98/ NT/
ME/XP)
After you get the necessary components and maybe some of the accessories for enhanced operation of your multifunction card, you can begin the
installation procedure. Figure 1-1 provides a concise flow chart to give
you an overall view of the software and hardware installation procedure:
5
Chapter 1
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
Figure 1.1: Installation Flow Chart
MIC-3780 User Manual
6
1.4 Accessories
Advantech offers a complete set of accessory products to support the
MIC-3780 card. These accessories include:
Wiring Cable: PCL-10168
The PCL-10168 shielded cable is specially designed for MIC-3780 cards
to provide high resistance to noise. To achieve better signal quality, the
signal wires are twisted in such a way as to form a “twisted-pair cable,”
reducing cross talk and noise from other signal sources. Furthermore, its
analog and digital lines are separately sheathed and shielded to neutralize
EMI/EMC problems.
Wiring Board: ADAM-3968
The ADAM-3968 is a 68-pin SCSI-II wiring terminal module for DINrail mounting. This terminal module can be readily connected to Advantech PC-LabCard® products and allow easy yet reliable access to individual pin connections for the MIC-3780 card.
7
Chapter 1
MIC-3780 User Manual
8
2
CHAPTER
2
Hardware Installation
This chapter provides a packaged items
checklist, proper instructions about
unpacking and step-by-step procedures
for card hardware installation.
Chapter 2 Hardware Installation
2.1 Unpacking
After receiving your MIC-3780 package, please inspect its contents first.
The package should contain the following items:
• MIC-3780 card
• Companion CD-ROM (DLL driver included)
• User Manual
The MIC-3780 card has electronic components vulnerable to electrostatic
discharge (ESD). ESD could easily damage the integrated circuits and
certain components if preventive measures are not carefully paid attention to. Before removing the card from the antistatic plastic bag, you
should take following precautions to ward off possible ESD damage:
• Touch the metal part of your computer chassis with your hand to discharge static electricity accumulated on your body. Or use a grounding
strap.
• Touch the anti-static bag to a metal part of your computer chassis
before opening the bag.
• Take hold of the card only by the metal bracket when removing it from
the bag.
After taking out the card you should first inspect the card for any possible
signs of external damage (loose or damaged components, etc.). If the card
is visibly damaged, please notify Advantech’s service department or the
local sales representative immediately. Avoid installing a damaged card
into your system. Also, pay extra caution to the following aspects to
ensure proper installation:
• Avoid physical contact with materials that could hold static electricity
such as plastic, vinyl and Styrofoam.
• Whenever you handle the card, hold it only by its edges. DO NOT
TOUCH the exposed metal pins of the connector or the electronic components.
Note
Keep the anti-static bag for future use. You might
need the original bag to store the card if you have to
remove the card from the PC or transport it elsewhere.
MIC-3780 User Manual
10
2.2 Software Installation
Advantech offers a complete range of device driver and software support
for Windows programming developers. You can apply the Windows
device drivers to the most popular Windows Programming tools, such as
Visual C++, Visual Basic, Inprise C++ Builder and Inprise Delphi. The
Advantech DLL for Windows NT/98/2000/XP drivers are based on the
Windows NT/98/2000 kernel technology.
For more information about the software installation for Windows 9X/
NT/2000/XP, please refer to the MIC-3780 Software Manual.
Note
Make sure you have firstly installed the driver before
installing the card. We strongly recommend that you
install the software driver before installing the hardware into your system, since this will guarantee a
smooth and trouble-free installation process.
In your CD-ROM, double click to run the “autorun.exe” on your computer, and you will see the figure below on the computer screen.
Please click ‘CONTINUE’ to proceed to the next step.
11
Chapter 2
Please Select ‘Installation’ to proceed to the next step. A list of items will
be shown on the screen: ‘Device Manager’, ’Individual Driver’, ‘Example & Utility’, and ‘Advance Options’.
Please install the ‘Device Manager’ first. For details on how to install the
‘Device Manager’ step by step, please see the software manual.
MIC-3780 User Manual
12
When you’re finished installing the ‘Device manager’, you can install the
driver of the corresponding card. Please click the individual Driver
Select ‘Compact PCI Series’.
13
Chapter 2
Select ‘MIC-3780’ to start installing its driver. For more information
about the software installation, please read the corresponding software
manual.
MIC-3780 User Manual
14
2.3 Hardware Installation
Note:
Make sure you have installed the driver first before
you install the card. We strongly recommend that
you install the software driver before you install the
hardware into your system, since this will guarantee a smooth and trouble-free installation process.
For more information about the driver installation, configuration and
removal procedures for Windows 9X, Windows NT, Windows 2K and
Windows XP, please see the corresponding help file:
After the DLL driver installation is completed, you can go on to install
the MIC-3780 card in one of the CompactPCI slots on your computer. It
is suggested that you refer to the computer user’s manual or related documentation if you have any doubts. Please follow the steps below to install
the card on your system.
2.3.1 Installing a Card
1.
Remove the cover of an unused slot of your CompactPCI computer
system.
2.
Hold the card vertically. Be sure that the card is pointing in the correct direction. The components of the card should be pointing to the
right-hand side and the black handle of the card should be pointing
to lower edge of the chassis.
3.
While holding the lower handle, pull the handle down to unlock it.
4.
Insert the MIC-3780 card into the CompactPCI chassis carefully by
sliding the lower edges of the card into the card guides.
5.
Push the card into slot gently by sliding the card along the card
guide until J1 meet the long needle on the backplane.
Note:
If your card is correctly positioned and has been slid
all the way into the chassis, the handle should match
the rectangular holes. If not, remove the card from
the card guide and repeat step 3 again. Do not try to
install a card by forcing it into the chassis.
15
Chapter 2
Step 6: Push the card firmly into place, and secure the card by pushing
the handle to lock it into place.
Note:
Note
Because the card has hot swap capability, the Blue
LED on the card can show you the installation states
of the card when the system is on.
In step 5, when J1 meets the long needle of the
backplane, the Blue LED will light. After step 6,
the system can configure the card automatically,
and the Blue LED is turned off when the system
has finished the device configuration.
If system power is off, you can install the card step
by step without attending the Blue LED’s state.
2.3.2 Removing a Card
1.
Push the handle down to unlock the card, and the CompactPCI system will uninstall the card configuration automatically.
2.
After the system has finished the device configuration, the Blue
LED on the card is lit. You can now slide the card out.
Note:
Because the card has hot swap capability, the
steps above describe how to remove a card
when the system is on.
If system power is off, please complete step1
and step2 without attending the Blue LED’s state
MIC-3780 User Manual
16
2.4 Board Layout
2.4.1 Connector
MIC-3780 has one 68-pin SCSI female connector. For more details about
switches and connectors, please see Chapter 4.
Figure 2.1: Board Layout
17
Chapter 2
MIC-3780 User Manual
18
CHAPTER
3
2
Pin Assignments and
Signals
This chapter provides useful information about how to connect input and
output signals to the MIC-3780 via the
I/O connector.
Sections include:
• Overview
• Switch and Jumper Settings
• Signal Connections
Chapter 3 Pin Assignments & Signals
3.1 Overview
Maintaining signal connections is one of the most important factors in
ensuring that your application system is sending and receiving data reliably. A good signal connection can avoid unnecessary and costly damage
to your PC and other hardware devices. This chapter provides useful
information about how to connect input and output signals to the MIC3780 via the I/O connector.
3.2 Switch and Jumper Settings
Figure 3.1: Card Connector, Jumper and Switch Locations
MIC-3780 User Manual
20
The MIC-3780 card has one function switch. (SW1)
Table 3.1: Board ID (SW1)
ID3
ID2
ID1
ID0
Board ID
1
1
1
1
0
1
1
1
0
1
1
1
0
1
2
1
1
0
0
3
1
0
1
1
4
1
0
1
0
5
1
0
0
1
6
1
0
0
0
7
0
1
1
1
8
0
1
1
0
9
0
1
0
1
10
0
1
0
0
11
0
0
1
1
12
0
0
1
0
13
0
0
0
1
14
0
0
0
0
15
Note: On: 1, Off: 0
3.3 Signal Connections
Table 3-2 shows the pin assignments for the 68-pin I/O connector on the
MIC-3780.
Table 3.2: I/O Connector Pin Assignments for MIC-3780
GND
68
34
FOUT3
GND
67
33
FOUT2
GND
66
32
FOUT1
GND
65
31
FOUT0
GND
64
30
OUT7
GND
63
29
OUT6
21
Chapter 3
Table 3.2: I/O Connector Pin Assignments for MIC-3780
GND
62
28
OUT5
GND
61
27
OUT4
GND
60
26
OUT3
GND
59
25
OUT2
GND
58
24
OUT1
GND
57
23
OUT0
DO7
56
22
DO6
DO5
55
21
DO4
DO3
54
20
DO2
DO1
53
19
DO0
+5V
52
18
+5V
DI7
51
17
DI6
DI5
50
16
DI4
DI3
49
15
DI2
DI1
48
14
DI0
GND
47
13
EXT_CLK
GATE7
46
12
GATE6
GATE5
45
11
GATE4
GATE3
44
10
GATE2
GATE1
43
9
GATE0
GND
42
8
CLK7
GND
41
7
CLK6
GND
40
6
CLK5
GND
39
5
CLK4
GND
38
4
CLK3
GND
37
3
CLK2
GND
36
2
CLK1
GND
35
1
CLK0
MIC-3780 User Manual
22
Table 3.3: I/O Connector Signal Descriptions
GND
-
-
DC ground
+5V
GND
Output
+5 VDC source
FOUT<0..3>
GND
Output
Frequency output channels
OUT<0..7>
GND
Output
Counter output
channels
DO<0..7>
GND
Output
Digital output
channels
EXT_CLK
GND
Input
External clock
input
CLK<0..7>
GND
Input
Clock input
channels
GATE<0..7>
GND
Input
Gate control
channels
DI<0..7>
GND
Input
Digital input
channels
3.3.1 Period Measurement
This approach is a particular suitable for a low frequency signal.
Unknown Pulse
COUNTER0
COUNTER1
Gate
Gate
OUT
CLK
OUT
CLK
CLOCK Source
Figure 3.2: Period Measurement
Implementing this measurement method requires two counters: one for
the up cycle period, and another for the down-cycle period. These added
together gives the total period. The duty cycle can also be calculated by
dividing the up period with the total period. Connect the unknown signal
to each counter's gate.
23
Chapter 3
Apply a standard clock pulse to each counter. Counter 0 counts the up
cycle, while counter 1 counts the down cycle. In MIC-3780, wiring is
simple. Just connect the unknown signal to counter 0, and use the register
to select the gate source. Counter 0 selects "Gate N", while counter 1
selects "Gate N-1".
Apply the standard clock to both counters by the clock source select register. It can change the clock for different measurement ranges. Counter 0
set as "Mode O" makes gate polarity positive. Counter 1 set as "Mode O"
makes gate polarity negative.
3.3.2 Frequency Measurement
This approach is very suitable for a high frequency signal.
COUNTER0
COUNTER1
Gate
Gate
OUT
OUT
CLOCK Source
CLK
CLK
Unknown Pulse
Figure 3.3: Frequency Measurement
Implementing this measurement needs two counters. One for the up cycle
period, another for the down cycle period. Adding them together gives
the total period. The duty cycle can also be calculated by dividing the up
period by the total period. Connect the unknown signal to each counter's
gate. Apply a standard clock to each counter. Counter 0 counts the up
cycle. Counter 1 counts the down cycle.
With MIC-3780, wiring is simple. Just connect the unknown signal to
counter 0, and use the register to select the gate source. Counter 0 selects
the "Gate N", counter 1 selects the "Gate N-1".
Apply the standard clock to both counters by the clock source select register. It can change the clock for different measurement ranges. Counter 0
set as "Mode O" makes gate polarity positive.
MIC-3780 User Manual
24
A
APPENDIX
2
Specifications
This appendix provides detailed specifications for MIC-3780.
Appendix A Specifications
A.1 Programmable Counter
Channels
8 (independent)
Resolution
16 bit
Programmable Clock Source
12 independent
Programmable Counter Modes
16
Max. Frequency
20 MHz
Interrupt Source
8 counter outputs
Counter Input Voltage
TTL level :0~5 V
Counter Output Voltage
Low
0.38 V max
High
4.06 V min
MIN
2 Hz
MAX
15 MHz
Frequency Measurement Range
A.2 Digital Input/Output
Input Channels
8
Input Voltage
Low
0.8 V max.
High
2.4 V min.
Interrupt Source
Channel 0
Output Channels
8
Output Voltage
Low
0.44 V max. @ 24 mA (sink)
High
3.76 V min. @ 24 mA (source)
MIC-3780 User Manual
26
A.3 General
I/O Connector Type
68-pin SCSI-II female
Dimensions
160 x 100 mm
Power Consumption
+5 V @ 320mA (MAX)
+3.3 V @ 1A (MAX)
Temperature
Operating 0 ~ 60 °C (32 ~140°F)
(refer to IEC 68-2-1,2)
Storage
-20 ~ 70°C (-4 ~ 158°F)
Relative Humidity
5~95%RH non-condensing (refer to IEC
68-2-3)
Certifications
CE, FCC Class A
27
Appendix A
MIC-3780 User Manual
28
B
APPENDIX
2
Block Diagram
This chapter provides information on
the block diagram for MIC-3780.
Appendix B Block Diagram
AddressBus
Address
Address
Decoder
Decoder
Output
Output
Buffer
Buffer
DO 0~7
DO 0~7
Input
Input
Buffer
Buffer
DI0~7
DI0~7
Interrupt
Interrupt
Control
Control
Logic
Logic
PCI
BUS
PCI
PCI
Interface
Interface
PLX903
PLX903
0
0
Data Bus(D0~D15)
Gate
Gate
Control
Control
Logic
Logic
10 MHz
10 MHz
OSC
OSC
POWER
POWER
MANAGER
MANAGER
MIC-3780 User Manual
16-bit
16-bit
Counter
Counter
0~7
0~7
Clock
Clock
Divider
Divider
30
Clock
Clock
Source
Source
Select
Select
Logic
Logic
4-bit
Fout4-bit
0~7
Fout0~7
DI 0
Out0~7
Out0~7
Gate0~7
Gate0~7
Clock0~7
Clock0~7
Fout0~3
Fout0~3
C
APPENDIX
2
Register Structure and
Format
This chapter provides information on
the register structure and format for
MIC-3780.
Appendix C Register Structure
and Format
C.1 Overview
The MIC-3780 is delivered with an easy-to-use 32-bit DLL driver for
user programming under the Windows 2000/95/98/NT/ME/XP operating
system. We advise users to program the MIC-3780 using the 32-bit DLL
driver provided by Advantech to avoid the complexity of low-level programming by registers.
The most important consideration in programming the MIC-3780 at register level is to understand the function of the card's registers. The information in the following sections is provided only for users who would
like to do their own low-level programming.
MIC-3780 User Manual
32
C.2 I/O Port Address Map
The MIC-3780 requires 32 consecutive addresses in the PC's I/O space.
The address of each register is specified as an offset from the card's base
address. For example, BASE+0 is the card's base address and BASE+6 is
the base address plus six bytes.
Table C-1 shows the function of each register of the MIC-3780 or driver
and its address relative to the card's base address.
Table C.1: MIC-3780 Register Format
Base
Address
+ HEX
MIC-3780 Register Format
Bit
15
00
H
02
H
04
H
06
H
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C2
C1
C0
Counter 0 Mode
C
M
15
C
M
14
C
M
13
R
N/A
W
Counter 0 Load
CL
15
CL
14
CL
13
R
N/A
W
Counter 0 Hold
C
H1
5
C
H1
4
C
H1
3
R
N/A
W
Counter 0 Command
R
N/A
33
Appendix C
Table C.1: MIC-3780 Register Format
Base
Address
+ HEX
MIC-3780 Register Format
Bit
15
08
H
0A
H
0C
H
0E
H
10
H
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C2
C1
C0
C
M
2
C
M
1
C
M
0
Counter 1 Mode
C
M
15
C
M
14
C
M
13
R
N/A
W
Counter 1 Load
CL
15
CL
14
CL
13
R
N/A
W
Counter 1 Hold
C
H1
5
C
H1
4
C
H1
3
R
N/A
W
Counter 1 Command
R
N/A
W
Counter 2 Mode
C
M
15
R
C
M
14
C
M
13
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
N/A
MIC-3780 User Manual
34
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
Table C.1: MIC-3780 Register Format
Base
Address
+ HEX
MIC-3780 Register Format
Bit
15
12
H
14
H
16
H
18
H
1A
H
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C2
C1
C0
Counter 2 Load
CL
15
CL
14
CL
13
R
N/A
W
Counter 2 Hold
C
H1
5
C
H1
4
C
H1
3
R
N/A
W
Counter 2 Command
R
N/A
W
Counter 3 Mode
C
M
15
C
M
14
C
M
13
R
N/A
W
Counter 3 Load
CL
15
R
CL
14
CL
13
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
N/A
35
Appendix C
Table C.1: MIC-3780 Register Format
Base
Address
+ HEX
MIC-3780 Register Format
Bit
15
1C
H
1E
H
20
H
22
H
24
H
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C2
C1
C0
Counter 3 Hold
C
H1
5
C
H1
4
C
H1
3
R
N/A
W
Counter 3 Command
R
N/A
W
Counter 4 Mode
C
M
15
C
M
14
C
M
13
R
N/A
W
Counter 4 Load
CL
15
CL
14
CL
13
R
N/A
W
Counter 4 Hold
C
H1
5
R
C
H1
4
C
H1
3
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
N/A
MIC-3780 User Manual
36
Table C.1: MIC-3780 Register Format
Base
Address
+ HEX
MIC-3780 Register Format
Bit
15
26
H
28
H
2A
H
2C
H
2E
H
W
14
13
12
10
9
8
7
6
5
4
3
2
1
0
C2
C1
C0
Counter 4 Command
R
N/A
W
Counter 5 Mode
C
M
15
C
M
14
C
M
13
R
N/A
W
Counter 5 Load
CL
15
CL
14
CL
13
R
N/A
W
Counter 5 Hold
C
H1
5
C
H1
4
C
H1
3
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C2
C1
C0
R
N/A
W
Counter 5 Command
R
11
N/A
37
Appendix C
Table C.1: MIC-3780 Register Format
Base
Address
+ HEX
MIC-3780 Register Format
Bit
15
30
H
32
H
34
H
36
H
38
H
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C2
C1
C0
C
M
2
C
M
1
C
M
0
Counter 6 Mode
C
M
15
C
M
14
C
M
13
R
N/A
W
Counter 6 Load
CL
15
CL
14
CL
13
R
N/A
W
Counter 6 Hold
C
H1
5
C
H1
4
C
H1
3
R
N/A
W
Counter 6 Command
R
N/A
W
Counter 7 Mode
C
M
15
R
C
M
14
C
M
13
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
N/A
MIC-3780 User Manual
38
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
Table C.1: MIC-3780 Register Format
Base
Address
+ HEX
MIC-3780 Register Format
Bit
15
3A
H
3C
H
3E
H
40
H
42
H
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C2
C1
C0
Counter 7 Load
CL
15
CL
14
CL
13
R
N/A
W
Counter 7 Hold
C
H1
5
C
H1
4
C
H1
3
R
N/A
W
Counter 7 Command
R
N/A
W
Command Enable
R
N/A
W
Interrupt Control
R
C
E7
C
E6
C
E5
C
E4
C
E3
C
E2
C
E1
C
E0
DI
0
C7
C6
C5
C4
C3
C2
C1
C0
DI
0
C7
C6
C5
C4
C3
C2
C1
C0
Interrupt Status
39
Appendix C
Table C.1: MIC-3780 Register Format
Base
Address
+ HEX
MIC-3780 Register Format
Bit
15
44
H
46
H
W
50
H
52
H
13
N/A
W
Digital Output
N/A
R
Board ID
10
9
8
7
6
5
4
3
2
1
0
DI
0
C7
C6
C5
C4
C3
C2
C1
C0
D
O
7
D
O
6
D
O
5
D
O
4
D
O
3
D
O
2
D
O
1
D
O
0
D
O
7
D
O
6
D
O
5
D
O
4
D
O
3
D
O
2
D
O
1
D
O
0
ID
3
ID
2
ID
1
ID
0
FOUT 0 Control
R
N/A
W
FOUT 1 Control
R
11
Digital Input
W
W
12
Clear Interrupt
R
R
4E
H
14
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
N/A
MIC-3780 User Manual
40
Table C.1: MIC-3780 Register Format
Base
Address
+ HEX
MIC-3780 Register Format
Bit
15
54
H
56
H
58
H
5A
H
5C
H
5E
H
W
14
13
11
10
9
8
F
O
E
FS
2
FS
1
F
O
E
FS
2
F
O
E
7
6
5
4
3
2
1
0
FS
0
D
V3
D
V2
D
V1
D
V0
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
FOUT 2 Control
R
N/A
W
FOUT 3 Control
R
N/A
W
FOUT 4 Control
R
N/A
W
FOUT 5 Control
R
N/A
W
FOUT 6 Control
R
N/A
W
FOUT 7 Control
R
12
N/A
41
Appendix C
C.3 Counter 0/1/2/3/4/5/6/7 mode — BASE+00/08/10/18/
20/28/30/38H
Table C.2: MIC-3780 Register for counter 0/1/2/3/4/5/6/7 mode
Base Add.
15
00
H
Counter 0 Mode
08
H
10
H
18
H
20
H
28
H
W
C
M
15
14
C
M
14
13
C
M
13
12
11
10
9
8
7
6
5
4
3
2
1
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
C
M
12
C
M
11
C
M
10
C
M
9
C
M
8
C
M
7
C
M
6
C
M
5
C
M
4
C
M
3
C
M
2
C
M
1
C
M
0
Counter 1 Mode
W
C
M
15
C
M
14
C
M
13
Counter 2 Mode
W
C
M
15
C
M
14
C
M
13
Counter 3 Mode
W
C
M
15
C
M
14
C
M
13
Counter 4 Mode
W
C
M
15
C
M
14
C
M
13
Counter 5 Mode
W
C
M
15
C
M
14
C
M
13
Counter 6 Mode
30
H
W
38
H
W
C
M
15
C
M
14
C
M
13
Counter 7 Mode
C
M
15
C
M
14
C
M
13
MIC-3780 User Manual
42
CM1 ~ CM0 Output control
00 Active high terminal count pulse
01Active low terminal count pulse
10 TC toggled from low
11TC toggled from high
CM2
Output enable control
0Enabled
1Disable (high impedance)
CM3
Count control (up/down)
0Count down
1Count up
CM4
Count control (once/repetitively)
0Count Once
1Count Repetitively
CM5
Count control (reload)
0Reload from LOAD register
1Reload from LOAD or HOLD register
CM6
Count control (special gate)
0Disable special gate
1Enable special gate
CM7
Count control (special gate)
0Count on rising edge
1Count on falling edge
43
Appendix C
CM11 ~ CM8 Count source selection
0000 Internal clock 20MHz
0001 OUT N-1
0010 CLK N
0011 CLK N-1
0100 FOUT 0
0101 FOUT 1
0110 FOUT 2
0111 FOUT 3
1000 FOUT 4
1001 FOUT 5
1010 FOUT 6
1011 FOUT 7
1100 GATE N-1
1101 N/A
1110 N/A
1111 N/A
CM13 ~ CM12Gate source selection
00No gating
01OUT N-1
10GATE N
11GATE N-1
CM14 Gating polarity selection
0 High level for level active, rising edge for edge active
1 Low level for level active, falling edge for edge active
CM15 Gate active edge or level
0 Level active
1 Edge active
MIC-3780 User Manual
44
C.4 Counter 0/1/2/3/4/5/6/7 load — BASE+02/0A/12/1A/
22/2A/32/3AH
Table C.3: MIC-3780 Register for counter 0/1/2/3/4/5/6/7 load
Base
Addr.
15
02
H
W
0A
H
W
12
H
W
1A
H
W
22
H
W
2A
H
W
32
H
W
3A
H
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
CL
12
CL
11
CL
10
CL
9
CL
8
CL
7
CL
6
CL
5
CL
4
CL
3
CL
2
CL
1
CL
0
Counter 0 Load
CL
15
CL
14
CL
13
Counter 1 Load
CL
15
CL
14
CL
13
Counter 2 Load
CL
15
CL
14
CL
13
Counter 3 Load
CL
15
CL
14
CL
13
Counter 4 Load
CL
15
CL
14
CL
13
Counter 5 Load
CL
15
CL
14
CL
13
Counter 6 Load
CL
15
CL
14
CL
13
Counter 7 Load
CL
15
CL
14
CL
13
CL15 ~ CL0 Counter load data
45
Appendix C
C.5 Counter 0/1/2/3/4/5/6/7 hold — BASE+04/0C/14/1C/
24/2C/34/3CH
Table C.4: MIC-3780 Register For Counter 0/1/2/3/4/5/6/7 Hold
Base
Addr.
15
04
H
W
0C
H
W
14
H
W
1C
H
W
24
H
W
2C
H
W
34
H
W
3C
H
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
C
H1
2
C
H1
1
C
H1
0
C
H9
C
H8
C
H7
C
H6
C
H5
C
H4
C
H3
C
H2
C
H1
C
H0
Counter 0 Hold
C
H1
5
C
H1
4
C
H1
3
Counter 1 Hold
C
H1
5
C
H1
4
C
H1
3
Counter 2 Hold
C
H1
5
C
H1
4
C
H1
3
Counter 3 Hold
C
H1
5
C
H1
4
C
H1
3
Counter 4 Hold
C
H1
5
C
H1
4
C
H1
3
Counter 5 Hold
C
H1
5
C
H1
4
C
H1
3
Counter 6 Hold
C
H1
5
C
H1
4
C
H1
3
Counter 7 Hold
C
H1
5
C
H1
4
C
H1
3
CH15 ~ CH0 Counter hold data
MIC-3780 User Manual
46
C.6 Counter 0/1/2/3/4/5/6/7 command — BASE+06/0E/
16/1E/26/2E/36/3EH
Table C.5: MIC-3780 Register for Counter 0/1/2/3/4/5/6/7 Command
Base
Addr.
15
06
H
W
0E
H
W
16
H
W
1E
H
W
26
H
W
2E
H
W
36
H
W
3E
H
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
C2
C1
C0
C2
C1
C0
C2
C1
C0
C2
C1
C0
C2
C1
C0
C2
C1
C0
C2
C1
C0
C2
C1
C0
Counter 0 Command
Counter 1 Command
Counter 2 Command
Counter 3 Command
Counter 4 Command
Counter 5 Command
Counter 6 Command
Counter 7 Command
C2 ~ C0Command code
000 Disarm counter
001 Load counter from LOAD
010 Disarm and save counter
011 Step counter
100 Arm counter
101 Load counter Arm counter
110 Save counter to HOLD
111 Reset counter
47
Appendix C
C.7 Command Enable — BASE+40H
Table C.6: MIC-3780 Register for Command Enable
Base
Addr.
15
W
40
H
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
C
E7
C
E6
C
E5
C
E4
C
E3
C
E2
C
E1
C
E0
Command enable
CEn Counter command enable bit (n: 0 ~ 7)
0 Don’t select this counter
1 Select the counter
C.8 Interrupt Control — BASE+42H
Table C.7: MIC-3780 Register for Interrupt Control
Base
Addr.
42
H
15
W
Cn
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
DI
0
C7
C6
C5
C4
C3
C2
C1
C0
Interrupt control
Counter interrupt enable bit (n: 0 ~ 7)
0 Disable interrupt for this counter
1 Enable interrupt for this counter
DI0 Interrupt enable bit
0 Disable interrupt for DI0
1 Enable interrupt for DI0
MIC-3780 User Manual
48
C.9 Interrupt status — BASE+42H
Table C.8: MIC-3780 Register for interrupt status
Base
Addr.
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
DI
0
C7
C6
C5
C4
C3
C2
C1
C0
Interrupt control
42
H
R
Cn
Counter interrupt status bit (n: 0 ~ 7)
0 No interrupt occurred
1 Interrupt occurred
DI0 Interrupt status bit
0 No interrupt occurred form DI0
1 Interrupt occurred form DI0
C.10 Clear interrupt — BASE+44H
Write any data to these two bytes to clear the interrupt.
Table C.9: MIC-3780 Register for Clear Interrupt
Base
Addr.
44
H
15
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
DI
0
C7
C6
C5
C4
C3
C2
C1
C0
Clear interrupt
49
Appendix C
C.11 Digital output — BASE+48H
Table C.10: MIC-3780 Register for digital output
Base
Addr.
48
H
15
W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
D
O7
D
O6
D
O5
D
O4
D
O3
D
O2
D
O1
D
O0
Digital output
C.12 Digital input — BASE+48H
Table C.11: MIC-3780 Register for digital input
Base
Addr.
48
H
15
R
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
DI
7
DI
6
DI
5
DI
4
DI
3
DI
2
DI
1
DI
0
Digital input
MIC-3780 User Manual
50
C.13 Board ID — BASE+4EH
The MIC-3780 offers Board ID register BASE+4EH. With correct Board
ID settings, users can easily identify and access each card during hardware configuration and software programming.
Table C.12: MIC-3780 Register for board ID
Base
Addr.
15
R
4E
H
14
13
12
11
1
0
9
8
7
6
5
4
3
2
1
0
B
D3
B
D2
B
D1
B
D0
Board ID
BD3 ~ DB0 Board ID
BD0
LSB of the Board ID
BD3
MSB of the Board ID
BD3
BD2
BD1
BD0
Board ID
1
1
1
1
15
1
1
1
0
14
1
1
0
1
13
1
1
0
0
12
1
0
1
1
11
1
0
1
0
10
1
0
0
1
9
1
0
0
0
8
0
1
1
1
7
0
1
1
0
6
0
1
0
1
5
0
1
0
0
4
0
0
1
1
3
0
0
1
0
2
0
0
0
1
1
0
0
0
0
0
51
Appendix C
C.14 FOUT 0/1/2/3/4/5/6/7 control — BASE + 50~5FH
Table C.13: MIC-3780 Register for FOUT 0/1/2/3/4/5/6/7 Control
Base
Addr.
15
14
13
50
H
W FOUT 0 Control
52
H
W FOUT 1 Control
54
H
W FOUT 2 Control
56
H
W FOUT 3 Control
58
H
W FOUT 4 Control
5
A
H
W FOUT 5 Control
5
C
H
W FOUT 6 Control
5
E
H
W FOUT 7 Control
MIC-3780 User Manual
12
11
10
9
8
F
O
E
FS
2
FS
1
F
O
E
FS
2
F
O
E
3
2
1
0
FS
0
D
V3
D
V2
D
V1
D
V0
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
F
O
E
FS
2
FS
1
FS
0
D
V3
D
V2
D
V1
D
V0
52
7
6
5
4
DV3 ~ DV0 FOUT divider
0000 Divide by 1
0001 Divide by 2
0010 Divide by 3
0011 Divide by 4
0100 Divide by 5
0101 Divide by 6
0110
Divide by 7
0111 Divide by 8
1000 Divide by 9
1001 Divide by 10
1010 Divide by 11
1011 Divide by 12
1100 Divide by 13
1101 Divide by 14
1110 Divide by 15
1111 Divide by 16
FS2 ~ FS0 FOUT source
000 External clock
001 CLK N
010 FOUT N-1
011 10 MHz clock
100 1 MHz clock
101 100 KHz clock
110 10 KHz clock
111 1 KHz clock
FOE
FOUT output enable
0Disable
1Enable
53
Appendix C
MIC-3780 User Manual
54
D
APPENDIX
2
Waveform of Each
Mode
The MIC-3780 offers 16 powerful
counter functions for your industrial or
laboratory applications. This chapter
will describe each mode in detail with
waveform diagrams.
Appendix D Waveform of Each Mode
D.1 Counter Mode Descriptions
Counter Mode register bits CM15-CM12 and CM6-CM4 select the operating 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. Representative waveforms for the counter modes are illustrated in Figure A
through X (because the letter suffix in the figure number is keyed to the
mode, Figures M, N, P, Q, V, and W do not exist).
The figures assume counting on rising source edges. These modes (which
automatically disarm the counter) (CM4 = 0) are shown with the WR
pulse entering the required ARM command. For modes that count repetitively (CM4 = 1) the ARM command is omitted. Both a TC output waveform and a TC Toggled output waveform are shown for each mode.
The symbols L and H are used to represent count values equal to the
Load and Hold register contents, respectively. The symbols K and N represent arbitrary count values. For each mode, the required bit pattern in
the Counter Mode register is shown; "don't care" bits are marked "X".
These figures are designed to clarify the mode descriptions.
To keep the following mode descriptions concise and to the point, the
phrase "source edges" is used to refer to active-going source edges only,
not to inactive-going edges. Similarly, the phrase "gate edges" refers only
to active-going gate edges. Also, again to avoid verbosity and euphuism,
the descriptions of some modes state that a counter is stopped or disarmed
"on a TC, inhibiting further counting."
As is fully explained in the TC section of the document, for these modes
the counter is actually stopped or disarmed following the active-going
source edge, which drives the counter out of TC. In other words, since a
counter in the TC state always counts, irrespective of its gating of arming
status, the stopping or disarming of the count sequence is delayed until
TC is terminated.
MIC-3780 User Manual
56
Table D.1: MIC-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~CM12)
N L
E
N
L
E
N
L
E
N
L
E
Count to TC once, then
disarm
Y Y
Y
Y
Y
Y
Y
Y
Y
Count to TC twice, then
disarm
Count to TC repeatedly
without disarming
Gate input dose not gate
counter input
Count only during active
gate level
Y
Y
Y
Y
Y
Y
Start count on active gate
edge and stop count on
next TC
Y
Y
Y
Y
Y
Y
Y
Start count on active gate
edge and stop count on
second TC
Y
Y
Start count on active gate
edge and stop count on
inactive gate edge
Reload counter from Load
Register on TC
Y Y
Y
Reload counter on each
TC, alternating reload
source between Load and
Hold Registers
Y
Y
Y
Y
Y
Y
Y
Y
Y
(N: No gate control, L: Level gate control, E: Edge gate control)
57
Appendix D
Table D.2: MIC-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
1
1
0
0
0
1
1
1
Gate Control
(CM15~CM12)
N L
E
N
L
E
N
L
E
N
L
E
Count to TC once, then
disarm
Y Y
Y
Y
Y
Y
Y
Y
Y
Count to TC twice, then
disarm
Count to TC repeatedly
without disarming
Gate input dose not gate
counter input
Count only during active
gate level
Y
Y
Y
Y
Y
Y
Start count on active gate
edge and stop count on
next TC
Y
Y
Y
Y
Y
Y
Y
Start count on active gate
edge and stop count on
second TC
Y
Y
Start count on active gate
edge and stop count on
inactive gate edge
Reload counter from Load
Register on TC
Y Y
Y
Reload counter on each
TC, alternating reload
source between Load and
Hold Registers
Y
Y
Y
Y
Y
Y
Y
Y
Y
Note: Counter modes M, N, P, Q, S, T, V, W are identical to A, B, D, E,
G, H, J, K.
MIC-3780 User Manual
58
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 automatically disarm itself, inhibiting further counting. Counting will resume
when a new ARM command is issued.
SOURCE
ARM
COMMAND
WR
COUNT
VALUE
X
L
L-1
L-2
K+1
K
K-1
2
1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
Mode A Waveforms
59
Appendix D
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
that occur while the gate is active and disregard those edges that occur
while the gate is inactive.
This permits the gate to turn the counting process on and off. On each TC
the counter will reload from the Load register and automatically disarm
itself, inhibiting further counting until a new ARM command is issued.
SOURCE
ARM
COMMAND
WR
GATE
COUNT
VALUE
X
L
L-1
L-2
K+1
TC OUTPUT
TC TOGGLED
OUTPUT
Mode B Waveforms
MIC-3780 User Manual
60
K
2
1
0
L
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 are disregarded.
The counter will start counting on the first source edge after the triggering
gate edge and will continue counting until TC. At TC, the counter will
reload from the Load register and automatically disarm itself. Counting
will then remain inhibited until a new ARM command and a new gate
edge are applied in that order.
Note that after application of a triggering gate edge, the gate input will be
disregarded for the remainder of the count cycle. This differs from Mode
B, where the gate can be modulated throughout the count cycle to stop
and start the counter.
SOURCE
WR
ARM
COMMAND
GATE
COUNT
VALUE
X
L
L-1
L-2
2
1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
Mode C Waveforms
61
Appendix D
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
itself from the Load register; hence the Load register value determines the
time between TCs. A square wave rate generator may be obtained by
specifying the TC Toggled output mode in the Counter Mode register.
SOURCE
COUNT
VALUE
2
1
0
L
L-1
L-2
2
1
0
TC OUTPUT
TC TOGGLED
OUTPUT
Mode D Waveforms
MIC-3780 User Manual
62
L
L-1
L-2
2
1
0
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 wave rate generator may be obtained by specifying the TC toggled output mode.
SOURCE
GATE
COUNT
VALUE
2
1
0
L
L-1
L-2
K+1
K
K-1
2
1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
Mode E Waveforms
63
Appendix D
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 itself from the Load register. The counter will then stop
counting, awaiting a new gate edge.
Note that unlike Mode C, a new ARM command is not needed after TC,
only a new gate edge. After application of a triggering gate edge, the gate
input is disregarded until TC.
SOURCE
GATE
COUNT
VALUE
X
L
L-1
L-2
2
1
0
TC OUTPUT
TC TOGGLED
OUTPUT
Mode F Waveforms
MIC-3780 User Manual
64
L
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
register either by a LOAD command or by the last TC of an earlier timing
cycle.
Upon counting to the first TC, the counter will reload itself from the Hold
register. Counting will proceed until the second TC, when the counter
will reload itself from the Load register and automatically disarm itself,
inhibiting further counting. Counting can be resumed by issuing a new
ARM command.
Specifying the TC Toggled output mode in the Counter Mode register
may generate a software-triggered delayed pulse one-shot. The initial
counter contends control of the delay from the ARM command until the
output pulse starts. The Hold register contents control the pulse duration.
SOURCE
ARM
COMMAND
WR
COUNT
VALUE
X
L
L-1
L-2
2
1
0
H
H-1
H-2
2
1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
Mode G Waveforms
65
Appendix D
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 qualify which source edges are to be counted. The counter must be armed for
counting to occur. Once armed, the counter will count all source edges
that occur while the gate is active and disregard those source edges that
occur while the gate is inactive. This permits the gate to turn the count
process on and off.
As with Mode G, the counter will be reloaded from the Hold register on
the first TC and reloaded from the Load register and disarmed on the second TC. This mode allows the Gate to control the extension of both the
initial output delay time and the pulse width.
SOURCE
ARM
COMMAND
WR
GATE
COUNT
VALUE
X
L
L-1
L-2
K+1
K
TC OUTPUT
TC TOGGLED
OUTPUT
SOURCE
WR
GATE
COUNT
VALUE
N+1
N
N-1
2
1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
Mode H
Waveforms
MIC-3780 User Manual
66
K-1
2
1
0
H
H-1
H-2
N+1
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 disarmed counter are disregarded. An armed counter will start counting on
the first source edge after the triggering gate edge. Countering will then
proceed in the same manner as in Mode G. After the second TC, the
counter will disarm itself. An ARM command and gate edge must be
issued in this order to restart counting.
Note that after application of a triggering gate edge, the gate input will be
disregarded until the second TC. This differs from Mode H, where the
gate can be modulated throughout the count cycle to stop and start the
counter.
SOURCE
WR
ARM
COMMAND
GATE
COUNT
VALUE
X
L
L-1
L-2
2
1
0
H
H-1
H-2
2
1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
Mode I Waveforms
67
Appendix D
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.
On the first TC, the counter will be reloaded from the Hold register.
Counting will then proceed until the second TC at which time the counter
will be reloaded from the Load register. Counting will continue, with the
reload source alternating on each TC, until a DISARM command is
issued to the counter. (The third TC reloads form the Hold register, the
fourth TC reloads form the Load register, etc.)
Specifying the TC Toggled output in the Counter Mode register can generate a variable duty cycle output. The Load and Hold values then directly
control the output duty cycle, with high resolution available when relatively high count values are used.
SOURCE
COUNT
VALUE
2
1
0
H
H-1
H-2
2
1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
Mode J
Waveforms
MIC-3780 User Manual
68
L-1
L-2
2
1
0
H
H-1
H-2
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 while the
gate is active and disregard those source edges that occur while the gate is
inactive. This permits the gate to turn the count process on and off.
As with Mode J, the reload source used will alternate on each TC, starting
with the Hold register on the first TC. After the gate modulate the duty
cycle of the output waveform. It can affect both the high and low portions
of the output waveform.
SOURCE
GATE
COUNT
VALUE
2
1
0
H
H-1
H-2
K+1
K
K-1
2
1
0
L
L-1
L-2
N+1
TC OUTPUT
TC TOGGLED
OUTPUT
SOURCE
GATE
COUNT
VALUE
N+1
N
N-1
2
1
0
H
H-1
H-2
TC OUTPUT
TC TOGGLED
OUTPUT
Mode K
Waveforms
69
Appendix D
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 disarmed counter are disregarded. The counter will start counting source
edges and counting will proceed until the second TC.
Note that after application of a triggering gate edge, the gate input will be
disregarded for the remainder of the count cycle. This differs from Mode
K, where the gate can be modulated throughout the count cycle to stop
and start the counter. On the first TC after application of the triggering
gate edge, the counter will be reloaded from the Hold register. On the second TC, the counter will be reloaded from the Load register and counting
will stop until a new edge is issued to the counter. Note that unlike Mode
K, new gate edges must be altered every second TC to continue counting.
SOURCE
GATE
COUNT
VALUE
X
L
L-1
L-2
2
1
0
H
TC OUTPUT
TC TOGGLED
OUTPUT
Mode L Waveforms
MIC-3780 User Manual
70
H-1
H-2
2
1
0
L
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 command or REST command.
SOURCE
WR
ARM
COMMAND
GATE
COUNT
VALUE
X
L
L-1
L-2
2
1
L
L-1
L-2
N+2
N+1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
SOURCE
WR
ARM
COMMAND
GATE
COUNT
VALUE
X
N
TC OUTPUT
TC TOGGLED
OUTPUT
Mode O Waveforms
71
Appendix D
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 REST
command.
SOURCE
GATE
COUNT
VALUE
X
L
L-1
L-2
2
1
X
L
L-1
L-2
N+2
N+1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
SOURCE
GATE
COUNT
VALUE
TC OUTPUT
TC TOGGLED
OUTPUT
Mode R Waveforms
MIC-3780 User Manual
72
N
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 command or
REST command.
SOURCE
WR
ARM
COMMAND
GATE
COUNT
VALUE
X
L
L-1
L-2
2
1
0
H
H-1
H-2
2
1
L-1
L-2
2
1
0
H
H-1
H-2
N+2
N+1
L-1
L-2
N+2
N+1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
SOURCE
WR
ARM
COMMAND
GATE
COUNT
VALUE
X
L
N
TC OUTPUT
TC TOGGLED
OUTPUT
SOURCE
WR
ARM
COMMAND
GATE
COUNT
VALUE
X
L
N
TC OUTPUT
TC TOGGLED
OUTPUT
Mode U Waveforms
73
Appendix D
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 command or REST
command.
SOURCE
GATE
COUNT
VALUE
X
L
L-1
L-2
2
1
0
H
H-1
H-2
2
1
X
L
L-1
L-2
2
1
0
H
H-1
H-2
N+2
N+1
X
L
L-1
L-2
N+2
N+1
0
L
TC OUTPUT
TC TOGGLED
OUTPUT
SOURCE
GATE
COUNT
VALUE
TC OUTPUT
TC TOGGLED
OUTPUT
SOURCE
GATE
COUNT
VALUE
N
TC OUTPUT
TC TOGGLED
OUTPUT
Mode X Waveforms
MIC-3780 User Manual
74
N