Good Day - I have been doing some validation testing on the CubeCell AB02S board and see that the ADC2 and ADC3 channels are ‘interacting’. For example having the turned on the VBAT_ADC_CTL (it’s LOW for ‘ON’) and reading the ADC1 I get a sensible number (Yes I know this is halved by the resistor divider). But if I inject a separate voltage into either ADC2 or ADC2 this will then affect the VBAT result.
In fact they all interact with one another, if I inject 1.0V into ADC3 then all of the other ADC results will report around 1000 (mV).
Have a lot of experience with the CY8… family of PSoC Ics, I suspect the internal MUX selection is not programmed properly on the ASR6502 (I have made this error before on those PSoC projects!)
If I am correct with this it would mean we would need a file to flash into the 6502 to correct this error OR (Hopefully) there is another instruction I am missing that needs to be included between the ADC reads?
Here is the code snippet:
digitalWrite(VBAT_ADC_CTL,LOW); // enable battery (1/2) onto ADC1
delay(500);
voltage=analogRead(ADC1);//return the voltage in mV, max value can be read is 2400mV
Serial.print("ADC1 (Batt) = ");
Serial.println((voltage));
delay(5000);
digitalWrite(VBAT_ADC_CTL,HIGH); // disable battery from ADC1
pixels.setPixelColor(0, pixels.Color(0, i, 0)); // Green
pixels.show(); // Send the updated pixel colors to the hardware.
voltage=analogRead(ADC2);//return the voltage in mV, max value can be read is 2400mV
Serial.print("ADC2 = ");
Serial.println(voltage);
delay(5000);
pixels.setPixelColor(0, pixels.Color(0, 0, i)); // Blu?
pixels.show(); // Send the updated pixel colors to the hardware.
voltage=analogRead(ADC3);//return the voltage in mV, max value can be read is 2400mV
Serial.print(“ADC3 = “);
Serial.println(voltage);
Serial.println(””);
delay(5000);