ZHCSQR5A March 2023 – March 2024 TMAG6180-Q1
PRODUCTION DATA
Figure 7-5 shows the response of the differential-ended AMR output signals and the Hall outputs (Q1, Q0) for a 360° input magnetic field (BIN).
An example code for extending the angle range from 180 degrees to 360 degrees using the Q0, Q1 outputs is given below ;
MeasuredAngle = arctan2(SIN,
COS)/2 ; //0-180° angle range , Multiply by 180/Pi if the angle is returned in
radians
MeasuredAngle = 90 - MeasuredAngle // If arctan2
function returns from -90deg to 90deg angle range, then use this to convert to
0-180° angle range
if (MeasuredAngle is between 45°–135°) then
(
if (Q1_Q0 is 00b or 10b)
then //around
90°
AbsAngle = MeasuredAngle ;
else //Q1_Q0 is 11b
or 01b, around
270°
AbsAngle = MeasuredAngle + 180°;
)
else //MeasuredAngle is
0°–45° or 135°-180°
(
if (Q1_Q0 is 00b or 01b)
then //around 0°
(
if (MeasuredAngle ≥ 135°) then
AbsAngle = MeasuredAngle +
180°;
else
//MeasuredAngle is 0-45°
AbsAngle =
MeasuredAngle;
)
else
//2Digital is 10b or 11b, around 180°
(
if (MeasuredAngle ≥ 135°)
then
AbsAngle = MeasuredAngle;
else
//MeasuredAngle is 0-45°)
AbsAngle = MeasuredAngle
+ 180°;
)
)