SC5506A Operating & Programming Manual
Rev 2.1.1
18
Reading the Calibration EEPROM
CAL_EEPROM_READ (0x21)
- Reading a single byte from an address in the device EEPROM is performed
by writing this register with the address for the instructWord. The data is returned as a byte. The CAL
EEPROM maximum address is also 0x7FFF. Reading above this address will cause the device to retrieve
data from the lower addresses. For example, addressing 0x8000 will return data stored in address location
0x0000. The calibration EEPROM map is shown in Table 8Table 8. Calibration EEPROM map..
All calibration data, whether floats, unsigned 8-bit, unsigned 16-bit or unsigned 32-bit integers, are stored
as flattened unsigned byte representation. A float is flattened to 4 unsigned bytes, so once it is read back
it needs to be un-flattened back to its original type. Unsigned values containing more than a single byte
are converted (un-flattened) simply by concatenation of the bytes through bit-shifting. The starting lower
address contains the least significant byte. Converting to floating point representation is slightly more
involved. First, convert the 4 bytes into an unsigned 32-bit integer value through concatenation, and then
(in C/C++) type-cast a float pointer to the address of the value. In C/C++, the code would be float Y = *(float
*)&X, where X has been converted earlier to an unsigned integer.
An example written in C code would look something like the following:
Reading the RF ALC DAC Value
GET_ALC_DAC_VALUE (0x39)
- The user may be interested to obtain the current value of the ALC DAC for
the purpose of making minor adjustments to the RF output power level. Data is returned in 2 bytes and
only the first 14 bits contain valid data.
Reading the Device Parameters
(firmware >= rev 4.0 )
GET_DEVICE_PARAMS (0x25)
- This register will return either the channel frequency or power level,
depending on the input byte value.
0: ch1 frequency
1: ch1 power level
2: ch2 frequency
3: ch2 power level
The frequency value comes back in Hz, occupying 5 returned bytes. The power level come back in 100
th
of
dBm masked by 0x7FFF of the first 2 of the 5 bytes. The mask 0x8000 is the sign bit.
byte_value[4]; // read in earlier
unsigned int
uint32_value;
float
float32_value;
int
count = 0;
while
(count < 4) {
uint32_value = unit32_value | (byte_value[count] <<
(count*8));
count++;
}
float32_value = *(
float
*)&uint32_value;