Hi Markus,
Yes there will definitely be a substantial overhead in using an ISR to manually toggle a GPIO output. Even if you stripped it right back to just your code inside the ISR then you're still going to be much slower than having the hardware do it all for you with a timer routed to an output pin. As you raise the frequency of your ISR eventually you starve the main code of cycles to the point where eventually it will not execute at all.
Last week I pushed a change to the master branch on Github that reduces the overhead of the library's ISR processing by a factor of 2 for the common case of just a single subscriber to the ISR so you might like to get the latest code to see if that helps you.
- Andy
Yes there will definitely be a substantial overhead in using an ISR to manually toggle a GPIO output. Even if you stripped it right back to just your code inside the ISR then you're still going to be much slower than having the hardware do it all for you with a timer routed to an output pin. As you raise the frequency of your ISR eventually you starve the main code of cycles to the point where eventually it will not execute at all.
Last week I pushed a change to the master branch on Github that reduces the overhead of the library's ISR processing by a factor of 2 for the common case of just a single subscriber to the ISR so you might like to get the latest code to see if that helps you.
- Andy