You are on page 1of 32

BL0940 Calibration-free Metering IC

BL0940 datasheet

BL0940 Calibration-free Metering IC

Datasheet

Shanghai Belling Corp., Ltd. 1 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

Version update
Version Date Content Author

V1.0 2018/06/07 create LK,HCJ

V1.1 2019/12/25 modification LK,HCJ

Sync with Chinese


V1.2 2021/12/1 YCN
version

Shanghai Belling Corp., Ltd. 2 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

Catalog
Version update .................................................................................................................................................... 2

1 Product Description ..................................................................................................................................... 5

1.1 Function Introduction ................................................................................................................... 5

1.2 System Block Diagram .................................................................................................................. 6

1.3 Description of Package and Pins ................................................................................................... 7

1.4 Register list ................................................................................................................................... 8

1.5 Special Register Description ......................................................................................................... 9

1.5.1 User mode selection register ................................................................................................ 9

1.5.2 Temperature mode control register ................................................................................... 10

1.6 Performance ............................................................................................................................... 11

1.6.1 Electronic Characteristic Parameter ................................................................................... 11

1.6.2 Absolute Maximum Rations ................................................................................................ 12

2 Function Description .................................................................................................................................. 13

2.1 Current and voltage transient waveform measurement ........................................................... 13

2.2 Active Power ............................................................................................................................... 14

2.3 Active power offset correction ................................................................................................... 14

2.4 Active power anti-creep ............................................................................................................. 15

2.5 Energy Measurement ................................................................................................................. 16

2.6 Current and Voltage RMS ........................................................................................................... 17

2.7 RMS offset calibration of current and voltage ........................................................................... 18

2.8 Over-current Detection .............................................................................................................. 18


Shanghai Belling Corp., Ltd. 3 / 32
810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

2.9 Phase Angle Calculation.............................................................................................................. 20

2.10 Zero Crossing Detection ............................................................................................................. 21

2.11 Temperature Measurement ....................................................................................................... 22

3 3 Communication Interface ....................................................................................................................... 24

3.1 SPI ............................................................................................................................................... 24

3.1.1 Operation Mode.................................................................................................................. 24

3.1.2 Frame Structure .................................................................................................................. 25

3.1.3 Write Operation Timing ...................................................................................................... 25

3.1.4 Read Operation Timing ....................................................................................................... 26

3.1.5 Fault-tolerant mechanism of SPI interface ......................................................................... 26

3.2 UART ........................................................................................................................................... 27

3.2.1 Description .......................................................................................................................... 27

3.2.2 Byte Formation ................................................................................................................... 27

3.2.3 Write Timing........................................................................................................................ 27

3.2.4 Read Timing......................................................................................................................... 28

3.2.5 Packet sending mode .......................................................................................................... 29

3.2.6 Protection mechanism of UART interface........................................................................... 30

4 Order Information...................................................................................................................................... 30

5 Package ...................................................................................................................................................... 30

Shanghai Belling Corp., Ltd. 4 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

1 Product Description

1.1 Function Introduction


BL0940 is a built-in clock and calibration-free energy metering IC, suitable for single-phase
multifunctional electricity meter, smart socket, smart home appliances, electric bicycle charging pile and
other applications with better cost performance.

BL0940 integrates 2 high-precision sigma-delta ADCs to measure current and voltage simultaneously. It
can measure electric parameters such as current and voltage RMS, active power, active energy, fast current
RMS (for over-current protection), and temperature detection, waveform output and so on. BL0940 output
data through the UART or SPI interface. It is available for the smart socket, smart appliances, single-phase
multi-function power meter, electric bicycle charging pile and information requirement of data acquisition in
electricity applications.

BL0940 has a patented anti-creep design, which can be combined with reasonable external hardware
design to ensure that the noise energy cannot be calculated in the energy pulse when there is no load

Features

⚫ 2 high-precision sigma-delta ADCs for current and voltage measuring


⚫ The range of current(10mA~35A)@1mohm
⚫ The range of Active energy(1w~7700w)@1mohm@220V
⚫ Measure RMS Voltage and Current, fast current RMS, Active Power, Active Energy
⚫ The gain error is less than 1%, calibration-free when peripheral components meet certain conditions.
⚫ the current channel support over-current monitoring function, the threshold and response time can be
configured.
⚫ Voltage zero-Crossing logic output
⚫ Built-in waveform register for load type analysis
⚫ Built-in temperature sensor
⚫ SPI(≤900KHz)/UART(4800bps)
⚫ On-chip power supply monitoring, IC reset when VDD is lower than 2.7V(typical).
⚫ On-chip voltage reference of 1.218V
⚫ On-chip 4MHz oscillator circuit
⚫ Power supply 3.3v, low power consumption 10mW (typical)
⚫ TSSOP14
Shanghai Belling Corp., Ltd. 5 / 32
810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

1.2 System Block Diagram

VDD

Internal Power
LDO
BL0940 Clock On/Reset

SEL
IP1
PGA SDM UART SCLK
IN1
/SPI RX/SDI
TX/SDO

DSP ZX
CF

VP REG
VN
PGA SDM

1.2V
Reference Temperature
OTP
Voltage Sensor

GND VT VPP

Figure 1

Shanghai Belling Corp., Ltd. 6 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

1.3 Description of Package and Pins

VDD 1 14 VPP
VT 2 13 TX/SDO
IP1 3 12 RX/SDI
IN1 4 BL0940 11 SCLK
VP 5 10 SEL
VN 6 9 CF
GND 7 8 ZX

Figure 2

Pins description(TSSOP14)

Pin Symbol Description


1 VDD Power supply(+3.3V)
2 VT External temperature sensor(NTC) signal input
3,4 IP1,IN1 Analog input of current channel, maximum differential voltage has a maximum
input range of ±50mV(35mV RMS)
5,6 VP,VN Analog input for voltage channel, this differential input has a maximum input range
of ±100mV(70mV RMS)
7 GND GND
8 ZX Voltage channel zero-crossing output pin
9 CF Energy pulse output, multiplex function refer to MODE register description
10 SEL Interface select pin (0: UART 1: SPI), pull-down resistance inside, disconnect is low-
level (UART), connected to VDD is high-level (SPI)
11 SCLK SPI clock input. If using UART interface, this pin doesn’t need be connected.
12 RX/SDI Data input for SPI interface/Receive line for UART interface
13 TX/SDO Data output for SPI interface/Transmit line for UART interface, this pin require
external pull-up resistor.
14 VPP Reserved

Shanghai Belling Corp., Ltd. 7 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

1.4 Register list


Addres Externa Internal
Symbol Bits Default Description
s l R/W R/W
Electrical parameter register (read only)
0x00 I_FAST_RMS R W 24 0x000000 Fast current RMS, unsigned
0x01 I_WAVE R W 24 0x000000 Current waveform register, signed
0x03 V_WAVE R W 24 0x000000 Voltage waveform register, signed
0x04 I_RMS R W 24 0x000000 Current RMS, unsigned
0x06 V_RMS R W 24 0x000000 Voltage RMS register, unsigned
0x08 WATT R W 24 0x000000 Active power register, signed
0x0A CF_CNT R W 24 0x000000 Active energy pulse count, unsigned
Current voltage waveform phase angle
0x0C CORNER R W 16 0x0000
register
0x0E TPS1 R W 10 0x000 Internal temperature register, unsigned
0x0F TPS2 R W 10 0x000 External temperature register, unsigned
User operated register (read and write)
I_FAST_RMS_
0x10 R/W R 16 0xFFFF Fast current RMS control register
CTRL
0x13 I_RMSOS R/W R 8 0x00 Current RMS offset adjust register
0x15 WATTOS R/W R 8 0x00 Active power offset adjust register
0x17 WA_CREEP R/W R 8 0x0B Active power no-load threshold register
0x18 MODE R/W R 16 0x0000 User mode selection register
When 0x5A5A5A is written, the user area
0x19 SOFT_RESET R/W R 24 0x000000
register is reset to default
Write protection register. After writing
USR_WRPRO 0x55, the user operation register can be
0x1A R/W R 8 0x00
T written. Write other values, user
operated register area is not writable
0x1B TPS_CTRL R/W R 16 0x07FF Temperature mode control register
External temperature sensor gain
0x1C TPS2_A R/W R 8 0x0000
coefficient adjust register
External temperature sensor offset
0x1D TPS2_B R/W R 8 0x0000
coefficient adjust register

Shanghai Belling Corp., Ltd. 8 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

1.5 Special Register Description

1.5.1 User mode selection register

0x18 MODE User mode selection register


No. Symbol Default Description
[7:0] reserved 0b00000000 reserved
0: 400ms
8 RMS_UPDATE_SEL 0b0 RMS register update rate
1: 800ms
0: 50Hz
9 AC_FREQ_SEL 0b0 AC frequency select
1: 60Hz
[11:10] reserved 0b00 reserved
0: energy pulse, enable
CF output function by MODE[11] configured
12 CF_UNABLE 0b0
selection 1: alarm, enable by
TPS_CTRL[14] configured
[15:13] reserved 0b000 reserved

Shanghai Belling Corp., Ltd. 9 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

1.5.2 Temperature mode control register

0x1B TPS_CTRL Temperature mode control register


No. Symbol Default Description
[15] Temperature switch, 0:on
default 0b0 1:off
0:Temperature alarm on
[14] Alarm switch,
1:Over-current and leakage
default 0b0,
alarm on
00:Automatic temperature
measurement
[13:12] Temperature 01:the same as 00
measurement selection, 10: Internal temperature
0x1B TPS_CTRL 0x07FF default 0b00 measurement
11: External temperature
measurement
00:50ms
[11:10] Temperature
01:100ms
measurement interval
10:200ms
default 0b01
11:400ms
[ 9:0] External temperature
Alarm when TPS2 register
measurement alarm threshold
value is greater than it.
setting, default 0x3FF

Shanghai Belling Corp., Ltd. 10 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

1.6 Performance

1.6.1 Electronic Characteristic Parameter

(VDD =3.3V,GND=0V,on-chip voltage reference,on-chip crystals,25℃,energy is measured by CF output)


Measuring project Symbol Conditions MIN. TYPE MAX. Unit
VDD VDD 3.0 3.6 V
Power consumption Iop VDD=3.3V 3 mA
4000:1 Input dynamic
Measuring range
range
Active energy
35A~100mA Input@
measurement accuracy 0.2 %
1mohm sampling resistor
(large signal)
Active energy
100mA~50mA Input@
measurement accuracy 0.4 %
1mohm sampling resistor
(small signal)
Active energy
50mA~10mA Input@
measurement accuracy 0.6 %
1mohm sampling resistor
(tiny signal)
RMS measurement 35A~100mA Input@
0.2 %
accuracy(large signal) 1mohm sampling resistor
RMS measurement 100mA~50mA Input@
2 %
accuracy(small signal) 1mohm sampling resistor
RMS measurement 50mA~10mA Input@
6 %
accuracy(tiny signal) 1mohm sampling resistor
50Hz Can be set to cycle/half 10 40 mS
Fast RMS response time
60Hz cycle 8.3 33 mS
Zero-crossing signal output
571 uS
delay
Measurement error caused
Phase advance 37゜
by phase angle between PF08err 0.5 %
(PF=0.8)
channels (capacitance)

Measurement error caused


Phase delay 60゜
by phase angle between PF05err 0.5 %
(PF=0.5)
channels (sensibility)

AC power suppression
(output frequency ACPSRR IP/N=100mV 0.1 %
amplitude variation)

Shanghai Belling Corp., Ltd. 11 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

DC power suppression
(output frequency DCPSRR VP/N=100mV 0.1 %
amplitude variation)
Differential current input
Analog input level (current) 50 mV
(peak)
Differential voltage input
Analog input level (voltage) 100 mV
(peak)
Analog input impedance 370 kΩ
SEL pull-down resistor SEL(pull-down) 56.9 kΩ
Analog input bandwidth (-3dB) 3.5 kHz
Internal voltage reference Vref 1.218 V
Logic input high-level VDD=3.3V±5% 2.6 V
Logic input low-level VDD=3.3V±5% 0.8 V
VDD=3.3V±5%
Logic output high-level VDD-0.5 V
IOH=5mA
VDD=3.3V±5%
Logic output low-level 0.5 V
IOL=5mA

1.6.2 Absolute Maximum Rations

(T = 25 ℃)
Parameter Symbol Value Unit
Power Voltage VDD -0.3 ~ +4 V
Analog Input Voltage to GND IP1,VP -4 ~ +4 V
Digital Input Voltage to GND UART_SEL,RX/SDI -0.3 ~ VDD+0.3 V
Digital Output Voltage to GND CF,TX/SDO -0.3 ~ VDD+0.3 V
Operating Temperature Range Topr -40 ~ +105 ℃
Storage Temperature Range Tstr -55 ~ +150 ℃

Shanghai Belling Corp., Ltd. 12 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

2 Function Description
BL0940 is composed of analog signal processing module and digital signal processing module. The
analog module includes two-channel PGA, two-channel sigma-delta ADC, internal clock, power on/reset
monitor, temperature sensor and other related analog modules. The digital module is digital signal
processing module (DSP).

2.1 Current and voltage transient waveform measurement

IP1
PGA ADC SINC3 HPF I_WAVE
IN1

VP PGA ADC SINC3 HPF V_WAVE

Figure 3

BL0940 has two high precision ADCs, the current signal is differential signal. Current channel is IP1/IN1,
voltage channel is VP/VN.

The current and voltage waveform data are updated at a rate of 7.8k. Each sampled data is 20bit signed
value, which are saved in waveform registers (I_WAVE, V_WAVE). The waveform value can be read
continuously when the SPI rate is greater than 375Kbps.

External Internal
Address Symbol Bits Default Description
R/W R/W
0x01 I_WAVE R W 24 0x000000 Current waveform register
0x03 V_WAVE R W 24 0x000000 Voltage waveform register
Bit[19:0] are valid, Bit[19] is the sign bit. Bit[19]=0 means the waveform data is positive and Bit[19]=1
means the waveform data is negative, in complement form. Bit[23:20] are filled with 0.

Shanghai Belling Corp., Ltd. 13 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

2.2 Active Power

WA_CREEP RMS_UPDATE_SEL

I_WAVE
LPF_ WATT
× + AVERAGE WATT
WATT ANTI-CREEP
V_WAVE WATT_t
WATTOS

Figure 4

External Internal
Address Symbol Bits Default Description
R/W R/W
0x08 WATT R W 24 0x000000 Active power register

Formula for calculating active power:

4046∗𝐼(𝐴)∗𝑉(𝑉)∗Cos(φ)
WATT =
𝑉𝑟𝑒𝑓2

I(A) and V(V) are the voltage RMS of analog input PIN(IP&IN, VP&GND), φ is the phase angle
between I(A) and V(V) (AC signal), Vref is the on-chip reference voltage, the typical value is 1.218v.

This register indicates whether the active power is positive or negative. Bit[23] is the symbol Bit.
Bit[23]=0 means the current power is positive and Bit[23]=1 means the current power is negative, in
complement form.

2.3 Active power offset correction


BL0940 has one 8-bit active power offset adjust register (WATTOS), default value is 00H.It eliminate the
offset of active power in the measurement of electric energy with the data in the form of complement of 2.
Bit[7] is the symbol Bit. The offset may come from board level noise or crosstalk. Offset adjustment can
make the values in the active power register close to 0 with no load.

Shanghai Belling Corp., Ltd. 14 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

External Internal
Address Symbol Bits Default Description
R/W R/W
0x15 WATTOS R/W R 8 0x00 Active power offset adjust register

WATT − WATT0
WATTOS =
8 × 3.05172

WATT is the active power after adjustment, and WATT0 is the active power before adjustment.

2.4 Active power anti-creep


BL0940 has the patented power anti-creep function, which ensures that the power of board level noise
will not accumulate when there is no load.

This register is 8bit unsigned data, default value is 0BH. The corresponding relationship between this
value and the active power register value is shown in the following formula. When the absolute value of the
input active power signal is less than this value, the output active power is set to 0. This can make the value
of the active power register is 0 and the energy does not accumulate in the case of no load, even if there is a
tiny noise signal.

External Internal
Address Symbol Bits Default Description
R/W R/W
0x17 WA_CREEP R/W R 8 0x0B Active power no-load threshold register

Set WA_CREEP based on the value of the power register WATT, their corresponding relationship as
below:

WATT
WA_CREEP =
3.0517578125∗8

Note: when the channel is in the anti-creep state, the RMS current register of this channel is
also set to 0.

Shanghai Belling Corp., Ltd. 15 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

2.5 Energy Measurement


BL0940 provides energy pulse measurement. The active instantaneous power is integrated by time to
get active energy and output calibration pulse in proportion. CF_CNT register saves the count of output
energy pulse.

CF_CLR

WATT_t ∫ counter CF_CNT

CF

Figure 5

External Internal
Address Symbol Bits Default Description
R/W R/W
0x0A CF_CNT R W 24 0x000000 Active energy pulse count

The count of active energy pulses corresponds to the consumption of electricity. The result is saved in
CF_CNT register. The count of pulses can be counted directly from the CF pin through I/O interruption. When
the period of CF is less than 180ms, the pulse is 50% duty cycle. When it is greater than or equal to 180ms,
the fixed pulse width of high-level is 90ms.

Note: CF_CNT is pulse algebraic sum accumulation. It means that pulse plus at positive
energy and minus at negative energy.

The cumulative time of each CF pulse:

1638.4∗256
tCF=
𝑊𝐴𝑇𝑇

WATT is the corresponding active power register value (WATT).

Shanghai Belling Corp., Ltd. 16 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

2.6 Current and Voltage RMS


The RMS of these channels is shown in the figure below. After the square circuit (X2), the low-pass filter
(LPF_RMS) and the ROOT circuit (ROOT), the instantaneous value RMS_t of RMS is calculated, and then the
average value of the two channels (I_RMS, V_RMS) is calculated.

I_WAVE x² LPF_RMS + root AVERAGE I_RMS

I_RMS_t
I_RMSOS RMS_UPDATE_SEL

V_WAVE x² LPF_RMS + root AVERAGE V_RMS

V_RMS_t
V_RMSOS RMS_UPDATE_SEL

Figure 6

External Internal
Address Symbol Bits Default Description
R/W R/W
0x04 I_RMS R W 24 0x000000 Current RMS register, unsigned
0x06 V_RMS R W 24 0x000000 Voltage RMS register, unsigned

0x18 MODE User mode selection register


No. Symbol Default Description
0: 400ms
8 RMS_UPDATE_SEL 0b0 RMS register update rate
1: 800ms
Set MODE[8].RMS_UPDAT_SEL, the average refresh time of RMS can be selected as 400ms or 800ms,
and the default value is 400ms. When a current channel is in anti-creep state, the RMS of the current
channel is 0.

324004∗𝐼(𝐴)
The current RMS conversion formula: I_RMS =
𝑉𝑟𝑒𝑓

79931∗𝑉(𝑉)
The voltage RMS conversion formula: V_RMS =
𝑉𝑟𝑒𝑓

𝑉𝑟𝑒𝑓 is the reference voltage, the typical value is 1.218V.

Shanghai Belling Corp., Ltd. 17 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

Note: I(A) is the input signal between IP1 and IN1 pins (mV), and V(V) is the input signal of VP
pins (mV).

2.7 RMS offset calibration of current and voltage


BL0940 has one 8-bit RMS offset register (I_RMSOS), whose default value is 00H. It is used to calibrate
the deviation in RMS with the complement form of 2.This deviation may come from the input noise. The
deviation calibration can make the value in the RMS register close to 0 without load.

External Internal
Address Symbol Bits Default Description
R/W R/W
0x13 I_RMSOS R/W R 8 0x00 Current RMS offset adjust register

RMS2 −RMS02
Calibration formula: RMSOS =
9.3132×215

RMS0 is the RMS current value before correcting and RMS is the RMS current value after correcting.

2.8 Over-current Detection


BL0940 has a fast RMS register, which can detect half cycle or cycle RMS. This function can be used for
over-current detection. The source of waveform L_WAVE is shown below. The absolute value of I_WAVE_F
accumulate by half-cycle or one cycle time, which is selected by FAST_RMS_CTRL[15]. The maximum
response time is 40ms (50Hz) or 33mS (60Hz) by setting AC_FREQ_SEL.

AC_FREQ_SEL
FAST_RMS

I_WAVE_F || ∫ >= flag_l


[23:9]
FAST_RMS_CTRL FAST_RMS_CTRL
[15] [14:0]

Figure 7

External Internal
Address Symbol Bits Default Description
R/W R/W
Shanghai Belling Corp., Ltd. 18 / 32
810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

Fast current RMS control


0x10 I_FAST_RMS_CTRL R/W R 16 0xFFFF
register
Set the refresh time to half-cycle or cycle by IFAST_RMS_CTRL, and set the fast RMS threshold (over-
current threshold).

No. Symbol Default Description


0: half-cycle
[15] Fast RMS refresh time
0x10 I_FAST_RMS_CTRL 0xFFFF 1: cycle
[14:0] Fast RMS threshold

0x18 MODE User mode selection register


No. Symbol Default Description
0:50Hz
9 AC_FREQ_SEL 0b0 AC frequency selection
1:60Hz
Set AC frequency by MODE[9].

External Internal
Address Symbol Bits Default Description
R/W R/W
0x00 I_FAST_RMS R W 24 0x000000 Fast current RMS
This register is updated according to one cycle or half-cycle. Bit[23:9] compare with the over-current
threshold FAST_RMS_CTRL [14:0]. If the value is greater than or equal to the threshold, CF pin outputs high-
level.

over-current alarm output indicator pin is CF, set MODE[12]=1 and TPS_CTRL[14]=1 before use it.

0x18 MODE User mode selection register


No. Symbol Default Description
0: energy pulse, enable by MODE[11]
CF output function configured
12 CF_UNABLE 0b0
selection 1: alarm, enable by TPS_CTRL[14]
configured
0x1B TPS_CTRL Temperature mode control register
No. Symbol Default Description
0: Temperature alarm on
Alarm
14 ALERT_CTRL 0b0
selection 1: over-current alarm on

The response time ofover-current is up to 2 cycles or 2 half-cycles because the fast RMS values are
updated by cycle or half-cycle.

Shanghai Belling Corp., Ltd. 19 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

2.9 Phase Angle Calculation


BL0940 has phase angle measurement function. The reactive quadrant can be indicated by the angle of
current and voltage respectively by calculating the positive zero-crossing time difference between current
and voltage. It is updated to the register CORNER when the current is positive zero crossing.

zx_pos_V

CORNER CORNER[15:0]
zx_pos_I

Figure 8

External Internal
Address Symbol Bits Default Description
R/W R/W
Current voltage waveform phase angle
0x0C CORNER R W 16 0x0000
register

V_WAVE

I_WAVE

Figure 9

𝑓𝑐
Phase Angle conversion formula: 2*pi*CORNER*
𝑓0

The unit is radian.

𝑓𝑐 is the frequency of the AC signal source, the default value is 50Hz. 𝑓0 is the sampling frequency, the
typical value is 1MHz.
Shanghai Belling Corp., Ltd. 20 / 32
810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

2.10 Zero Crossing Detection


BL0940 has the voltage zero-crossing detection function, and the zero-crossing signal is directly output
by pin ZX. When ZX=0, it indicates the positive half cycle of the waveform, and when ZX=1, it indicates the
negative half cycle of the waveform. The delay between the zero-crossing signal and the actual input signal is
about 570us.

570us

ZX

Figure 10

Shanghai Belling Corp., Ltd. 21 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

2.11 Temperature Measurement


BL0940 supports internal temperature measurement and external temperature measurement。

Turn on the alarm function, the CF pin will output high-level if the TPS2 is greater than or equal to the
alarm threshold, when the temperature value is lower than the alarm value or the alarm function is turned
off, the CF pin output low-level.

0x1B TPS_CTRL Temperature mode control register


No. Symbol Default Description
[15]Temperature 0: on
measurement switch 1: off
0: Temperature alarm on
[14] Alarm selection
1: Leakage/over-current alarm on
00: Automatic temperature measurement
[13:12] Temperature 01: the same as 00
measurement selection 10: internal temperature measurement
0x1B TPS_CTRL 0x07FF 11: external temperature measurement
00:50ms
[11:10] Temperature
01:100ms
measurement interval
10:200ms
selection
11:400ms
[ 9:0] External
temperature alarm
threshold
First set MODE[12]=1, and then set TPS_CTRL[14]=0, then CF pin is turned on to output external
temperature alarm indicator.

0x18 MODE User mode selection register


No. Symbol Default Description
0: energy pulse, enable by MODE[11]
CF output function configured
12 CF_UNABLE 0b0
selection 1: alarm, enable by TPS_CTRL[14]
configured
The external and internal temperature values are saved in the TPS2 and TPS1 registers respectively.

External Internal
Address Symbol Bits Default Description
R/W R/W
0x0E TPS1 R W 10 0x0000 Internal temperature register, unsigned
0x0F TPS2 R W 10 0x0000 External temperature register, unsigned

Shanghai Belling Corp., Ltd. 22 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

Internal temperature measurement formula:

Tx=(170/448)(TB/2-32)-45

TB is the value in TPS1.

The external temperature is measured by SAR ADC. The maximum input signal of the VT pin is VDD/2
(V), full scale is 1024.

External Internal
Address Symbol Bits Default Description
R/W R/W
External temperature sensor gain
0x1C TPS2_A R/W R 8 0x00
coefficient correction register
External temperature sensor offset
0x1D TPS2_B R/W R 8 0x00
coefficient correction register

Shanghai Belling Corp., Ltd. 23 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

3 3 Communication Interface
Register data are sent as 3 bytes (24bit). The data is fixed 3 bytes, if valid data bytes are less than 3
bytes, invalid bits are filled with 0.

3.1 SPI

⚫ Select by pin SEL, multiplex with UART


⚫ Slave mode
⚫ Half-duplex communication, the communication rate can be configured, the maximum
communication rate is 900khz
⚫ 8-bit data transmission, MSB first, LSB last
⚫ Clock polarity / phase (CPOL = 0, CPHA = 1)

3.1.1 Operation Mode

The master device works in mode1: CPOL = 0, CPHA = 1. In idle state, SCLK is at low-level. Data is
received on the falling edge and data is sent on the rising edge.

Figure 11

Shanghai Belling Corp., Ltd. 24 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

3.1.2 Frame Structure

In SPI communication mode, MCU send 8-bit identification byte (0x58) or (0xA8). (0x58) is the read
operation identification byte and (0xA8) is the write operation identification byte. Then send the address
byte of the register will be accessed (refer to BL0940 register list). The below figure shows the data transfer
sequence for read and write operations respectively. After one frame of data is transmitted, BL0940 re-
enters the communication mode. The number of SCLK pulses required for each reading and writing
operation is 48 bits.

There are two types of frame structures, which are explained as follows:

1) Write operation frame

Write operation
frame
0xA8 ADDR[7:0] DATA_H[7:0] DATA_M[7:0] DATA_L[7:0] CHECKSUM[7:0]

The checksum byte is ((0xA8 + ADDR + DATA_H + DATA_M + DATA_L) & 0xFF) and then bitwise
inverted.

2) Read operation frame

MCU send read


command frame 0x58 ADDR[7:0]

BL0940 return
data frame DATA_H[7:0] DATA_M[7:0] DATA_L[7:0] CHECKSUM[7:0]

The checksum byte is ((0x58 + ADDR + DATA_H + DATA_M+ DATA_L) & 0xFF) and then bitwise inverted.

Note: The data is fixed 3 bytes, high byte first, low byte last, if valid data bytes are less than
3 bytes, invalid bits are filled with 0.

3.1.3 Write Operation Timing

The serial write timing is performed as follows. The frame identification byte {0xA8} indicates that the
data communication operation is data writing, and ADDR is the address of the target register. The MCU need
make the data ready before the lower edge of SCLK, and shift the data at the lower edge of this clock. All
remaining bits of the data are also shifted left on the lower edge of this SCLK (Figure 12).

Shanghai Belling Corp., Ltd. 25 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

SCLK

SDI ADDR[7:0] DATA_H,M,L[7:0] CHECKSUM[7:0]

SDO

Figure 12

3.1.4 Read Operation Timing

During the data read operation, BL0940 shifts the corresponding data to the SDO pin on the rising edge
of SCLK. SDO keeps unchanged during SCLK =1. MCU can sample SDO value before the next falling edge.
MCU must send a read command frame first before read operation.

SCLK

SDI ADDR[7:0]

SDO DATA_H,M,L[7:0] CHECKSUM[7:0]

Figure 13

When BL0940 is in communication mode, the frame identification byte {0x58} indicates that the data
communication operation is data reading. The next byte ADDR is the address of the target register. After
receiving the register address, BL0940 starts to shift out the data in the register on the rising edge of SCLK
(Figure 13). All remaining bits of the register data are shifted out on subsequent rising SCLK edges.

On the falling edge of SCLK, an external device can sample the output data of the SPI. Once the read
operation is completed, SPI re-enters the communication mode. SDO enters a high-impedance state on the
falling edge of the last SCLK signal.

3.1.5 Fault-tolerant mechanism of SPI interface

SPI supports soft reset function, reset SPI interface individually by sending 6bytes of 0xFF.

Shanghai Belling Corp., Ltd. 26 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

3.2 UART

3.2.1 Description

BL0940 supports UART communication. The UART interface only requires two low speed optocouplers
to achieve isolated communication.

Baud rate: 4800bps Check bits: None Data bits: 8 Stop bits: 1.5

Slave mode, half-duplex communication

3.2.2 Byte Formation

t1 t2 t3

By te Start Bit D0 D1 D2 D3 D4 D5 D6 D7 Stop Bit

Start bit low duration: t1=208us

Valid data bit duration: t2=208*8=1664us

Stop bit high duration: t3=208us+104us

3.2.3 Write Timing


The timing of writing data is shown below. MCU first sends the command byte (0xA8) and the address
of the target register (ADDR), and then sends data bytes in sequence. Low byte is first and high byte is next,
if the valid data byte is less than 3 bytes, the invalid bits shall be filled with 0. Finally sends the checksum
byte.

t0

RX 0xA8 ADDR[0:7] DATA_L[0:7] …… DATA_H[0:7] CHECKSUM[0:7]

t1 t1 t1

(0xA8) is the frame identification byte for the write operation. ADDR is the internal target register in
BL0940 corresponding to the write operation.

The checksum byte is (((0xA8)+ADDR+Data_L+Data_M+Data_H)& 0xFF) and then bitwise inverted.

Shanghai Belling Corp., Ltd. 27 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

3.2.4 Read Timing


The timing of reading data is shown below. MCU first sends the command byte (0x58) and the address
of the target register (ADDR), and then BL0940 sends data bytes in sequence. Low byte is first and high byte
is next, if the valid data byte is less than 3 bytes, the invalid bits shall be filled with 0. Finally sends the
checksum byte.

t0

RX 0x58 ADDR[0:7] 帧头 ……
t0

TX
DATA_L[0:7] …… DATA_H[0:7] CHECKSUM[0:7]

t1 t2 t4 t3

(0x58) is the frame identification byte for the read operation. ADDR is the internal target register in
BL0940 corresponding to the read operation.

The checksum byte is (((0x58)+ADDR+Data_L+Data_M+Data_H)& 0xFF) and then bitwise inverted.

Timing Description

Description Min Type Max Unit

t1 Interval between MCU sending bytes 0 20 mS

t2 Interval between the end of MCU sending register address and BL0940 72 uS
sending byte during read operation

t3 Frame interval 0.5 uS

t4 Interval between BL0940 sending bytes 116 uS

Shanghai Belling Corp., Ltd. 28 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

3.2.5 Packet sending mode


After received the command "(0x58) + 0xAA", BL0940 will return a full electrical parameter data packet.
The returned data packet has a total of 35 bytes, and takes 77ms.

The detailed format is: Frame head(1byte)-> I_FAST_RMS(3byte)-> I_RMS(3byte)-> reserved(3byte)->


V_RMS(3byte)-> reserved (3byte)-> WATT(3byte)-> reserved (3byte)-> CF_CNT(3byte)-> reserved (3byte)->
TPS1(2byte TPS1 + 1byte 0)-> TPS2(2byte TPS2 + 1byte 0)-> CHECKSUM(1byte)

Full electrical parameter data packet format:

Name No. Value Name No. Value


Frame head 0 Head(0x58) 19 reserved
1 I_FAST_RMS_l reserved 20 reserved
I_FAST_RMS 2 I_FAST_RMS_m 21 reserved
3 I_FAST_RMS_h 22 CF_CNT_l
4 I_RMS_l CF_CNT 23 CF_CNT_m
I_RMS 5 I_RMS_m 24 CF_CNT_h
6 I_RMS_h 25 reserved
7 reserved reserved 26 reserved
reserved 8 reserved 27 reserved
9 reserved 28 TPS1_l
10 V_RMS_l TPS1 29 TPS1_m
V_RMS 11 V_RMS_m 30 0x00
12 V_RMS_h 31 TPS2_l
13 reserved TPS2 32 TPS2_m
reserved 14 reserved 33 0x00
15 reserved Checksum 34 checksum
16 WATT_l
WATT 17 WATT_m
18 WATT_h

checksum=(((0x58) + 0x55 + data1_l + data1_m + data1_h +…….)& 0xff)and then bitwise inverted.

Shanghai Belling Corp., Ltd. 29 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

3.2.6 Protection mechanism of UART interface


UART communication has a timeout protection mechanism. If the interval between bytes exceeds
18.5ms, the UART interface will automatically reset.

If the frame identification byte is incorrect or the checksum byte is incorrect, the frame data will be
discarded.

UART module reset: The RX pin is pulled high after the low-level exceeds 6.65mS, and the UART module
will be reset.

4 Order Information
BL0940-TSSOP14L

5 Package
Moisture sensitivity level: MSL 3

Quality guarantee period: 2 years

Package: Taping

Smallest packaging: 3000

Shanghai Belling Corp., Ltd. 30 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

Shanghai Belling Corp., Ltd. 31 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn
BL0940 Calibration-free Metering IC

Shanghai Belling Corp., Ltd. 32 / 32


810, Yishan Road, Shanghai, China, 200233 Tel: +86-21-24261000
www.belling.com.cn

You might also like