Why do I get inaccurate values on my analog to digital converter on my STM32MP1?
I've just watched a few tutorials on ADC, and I've enabled IN1 on ADC1 which seems to map to the connector labeled A3 as per this doc.
I then added the following to my main.c within the CM4 project.
uint32_t raw = 0;
char msg[100];
HAL_ADC_Start(&hadc1);
HAL_ADC_PollForConversion(&hadc1, HAL_MAX_DELAY);
raw = HAL_ADC_GetValue(&hadc1);
HAL_Delay(100);
sprintf(msg, "%d\r\n", raw);
VIRT_UART_Transmit(&huart0, msg, strlen(msg));Then I plugged pin A3 directly into GND so I could validate it's working by getting a reading of 0, but I get either 32768, 65518, or 0. I've also tried to supply it 1v and it seems to give 65518 constantly.
I've also tried to switch to hdac2 by creating the same configurations in the IOC and I had the same results. It seems like it may be reading multiple different values from the different ports and displaying them all as they come in, but I don't even have anything defined in the other INs.
Furthermore, if I did define multiple INs for one ADC (which I didn't but seems allowed), how would i know which one I'm reading from?
It's also worth mentioning ADC1 has the following error:
Partially disabled conflict with:
SAI2 (SAI B): Mode SPDIF TX TransmiterI'm not sure how to fix this, but as I said, I tried using adc2 as well with the same results and multiple different INs.
