• AVR Freaks

MCP3021 output 1/4 of what it should be?

Author
David Ashman Zone 7 Engineering
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2019/09/30 22:07:57
  • Location: 0
  • Status: offline
2019/10/01 11:25:02 (permalink)
0

MCP3021 output 1/4 of what it should be?

I'm using an MCP3021 with a floating point BlackFin BF706 processor.  After translating the two received I2C sample bytes back to a voltage, I'm getting 1/4 of the DC voltage I measure at AIN.  Has anyone else had this issue?  Below are my code snippets:
 
#define BIT_WEIGHTING (3.3F / 1024.0F)
 
uint16_t tmp;
float result;
uint8_t buf[2];
 
... read I2C into buf[]
 
tmp = ((((uint16_t)buf[0U]) << 6U) | (((uint16_t)buf[1U]) >> 2U));
result = (float)tmp * BIT_WEIGHTING;
 
 
Thanks in advance!
post edited by David Ashman Zone 7 Engineering - 2019/10/05 08:53:20
#1

1 Reply Related Threads

    David Ashman Zone 7 Engineering
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2019/09/30 22:07:57
    • Location: 0
    • Status: offline
    Re: MCP3021 output 1/4 of what it should be? 2019/10/17 16:23:50 (permalink)
    0
    UPDATE: I changed the voltage divider resistors to AIN on the custom circuit board from M ohm range to 10k ohm, and the part appears to be correctly sampling. So, I'm assuming that with the larger divider resistors the part didn't have enough input bias current. 
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5