The Programmer is one of the more complex modules. There are two stages involved in its process: mask and data. In the first stage, involves reading and storing the 4-byte mask (32-bits corresponding to 32 channels of the DAC), which follows immediate after the location and type bytes of the P-packet payload. Then the Programmer steps through the rest of the P-packet in 2-byte words, each containing the 14-bit DAC voltage, ordering write operations via the [[Programming_the_DAC|DAC Controller]] for each one. The packet is expected to have all 32 values in ascending order of channels. For any channels that need not be altered or to avoid writing to unused channels of the DAC, the mask must contain 0's for the corresponding bits. The [[FPGA_Registers#DAC Register|DAC Register]] is pulsed simulataneously with the DAC controller to record the programmed value. The will later be sent back to the PC for confirmation. (No feedback from the DAC chip itself is possible. Some channels may be sampled by the ADC if necessary.)
The Programmer is one of the more complex modules. There are two stages involved in its process: mask and data. The first stage involves reading and storing the 4-byte mask (32-bits corresponding to 32 channels of the DAC), which follows immediately after the location and type bytes of the P-packet payload. Then the Programmer steps through the rest of the P-packet in 2-byte words, each containing the 14-bit DAC voltage, ordering write operations via the [[Programming_the_DAC|DAC Controller]] for each one. The packet is expected to have all 32 values in ascending order of channels. For any channels that need not be altered or to avoid writing to unused channels of the DAC, the mask must contain 0's for the corresponding bits. The [[FPGA_Registers#DAC Register|DAC Register]] is pulsed simulataneously with the DAC controller to record the programmed value. The will later be sent back to the PC for confirmation. (No feedback from the DAC chip itself is possible. Some channels may be sampled by the ADC if necessary.)