2 The following C program reads a byte of data from Port B, finds the square, wait for two (10 Marks) second and then se
Posted: Sun May 15, 2022 5:45 pm
2 The following C program reads a byte of data from Port B, finds the square, wait for two (10 Marks) second and then send it to Port D. Debug the errors in the following program for the PIC16 microcontroller and write the corrected program. (2marks per error identified and correction) #include <xc.h> void MAIN (void) { unsigned char; TRISD = 0x00; TRISB = 0x00; while (1) { readbyte = PORTB; readbyte *= readbyte _delay_ms(2000); readbyte = PORTD; } }