| ??? 05/08/09 12:01 Read: times |
#165148 - pwm code Responding to: ???'s previous message |
void PWM_SETUP(void)
{
CFG841 |= 0xC0;
PWMCON = 0xDF; // Dual 8 bit PWM - MODE 5
// PWM0
// 11.0592 MHz /64 /PWM1L Clock Div = 1/64
// 11.0592 MHz /64 /0xFF = 677 Hz
// PWM0L/PWM1L = Duty Cycle 0x3F / 0xFF = 24.706%
// PWM1
// 11.0592 MHz /64 /PWM1L Clock Div = 1/64
// 11.0592 MHz /64 /0xFF = 677 Hz
// PWM0H/PWM1H = Duty Cycle 0x3F / 0xFF = 24.706%
PWM0L = 0x3F;
PWM0H = 0x3F;
PWM1L = 0xFF;
PWM1H = 0xFF;
}
Kai thanks again this my code, I succeed to define the Duty cycle and frequency from your expanation I using uvision3 for simulation do you knew how to see the PWM output in the simulation (logic analyzer) ? (P3^4 or P3^3) Mayer |
| Topic | Author | Date |
| How to setup Dudy cycle ADuC841 PWM | 01/01/70 00:00 | |
| PWM | 01/01/70 00:00 | |
| ADUC841 pwm | 01/01/70 00:00 | |
| Mode 5 // 1101 1111 | 01/01/70 00:00 | |
| pwm code | 01/01/70 00:00 | |
Yes, use the logic analyzer | 01/01/70 00:00 |



