參數(shù)資料
型號: DM6806
廠商: Electronic Theatre Controls, Inc.
英文描述: DM5806 DATA MODULE DIGITAL I/O BOARD
中文描述: DM5806數(shù)據(jù)模塊數(shù)字I / O板
文件頁數(shù): 39/64頁
文件大小: 270K
代理商: DM6806
4-9
v = inportb(port_address);
v = v & 199;
v = v | 40;
outportb(port_address, v);
A final note:
Don’t be intimidated by the binary operators AND and OR and try to use operators for which you
have a better intuition. For instance, if you are tempted to use addition and subtraction to set and clear bits in place
of the methods shown above, DON’T! Addition and subtraction may seem logical, but they
will not work
if you try
to clear a bit that is already clear or set a bit that is already set. For example, you might think that to set bit 5 of a
port, you simply need to read in the port, add 32 (2
5
) to that value, and then write the resulting value back to the port.
This works fine if bit 5 is not already set. But, what happens when bit 5
is
already set Bits 0 to 4 will be unaffected
and we can’t say for sure what happens to bits 6 and 7, but we can say for sure that bit 5 ends up cleared instead of
being set. A similar problem happens when you use subtraction to clear a bit in place of the method shown above.
Now that you know how to clear and set bits, we are ready to look at the programming steps for the DM5806
board functions.
Initializing the 8255 PPI
Before you can operate the DM5806, the 8255 must be initialized. This step must be executed every time you
start up, reset, or reboot your computer.
The 8255 is initialized by writing the appropriate control word to I/O port BA + 3. The contents of your control
word will vary, depending on how you want to configure your I/O lines. Use the control word description in the
previous I/O map section to help you program the right value. Remember that the DM5806 cannot use Mode 2. In
the example below, a decimal value of 128 sets up the 8255 so that all I/O lines are Mode 0 outputs.
Digital I/O Operations
Once the 8255 is initialized, you can use the digital I/O lines to control or monitor external devices.
Timer/Counters
An 8254 programmable interval timer provides three 16-bit, 8-MHz timer/counters for timing and counting
functions such as frequency measurement, event counting, and interrupts. All three timer/counters are cascaded at
the factory. Figure 4-1 shows the timer/counter circuitry.
Each timer/counter has two inputs, CLK in and GATE in, and one output, timer/counter OUT. They can be
programmed as binary or BCD down counters by writing the appropriate data to the command word, as described in
the I/O map section at the beginning of this chapter.
One of two clock sources, the on-board 8-MHz crystal or an external clock routed through on-board I/O
connector P6 can be selected as the clock input to each timer/counter. In addition, the timer/counters can be cas-
caded by connecting TC0’s output to TC1’s clock input and TC1’s output to TC2’s clock input. The diagram shows
how these clock sources are connected to the timer/counters.
An external gate source can be connected to each timer/counter through P6. When a gate is disconnected, an on-
board pull-up resistor automatically pulls the gate high, enabling the timer/counter.
The output from each timer/counter is available at P6, where it can be used for interrupt generation or for
counting functions.
The timer/counters can be programmed to operate in one of six modes, depending on your application. The
following paragraphs briefly describe each mode.
D7
D6
D5
D4
D3
D2
D1
D0
1
0
0
0
0
0
0
0
相關PDF資料
PDF描述
DM6380L V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM6381F V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM6382F V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM6383F V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM336P V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
相關代理商/技術參數(shù)
參數(shù)描述
DM6CD330J03 制造商:n/a 功能描述:DM6X033 S7B3A
DM6-M25 制造商:Mencom 功能描述:
DM6-MF-25 制造商:Mencom 功能描述:
DM6-MM-06 制造商:Mencom 功能描述:
DM6-MM-10 制造商:Mencom 功能描述: