Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/30/07 11:52
Read: times


 
#131703 - 128 should be enough
Responding to: ???'s previous message
I use to do it through the basic timer mode using ccuinterupt at 0.125us per count. Created an array of 1's and 0's (for duty cycle) and run them through ccuinterupt. But seems if i reduced the count too low (change the frequency) it will not work right.

so i need a way to create the pwm >20khz and change the duty cycle. Just need some help trying to set up my control register on how to make the pwm.

I put
TPCR2H = 0; /* set ccu prescaler high*/
TPCR2L = 0; /* set ccuprescaler low */
TCR20 = 0x03; /* Symmetrical PWM, up-counter */
TIFR2 = 0; /* Clear all interrupt flags */
TICR2 = 0x89; /* enable interrupt for OCA, ICA,
ECCU = 1; /* enable CCU interrupts */

Thanks

List of 4 messages in thread
TopicAuthorDate
PWM 89LPC935            01/01/70 00:00      
   How Many Bits of Resoultion?            01/01/70 00:00      
      128 should be enough            01/01/70 00:00      
   how to take duty cycle of hex            01/01/70 00:00      

Back to Subject List