cancel
Showing results for 
Search instead for 
Did you mean: 

How to use analogue pins (not ADC) to read voltage?

sal92
Associate

hi all,

 

I am using STM32F733xx and i want to read the Vout i will be monitoring is between 1-5v, to read that i have used analogue pins PG13, PH3 ,PH2,PG14, PE2,PE3, PE6, PE4,PE5,PF1,PF0,PF2

I already have the PCB so i cant change the design can anyone suggest any solution to this?

Looking for some firmware based solution to this problem.

 

Thanks in advance,

Regards,

Sal

2 REPLIES 2

Welcome to the forum.

For best results, please see: How to write your question to maximize your chances to find a solution.

 


@sal92 wrote:

i have used analogue pins PG13, PH3 ,PH2,PG14, PE2,PE3, PE6, PE4,PE5,PF1,PF0,PF2


None of those pins has any analogue function:

PG13 TRACED0, LPTIM1_OUT,USART6_CTS, FMC_A24,EVENTOUT
PH3  QUADSPI_BK2_IO1,SAI2_MCK_B, FMC_SDNE0,EVENTOUT
PH2  LPTIM1_IN2, QUADSPI_BK2_IO0, SAI2_SCK_B, FMC_SDCKE0, EVENTOUT
PG14 TRACED1, LPTIM1_ETR,USART6_TX,QUADSPI_BK2_IO3, FMC_A25,EVENTOUT
PE2  TRACECLK, SPI4_SCK, SAI1_MCLK_A, QUADSPI_BK1_IO2, FMC_A23, EVENTOUT
PE3  TRACED0, SAI1_SD_B, FMC_A19, EVENTOUT
PE6  TRACED3, TIM1_BKIN2,TIM9_CH2, SPI4_MOSI,SAI1_SD_A, SAI2_MCK_B,FMC_A22, EVENTOUT
PE4  TRACED1, SPI4_NSS,SAI1_FS_A, FMC_A20,EVENTOUT 
PE5  TRACED2, TIM9_CH1,SPI4_MISO, SAI1_SCK_A,FMC_A21, EVENTOUT 
PF1  I2C2_SCL, FMC_A1, EVENTOUT
PF0  I2C2_SDA, FMC_A0, EVENTOUT
PF2  I2C2_SMBA, FMC_A2, EVENTOUT

 

Please show your schematic - that would be easier to follow.

 

An ADC is the only way you're going to directly read an analogue voltage as a digital value.

Otherwise, you're going to have to "synthesise" an ADC; eg, use a DAC to generate a "reference", and a comparator to compare.

Whatever you do, it's going to need hardware changes...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
TDK
Guru

Even if they were wired to the correct pins, the ADC isn't going to be able to measure 5 V.

If you feel a post has answered your question, please click "Accept as Solution".