Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: PWMC suddenly stops working
PostPosted: Sun Jun 28, 2009 6:44 pm 
Offline

Joined: Sun Jun 28, 2009 6:38 pm
Posts: 1
I am using the 4 PWMC channels to output to LED's. Each time a PWMC cycle of channel 0 is finished, an interrupt is triggered. In this interrupt, I then write new values to the 4 PWMC channels. What happens is that sometimes, after a while, suddenly one (which one is random) of the 4 PWMC channels stops working - in this case, I can only measure a DC output on the oscilloscope anymore, not a pulse. So it's like the hardware just stopped working.

What could cause the PWMC channel to stop working? Is there some known bug about this? I read somewhere in this forum that the minimum value one should output on the PWMC is not 1, but 2. Is this true?

If anybody could only give me a hint what's wrong here, I'd be endlessly thankful as I am on time pressure and this is driving me mad...


Top
 Profile  
 
 Post subject: Re: PWMC suddenly stops working
PostPosted: Wed Jul 01, 2009 7:24 pm 
Offline

Joined: Wed Jun 07, 2006 10:52 pm
Posts: 60
You can't write new values to the PWM registers if their counter is less than 2. If you do, it can censored it up.

This is how I got around it:

Code:
while (AT91C_BASE_PWMC->PWMC_CH[nChannel].PWMC_CCNTR < 2);

AT91C_BASE_PWMC->PWMC_CH[nChannel].PWMC_CUPDR = nDutyCycle;


Basically just wait until the counter is no longer less than 2.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
cron