SBASA56 September 2023 AMC131M02
PRODUCTION DATA
The WREG command allows writing an arbitrary number of contiguous device registers. The binary format of the command word is 011a aaaa annn nnnn, where a aaaa a is the binary address of the register to begin writing and nnn nnnn is the unsigned binary number of consecutive registers to write minus one. Send the data to be written immediately following the command word. Write the intended contents of each register into individual words, MSB aligned.
If the input CRC is enabled, write this CRC after the register data. The registers are written to the device as they are shifted into DIN. Therefore, a CRC error does not prevent an erroneous value from being written to a register. An input CRC error during a WREG command sets the CRC_ERR bit in the STATUS register.
The device ignores writes to read-only registers or to out-of-bounds addresses. Gaps in the register map address space are still included in the parameter nnn nnnn, but are not writeable so no change is made to them. The response to the WREG command that occurs in the following frame appears as 010a aaaa ammm mmmm, where mmm mmmm is the number of registers actually written minus one. This number can be checked by the host against nnn nnnn to make sure the expected number of registers are written.
Figure 8-27 shows a typical WREG sequence. In this example, the number of registers to write is larger than the number of ADC channels and, therefore, the frame is extended beyond the ADC channels and output CRC word. Make sure all ADC data and output CRC are shifted out during each transaction where new data are available.