SC5313A Operating & Programming Manual
Rev 1.0.2
17
Q
U E R Y I N G T H E
S C 5 3 1 3 A :
W
R I T I N G T O
R
E Q U E S T
R
E G I S T E R S
The registers to read data back from the device (such as device status) are accessed through the
sc5313a_RegRead
function. The function and parameter format for this command is
sc5313a_RegRead(deviceHandle, registerCommand, instructWord,*dataOut)
. Any instructions in
addition to the register call are placed into “instructWord”, and data obtained from the device is
returned via the pointer value
dataOut
. The set of request registers are shown in Table 5.
Table 5. Query registers.
Register Name
Register
Address
Serial
Range
Bit 7
(MSB)
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
GET_TEMPERATURE
0x20
[7:0]
Open
Open
Open
Open
Open
Open
Open
Open
GET_DEVICE_STATUS
0x21
[7:0]
Open
Open
Open
Open
Open
Open
Open
Open
USER_EEPROM_READ
0x23
[7:0]
EEPROM Address [7:0]
[15:8]
EEPROM Address [15:8]
CAL_EEPROM_READ
0x24
[7:0]
EEPROM Address [7:0]
[15:8]
EEPROM Address [15:8]
To read from the device using native USB transfers instead of the
sc5313a_RegRead
function requires
two operations. First, a write transfer is made to the device
ENPOINT_OUT
to tell the device what data
needs to be read back. Then, a read transfer is made from
ENDPOINT_IN
to obtain the data. The
number of valid bytes returned varies from 1 to 3 bytes. See the register details below.
Reading the Device Temperature
GET_TEMPERATURE (0x17)
-
Data returned by this register needs to be processed to correctly represent
data in temperature units of degrees Celsius. Data is returned in the first 14 bits [13:0]. Bit [13] is the
polarity bit indicating whether it is positive (0x0) or negative (0x1). For an ENDPOINT_IN transfer, data is
returned in 2 bytes with the MSB first. The temperature value represented in the raw data is contained
in the next 13 bits [12:0]. To obtain the temperature ADC code, the raw data should be masked (bitwise
AND’ed) with 0x1FFF, and the polarity should be masked with 0x2000. The conversion from 12 bit ADC
code to an actual temperature reading in degrees Celsius is shown below:
Positive Temperature (bit 13 is 0)
= ADC code / 32
Negative Temperature (bit 13 is 1) = (ADC code – 8192) / 32
It is not recommended to read the temperature too frequently, especially once the temperature of the
SC5313A has stabilized. The temperature sensor is a serial device located inside the RF module.
Therefore, like any other serial device, reading the temperature sensor requires a sending serial clock
and data commands from the processor. The process of sending clock pulses on the serial transfer line
may cause unwanted spurs on the RF signal as the serial clock could potentially modulate the externally-
supplied LO signal within the device.