beautypg.com

The leds – BECKHOFF C1230S User Manual

Page 9

background image

Eiserstraße 5 / D-33415 Verl / Phone05246/963-0 / Fax 05246/963-149

ISA Bus interface card C1230S

9

C1230S

Special
keys

S10

S9

S8

S7

S6

S5

S4

S3

S2

S1

Port

Port C

Port A

Address

222H

220H

Bit

1

0

7

6

5

4

3

2

1

0

Pressed=

0

0

0

0

0

0

0

0

0

0

Cleared=

1

1

1

1

1

1

1

1

1

1

Since, after a reset, all the component’s ports are configured for input, the
keys can be interrogated without altering the control register.

Example:
- Press keys S5 and S9, and interrogate addresses 220H and 222H at the
same time.
- From address 220H you obtain 11101111B, while 222H returns
XXXXXX10B. The X stands here for an undefined value that need not be
considered.

The LEDs

The 10 special keys each contain a light emitting diode that can be driven
through the software. They are addressed through port B and the upper
half of port C of the same input/output component as the special keys. This
is located in the address range from 220H to 223H.

Inverted drive

Note that drive of the LEDs is inverted, so that if the bit is set, the LED is
out.

The component must be re-
configured for output in the
control register.

Since after a reset all the component’s ports are configured as inputs, the
value 10010001B (= 91H) must be written into the control register at
address 223H before the LEDs are first used, so that port B and the upper
half of port C function as outputs. The configuration is retained until this is
over-written.

Example:
- Write 10010001B (91H) into address 223H.
- In order to switch on LED 6 and to switch all the others off, write DFH to
address 221H and set bits 4 and 5 of address 222H, by writing a value in
which bits 4 and 5 are 1, for instance 30H or FFH.

LEDs

10

9

8

7

6

5

4

3

2

1

Port

Port C

Port B

Address

222H

221H

Bit

5

4

7

6

5

4

3

2

1

0

LED on=

0

0

0

0

0

0

0

0

0

0

LED off=

1

1

1

1

1

1

1

1

1

1