Subversion Repositories Code-Repo

Rev

Rev 199 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 199 Rev 201
Line 9... Line 9...
9
    OC2RS = 0x0001;    // PWM duty cycle
9
    OC2RS = 0x0001;    // PWM duty cycle
10
    OC2CON = 0x0006;   // PWM off, 16-bit, timer 2, fault pin disabled
10
    OC2CON = 0x0006;   // PWM off, 16-bit, timer 2, fault pin disabled
11
 
11
 
12
    IFS0CLR = 0x00000100;   // Disable Timer 2 interrupt
12
    IFS0CLR = 0x00000100;   // Disable Timer 2 interrupt
13
    T2CONSET = 0x8000;      // Turn on Timer 2
13
    T2CONSET = 0x8000;      // Turn on Timer 2
14
    PR2 = 0x0003;       // PWM period ~ 16-20Mhz
14
    PR2 = 0x0003;           // PWM period ~ 16-20Mhz
15
}
15
}
16
 
16
 
17
void PWM2_Start(void) {
17
void PWM2_Start(void) {
18
    OC2CONSET = 0x8000;
18
    OC2CONSET = 0x8000;
19
}
19
}