Nobody has an idea? In pins_teensy.c PWM is generated with TPM or FTM. But to understand the FTM flowcharts and the application notes is really hard.
The use of FTM_SYNC_CNTMAX or FTM_SYNC_CNTMIN and FTM_SYNC_SWSYNC is not clear to me. They say that COMBINE has to be used but this is always
linking two channels.
Or should i try to use FTM_PWMLOAD? I would say no. Because i have to preload the CnV registers and then write all new values at one point to the
FTM.
To explain my problem:
analogWrite(redVal, redPin);
analogWrite(greenVal, greenPin);
analogWrite(blueVal, bluePin);
gives the following result:
As you can see, the red part of the white laser is activated first. Then comes the green part in and the beam goes to yellow. The blue part comes
and the beam goes to white.
At the end the red part is switched off, the beam becomes cyan. Then the green part is switched off, the blue part is the last visible color before the laser
goes off.
This happens because the light source is just a point modulated over mirrors in his movement to get a line.
The Teensy is fast enough to generate an 8 bit resolution for each color (rgb) just with TTL modulation.
The problem is just to write the PWM values at the very same time to the pins.
May be that anybody had the same problem before?
Martin