Manual

RF22
Version: 0.1 Date: 12/23/2008
Tel: +86-755-82973805 Fax: +86-755-82973550 E-mail: sales@hoperf.com http://www.hoperf.com
62
2 dio2 Direct I/O for GPIO2.
If the GPIO2 is configured to be a direct output then the value on the GPIO pin can be set here.
If the GPIO2 is configured to be a direct input then the value of the pin can be read here.
1 dio1 Direct I/O for GPIO1.
If the GPIO1 is configured to be a direct output then the value on the GPIO pin can be set here.
If the GPIO1 is configured to be a direct input then the value of the pin can be read here.
0 dio0 Direct I/O for GPIO0.
If the GPIO0 is configured to be a direct output then the value on the GPIO pin can be set here.
If the GPIO0 is configured to be a direct input then the value of the pin can be read here.
Register 0Fh. ADC Configuration
Bit D7 D6 D5 D4 D3 D2 D1 D0
Name
adcstart/adcdone
adcsel[2:0] adcref[1:0]
adcgain[1:0]
Type R/W
R/W
R/W
R/W
Reset value = 00000000
Bit Name Function
7
adcstart/adcdone
ADC Measurement Start Bit.
Reading this bit gives 1 if the ADC measurement cycle has been finished.
6:4 adcsel[2:0] ADC Input Source Selection.
The internal 8 bit ADC input source can be selected as follows:
000: Internal Temperature Sensor
001: GPIO0, single-ended
010: GPIO1, single-ended
011: GPIO2, single-ended
100: GPIO0(+) – GPIO1(–), differential
101: GPIO1(+) – GPIO2(–), differential
110: GPIO0(+) – GPIO2(–), differential
111: GND
3:2 adcref[1:0] ADC Reference Voltage Selection.
The reference voltage of the internal 8 bit ADC can be selected as follows:
0X: bandgap voltage (1.2V)
10: VDD / 3
11: VDD / 2
1:0 adcgain[1:0] ADC Sensor Amplifier Gain Selection.
The full scale range of the internal 8 bit ADC in differential mode (see adcsel) can be set as
follows:
adcref[0] = 0: adcref[0] = 1:
FS = 0.014 * (adcgain[1:0] + 1) * VDD FS = 0.021 * (adcgain[1:0] + 1) * VDD
Register 10h. ADC Sensor Amplifier Offset
Bit D7 D6 D5 D4 D3 D2 D1 D0
Name Reserved adcoffs[3:0]
Type R R/W
Reset value = xxxx0000
Bit Name Function
7:4 Reserved Reserved.
3:0 adcoffs[3:0] ADC Sensor Amplifier Offset*.
*Note: The offset can be calculated as Offset = adcoffs[2:0] * VDD / 1000; MSB = adcoffs[3] = Sign bit.
Register 11h. ADC Value
Bit D7 D6 D5 D4 D3 D2 D1 D0
Name
adc[7:0]
Type R