Please find bellow some hints regarding the question 1)
The synchronization issue is coming from the following:
The thing is that Analog Die register accesses are done with D2D frequency (up to 32 MHz), but the data is just copied in the register and the different settings becomes active only after the next rising edge of the acquisition clock (512 kHz). Accordingly when 2 accesses to the same register are done within a short period, you never know what happens, because when the rising edge comes, the setting which is currently in the register becomes active.
The safest way to avoid the problem is to wait for minimum 2us (1 cycle of the acquisition clock) between subsequent accesses to the same register.
For instance, this function restarts the measurement in case it is not in sync and does a resynchronization (asm code is handling a wait of ~3.5us):
static void ADC_Sync(void) {
//volatile unsigned char loop = 0;
/*Disable the voltage and current measurement*/
B_ACQ_CTL = 0x1000; //disable interrupt
B_ACQ_CTL = 0x0200; //ACQ_CTL_CLEAR_VMEN;
B_ACQ_CTL = 0x0100; //ACQ_CTL_CLEAR_CMEN;
/*Removing ongoing requests*/
B_ACQ_SR = 0x0300; //ACQ_SR.Word = ACQ_SR_CLEAR_VM | ACQ_SR_CLEAR_CM;
//while(loop<10)loop++;
__asm {
LD D0,#0
loop:
INC.b D0
CMP D0,#100
BLE loop
}
/*Enable the voltage and current measurement*/
B_ACQ_CTL = 0x1313; //ACQ_CTL_SET_VMEN | ACQ_CTL_SET_CMEN;
}