Explain the meaning of the following two statements and what do they accomplish:
ID: 3573055 • Letter: E
Question
Explain the meaning of the following two statements and what do they accomplish: TRISbits. TRISB0 = 1 TRISbits. TRISB0 =0; An LED is connected to pin RB0 of a P1C18F452 microcontroller, write a program to flash the LED such that ON time is 5 sec and the OFF time is 3 sec. Assume you have function with the signature void delay_ms(int n), where n is the number of milliseconds delay. Using C language, write an initialization subroutine to set up INT1 as falling- edge triggered and INT2 as rising-edge triggered interrupt inputs having high priorities. Explain how you can find the source of the interrupt when an interrupt occurs Write the high priority interrupt subroutine (handler) that turns on the right LED (pin 1 on PORTA) when the interrupt initialized in (a) is coming from INT1 and turns on the left LED (pin 3 on PORTA)when it comes from INT2. An analog -to-digital converter has a positive input reference voltage of 5.0V and k set up for 10-bit conversion. Calculate the resolution of the ADC in millivolts per hit What is the output code if the input voltage is 2.0V. An LM35DZ type analog temperature sensor is connected to analog port ANO of a PIC 18F452 microcontroller. The sensor provides an analog output voltage proportional to the temperature, i.e., V_O = 10mV/degree C. Write a small program that show s the steps required to read the temperature. Explain why the use of local variables is preferable in C programs designed for microcontroller with limited RAM Explain how the use of functions leads to well-structured C programs and the benefits of this design approach. Consider the ease of a microcontroller operating at 10 MHz that is required to communicate at 9600 baud with the serial port on a PC. The USART is used in asynchronous mode. Calculate the possible values of the baud rate generator register (SPBRG) for BRGH = 0 and 1, respectively. Which one of the two values above in (a) is acceptable and why? What is the actual baud rate achieved using the value selected in (1)?Explanation / Answer
5) a) Resolution is determined by refernce input and by word width.
Refernce voltage is the maximum value that ADC can convert which is 5 V.
10 bits means 2^10 output codes i.e. 1024
Hence the resolution = 5V/1024 which is 0.00488V or 4.88mV.
b) If refernce volatge is 2V
then it becomes 2/1024 V = 0.00195V or 1.95mV
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.