GFD212A使用范围,ABB输入模块
可编程间隔计时器(8254)8254是一种具有六种不同定时功能的多功能计数器/计时器设备操作模式。然而,这里只描述了一种模式。该模式是调用速率生成器。使用此模式,电路板的操作类似于数据记录器。基本上,该模式的功能类似于除以n计数器。计数器加载了n个计数,然后通过在中设置一个位来指示开始计数CSR(计数起始H数据位10)。当计数减少到“一”时,a产生脉冲,启动先前已完成的A/D扫描序列已编程。扫描顺序必须是扫描中断模式或扫描轮询模式,如第4.4.2节所述和4.4.3。
GFD212A使用范围扫描完成且电路板处于扫描中断时模式下,将向主机CPU发出扫描结束中断。否则,CPU必须轮询CSR中注册的扫描结束H位,以确定何时进行扫描完成。然后CPU读取双端口寄存器。同时间隔计时器重新加载计数器并再次开始计数。这个计数时间间隔必须大于读取所有双精度计数器所需的时间端口寄存器加上A/D扫描序列完成的时间。这次是扫描所有64个通道时约2毫秒。
8254有三个16位宽度的计数器。计数器时钟为8 MHz这导致计时器分辨率为125 ns或0.125µs。如果加载FFFF十六进制的最大计数,将生成开始扫描脉冲每8.192毫秒一次。确定如下:216=65536(加载计数的十进制等效值)x0.125x10-6(8 MHz时钟周期)=8.192x10-3秒。可以级联三个16位计数器以形成48位计数器。二计数器级联在一起并加载所有“一”将生成开始扫描每8分57秒脉搏一次。参考第5.4.5节确定级联计数器的跳线配置。可编程定时器占用4个字的地址空间及其相对地址如表4.1-1所示。对可编程定时器的每次写入都是一个字长(D15至D0),其中所有必要信息包含在低位字节(D7到D0)。8254中每个寄存器的相对地址为如表4.4.6-1所示。
Programmable Interval Timer (8254)
The 8254 is a very versatile counter/timer device with six different timing
modes of operation. However, only one mode is described here. That mode is
called RATE GENERATOR. Using this mode allows the board to operate similar to
a data-logger. Basically this mode functions like a divide-by-n counter. Thecounter is loaded with n counts and is then told to start counting by setting a bit in
the CSR (count START H-data bit 10). When the count has decremented to "one", a
pulse is generated which starts the A/D scanning sequence which has previously
been programmed. The scanning sequence must be either the SCANNING
INTERRUPT MODE or the SCANNING POLL MODE as discussed in Sections 4.4.2
and 4.4.3.
When the scan is done and the board is in the SCANNING INTERRUPT
MODE, an end-of-scan interrupt will be issued to the host CPU. Otherwise, the CPU
must poll the registered end-of-scan H bit in the CSR to determine when the scan is
done. The dual port registers are then read by the CPU. Concurrently with this, the
Interval Timer reloads the counter and begins counting again. The
counting time interval must be longer than the time required to read all the dual
port registers plus the time for the A/D scan sequence to complete. This time is
approximately 2 ms when all 64 channels are being scanned.
The 8254 has three counters of 16-bit width. The counter clock is 8 MHz
which results in timer resolution of 125 ns or 0.125 µs. One 16-bit counter, if
loaded with a maximum count of FFFF HEX, would generate a start scan pulse
every 8.192 ms. This is determined as follows:
216 = 65,536 (Decimal equivalent of loaded count)
x0.125x10-6 (Period of 8 MHz Clock) = 8.192x10-3 second Three 16-bit counters may be cascaded to make a 48-bit counter. Two
counters cascaded together and loaded with all "ones" would generate a start scan
pulse every eight minutes and 57 seconds. Refer to Section 5.4.5 to determine
jumper configurations for cascading counters.
The Programmable Timer occupies 4 words of address space and its
relative address is shown in Table 4.1-1. Each write to the Programmable Timer is a
word in length (D15 to D0) of which all necessary information is contained in the
lower byte (D7 through D0). The relative address of each register in the 8254 is
shown in Table 4.4.6-1.