Hi there,
Ive got this PWM program. Can anyone help me to describe how its work?
Thank you for the feedback
#include <reg51.h>
sbit output = P3^7;
void timer0_isr(unsigned char a) interrupt 1;
void timer1_isr(unsigned char B) interrupt 3;
void timer0_isr(unsigned char a) interrupt 1 {
output=1;
TL0 = a;
TR0=1;
}
void timer1_isr(unsigned char B) interrupt 3 {
output =0;
TL1 = b;
TR1 = 1;
}
void ISR_initialization (void){
IP = 0x00;
// IE = 0x82;
ET0 = 1;
ET1 = 1;
TMOD = 0x11;
TH0 = 0xFF; //
TH1 = 0xFF;
TF0 =0;
TF1 =0;
}
void main (){
ISR_initialization ();
}
Ive got this PWM program. Can anyone help me to describe how its work?
Thank you for the feedback
#include <reg51.h>
sbit output = P3^7;
void timer0_isr(unsigned char a) interrupt 1;
void timer1_isr(unsigned char B) interrupt 3;
void timer0_isr(unsigned char a) interrupt 1 {
output=1;
TL0 = a;
TR0=1;
}
void timer1_isr(unsigned char B) interrupt 3 {
output =0;
TL1 = b;
TR1 = 1;
}
void ISR_initialization (void){
IP = 0x00;
// IE = 0x82;
ET0 = 1;
ET1 = 1;
TMOD = 0x11;
TH0 = 0xFF; //
TH1 = 0xFF;
TF0 =0;
TF1 =0;
}
void main (){
ISR_initialization ();
}