EMERSON 5X00105G07 PLC模塊
計時器控制狀態(tài)寄存器1(TCSR1)計時器通過位于BAR2地址偏移0x00處的計時器控制狀態(tài)暫存器1(TCSR 1)進行控制和監(jiān)控。該寄存器中的位映射如下:每個定時器都有一個獨立選擇的時鐘源,該時鐘源由“定時器x時鐘選擇”字段中的位模式選擇,如下所示:通過將“1”寫入適當?shù)摹岸〞r器x啟用”字段,可以獨立啟用每個定時器。類似地,通過將“1”寫入適當?shù)摹皌imer x IRQ Enable”字段,可以獨立啟用每個計時器產(chǎn)生的中斷。如果中斷由計時器產(chǎn)生,則可以通過讀取“計時器x引起的IRQ”字段來確定中斷源。如果字段設置為“1”,則相應的計時器導致中斷。請注意,多個計時器可能會導致一次中斷。因此,必須讀取所有計時器的狀態(tài),以確保識別所有中斷源。
Timer Control Status Register 1 (TCSR1)
The timers are controlled and monitored via the Timer Control Status Register 1
(TCSR1) located at offset 0x00 from the address in BAR2. The mapping of the bits in
this register are as follows:Each timer has an independently selectable clock source which is selected by the bit
pattern in the “Timer x Clock Select” field as follows:Each timer can be independently enabled by writing a “1” to the appropriate “Timer x
Enable” field. Similarly, the generation of interrupts by each timer can be
independently enabled by writing a “1” to the appropriate “Timer x IRQ Enable”
field.
If an interrupt is generated by a timer, the source of the interrupt may be determined
by reading the “Timer x Caused IRQ” fields. If the field is set to “1”, then the
respective timer caused the interrupt. Note that multiple timers can cause a single
interrupt. Therefore, the status of all timers must be read to ensure that all interrupt
sources are recognized.