TIP670 User Manual Issue 1.3
Page 13 of 19
6 Programming
After power-up or system reset the CIO Z8536 is in its initial state and the I/O ports A, B, C are
disabled and configured to output direction. For normal operation of the TIP670 a minimum software
initialization is required.
6.1 Required Software Initialization
The input lines of the TIP670 are connected to port B of the CIO Z8536. This port has to be configured
as input and because of the inverting function of the optocouplers the input polarity has to be set to
inverting.
To perform this required software initialization sees the following procedure:
•
Write 0x00 to CIOSR
Write 0x01 to CIOSR
Write 0x00 to CIOSR
This sequence puts the CIO Z8536 into a known (reset) state
•
Write 0x2B to CIOCSR
This selects the Port B Data Direction Register (PBDD) for the next operation
•
Write 0xFF to CIOCSR
Writing 0xFF into PBDD will configure all bits of port B as input
•
Write 0x2A to CIOCSR
This selects the Port B Data Path Polarity Register (PBDP) for the next operation
•
Write 0xFF to CIOCSR
Writing 0xFF into PBDP will configure all bits of port B to be inverted
•
Write 0x01 to CIOCSR
This selects the Master Configuration Control Register (MCCR) for the next operation
•
Write 0x84 to CIOCSR
Writing 0x84 into MCCR will enable port A and B
After this sequence the directly accessible port registers Port A and Port B can be used for reading the
actual status of the TIP670 input and setting the TIP670 outputs.