0
\$\begingroup\$

I would like to make a spot welding device with pulse current from 0.02 to 10 s.

For prototyping I'm using 3 push buttons; one to initiate the welding process and two for current control (current+ and current-).

I am using a Nucleo-F042K6 which has two interrupt functions for interrupts, EXTI line 0 to 1 interrupts and EXTI line 4 to 15 interrupts. How do I select the microcontroller lines for current+ and current- with interrupts from EXTI line 4 to 15 interrupts, since they're using the same function? I already used one of the lines (EXTI line 0 to 1 interrupts) to initiate the welding.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Why do you want to use interrupts to handle the buttons? \$\endgroup\$ Commented Mar 16, 2023 at 17:00
  • 1
    \$\begingroup\$ Your post is missing how exactly you want to implement it. Do you use C or assembly? Do you use HAL, LL HAL, or have you written all code by poking memory addresses yourself? And usually, while you can read buttons with interrupts, usually there are more reasons why you really don't even want to do it. \$\endgroup\$ Commented Mar 16, 2023 at 17:35
  • \$\begingroup\$ It's generally a design flaw to trigger interrupts by buttons. \$\endgroup\$ Commented Oct 8, 2024 at 15:55

1 Answer 1

1
\$\begingroup\$

Arrange for all switches to generate a common interrupt then, in the interrupt service routine, read all three buttons and decide which one was pressed. You'll probably need to use a three diodes and a three resistors plus three spare IO lines for the buttons.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ That's redundant on the STM32 platform, as it already supports triggering a single interrupt vector from multiple input pins. No diodes needed. \$\endgroup\$ Commented Mar 16, 2023 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.