dsPIC33CH Curiosity Development Board User’s Guide
DS50002762A-page 20
Advance Information
2018 Microchip Technology Inc.
2.7 HIGH-SIDE CURRENT SENSING
The SMPS on-time current can be measured by the voltage developed across the
high-side current sense resistors, R59 and R74. However, the ISENSEH signal is
referenced to the +5V input rail of the SMPS circuit (not to ground), which prevents it
from being measured directly by the ADC or comparators in the microcontroller U1.
Therefore, the ISENSEH voltage signal is level shifted (to be ground referenced) and
amplified by the components, U7A, Q1, R52 and R98, with an effective gain of 3.3.
Components, R97 and R102, add a small DC bias (approximately -71 mV, before level
shifter gain or about +235 mV at RA3_ISENSEH), which appears at the
RA3_ISENSEH microcontroller pin as an intentional offset error in the current
measurement. This intentional DC biasing ensures that the current sense voltage
signal is always within the U1 comparator input sensing range and the internal DAC
reachable range, even when the Q6 current is exactly 0.0 mA with realistic comparator
and DAC offset voltages.
The final output voltage on RA3_ISENSEH is related to the Q6 current approximately,
as shown in Equation 2-1 and Equation 2-2 (where RA3_ISENSEH is the voltage in
volts measurable with the microcontroller ADC; V
IN
is the +5V rail input voltage, which
may be ~4.6V under load during operation and IQ6 is the current through the MOSFET
Q6 in amps). Equation 2-1 and Equation 2-2 were derived by simplifying and substitut-
ing resistor values into Equation 2-3 through Equation 2-6, which in turn, were derived
from the schematic implementation.
EQUATION 2-1:
EQUATION 2-2:
EQUATION 2-3:
EQUATION 2-4:
EQUATION 2-5:
EQUATION 2-6:
RA3_ISENSEH
0.04877 • V
IN
+ 1.626 • I
Q
6
RA3_ISENSEH – 0.04877 • V
IN
I
Q
6
1.626
Rsense = = 0.5 Ohms
1
R59
1
R74
+
–1
ISENSEH_BIASED = (V
IN
– I
Q
6 • Rsense)
R102
(R102 + R97)
RA3_ISENSEH =
R98
R52
(V
IN
– ISENSEH_BIASED)
RA3_ISENSEH =
R98
R52
[]
(V
IN
– I
Q
6 • Rsense)(R102)
R102 + R97
V
IN
–