Why is my ADC only showing zero as an output while simulating the stm32f103C6 model in proteus?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-10 4:06 AM
The above is my schematic layout of ,STM32F103C6 Series, attached to a virtual terminal with transmitting and receiving lines mentioned and the pin PA2 is used as an ADC input pin.
The above is the power rails configuration .
The above is the pinout view where PA9 and PA10 are used for transmitting and receiving which are attached to the virtual terminal as showed.
The above is the code where I declared test as an unsigned integer of 16 bits and character msg of length 10.
Then I have written the code for starting the ADC and then stopping for Conversion whereafter I have retrieved the values from HAL_ADC_GetValue and transmited to the virtual monitor by the help of UART Transmit function
Then I have build my program and converted into hex file whereafter I copied its path to the proteus stm32 model's program file.
The above is the output I am getting.
I am very confused on what went wrong in my program and simulation,
It would be very helpful If you guyz could assist me on this issue.
Solved! Go to Solution.
- Labels:
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-16 1:50 AM
Can you attach your main file? I am not able to understand where to use this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-16 7:01 AM - edited ‎2023-10-16 7:54 AM
I told you to output the values on GPIOs before outputting them on UART (I've already attached the main file). You have to see GPIOB showing the ADC value in the simulation ! If not, there is an issue in your simulation environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-25 11:13 PM - edited ‎2023-10-26 1:28 AM
Could I still print the values on GPIOB if I do not have the stm32 board?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-26 8:21 AM - edited ‎2023-10-26 8:55 AM
Hello,
What do you mean by print the value on GPIOB.
The idea is to have the value on GPIOB port. So in your the simulation, you have to see the converted value on the port: 0=Blue, 1=Red. Or connect LEDs on port B to show the binary value of the converted ADC signal.
If it doesn't work I suspect an issue with Proteus simulation.

- « Previous
-
- 1
- 2
- Next »