Thank you, Can a project have a private version of kinetis.h? How?
This type of per sketch customization is sort of difficult in the "pure" Arduino environment.
If you look in Kinetis.h you will see lines like:
Code:
#elif (F_CPU == 96000000)
#define F_PLL 96000000
#ifndef F_BUS
#define F_BUS 48000000
//#define F_BUS 96000000
#endif
#define F_MEM 24000000
So it only defines it if it is not already defined.
So for example if you can get the compile line options to include something like: -DF_BUS=96000000
Than it is defined and it will use that faster setting.
I believe in several of the other ways to build sketches like makefiles, VisualTeansy... You can probably easily customize the defines that get passed in like this.
Also some users like @FrankB has updated platform.txt to take defines out of some sketch specified file (defs.h) and add them to the build process.
And there are probably other hacks one can do with boards.txt... to hack on adding on another Optimize option like: Faster F_BUS where you copy the faster option and then on the commands list add it....
As for Synchronizing two PWM signals, not sure. I have not tried this. I know someone was working on something like this recently with T4. if it were me, I would probably look around and see what happens if I hack it.
That is I might look up which timer is associated with each of the pins you are trying to sychronize and see if I quickly try to set the FTMxCNT register of each of them to 0, will it get them more in sync? Or something like that depending on your actual needed offsets. like are the all multiples of each other.
I have done some servo controller code before, but with that I often used a timer and figure out delays to the next event... Sometime not ideal.