SC5313A Operating & Programming Manual
Rev 1.0.2
18
Reading the Device Status
GET_DEVICE_STATUS (0x21)
- This register, summarized in Table 6, returns the device status
information such as phase lock status of the PLL, current reference settings, etc. Data is contained in the
first three bytes.
Table 6. Description of the status data bits.
Bit Description
[4] RF AMP#1 Enable
[3] RF AMP#2 Enable
[2] RF Path Selection
[1] LO Output Enable
[0] Device accessed
Reading the User EEPROM
USER_EEPROM_READ (0x23)
- Once data has been written to the user EEPROM, it can be retrieved by
calling this register and using the process outlined below for reading calibration data. The maximum
address for this EEPROM is 0x7FFF. A single byte is returned.
Reading the Calibration EEPROM
CAL_EEPROM_READ (0x24)
- 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 7.
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.
Converting to floating point representation is slightly more involved. First, convert the 4 bytes into an
unsigned 32-bit integer value, 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:
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;