BL602/604 Reference Manual
The gpadc_data_out register stores the ADC result. This result contains the ADC result, sign bit and channel infor-
mation. The data format is as follows:
Table 4.3: Meaning of ADC conversion result
BitS 25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
me
an
Positive channel
number
Negative channel
number
Conversion result
bit21-bit25 of the conversion result is the positive channel number, bit16-bit20 is the negative channel number, and
bit0-bit15 is the converted value.
The gpadc_res_sel control bit can set the number of bits of the conversion result, which are 12 bits, 14 bits, and
16 bits, respectively. Among them, 14 bits and 16 bits are the results obtained by multiple sampling to improve the
accuracy.
The values that can be set are as follows:
• 3’b000 12bit 2MS/s, OSR=1
• 3’b001 14bit 125kS/s, OSR=16
• 3’b010 14bit 31.25kS/s, OSR=64
• 3’b011 16bit 15.625KS/s, OSR=128
• 3’b100 16bit 7.8125KS/s, OSR=256
The ADC conversion result is left-justified. When 12 bits are selected, bit15-bit4 of the conversion result is valid.
When 14 bits are selected, bit15-bit2 of the conversion result is valid. When 16 bits are selected, bit15-bit0 of the
conversion result is valid.
Similarly, in the differential mode, the highest is the sign, that is, when 14 bits are selected, bit15 is the sign bit,
bit14-bit2 is the conversion result, and bit14 is the MSB.
In single-ended mode, there is no sign bit, that is, when 12 bits are selected, bit15-bit4 is the conversion result and
bit15 is the MSB.
In actual use, the results of the ADC are generally placed in the FIFO, which is particularly important in the multi-
channel scan mode. Therefore, users generally obtain conversion results from the ADC FIFO. The data format of the
ADC FIFO is the same in the gpadc_data_out register.
4.3.6 ADC interrupt
The ADC module can generate interrupts when the positive sampling is saturated and the negative sampling is satu-
rated. The respective interrupts can be masked by gpadc_pos_satur_mask, gpadc_neg_satur_mask.
BL602/604 Reference Manual
50/ 195
@2020 Bouffalo Lab