View previous topic :: View next topic |
Author |
Message |
techknight
Joined: 21 Apr 2008 Posts: 231
|
Posted: Sat Jul 04, 2015 11:51 pm Post subject: xMega PWM question |
|
|
With the 74HC595, the output enable is inverse logic. Active low.
Now, the problem with this is, it makes the PWM CCA backwards on the timer. So, is there a way to fix it in the xmega? I know I could do it in the Megas with changing a parameter or two in the config timer.
any ideas without throwing an inverter in there? thanks.
(BASCOM-AVR version : 2.0.7.8 ) |
|
Back to top |
|
|
JC
Joined: 15 Dec 2007 Posts: 586 Location: Cleveland, OH
|
Posted: Mon Jul 06, 2015 1:26 pm Post subject: |
|
|
Which Xmega?
I thought the Xmegas had a register to invert the output signal, as one of the last stages of the digital I/O pin driver hardware.
It is obviously much easier to set a Register bit than it is to add additional hardware.
JC |
|
Back to top |
|
|
techknight
Joined: 21 Apr 2008 Posts: 231
|
Posted: Mon Jul 06, 2015 3:51 pm Post subject: |
|
|
Well, I dont know if it does or not. |
|
Back to top |
|
|
techknight
Joined: 21 Apr 2008 Posts: 231
|
Posted: Mon Jul 06, 2015 4:21 pm Post subject: |
|
|
I am also having another problem.
If I set the TCC0_CCA value right after initializing the timer for the first time, it works fine.
But in the middle of the program, no matter what I do, if I set TCC0_CCA again, I lose the PWM completely.
any ideas?
Edit: I figured it out. it seems to repeat every 256 even though its a 16-bit mode pwm.... odd. |
|
Back to top |
|
|
techknight
Joined: 21 Apr 2008 Posts: 231
|
Posted: Mon Jul 06, 2015 8:43 pm Post subject: |
|
|
New problem: PORTC.4 isnt working! Ive scoured the datasheet to see a reason why, and I am coming up empty.
But for the life of me, if I set PORTC.4 = output, and try working with PORTC.4, it does not function. Strange. |
|
Back to top |
|
|
Meister
Joined: 27 May 2010 Posts: 319
|
Posted: Tue Jul 07, 2015 2:10 pm Post subject: |
|
|
Code, please. |
|
Back to top |
|
|
|