@thor i don't really know arduinos, but iirc with msp430 it was just writing one or two registers describing the pulse and setting the pin to pwm output. the .h files were also okish imo. maybe you can offload the hardware-talking parts to something like that and only use the bigger microcontroller to tie everything together.