RFQ/BOM 0 Sign In / Register

Select Your Location

user image

It is necessary to design a circuit that satisfies the LED and button sharing the IO port of an MCU. How can I meet the demand?

Hardware design
August 06, 2020 by Brylee 1305

Requirements: LEDs and buttons share the IO port of an MCU

Goal: When the button is pressed once, the light is on, and it stays on until the corresponding button is pressed again, and the light is off

The picture I draw now cannot meet this requirement, because when the light is on, the IO port of the MCU is high, and both sides of the button are high, and it is impossible to give a signal to the MCU. How can you design to meet the demand without adding other types of components?

All Comments

user image

Cheyanne Posted on August 6, 2020

You explain first, what kind of operation is required, that is, when the switch is pressed, MCU_IO goes from HIGH to LOW??

0
user image

Jaylah Posted on August 6, 2020

Remove 3K, set the R value according to the actual lamp design resistance value, and exchange the LED with the switch. IO is initialized to high impedance or high level. When the button is pressed, the LED is on and the IO outputs low level. The LED is always on. When the button is pressed again, the IO outputs high level and the LED is off. Personal analysis. No verification. for reference only

0
user image

Kaliyah Posted on August 6, 2020

See if this design is feasible?

0

Write an answer

You need to log in to reply. Sign In | Register