Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bombasticbob opened this issue Oct 14, 2014 · 7 comments
Open

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

bombasticbob opened this issue Oct 14, 2014 · 7 comments
Assignees

Comments

@bombasticbob
Copy link
Contributor

work in progress.

@bombasticbob
Copy link
Contributor Author

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.

@omegahacker
Copy link

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.

@bombasticbob
Copy link
Contributor Author

thanks, will do

@bombasticbob
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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 bombasticbob changed the title current E5 PWM implementation is broken current E5 PWM implementation is LIMITED (was 'broken') Aug 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants