Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Show me what the menu will look like on the PC terminal program Puty. Explain the Interrupt Service Routine case statement. What does the main
Show me what the menu will look like on the PC terminal program Puty. Explain the Interrupt Service Routine case statement. What does the main program loop do?
***CODE***
#include "config.h" #include "serial_uart.h" // Insert subroutines // Subroutine that transmits the Menu to the PC void Build_Menu() { putch(0x0c); printf(" \tMain Menu "); printf("\tf\tFirst Name "); printf("\tl\tLast Name "); printf("\t4\tToggle LED on RA4 "); printf("\t5\tToggle LED on RA5 "); printf("\t6\tToggle LED on RA6 "); printf("\tm\tMenu "); } // Interrupt Service Routine (ISR)) void interrupt my_isr(void) { int8_t c; if( RCIE && RCIF) { // Get character c = getch(); // Check what character was received and act on it switch(c) { case 'f': printf("First "); break; case 'l': printf("Last "); break; case 'm': Build_Menu(); break; case '4': if(LATAbits.LATA4 == 1) PORTAbits.RA4 = 0; else PORTAbits.RA4 = 1; break; case '5': if(LATAbits.LATA5 == 1) PORTAbits.RA5 = 0; else PORTAbits.RA5 = 1; break; case '6': if(LATAbits.LATA6 == 1) PORTAbits.RA6 = 0; else PORTAbits.RA6 = 1; break; } } } // Main program int main(int argc, char** argv) { // Local variables int cnt; // Setup the oscillator OSCILLATOR_Initialize(); // Initialize PPS and PORTS PORT_PIN_Initialize(); // Initialize the UART UART_Initialize(); // Draw the menu Build_Menu(); while (1) { } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started