Shop OBEX P1 Docs P2 Docs Learn Events
H48C Accelerometer — Parallax Forums

H48C Accelerometer

fzrobotfzrobot Posts: 7
edited 2007-02-19 06:58 in BASIC Stamp
Hi, I have a (hopefully) simple question regarding the H48c accelerometer

I execute the code in the sample code for the accelerometer:
    LOW CS
    SHIFTOUT Dio, Clk, MSBFIRST, [noparse][[/noparse]%11\2, VRef\3]     ' select vref register
    SHIFTIN  Dio, Clk, MSBPOST,  [noparse][[/noparse]VRefCount\13]      ' read ref voltage counts
    HIGH CS
    PAUSE 1
    LOW CS
    SHIFTOUT Dio, Clk, MSBFIRST, [noparse][[/noparse]%11\2, Tiltaxis\3] ' select axis
    SHIFTIN  Dio, Clk, MSBPOST,  [noparse][[/noparse]axisCount\13]      ' read axis voltage counts
    HIGH CS




But, I find that the range of the difference between axisCount and VrefCount, only ranges only from -455 to 465 (decimal). In other words if I subtract axisCount - VrefCount the result ranges from -455 to 465.

I thought that I would see the full range (total counts = 4096 for a 12-bit A/D Converter) from -2048 to 2047.

Can anybody give me some advice on this?

Thanks,

-Cisco
Sign In or Register to comment.