Pin change interrupts for PyBoard v1.1?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Posts: 19
Joined: Tue Apr 03, 2018 2:58 am

Pin change interrupts for PyBoard v1.1?

Post by hybotics » Sun Dec 02, 2018 10:35 pm


I am working on a port of an Arduino library to Micropython, and am having some difficulty, I think this is because the Arduino library uses pin change interrupts, and Micropython does not seem to support that. Falling or Rising Edge does not get me the results I need.

Is there a way that Micropython can do this now, or will be able to it in the future?


User avatar
Posts: 3153
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada

Re: Pin change interrupts for PyBoard v1.1?

Post by dhylands » Sun Dec 02, 2018 11:32 pm

The STM32F4 used by the pyboard has a module called EXTINT, and the micropython support for that is documented here: ... xtInt.html

This is capable is generating interrupts on rising or falling edges, or both, but not on levels.

Note that there are 16 lines, and you need to look at the cpu pin to figure out which line is used. C5 uses line 5, and B4 uses line 4. This means that you can't have ExtInt configured for both C4 and B4, only one or the other. You can use the quick reference to determine the cpu pins for a given pin: ... ckref.html

Post Reply