Konica Minolta PCI-1712 Computer Hardware User Manual


 
– 52 –
Chapter 5
PCI-1712/1712L User’s Manual
Advantech Co., Ltd.
www.advantech.com
(65535-50000)/1K = 15.535 sec.
Figure 5-7: Pulse width measurement
The following C program is the example to explain how to implement
the pulse width measurement by software.
outport(addr2_1712+0x26,0x00); //Set internal clock as 10 MHz
while(!kbhit())
{
outport(addr2_1712+0x1e,0x70); //CNT1 82C54 mode 0
outport(addr2_1712+0x1a,0xff); //Set CNT1 low byte
outport(addr2_1712+0x1a,0xff); //Set CNT1 high byte
outport(addr2_1712+0x1e,0xb0); //CNT2 82C54 mode 0
outport(addr2_1712+0x1c,0xff); //Set CNT2 low byte
outport(addr2_1712+0x1c,0xff); //Set CNT2 high byte
outport(addr2_1712+0x24,0x80); //Set CNT2’s gate input as high
outport(addr2_1712+0x24,0x88); //Generate one clock to CNT2
outport(addr2_1712+0x24,0x31); /*Set CNT2’s clock source as