You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have written a simple program that should recognize edges on an input and trigger an interrupt. The interrupt doesn't happen.
Here is the simple program:
package main
import (
"fmt""machine""time"
)
funcbcast(xbool) int {
ifx {
return1
} else {
return0
}
}
funcmain() {
// square wave is fed to pin 10p:=machine.Pin(10)
p.Configure(machine.PinConfig{Mode: machine.PinInputPullup})
// and should be echoed to pin 11q:=machine.Pin(11)
q.Configure(machine.PinConfig{Mode: machine.PinOutput})
err:=p.SetInterrupt(machine.PinRising, func(pin machine.Pin) {
fmt.Printf("verify pin: %d\n", pin)
fmt.Printf("interrupt: %d, %d\n", bcast(p.Get()), bcast(pin.Get()))
q.Set(p.Get())
})
iferr!=nil {
fmt.Printf("err set interrupt: %s\n", err.Error())
panic(err.Error())
} else {
fmt.Printf("set interrupt ok\n")
}
fori:=0; i<300; i++ {
fmt.Printf("tick %d, pin=%d\n", i, bcast(p.Get()))
time.Sleep(1*time.Second)
}
}
And here is the output when run on a Pico2. The main loop runs fine and the pin is clearly changing state but the interrupt is not recognized.
I suspect that there is something about the RP2350 that requires a slight additional bit of work in order to enable the control of interrupts. It may have to do with the newly introduced security model.
I don't have a 2040 based Pico to test on right now so I can't confirm this works on the RP2040
I have written a simple program that should recognize edges on an input and trigger an interrupt. The interrupt doesn't happen.
Here is the simple program:
And here is the output when run on a Pico2. The main loop runs fine and the pin is clearly changing state but the interrupt is not recognized.
I suspect that there is something about the RP2350 that requires a slight additional bit of work in order to enable the control of interrupts. It may have to do with the newly introduced security model.
I don't have a 2040 based Pico to test on right now so I can't confirm this works on the RP2040
The text was updated successfully, but these errors were encountered: