beautypg.com

Special i/o functions – Toshiba 6F3B0253 User Manual

Page 263

background image

6F3B0253

Basic Hardware and Function

261

8. Special I/O Functions

8.3 High speed counter

8.3.1

Single phase up-counter

Function

When the count input is changed from OFF to ON, the count value is increased by 1.
When the count value reaches the set value, the count value is reset to 0, and I/O
interrupt program is activated (if the interrupt enable flag is ON). The count value is
reset to 0 when the reset input comes ON.
This counter operation is enabled while the soft-gate is ON. The count value is reset to
0 when the soft-gate is changed from ON to OFF.
The set value is set internally at the timing of the soft-gate changing from OFF to ON.
When the soft-gate is OFF, the count value can be changed by writing the data into
the set value register and setting the count preset flag to ON.
The count value range is H0000 to HFFFF (16-bit data).

Hardware condition

Count input (X000 and X001)

ON/OFF pulse width: 100

µ

s or more (max. 5KHz)

Reset input (X002 and X003)

ON/OFF duration:

2ms or more

Related registers

SW16: Function selection. Refer to section 8.1.

Function

Register/device

Remarks

Channel 1

Channel 2

Count input

X000

X001

(Note)

Reset input

X002

X003

Set value

SW18

SW20

Data range: H0000 to HFFFF

Count value

SW22

SW23

Soft-gate

S240

S248

Operation is enabled when ON

Interrupt enable

S241

S249

Interrupt is enabled when ON

Count preset

S243

S24B

Used to preset the counter value

Note) When both channels are used, X000 to X003 cannot be used as normal

input devices. However, if either one channel is used, these inputs for unused
channel can be used as normal input devices.

Interrupt assignment

Channel 1

I/O interrupt program #1

Channel 2

I/O interrupt program #2