JAJSLP3 june 2023 AFE43902-Q1 , AFE53902-Q1
PRODUCTION DATA
The state machine converts a temperature input to a voltage output based on the values saved in the thermal foldback profile. The voltage output from the temperature sensor is read by the ADC and converted to an ADC code. There are three X and Y points available to map the ADC codes (X points) to a temperature (Y points). These points can be used to apply linearization to the temperature sensor output. The ADC is 10-bits, so the maximum code is 1023d. Equation 9 calculates the ADC output code based on the voltage input.
This application example uses the 5-V VDD as the ADC reference. Equation 10 calculates the ADC code for a 2.5-V input.
Table 8-6 shows the ADC code to temperature mapping used in this application example. An NTC resistor is used as the temperature sensor. Higher ADC codes correspond to a lower temperature.
ADC CODE | TEMPERATURE |
---|---|
0x000 | 100°C |
0x200 | 50°C |
0x3FF | 0°C |
There are four X and Y points available to map the temperature (X points) to an output voltage (Y points). The voltage output is configured by a 10-bit DAC code. The maximum code is 1023d. Equation 11 calculates the DAC code for a desired voltage output.
This application example uses the 5-V VDD as the DAC reference. Equation 8 calculates the DAC code for a 1-V output.
Table 8-7 shows the temperature to output voltage mapping used in this application example. The profile can have both negative and positive slopes.
TEMPERATURE | OUTPUT VOLTAGE (CODE) |
---|---|
20°C | 4 V (0x320) |
50°C | 5 V (0x3FF) |
75°C | 3.4 V (0x2BC) |
100°C | 0 V (0x00) |
Follow these guidelines to setup the registers on the AFE53902-Q1:
REGISTER FIELD NAME | ADDRESS[FIELD] | ADDRESS LOCATION |
---|---|---|
X1-TEMPERATURE | 0x20[10:1] | SRAM |
Y1-TEMPERATURE | 0x21[7:0] | SRAM |
X2-TEMPERATURE | 0x22[10:1] | SRAM |
Y2-TEMPERATURE | 0x23[7:0] | SRAM |
X3-TEMPERATURE | 0x24[10:1] | SRAM |
Y3-TEMPERATURE | 0x25[7:0] | SRAM |
X1-OUTPUT | 0x26[7:0] | SRAM |
Y1-OUTPUT | 0x27[9:0] | SRAM |
X2-OUTPUT | 0x28[7:0] | SRAM |
Y2-OUTPUT | 0x29[9:0] | SRAM |
X3-OUTPUT | 0x2A[7:0] | SRAM |
Y3-OUTPUT | 0x2B[9:0] | SRAM |
X4-OUTPUT | 0x2C[7:0] | SRAM |
Y4-OUTPUT | 0x2D[9:0] | SRAM |
PWM-FREQUENCY | 0x2E[11:7] | SRAM |
DAC-0-VOUT-CMP-CONFIG | 0x15[12:10][4:0] | Register |
DAC-1-VOUT-CMP-CONFIG | 0x03[12:10][4:0] | Register |
COMMON-CONFIG | 0x1F[15:0] | Register |
DEVICE-MODE-CONFIG | 0x25[15:0] | Register |
STATE-MACHINE-CONFIG0 | 0x27[2:0] | Register |
Only the bits listed in the address column of Table 8-8 are saved in NVM and used in the state machine. For example, only bits 12 to 10 and 4 to 0 are saved in NVM for the DAC-x-VOUT-CMP-CONFIG registers.
The pseudocode for this application example is as follows:
//SYNTAX: WRITE <REGISTER NAME(Hex Code)>, <MSB DATA>, <LSB DATA>
//Stop the state machine
WRITE STATE-MACHINE-CONFIG0(0x27), 0x00, 0x03
//Set the thermal foldback profile values
//The voltage output is a 10-bit value
WRITE X1-TEMPERATURE(SRAM 0x20), 0x00, 0x00
WRITE Y1-TEMPERATURE(SRAM 0x21), 0x00, 0x64
WRITE X2-TEMPERATURE(SRAM 0x22), 0x04, 0x00
WRITE Y2-TEMPERATURE(SRAM 0x23), 0x00, 0x32
WRITE X3-TEMPERATURE(SRAM 0x24), 0x07, 0xFF
WRITE Y3-TEMPERATURE(SRAM 0x25), 0x00, 0x00
WRITE X1-OUTPUT(SRAM 0x26), 0x00, 0x14
WRITE Y1-OUTPUT(SRAM 0x27), 0x03, 0x20
WRITE X2-OUTPUT(SRAM 0x28), 0x00, 0x32
WRITE Y2-OUTPUT(SRAM 0x29), 0x03, 0xFF
WRITE X3-OUTPUT(SRAM 0x2A), 0x00, 0x4B
WRITE Y3-OUTPUT(SRAM 0x2B), 0x02, 0xBC
WRITE X4-OUTPUT(SRAM 0x2C), 0x00, 0x64
WRITE Y4-OUTPUT(SRAM 0x2D), 0x00, 0x00
//Set the channel 0 reference to VDD, enable the comparator for ADC mode (this is the device default)
WRITE DAC-0-VOUT-CMP-CONFIG(0x15), 0x04, 0x01
//Set channel 1 reference to VDD (this is the device default)
WRITE DAC-1-VOUT-CMP-CONFIG(0x03), 0x04, 0x00
//Power on the DAC and ADC channel
WRITE COMMON-CONFIG(0x1F), 0x03, 0xF9
//Set the device mode (this is the device default)
WRITE DEVICE-MODE-CONFIG(0x25), 0x90, 0x00
//Start the state machine
WRITE STATE-MACHINE-CONFIG0(0x27), 0x00, 0x03
//Save settings to NVM
WRITE COMMON-TRIGGER(0x20), 0x00, 0x02