I'm using a MSP430F427A's SD16 to measure some voltages and current. The voltage channels are working fine. The current channel however, has a strange issue. I've been searching on this forum, but couldn't find a solution. Let me discribe the situation:
We have two firmware versions:
- Tester software, for calibration of the analog channels
- Application software, using the calibration constants.
How can I have a difference in offset between both version and why does the low power mode influence it?
The tester software has less code, so it's longer in low power mode.
Measurements:
| 0Amps | 30Amps | |
| App (low power mode) | -31 | 1202 |
| Tester (low power mode) | -39 | 1194 |
| App (no low power mode) | -8 | 1225 |
| Tester (no low power mode) | -11 | 1222 |
When I set the current channel to use input channel 7 (offset), ALL four versions as described above have the same offset.
Common init code:
|
WD_RESET_1S(); /* ACLK = LFXT1CLK = 32768 /* /* initialise inputs for Buttons */ /* Initialise Timer A for Buzzer and backlight /* backlight */ /* initialise output for relay, buzzer and backlight */ /* initialise basic timer for periodical interrupt */ |
ADC init code:
|
/* Initialise the ADC */ /* Low power mode off, clock source is MCLK / 4, VMID off, ref on, overflow /* Continuous conversion, OSR = 265, output 2's complement upper 16 bits only, /* Continuous conversion, OSR = 265, output 2's complement upper 16 bits only, /* Continuous conversion, OSR = 256, output 2's complement upper 16 bits only, /* No delay, gain = 8, input channel = 0 (external). */ memset(SD16Temp, 0, sizeof(SD16Temp)); /* Start sampling. The channels are grouped, so it is only necessary to |
If you need more info, please ask.