Waiting time counter (wt) – Rainbow Electronics T89C5121 User Manual

Page 32

Advertising
background image

32

A/T8xC5121

4164G–SCR–07/06

Waiting Time Counter (WT)

The WT counter is a 24 bits down counter which can be loaded with the value contained
in the SCWT2, SCWT1, SCWT0 registers. Its main purpose is time out signal genera-
tion. It is 24 bits wide and is decremented at the ETU rate. The ETU counter acts as a
prescaler (See Figure 16).

When the WT counter timeout, an interrupt is generated and the SCIB function is
locked: reception and emission are disabled. It can be enabled by resetting the macro or
reloading the counter.

Figure 16. Waiting Time Counter

The counter is loaded, if WTEN = 0, during the write of SCWT2 register.

This counter is available in both UART and manual modes. But the behaviour depends
on the selected mode.

In manual mode, the WTEN signal controls the start of the counter (rising edge) and the
stop of the counter (falling edge). After a time out of the counter, a falling edge on
WTEN, a reload of SCWT2 and a rising edge of WTEN are necessary to start again the
counter and to release the SCIB macro. The reload of SCWT2 transfers all SCWT0,
SCWT1 and SCWT2 registers to the WT counter.

In UART mode there is an automatic load on the start bit detection. This automatic load
is very useful for changing on-the-fly the Timeout value since there is a register to hold
the load value. This is the case, for example, when in T = 1 a launch is performed on the
BWT Timeout on the start bit of the last transmitted character. But on the receipt of the
first character an other time out value (CWT) must be used . For this, the new load value
of the waiting time counter must be loaded with CWT before the transmission of the last
character. The reload of SCWT[2-0] with the new value occurs with WTEN = 1.

After a time out of the counter in UART mode, the restart is done as in manual mode.

The maximum interval between the start leading edge of a character and the start lead-
ing edge of the next character is loaded in the SCWT2, SCWT1, SCWT0 registers.

In T = 1 mode, the CWT (character waiting time) or the BWT (block waiting time) are
loaded in the same registers.

The maximum time between two consecutive start bit is WT[23:0] * ETU.

When used to check BWT according to ISO 7816, WT can be set between 971 and
15728651.

ETU Counter

WT Counter

Timeout

SCWT2

SCWT1

SCWT0

WT[23:0]

Load

WTEN

Start bit

UART

Write_SCWT2

Advertising