ADC on G474CE
#2778
Replies: 2 comments 1 reply
-
PA10 is not an ADC pin. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I tried PA0 to PA10 and none worked.
I put up a longer post detailing that I tried all the pins but it did not seem to get posted.
I tried many pins and none worked for analogread.
Many worked for digitalread.
The mapping on the Weact G474 long board is not very comprehensive linking
the board markings to the pin descriptors eg: what is A0 on the board, is
it PA0?
Odd how the same code with different pin designations and the STM32
register printouts works for AVR and ESP chips.
…On Mon, 28 Jul 2025 at 03:48, Frederic Pillon ***@***.***> wrote:
PA10 is not an ADC pin.
PinMode is not needed.
—
Reply to this email directly, view it on GitHub
<#2778 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF56IXIKLSYZW4CBOI6WMT3KUGGRAVCNFSM6AAAAACCO7SG4GVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOJQGI4DONI>
.
You are receiving this because you authored the thread.Message ID:
<stm32duino/Arduino_Core_STM32/repo-discussions/2778/comments/13902875@
github.com>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am getting all 0 on printing ov analogread on the code below:
`void setup() {
// put your setup code here, to run once:
delay(20);
Serial.begin(115200);
while (!Serial);
delay(500);
Serial.println();
Serial.print("SETUP: ");
Serial.println(BOARD_NAME);
Serial.print("FLASH->ACR = 0x");Serial.println(FLASH->ACR,HEX);
Serial.print("SystemCoreClock: ");
Serial.println(SystemCoreClock);
Serial.print("F_CPU: ");
Serial.println(F_CPU);
Serial.printf("RCC_CR 0x%08X \n", RCC->CR);
Serial.printf("RCC_CFGR 0x%08X \n", RCC->CFGR);
Serial.printf("RCC_PLLCFGR 0x%08X \n", RCC->PLLCFGR);
pinMode(PA3, INPUT_ANALOG);
}
void loop() {
// put your main code here, to run repeatedly:
static int outval = 0;
analogWrite(A2,outval); /* full range 0-255 /
outval += 10;
if (outval > 255) outval = 0;
delay(10);
String message = "Vb = ";
//int VB= analogRead(PA3); / full range 0-1024 /
int VB= digitalRead(PA10); / full range 0-1024 */
//int VA= analogInputToDigitalPin(p)
//message += VB;
//Serial.println(analogRead(PA0));
Serial.println(VB);
//Serial.println(message);
delay(100);
}`
I have VREF wired to 3.3V and A2 connected to the relevant input pin but no value is shown on analogread.
The value toggles on digitalread on any of the pins tried.
Is there anything else needs to be done.
Beta Was this translation helpful? Give feedback.
All reactions