arduino icon indicating copy to clipboard operation
arduino copied to clipboard

current E5 PWM implementation is LIMITED (was 'broken')

Open bombasticbob opened this issue 11 years ago • 7 comments

work in progress.

bombasticbob avatar Oct 14 '14 20:10 bombasticbob

there seems to be an interaction of some kind where pins PC4 through pC7 have half the frequency of pins PC0 through PC3. This is probalby the waveform generator module [it needs to be disabled in the startup code, probably]. PD0 though PD3 won't be able to have PWM. PD4 through PD7 work fine, but if PD6 and PD7 are used for serial, there won't be any PWM out.

Still working on PWM for E series.

bombasticbob avatar Oct 19 '14 22:10 bombasticbob

Randomly ran across this comment when looking for E5 PWM examples. One thing that might explain why PC4 and PC5 might not behave the same is that the REMAP pin docs state that OCA and OCB will be OR-modulated between TCC4 and TCC5. No idea if that's what you're seeing, but thought I'd mention it as a possibile debugging path.

omegahacker avatar Dec 24 '14 15:12 omegahacker

thanks, will do

bombasticbob avatar Dec 30 '14 19:12 bombasticbob

a few observations: a) assigning FFH to WEXC_OUTOVDIS disables PWM output on port C only. When assigned to zero (the default value), PWM "almost works" on port C. b) port C pins 0-5 work as expected except 4 and 5 have half the output freq c) port D pins 6 and 7 do not work (header file defs for timer 5 suggest only CCA and CCB are used) d) consistently for timers 4 and 5, pins 6 and 7 aren't working [something else affects them?]

bombasticbob avatar Jan 07 '15 19:01 bombasticbob

using 'NORMAL' vs 'SINGLE SLOPE PWM' seems to help correct the problems with bit-select and signal output. however, 'NORMAL' only does one pulse per count overflow, so you get symmetrical 1khz output instead of PWM 2khz output (but it works correctly on all pins when selected).

bombasticbob avatar Jan 07 '15 20:01 bombasticbob

it appears that timer 5 PWM timer output on pins 6 and 7 basically doesn't happen, and similarly the output from timer 4 isn't being used on pins 4-7 on the E series. modes for the waveform extension affect PWM output directly. In short, there are only 6 usable PWM outputs for TC4 and TD5.

bombasticbob avatar Jan 13 '15 18:01 bombasticbob

In the interrim, the default 32E5 mapping will only support PWM on the following pins:

3 - port D pin 4 4 - port D pin 5 8 - port C pin 2 9 - port C pin 3 16 - port C pin 0 (also SDA) 17 - port C pin 1 (also SCL)

bombasticbob avatar Aug 17 '15 18:08 bombasticbob