Omega Vehicle Security DAQ-16 user manual Programming the 8254 Counter/Timer

Page 28

4.2Programming the 8254 Counter/Timer

This section provides programming information for the 8254 counter/timer as implemented on the DAQ-16. For more details on the 8254, consult the Intel Micro-Processor and Peripheral Handbook.

To program any of the counters contained in the 8254 counter/timer, three steps are required:

1.Write the configuration byte to the 8254 mode select/status register. This byte sets the operating mode of the selected counter.

2.Write the least significant byte of the count value to the selected counter register.

3.Write the most significant byte of the count value to the selected counter register.

The following examples illustrate the programming sequence for each of the counters in the 8254. The variable 'base_address' is the base address of the DAQ-16 as defined by the address selection switches.

Counter 0 - Clock rate register (low word)

operating mode:

2

 

 

 

minimum count value:

2

 

 

 

configuration byte:

0 / 0 / 1 / 1 / 0 / 1 / 0 / 0 = 34H

Example:

Program the value 2675H into the low word of the clock rate register.

 

 

output

34H

to

base_address + 0FH

 

 

output

75H

to

base_address + 0CH

 

 

output

26H

to

base_address + 0CH

Example:

Program the value 0008H into the low word of the clock rate register.

 

 

output

34H

to

base_address + 0FH

 

 

output

08H

to

base_address + 0CH

 

 

output

00H

to

base_address + 0CH

DAQ-16 Users Manual

28

Image 28
Contents 15,1*,1 WARRANTY/DISCLAIMER For immediate technical or application assistance Servicing North AmericaServicing Europe Page Manufacturers Name Manufacturers AddressApplication of Council Directive Standards to which Conformity is DeclaredTable of Contents List of Figures and Tables Installation IntroductionDAQ-16 Specifications Analog to Digital Converter Maximum Input Voltage Amplifier RangeJumper J7 Configuration Volt range Unipolar Bipolar Binary 2s complement Voltage Binary ’s Complement Digital to Analog Converters Digital Input/Output Channel BipolarUnipolar Gain =Base Address I/O Base Address SelectionClock Selection Internal Clock External Clock Trigger Selection Start of ConversionDirect Memory Access 10. Jumpers J8 and J9 ConfigurationInterrupts External InterruptExternal Connections Page Register Description Control Word RegisterCHSL2 CHSL1 CHSL0 Multi-Function Timer Register Start of Conversion Register3 DAC0 Register 4 DAC1 RegisterProgramming the 8254 Counter/Timer Counter 1 Clock rate register high word Version January 28