Why is my ADC only showing zero as an output while simulating the stm32f103C6 model in proteus?

Discussion on both general simulation and Proteus VSM microcontroller simulation.
Post Reply
Krishnangshu
Unlicenced User
Posts: 2
Joined: Sun 2023-10-29 12:02

Why is my ADC only showing zero as an output while simulating the stm32f103C6 model in proteus?

Post by Krishnangshu »

I have attached the 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.
I have also configured the power rails , which is shown in the image attached below.
The code written in the stmcubeide is attached below, 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 output I am getting for this simulation is 0 irrespective of the voltage I am giving in PA2 which is also attached below.
It would be very helpful If you guys could assist me on this issue.
Attachments
Krishnangshu_2-1696935105658.png
Krishnangshu_2-1696935105658.png (54.92 KiB) Viewed 830 times
Krishnangshu_1-1696935020724.png
Krishnangshu_1-1696935020724.png (42.01 KiB) Viewed 830 times
Krishnangshu_0-1696934804825.png
Krishnangshu_0-1696934804825.png (51.31 KiB) Viewed 830 times
Ettore
Labcenter Staff
Posts: 2931
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Why is my ADC only showing zero as an output while simulating the stm32f103C6 model in proteus?

Post by Ettore »

Could you please attach here your Proteus project (.pdsprj file) including source code files ? So that we can have it a look.
Kind regards,
Ettore Arena - Labcenter Electronics.
Krishnangshu
Unlicenced User
Posts: 2
Joined: Sun 2023-10-29 12:02

Re: Why is my ADC only showing zero as an output while simulating the stm32f103C6 model in proteus?

Post by Krishnangshu »

The proteus project and the is attached below but I am not able to attach the main.c file from the stm32cubeide.
Attachments
stm32.pdsprj
(14.82 KiB) Downloaded 333 times
David
Site Admin
Posts: 2263
Joined: Mon 2006-02-20 14:56
Location: Head Office
Contact:

Re: Why is my ADC only showing zero as an output while simulating the stm32f103C6 model in proteus?

Post by David »

Hi,

Unfortunately you need to purchase a licence in order to receive support. Using a cracked / illegal copy of the software doesn't warrant support. Sorry.

https://www.labcenter.com/pricing/comm/

Regards,
Dave.
Post Reply