Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

xMega PWM question

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
techknight

Bascom Member



Joined: 21 Apr 2008
Posts: 231

usa.gif
PostPosted: Sat Jul 04, 2015 11:51 pm    Post subject: xMega PWM question Reply with quote

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
View user's profile
JC

Bascom Member



Joined: 15 Dec 2007
Posts: 586
Location: Cleveland, OH

usa.gif
PostPosted: Mon Jul 06, 2015 1:26 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
techknight

Bascom Member



Joined: 21 Apr 2008
Posts: 231

usa.gif
PostPosted: Mon Jul 06, 2015 3:51 pm    Post subject: Reply with quote

Well, I dont know if it does or not.
Back to top
View user's profile
techknight

Bascom Member



Joined: 21 Apr 2008
Posts: 231

usa.gif
PostPosted: Mon Jul 06, 2015 4:21 pm    Post subject: Reply with quote

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
View user's profile
techknight

Bascom Member



Joined: 21 Apr 2008
Posts: 231

usa.gif
PostPosted: Mon Jul 06, 2015 8:43 pm    Post subject: Reply with quote

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
View user's profile
Meister

Bascom Member



Joined: 27 May 2010
Posts: 319

blank.gif
PostPosted: Tue Jul 07, 2015 2:10 pm    Post subject: Reply with quote

Code, please.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum