ADE5166_08 AD [Analog Devices], ADE5166_08 Datasheet - Page 143

no-image

ADE5166_08

Manufacturer Part Number
ADE5166_08
Description
Single-Phase Energy Measurement IC with 8052 MCU, RTC, and LCD Driver
Manufacturer
AD [Analog Devices]
Datasheet
Table 168. Port 0 Alternate Functions
Pin
No.
P0.0
P0.1
P0.2
P0.3
P0.4
P0.5
P0.6
P0.7
Table 169. Port 1 Alternate Functions
Pin
No.
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
Table 170. Port 2 Alternate Functions
Pin
No.
P2.0
P2.1
P2.2
P2.3
Alternate Function
BCTRL external battery control input
INT1 external interrupt
INT1 wake-up from PSM2 operating mode
FP19 LCD segment pin
CF1 ADE calibration frequency output
CF2 ADE calibration frequency output
MOSI SPI data line
SDATA I
MISO SPI data line
Zero Crossing Detection 2
SCLK serial clock for I
T0 Timer 0 input
SS SPI slave select input for SPI in slave mode
SS SPI slave select output for SPI in master mode
T1 Timer 1 input
RxD2 receiver data input for UART2
RxD2 edge wake-up from PSM2 operating
mode
Alternate Function
RxD receiver data input for UART
TxD transmitter data output for UART
FP25 LCD segment pin
Zero-Crossing Detection 1
FP24 LCD segment pin
T2EX Timer 2 control input
FP23 LCD segment pin
T2 Timer 2 input
FP22 LCD segment pin
FP21 LCD segment pin
FP20 LCD segment pin
Alternate Function
FP18 LCD segment pin
FP17 LCD segment pin
FP16 LCD segment pin
SDEN serial download pin sampled on reset;
P2.3 is an output only; TxD2 is the transmitter
data output for UART2
2
C data line
2
C or SPI
Alternate Function Enable
Set INT1PRG = X01 in the interrupt pins configuration SFR (INTPR, Address 0xFF[3:1]).
Set EX1 in the interrupt enable SFR (IE, Address 0xA8).
Set INT1PRG = 11x in the interrupt pins configuration SFR (INTPR, Address 0xFF[3:1]).
Set FP19EN in the LCD Segment Enable 2 SFR (LCDSEGE2, Address 0xED).
Clear the DISCF1 bit in the ADE energy measurement internal MODE1 register
(Address 0x0B).
Clear the DISCF2 bit in the ADE energy measurement internal MODE1 register
(Address 0x0B).
Set the SCPS bit in the configuration SFR (CFG, Address 0xAF), and set the SPIEN bit
in SPI Configuration SFR 2 (SPIMOD2, Address 0xE9).
Clear the SCPS bit in the configuration SFR (CFG, Address 0xAF), and set the I2CEN
bit in the I
Set the SCPS bit in the configuration SFR (CFG, Address 0xAF), and set the SPIEN bit
in SPI Configuration SFR 2 (SPIMOD2, Address 0xE9).
Set the ZX2 bit in the MODE3 energy measurement SFR (MODE3, Address 0x2B)
Set the I2CEN bit in the I
Configuration SFR 2 (SPIMOD2, Address 0xE9) to enable the I
Set the C/T0 bit in the Timer/Counter 0 and Timer/Counter 1 mode SFR (TMOD,
Address 0x89) to enable T0 as an external event counter.
Set the SS_EN bit in SPI Configuration SFR 1 (SPIMOD1, Address 0xE8).
Set the SPIMS_b bit in SPI Configuration SFR 2 (SPIMOD2, Address 0xE9).
Set the C/T1 bit in the Timer/Counter 0 and Timer/Counter 1 mode SFR (TMOD,
Address 0x89) to enable T1 as an external event counter.
Set the REN2 bit in the serial communications control SFR (SCON2, Address 0xE1).
Set RXPROG[1:0] = 11 in the peripheral configuration SFR (PERIPH, Address 0xF4).
Alternate Function Enable
Set the REN bit in the serial communications control register SFR (SCON, Address
0x98).
This pin becomes TxD as soon as data is written into SBUF.
Set FP25EN in the LCD segment enable SFR (LCDSEGE, Address 0x97).
Set the ZX1 bit in the MODE3 energy measurement SFR (MODE3, Address 0x2B)
Set FP24EN in the LCD segment enable SFR (LCDSEGE, Address 0x97).
Set EXEN2 in the Timer/Counter 2 control SFR (T2CON, Address 0xC8).
Set FP23EN in the LCD segment enable SFR (LCDSEGE, Address 0x97).
Set the C/T2 bit in the Timer/Counter 2 control SFR (T2CON, Address 0xC8) to
enable T2 as an external event counter.
Set FP22EN in the LCD segment enable SFR (LCDSEGE, Address 0x97).
Set FP21EN in the LCD segment enable SFR (LCDSEGE, Address 0x97).
Set FP20EN in the LCD segment enable SFR (LCDSEGE, Address 0x97).
Alternate Function Enable
Set FP18EN in the LCD Segment Enable 2 SFR (LCDSEGE2, Address 0xED).
Set FP17EN in the LCD Segment Enable 2 SFR (LCDSEGE2, Address 0xED).
Set FP16EN in the LCD Segment Enable 2 SFR (LCDSEGE2, Address 0xED).
Enabled by default. This pin becomes TxD2 as soon as data is written into SBUF2.
Rev. 0 | Page 143 of 148
2
C mode SFR (I2CMOD, Address 0xE8).
2
C mode SFR (I2CMOD, Address 0xE8) or the SPIEN bit in SPI
ADE5166/ADE5169
2
C or SPI interface.

Related parts for ADE5166_08