ADC Voltage Input Issue - MCU Not Reading Data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-06 12:33 AM
Dear ST
I am encountering an issue with our current setup involving an Analog-to-Digital Converter (ADC) and a Microcontroller Unit (MCU).
The ADC is successfully receiving the input voltage when measured directly at its pins. However, the MCU connected to the ADC does not appear to be reading this voltage data. Consequently, I am unable to visualize the voltage output in our software interface.
Here are some details that might be helpful:
- ADC Model: [ADS8688IDBTR]
- MCU Model: [STM32G0B1VET6]
- Connection Method: [SPI]
- Software/Firmware Used: [STM CUBEIDEA 1.12.1}
- Observed Behavior: The ADC shows the correct voltage, but the MCU's readings (when debugging or trying to output) are consistently zero or incorrect, and no data is reflected in the visualization software.
- Troubleshooting Steps Taken So Far:
- Confirmed voltage at ADC input pins using a multimeter.
- Checked physical connections between ADC and MCU for continuity.
- Verified power supply to both ADC and MCU.
Could you please provide some guidance or assistance in diagnosing and resolving this issue? I suspect it might be related to [mention your suspicion if you have one, e.g., "incorrect MCU configuration for ADC communication," "driver issues," "software library incompatibility"].
Please let me know if you require any further information, such as code snippets, schematics, or specific register settings.
Email, shivabaln@dncltech.com
- Labels:
-
STM32G0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-11 12:56 PM
Troubleshooting Steps Taken So Far:
- Confirmed voltage at ADC input pins using a multimeter.
- Checked physical connections between ADC and MCU for continuity.
- Verified power supply to both ADC and MCU.
Did you check with an oscilloscope to be sure that the STM32's SPI bus is clocking and has data?
You return HAL status on your call to ADS_Cmd_Write inside ADS_Read_All_Raw. But you don't check the HAL status returned from ADS_Read_All_Raw. So, you are printing data without checking the HAL status to insure you have valid data returned.
while (1)
{
/* USER CODE END WHILE */
current = HAL_GetTick();
/* USER CODE END WHLE */
/* USER CODE BEGIN 3 */
if(previous<current) {
unsigned long now = HAL_GetTick();
ADS_Read_All_Raw(&ads, ads_data);
for(int i=0; i<8; i++) {;
volt_helper = ((float)ads_data[i])*2.5f/65535.0f;
volt[i] = (int)(volt_helper*100000000);
printf("CHN_%d: %u "BYTE_TO_BIN_PAT" "BYTE_TO_BIN_PAT" %d.%d\n", i, (uint16_t)(ads_data[1]<<8 | ads_data[0]), BYTE_TO_BIN(ads_data[1]), BYTE_TO_BIN(ads_data[0]), volt[i]/100000000, volt[i]%100000000);
}
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-11 2:57 PM
Start simple. Hook up a scope, send a command, then a Command Read-Back Register command.
