Question: What does the code below do? What is the logic? Please put comments in the code to make it readable(Put comments like for a person
What does the code below do? What is the logic?
Please put comments in the code to make it readable(Put comments like for a person who don't know anything). e.g #use delay(clock = 4000000) why clock = 4000000 ? I don't know.
# include < 16 f877.h > # fuses XT, NOWDT, NOPROTECT, NOBROWNOUT, NOLVP, NOPUT, NOWRT, NODEBUG, NOCPD #use delay(clock = 4000000) #use fast_io(c) int i = 0; # int_timer1 void timer1_kesme() { set_timer1(60536); i++ if (i == 50) { output_high(pin_c0); output_low(pin_c1); } else if (i == 100) { output_low(pin_c0); output_high(pin_c1); i = 0; } } void main(void) { setup_psp(PSP_DISABLED); setup_spi(SPI_SS_DISABLED); setup_timer_2(T2_DISABLED, 0, 1); setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_CCP1(CCP_OFF); setup_CCP2(CCP_OFF); set_tris_c(0 x00); output_c(0 x00); setup_timer_1(T1_INTERNAL | T1_DIV_BY_4); set_timer1(60536); enable_interrupts(int_timer1); enable_interrupts(GLOBAL); while (1);
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
