Digital inputs and outputs
This controller is equipped with 6 digital I/O pins. Of these, 4 can be configured as either input or output. Pins DIO5_IO_MISO and DIO6_IO_CLK are preset as inputs.
Defining input and output assignments
- Pin 1: DIO1_IO_CS
- Pin 2: DIO2_CD_CLK
- Pin 3: DIO3_CD_DIR
- Pin 4: DIO4_IO_MOSI
- Subindex 01h
Output Mask: This bit mask defines whether the pin is used as input or output:
- Bit = "0": Pin is input (default)
- Bit = "1": Pin is output
- Subindex 02h
Pullup Mask: This bit mask defines whether the pin is a
- Bit = "0": Pin is pulldown (default)
- Bit = "1": Pin is pullup
Example for subindex 01h: Pin 2 and pin 3 are to be outputs, value = "6" (=0110 b)
- The first bit corresponds to the special function of an output or input. These functions are always available on bits 0 to 15 (inclusive) of the respective object. These include the limit switches and the home switch for the digital inputs and the brake control for the outputs.
- The second bit shows the output/input as a level; these are then available on bits 16 to 31.
To manipulate the value of output 2, always use bit 17 in 60FEh.
To activate the "negative limit switch" special function of input 1, set bit 0 in 3240h:01h; to query the status of the input, read bit 0 in 60FDh. Bit 16 in 60FDh also shows the status of input 1 (independent of whether or not the special function of the input was activated).
This assignment is graphically illustrated in the following drawing.
The following inputs are available:
|PIN/input||Name for Input Routing||Factory settings|
|B3/DIO1_IO_CS||physical input 1||None|
|B4/DIO2_CD_CLK||physical input 2||Clock input in clock-direction mode|
|B5/DIO3_CD_DIR||physical input 3||Home switch / direction input in clock-direction mode|
|B6/DIO4_IO_MOSI||physical input 4||None|
|B7/DIO5_IO_MISO||physical input 5||None|
|B8/DIO6_IO_CLK||physical input 6||None|
The value of an input can be manipulated using the following OD settings, whereby only the corresponding bit acts on the input here.
3240h:01h (Special Function Enable): This bit allows special functions of an input to be switched off (value "0") or on (value "1"). If input 1 is not used as, e.g., a negative limit switch, the special function must be switched off to prevent an erroneous response to the signal generator. The object has no effect on bits 16 to 31.
The firmware evaluates the following bits:
- Bit 0: Negative limit switch
- Bit 1: Positive limit switch
- Bit 2: Home switch
If, for example, two limit switches and one home switch are used, bits 0–2 in 3240h:01h must be set to "1".
3240h:02h (Function Inverted): This bit switches from normally open logic (a logical high level at the input yields the value "1" in object 60FDh) to normally closed logic (the logical high level at the input yields the value "0"). This applies for the special functions (except for the clock and direction inputs) and for the normal inputs.
If the bit has the value "0", normally open logic applies; for the value "1", normally closed logic applies. Bit 0 corresponds to input 1 here, bit 1 to input 2, etc.
3240h:03h (Force Enable): This bit switches on the software simulation of input values if it is set to "1". In this case, the actual values are no longer used in object 3240h:04h, but rather the set values for the respective input.
3240h:05h (Raw Value): This object contains the unmodified input value.
60FDh (Digital Inputs): This object contains a summary of the inputs and the special functions.
Computation of the inputs
Computation of the input signal using the example of input 1:
The value at bit 0 of object 60FDh is interpreted by the firmware as negative limit switch; the result of the complete computation is stored in bit 16.
To perform the assignment of the inputs more flexibly, there is a mode called Input Routing Mode. This assigns a signal of a source to a bit in object 60FDh.
This mode is activated by setting object 3240h:08h (Routing Enable) to 1.
Object 3242h determines which signal source is routed to which bit of 60FDh. Subindex 01h of 3242h determines bit 0, subindex 02h determines bit 1, and so forth. You can find the signal sources and their numbers in the following lists.
|00||00||Signal is always 0|
|01||01||Physical input 1|
|02||02||Physical input 2|
|03||03||Physical input 3|
|04||04||Physical input 4|
|05||05||Physical input 5|
|06||06||Physical input 6|
|07||07||Physical input 7|
|08||08||Physical input 8|
|09||09||Physical input 9|
|10||0A||Physical input 10|
|11||0B||Physical input 11|
|12||0C||Physical input 12|
|13||0D||Physical input 13|
|14||0E||Physical input 14|
|15||0F||Physical input 15|
|16||10||Physical input 16|
|65||41||Hall input "U"|
|66||42||Hall input "V"|
|67||43||Hall input "W"|
|68||44||Encoder input "A"|
|69||45||Encoder input "B"|
|70||46||Encoder input "Index"|
The following table describes the inverted signals of the previous table.
|128||80||Signal is always 1|
|129||81||Inverted physical input 1|
|130||82||Inverted physical input 2|
|131||83||Inverted physical input 3|
|132||84||Inverted physical input 4|
|133||85||Inverted physical input 5|
|134||86||Inverted physical input 6|
|135||87||Inverted physical input 7|
|136||88||Inverted physical input 8|
|137||89||Inverted physical input 9|
|138||8A||Inverted physical input 10|
|139||8B||Inverted physical input 11|
|140||8C||Inverted physical input 12|
|141||8D||Inverted physical input 13|
|142||8E||Inverted physical input 14|
|143||8F||Inverted physical input 15|
|144||90||Inverted physical input 16|
|193||C1||Inverted Hall input "U"|
|194||C2||Inverted Hall input "V"|
|195||C3||Inverted Hall input "W"|
|196||C4||Inverted encoder input "A"|
|197||C5||Inverted encoder input "B"|
|198||C6||Inverted encoder input "Index"|
Input 1 is to be routed to bit 16 of object 60FDh:
The number of the signal source for input 1 is "1". The routing for bit 16 is written in 3242h:11h.
Hence, object 3242h:11h must be set to the value "1".
The outputs are controlled via object 60FEh. Here, output 1 corresponds to bit 16 in object 60FEh, output 2 corresponds to bit 17, etc., as with the inputs. The first 4 I/O pins can be configured as outputs, see Defining input and output assignments. The outputs with special functions are again entered in the firmware in the lower bits 0 to 15. The only bit assigned at the present time is bit 0, which controls the motor brake.
The digital outputs, with the exception of the brake output, have a digital level of 3.3 V DC. The maximum admissible current is 10 mA.
The brake output is implemented as open drain. Hence, an external voltage supply as shown in the following figure is always necessary. See also Automatic brake control.
Additional OD entries are available for manipulating the value of the outputs (see the following example for further information). As with the inputs, only the bit at the corresponding location acts on the respective output:
3250h:01h: No function.
3250h:02h: This is used to switch the logic from normally open to normally closed. Configured as normally open, the input outputs a logical high level if the bit is "1". With the normally closed configuration, a logical low level is output accordingly for a "1" in object 60FEh.
3250h:05h: The bit combination applied to the outputs is stored in this subindex.
Computation of the outputs
Example for calculating the bits of the outputs:
The "Output Routing Mode" assigns an output a signal source; a control bit in object 60FEh:01h switches the signal on or off.
The source is selected with 3252h:01 to 05 in the "high byte" (bit 15 to bit 8). The assignment of a control bit from object 60FEh:01h is performed in the "low byte" (bit 7 to bit 0) of 3252h:01h to 05 (see following figure).
The subindex of object 3252h determines which signal source is routed to which output. The output assignments are listed in the following:
|Subindex 3252h||Output Pin|
|01h||Configuration of the PWM output (software PWM)|
|02h||Configuration of output 1|
|03h||Configuration of output 2 (if available)|
|04h||Configuration of output 3 (if available)|
|05h||Configuration of output 4 (if available)|
|Number in 3252:01 to 05|
|00XXh||Output is always "1"|
|01XXh||Output is always "0"|
|02XXh||Encoder signal (6063h) with frequency divider 1|
|03XXh||Encoder signal (6063h) with frequency divider 2|
|04XXh||Encoder signal (6063h) with frequency divider 4|
|05XXh||Encoder signal (6063h) with frequency divider 8|
|06XXh||Encoder signal (6063h) with frequency divider 16|
|07XXh||Encoder signal (6063h) with frequency divider 32|
|08XXh||Encoder signal (6063h) with frequency divider 64|
|09XXh||Position Actual Value (6064h) with frequency divider 1|
|0AXXh||Position Actual Value (6064h) with frequency divider 2|
|0BXXh||Position Actual Value (6064h) with frequency divider 4|
|0CXXh||Position Actual Value (6064h) with frequency divider 8|
|0DXXh||Position Actual Value (6064h) with frequency divider 16|
|0EXXh||Position Actual Value (6064h) with frequency divider 32|
|0FXXh||Position Actual Value (6064h) with frequency divider 64|
|10XXh||PWM signal that is configured with object 2038h:05h and 06h|
|11XXh||Inverted PWM signal that is configured with object 2038h:05h and 06h|
The encoder signal is only output if using an encoder, not with Hall sensors.
On any change of the "encoder signal" (6063h) or the current position (6064h in user-defined units) by an increment, a pulse is output at the digital input (for frequency divider 1). Take this into account when selecting the frequency divider, especially when using sensors with low resolution (such as Hall sensors).
The output is switched on by setting bit 5 in object 60FE:01.