cancel
Showing results for 
Search instead for 
Did you mean: 

How do I check if an I/O pin is high or low (state of the pin)? When I toggle pins I want to know what variable to check.

MLöfg.1
Associate

Nucleo board:

STM32F042K6T6

2 REPLIES 2
Javier1
Principal

have a look at this AN4899

0693W00000UoKmjQAF.png 

Is your pin defined as gpio?

we dont need to firmware by ourselves, lets talk
itsrabbit
Associate II

You can put a debug point after you toggle your pins, after it stops on debug point; you can see pin status from "Special Function Registers (SFRs)" screen. You can open that tab from Window-> Show View -> SFRs.

In SFRs screen you can check the Input Data Register (IDR) or Output Data Register (ORD) and verify that you're doing it right.

Best regards,

AC