Counter timer controller
6000 Series user’s manual
15-4
Example
OUT &153, &76
Writes a 76h as a control word to the CTC control
register and configures a selected counter.
OUT &150, &AA
Writes the count value of AAH to the counter. The
counter is determined in the 76h control word.
Examples of a CTC control word:
00111010 = 3A hex
Select Counter = Counter 0
RW = Least significant byte then most significant byte
Mode = Mode 5 hardware triggered strobe
BCD = Binary counter 16 bits
01110110 = 76 hex
Select Counter = Counter 1
RW = Least significant byte then most significant byte
Mode = Mode 3 square wave generator
BCD = Binary counter 16 bits
10110100 = B4 hex
Select Counter = Counter 2
RW = Least significant byte then most significant byte
Mode = Mode 2 rate generator
BCD = Binary counter 16 bits
Examples of the count value
A count value is then loaded after the counter has been configured.
&4800 is equal to 18432 decimal. If the 1.843 MHz clock is divided by
this value, the result will be 100. Therefore, if counter 2 is loaded with
this count, the OUTPUT will cycle every 1/100 of a second or 100Hz.
&64 is equal to 100 decimal. If this value is loaded into counter 0 and
since the 100 Hz output of counter 2 is routed to counter 0 CLOCK, the
output generated from counter 0 will cycle once every second or 1 Hz.
The selected counter may then require the GATE to change states
before counting begins. How the OUTPUT appears (Square Wave,
Strobe, etc.) will depend on how the counter was configured. Refer to
the Control word definition section .
A programming example, 6020_CTC.CPP, is included on the 6020
utility disk, which demonstrates the use of CTC counters 0 and 1 to
generate periodic interrupts.
Control word definition
The control word sets the counter/timer to a specific mode of counting.
In addition to the various counting modes, the setup in Table 15-2
should be considered:
Содержание 6000 Series
Страница 2: ...O C T A G O N S Y S T E M S Embedded PCs For Extreme Environments 6000 Series User s Manual 4738 0906 ...
Страница 7: ...Notice to user PC 500 user s manual ...
Страница 9: ...About this manual 6000 Series user s manual ...
Страница 37: ...2 20 Quick start 6000 Series user s manual ...
Страница 65: ...5 16 Serial ports 6000 Series user s manual ...
Страница 87: ...6 22 EZ I O 6000 Series user s manual ...
Страница 103: ...8 8 Analog I O 6000 Series user s manual ...
Страница 119: ...14 2 PC 104 expansion 6000 Series user s manual ...
Страница 133: ...16 4 Watchdog timer reset and remote reset 6000 Series user s manual ...
Страница 139: ...17 6 Serial EEPROM 6000 Series user s manual ...
Страница 157: ...21 2 Software utilities 6000 Series user s manual ...
Страница 161: ...22 4 Troubleshooting 6000 Series user s manual ...
Страница 177: ...A 16 6010 technical data 6000 Series user s manual ...
Страница 215: ...D 16 6040 technical data 6000 Series user s manual ...
Страница 229: ...F 2 Miscellaneous 6000 Series user s manual ...
Страница 231: ...G 2 Accessories 6000 Series user s manual ...
Страница 233: ...Warranty 6000 Series user s manual ...