HVI*2 for S12ZVC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HVI*2 for S12ZVC

536 Views
aaronlee
Contributor V

I have the code that work fine with HVI0 (PL0) as attachment.

1 channel (PL0 or PL1) can work fine.

Now, I want to measure 2 channel (PL0 & PL1) at the same time. How to do?

Original Attachment has been moved to: 20170604_ADC_Meter24V.rar

Labels (1)
0 Kudos
1 Reply

354 Views
aaronlee
Contributor V

//Command and result list have to be aligned - Base Pointer Register[1,0]=0;
volatile unsigned long adc0_cmdlist[2] __attribute__ ((aligned (4))); //max 256 bytes = 64 commands per 4-byte entries
volatile unsigned int adc0_results[2] __attribute__ ((aligned (4))); //max 128 bytes = 64 results per 2-byte entries

//Define ADC0 command list
adc0_cmdlist[0] = CMD_SEL(eolw)+INTFLG_SEL(1)+VRH_SEL(1)+VRL_SEL(1)+CH_SEL(HVI0)+SMP(0);
adc0_cmdlist[1] = CMD_SEL(eolw)+INTFLG_SEL(1)+VRH_SEL(1)+VRL_SEL(1)+CH_SEL(HVI1)+SMP(0);

I resolved the problem. The adc0_cmdlist[0] should be modify as follow:

adc0_cmdlist[0] = CMD_SEL(norm)+INTFLG_SEL(1)+VRH_SEL(1)+VRL_SEL(1)+CH_SEL(HVI0)+SMP(0);

0 Kudos