Hi All,
Currently I'm using register PGAINSEL[1:0] to select inputs for PGA.
10 PGA_IN0 is selected as input voltage (PGAIN).
11 PGA_IN1 is selected as input voltage (PGAIN).
Issue: The value getting as PGA output for the inputs given is getting skewed occasionally.
So I want to configure ADC option Bits to select the PGA inputs to solve this.
If I need to use ADC option bit to select PGA inputs i.e.
ADC option bit[3:0] PGA input source selection
What are all the configurations to be made.
Can anyone help on this?
-Charudatta
Hi Charudatta,
In attachment is simple ADC example code for S12ZVL.
So, for measuring PGA_IN0 and PGA_IN1 you may configure commands like:
#define PGA_ADC 0x0F //See table Analog Input Channel Select in refernce manual
adc0_cmdlist[0] = CMD_SEL(norm)+ OPT(1)+INTFLG_SEL(0)+VRH_SEL(1)+VRL_SEL(1)+CH_SEL(PGA_ADC)+SMP(0x14);
adc0_cmdlist[1] = CMD_SEL(eolw)+ OPT(2)+INTFLG_SEL(1)+VRH_SEL(1)+VRL_SEL(1)+CH_SEL(PGA_ADC)+SMP(0x14);
Note: SMP(0x14) refers to longest sampling time = 24 ADC Clock Cycles
Unfortunately, I don't have S12ZVL64/S12ZVL96/S12ZVL128 board, for now, therefore, I cannot test it.
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------