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
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
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
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; } }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!