?? Develop the program in EXAMPLE 1 so you have to receive a character using UART receive interrupt instead checking the UART receive buffer all the time.
Tell me where the change will be
>1 # include
#include #pragma config FNOSC-FRC #pragma config POSCHD-NONE #pragma config OSCIOFNC 0N // OSC2 Pin Function (OSC2 pin has digital I/O function) #pragma config FCKSM = CSECMD // Clock Switching and Monitor (Clock switching is! enabled, #pragma config FWDTEN = OFF // Watchdog timer is disabled #pragma config JTAGEN OFF // JTAG Port Enable (JTAG is Disabled) delayXXX) functions macros defined here // Use internal oscillator (FOSC 8 Mhz) Primary Oscillator Source (Primary Oscillator Disabled) 10 12void vInitPLLIntosc void 13void uarti( void ); 14void vPutCharUi char cChar 15void vPutstrU1char pcStr 16char cGetCharU1 ( void 18int main( void) 19 20 21 char cChar; ADIPCFGL -0xFEFE: 1/ Initialize AN pins as digital CNPU2bits.CN30PUE-1 // Enable internal pull-up resistor for A2 pin TR?SA2= 1; // A2 pin is an input 23 24uartl 25 26 27 28 29 30 vInitPLLIntosc/ Initialization of PLL printf ("Hello its me (Microstick Plus) In"I Write welcome text to standard butput while (1) cChar-cGetCharUI ( ) ; VPutCharUl (cChar) // Read one character form UART // Send back the read character >1 # include #include #pragma config FNOSC-FRC #pragma config POSCHD-NONE #pragma config OSCIOFNC 0N // OSC2 Pin Function (OSC2 pin has digital I/O function) #pragma config FCKSM = CSECMD // Clock Switching and Monitor (Clock switching is! enabled, #pragma config FWDTEN = OFF // Watchdog timer is disabled #pragma config JTAGEN OFF // JTAG Port Enable (JTAG is Disabled) delayXXX) functions macros defined here // Use internal oscillator (FOSC 8 Mhz) Primary Oscillator Source (Primary Oscillator Disabled) 10 12void vInitPLLIntosc void 13void uarti( void ); 14void vPutCharUi char cChar 15void vPutstrU1char pcStr 16char cGetCharU1 ( void 18int main( void) 19 20 21 char cChar; ADIPCFGL -0xFEFE: 1/ Initialize AN pins as digital CNPU2bits.CN30PUE-1 // Enable internal pull-up resistor for A2 pin TR?SA2= 1; // A2 pin is an input 23 24uartl 25 26 27 28 29 30 vInitPLLIntosc/ Initialization of PLL printf ("Hello its me (Microstick Plus) In"I Write welcome text to standard butput while (1) cChar-cGetCharUI ( ) ; VPutCharUl (cChar) // Read one character form UART // Send back the read character