Using a 20-bit Shift Register - KBA86923

Version: **


Question: How do you use a shift register with a length of 20 bits when the API ShiftReg_WriteData has an argument that is 8, 16, or 32 bits?



For the API ShiftReg_WriteData, the data type is determined by the Shift Register Length parameter. When you double-click the Shift Register Component, you can see the configuration window where you set the Length (bits) field (Figure 1). This parameter determines the length of the shift register in bits. Valid values are 2 through 32 bits. Here you can set the value to 20. Now, even if you specify the argument as a 32-bit value, the API ShiftReg_WriteData will take only the lower 20 bits and do the shift operation depending on the shift direction and shift_in input. You can also directly give the argument as a 20-bit value.

Figure 1. Setting the Length (bits) Field