You have configured the PIC as follows:EUSART to run at 9600 BaudTMR to run with a 1:1 prescaler and call myTMR1ISR whenever TMR1 rolls over.The constant ONE_MILLISECOND is the number of 1:1 prescaled TMR1 counts that occur in 1 millisecond. Which of the following best describes the behavior observed on the terminal when the PIC is executing the following ISR?void myTMR1ISR(void) { printf("One Long String\r\n"); PIR1bits.TMR1IF = 0; TMR1_SetTimer(0x10000 - ONE_MILLISECOND);}Group of answer choicesAn unknown, but consistent delay between print messages, main responsiveNo delay between messages being printed, main unresponsive1ms delay between print messages, main responsive
Question
You have configured the PIC as follows:EUSART to run at 9600 BaudTMR to run with a 1:1 prescaler and call myTMR1ISR whenever TMR1 rolls over.The constant ONE_MILLISECOND is the number of 1:1 prescaled TMR1 counts that occur in 1 millisecond. Which of the following best describes the behavior observed on the terminal when the PIC is executing the following ISR?void myTMR1ISR(void) { printf("One Long String\r\n"); PIR1bits.TMR1IF = 0; TMR1_SetTimer(0x10000 - ONE_MILLISECOND);}Group of answer choicesAn unknown, but consistent delay between print messages, main responsiveNo delay between messages being printed, main unresponsive1ms delay between print messages, main responsive
Solution
The behavior observed on the terminal when the PIC is executing the given ISR would be "An unknown, but consistent delay between print messages, main responsive".
Here's why:
The ISR (Interrupt Service Routine) is printing a string every time the Timer1 overflows. The time it takes for the Timer1 to overflow is not specified, but it is longer than 1 millisecond because after each overflow, the timer is set to a value that is 1 millisecond less than its maximum value (0x10000).
The time it takes to print the string is also not specified, but it is likely to be significant because the EUSART is running at 9600 Baud, which is relatively slow.
Therefore, there will be a delay between the print messages, and this delay will be consistent because the timer overflow and the print operation are deterministic.
The main program will be responsive because the ISR is not blocking. After the ISR is executed, the program control will return to the main program.
Similar Questions
You have configured the PIC as follows:RC2 is configured as an outputTMR1 to run with a 1:1 prescaler and calls myTMR1ISR whenever TMR1 rolls over.What is the frequency and duty cycle of the waveform formed on RC2?void myTMR1ISR(void) { if (PORTCbits.RC2 == 1) { LATCbits.LATC2 = 0; TMR1_WriteTimer(0x10000 - 8000); } else { LATCbits.LATC2 = 1; TMR1_WriteTimer(0x10000 - 24000); } PIR1bits.TMR1IF = 0;}Group of answer choices500 Hz at 75% duty cycle2000 Hz at 66% duty cycleNone of the above500 Hz at 25% duty cycle2000 Hz at 33% duty cycle
The main function or role performed by the CCP module of PIC in compare mode in addition to timer 1 is
Configure TIMER 2 of PIC microcontroller for 1 ms delay
What value we should load in OCR0 register to generate 25.6ms of delay. Use Timer 0, CTC mode, with prescalar = 1024.
The main function or role performed by the CCP module of PIC in compare mode in addition to timer 1 isSelect one:a. To vary the oscillator frequencies in order to receive larger periodsb. To vary the status of synchronized levelsc. To vary the pin status in accordance to the precisely controlled timed. To vary the duty cycle of the rectified output
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.