Changes

Jump to navigation Jump to search
880 bytes added ,  15:14, 17 July 2007
no edit summary
Line 56: Line 56:     
This is the packet sent from the PC to the FPGA to set new values to the DAC channels.  The first byte of the packet will be an ASCII '''P''': 0x50, 0101 0000.  The next four bytes (if all 32 channels are used; 2 bytes if 16 channels, 3 if 24 channels) together form a programming mask.  Any channel that is to be reprogrammed will have a 1 in the corresponding location, and any channel that is to be left alone will have a 0 in the corresponding location.  The MSB of the first byte will be channel 31 (or 23 or 15) and the LSB of the fourth (or third or second) byte will be channel 0.  Thus, if all 32 channels are to be used, but only channels 14 through 26 are to be programmed, the packet would contain:
 
This is the packet sent from the PC to the FPGA to set new values to the DAC channels.  The first byte of the packet will be an ASCII '''P''': 0x50, 0101 0000.  The next four bytes (if all 32 channels are used; 2 bytes if 16 channels, 3 if 24 channels) together form a programming mask.  Any channel that is to be reprogrammed will have a 1 in the corresponding location, and any channel that is to be left alone will have a 0 in the corresponding location.  The MSB of the first byte will be channel 31 (or 23 or 15) and the LSB of the fourth (or third or second) byte will be channel 0.  Thus, if all 32 channels are to be used, but only channels 14 through 26 are to be programmed, the packet would contain:
   
{| align="center" cellpadding="4" border="0" cellspacing="0" style="text-align:left"
 
{| align="center" cellpadding="4" border="0" cellspacing="0" style="text-align:left"
 
! First data byte
 
! First data byte
Line 70: Line 69:  
| 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0
 
| 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0
 
|}
 
|}
 +
Following this are 64 (or 48 or 32) bytes of programming data.  The first two bytes are for channel 31 (or 23 or 15) and the last two bytes are for channel 0.  Each channel has 14 bits, so the format is two leading zeros and 6 MSB of data is the first byte, then 8 LSB of data in the second byte.  All channels are present in the packet, but only those marked in the mask will be programmed; all other bytes will be ignored and can take on any value.  The total size of a programming packet is:
 +
{| align="center" cellpadding="4" border="0" cellspacing="0" style="text-align:center"
 +
! Number of channels
 +
! Bytes per Packet
 +
|-
 +
| 32 || 69
 +
|-
 +
| 24 || 52
 +
|-
 +
| 16 || 35<sup>*</sup>
 +
|}
 +
Since the minimum number of data bytes in a packet is 46, the packet may need to be padded if only 16 channels are to be used.  Padding may not be necessary if the PC includes layer 3 and layer 4 data.
461

edits

Navigation menu