digistump/DigisparkArduinoIntegration — pull request #5 by RC-Navy (2013-05-18 11:51:13+00:00)
Title: Some enhancement for Digispark

Hi Erik,

as you can see, I learnt to use github to propose my changes, my ideas for Digispark...
I did some work/test on DigisparkArduinoIntegration for several weeks.

Mainly:

1) librairies:
-a) fix some path issue in header files
-b) added examples
-c) fix keyword.txt for syntax color
-d) added half duplex capabilitty on a single wire in
-c) added library to allow PWM on any Pin whilst keeping DigiUSB
-d) added with some improvements: code size reduction + capability to call an external function in ISR (for example to share the timer for calling periodically the TinySoftPwm manager).

2) core:
-a) added a modification to allow high speed hardware PWM on Pin0 (up to 32.2KHz), 1 (up to 64.5KHz) and 4 (up to 64.5KHz) without breaking micros(), millis(), delay() and without disturbing DigiUSB. FAVOR_PHASE_CORRECT_PWM shall be set to 0 in core_build_option.h, otherwise Pin1 can only reach 32.2KHz and not 64.5KHz.
If you accept to merge this one with the next release, I will write a chapter on the wiki about PWM (TinySoftPwm and HW) for the Digispark focussing on the fact the DigiUSB can still be used. , HW PWM and DigiUSB can work together. For example, this allows to command the 3 PWM channels of a RGB strip Led through USB. High speed HW PWM allows to make speed controller for brushed motors, but without audible noise. What do you think about these ideas?

Regards,

RC Navy (Philippe)