Help
Advanced Member level 2
Hi,
Anyone can help me to explain the code?
How does it work? What's the program doing? How can it generate the frequency at P1^0? I try to changed it to P2^1 but still generated at P1^0..why?
Thank You.
Anyone can help me to explain the code?
Code:
void PWM_3_Set_050(void)
{
T2CON &= 0xFD; // Clear *only* C /T2 bit
T2MOD |= 0x02; // Set T2OE bit (omit in basic 8052 clone)
// Set at lowest frequency (~45Hz with 12MHz xtal)
// - adjust as required (see PRM HARDWARE)
TL2 = 0x00; // Timer 2 low byte
TH2 = 0x00; // Timer 2 high byte
RCAP2L = 0x00; // Timer 2 reload capture register, low byte
RCAP2H = 0x00; // Timer 2 reload capture register, high byte
ET2 = 0; // No interrupt.
TR2 = 1; // Start timer 2
}
How does it work? What's the program doing? How can it generate the frequency at P1^0? I try to changed it to P2^1 but still generated at P1^0..why?
Thank You.