Hey everyone,
I have been playing around with the SD16 again and am having some trouble measuring VCC correct using the internal resistor divider on A5. My MCLK is 16MHz. My code is as follows:
SD16CTL = SD16REFON + SD16SSEL_1 + SD16XDIV_2; // Internal Reference, SMCLK, /16
SD16INCTL0 = chan; // Fourth sample (implied), read 'chan'
SD16CCTL0 = SD16IE + SD16SNGL; // Enable interrupt, enable single mode
SD16CCTL0 |= SD16SC; // Start SD16 conversion
I am also using the I2C but this should not effect the measured value at all. I am constantly measuring about 0xB8C0 (~47300). Doing the math...
(0xB8C0-0x8000)*V_ref/(2^16)-V_ref/2) * 11.
This gives me a result of about 2.9V. I tested the V_ref (which is actually at 1.07V, but taking that into account makes my answer even less correct). My actual VCC measured by my Flukes is 3.38V. I have tried this on 4 separate MSP430F2013 chips.
I am out of ideas for what could be causing this. Does anyone have any ideas or has anyone had this problem before?
I am desperate for help!
Thanks in advance.
NJC