2022-01-09 06:28 AM
Hello, I have a custom designed board with 7 analog inputs on sigma delta ADC's.
6 of my inputs are working properly.
I have a software issue.
When I erase the flash or de-solder the mcu I can measure the correct voltage from my test points.
But when I upload the stmcubeide generated empty project, only 1 input goes low. Other 6 inputs are ok.
Where to check? What to check?
Solved! Go to Solution.
2022-01-10 08:11 AM
Hello, I solved the problem.
The project was not empty but I read everywhere line by line.
Today, I made a new project, and started moving everything line by line.
Everything was perfect till I move my lcd controller.
My SDADC pins are PB 0, 1,2 8, 9, 14, 15 and PD8
found that
GPIO_InitStruct.Pin = LCD_DB4_Pin|LCD_DB5_Pin|LCD_DB6_Pin|LCD_DB7_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
these lines lock PB2. Reconfigured through CubeMX and everything is fine.
Thanks TDK.
2022-01-09 07:47 AM
> When I erase the flash or de-solder the mcu I can measure the correct voltage from my test points.
> I have a software issue.
Makes sense.
What pin? It's probably initialized as something else by default.
> But when I upload the stmcubeide generated empty project, only 1 input goes low.
Why does it matter what an empty project does? Shouldn't you be initializing the pins how you want?
2022-01-09 08:04 AM
Hello,
PB2 as SDADC1_AIN4P
None of GPIO's are modified.
I've initialized all sdadc inputs the same way. I'm missing something.
2022-01-09 08:17 AM
> None of GPIO's are modified.
> I've initialized all sdadc inputs the same way.
I'm still not understanding if your project is empty or if you're initializing ADC pins as analog.
Regardless, checking GPIO registers would verify if pins are set to analog state.
Stepping through the code to determine where the pin gets pulled down would also likely identify the problem.
2022-01-10 08:11 AM
Hello, I solved the problem.
The project was not empty but I read everywhere line by line.
Today, I made a new project, and started moving everything line by line.
Everything was perfect till I move my lcd controller.
My SDADC pins are PB 0, 1,2 8, 9, 14, 15 and PD8
found that
GPIO_InitStruct.Pin = LCD_DB4_Pin|LCD_DB5_Pin|LCD_DB6_Pin|LCD_DB7_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
these lines lock PB2. Reconfigured through CubeMX and everything is fine.
Thanks TDK.