
Hercules-EBX CPU User Manual V1.02
Page 101
Reading a counter
a. Latch the counter:
Counter 0
Counter 1
outp(base+27,0x40); outp(base+27,0xC0);
b. Read the data:
The value is returned in 3 bytes, low, middle, and high (2 bytes for counter 1)
Counter 0
Counter 1
low=inp(base+24); low=inp(base+24);
middle=inp(base+25); high=inp(base+25);
high=inp(base+25);
c. Assemble the bytes into the complete counter value:
Counter 0
Counter 1
val = high * 2^16 + middle * 2^8 + low;
val = high * 2^8 + low;
Enabling the counter gate
Counter 0
Counter 1
outp(base+27,0x10); outp(base+27,0x90);
The counter will run only when the gate input is high.
Disabling the counter gate
Counter 0
Counter 1
outp(base+27,0x20); outp(base+27,0xA0);
The counter will run continuously.
Clearing a counter
Clearing a counter is done when you want to restart an operation. Normally you only clear a
counter after you have stopped (disabled) and read the counter. If you clear a counter while it is
still enabled, it will continue to count incoming pulses, so its value may not stay at zero.
a. Stop (disable) the counter:
Counter 0
Counter 1
outp(base+27,0x08); outp(base+27,0x88);
b. Read the data (optional). See “Reading a counter” above.
c. Clear the counter:
Counter 0
Counter 1
outp(base+27,0x01); outp(base+27,0x81);
Содержание HERCULES-EBX HRC400-5A128
Страница 9: ...Hercules EBX CPU User Manual V1 02 Page 9 3 HERCULES BOARD DRAWING...
Страница 118: ...Hercules EBX CPU User Manual V1 02 Page 118 Figure 14 Hercules EBX Cable Kit...
Страница 121: ...Hercules EBX CPU User Manual V1 02 Page 121...
Страница 123: ...Hercules EBX CPU User Manual V1 02 Page 123...