Other Parts Discussed in Thread: MSP-EM-DESIGN-CENTER
Hello TI community,
I am working on metering and AM using ti metering library (emeter-metrology-6779) for MSP430F67791A. The library is set to sampling rate 4096 using Over sampling ratio (OSR = 256-1). When i tried to set sampling ratio to 2048 using OSR (OSR = 512-1), The measured voltage and frequency becomes zero. The following lines of code are set:
#define sd_set_normal_live_current_mode_(a) \
sd_xxxx_reg(SD_INCTL_, a) = SD_LIVE_CURRENT_GAIN; \
sd_xxxx_reg(SD_CCTL_, a) = SD_DF_1 | SD24SCS_4; \
sd_xxxx_reg(SD_OSR_, a) = 512 - 1; \
sd_xxxx_reg(SD_PRE_, a) = 0;
#define sd_set_normal_live_current_mode(a) sd_set_normal_live_current_mode_(a)
#define sd_set_normal_neutral_current_mode_(a) \
sd_xxxx_reg(SD_INCTL_, a) = SD_NEUTRAL_CURRENT_GAIN; \
sd_xxxx_reg(SD_CCTL_, a) = SD_DF_1 | SD24SCS_4; \
sd_xxxx_reg(SD_OSR_, a) = 512 - 1; \
sd_xxxx_reg(SD_PRE_, a) = 0;
#define sd_set_normal_neutral_current_mode(a) sd_set_normal_neutral_current_mode_(a)
#define sd_set_normal_voltage_mode_(a) \
sd_xxxx_reg(SD_INCTL_, a) = SD_VOLTAGE_GAIN; \
sd_xxxx_reg(SD_CCTL_, a) = SD_DF_1 | SD24ALGN | SD24SCS_4; \
sd_xxxx_reg(SD_OSR_, a) = 512 - 1; \
sd_xxxx_reg(SD_PRE_, a) = 0;
#define sd_set_normal_voltage_mode(a) sd_set_normal_voltage_mode_(a)
---------------------------------------------and------------------------------------------------
#define SAMPLE_RATE 2048
#define ADC_BITS 16
#define SAMPLES_PER_10_SECONDS 20480
any help?
regards
Hossam
