TECH 3157 Quiz – Timer/Counter, ADC Fall 2020 Please complete the Quiz all by yourself independently. No discussion with others is allowed Name_______________________ 1) (10 pts) A PWM waveform with a frequency of 40 KHz and duty ratio of 60% needs to be generated using the PWM function of the ATmega328P. Use timer 1 and fast PWM mode to generate the PWM waveform in channel B (i.e. OC1B). Please determine the proper register values of Timer 1 that needed to generate the required waveform TCCR1A, TCCR1B, OCR1A and OCR1B. Please show the process in detail. ‘ 2) (10 pts) If the timer 0 is working on waveform generation mode 5, what is the lowest and highest frequency of the PWM waveform that can be generated, respectively? 3) (2pts ) True or False: ATmega328P has a 10-bit successive approximation ADC. 4) (4 pts) What should Vref value be if we want a resolution of 2 mV for the 10-bit ADC (i.e. the minimum voltage changes that it can detect is 2mV)? 5) (4pts) If we want to read an analog input from channel A2 with a reference voltage of 1.1V, what value should ADMUX be set? Please explain. 6) (10 pts) If the reference voltage is 5V, and the obtained ADC value is as follows: ADCH = 0x03, ADCL = 0x40 What is the analog voltage Vin if ADLAR is set as 1? How about if ADLAR is 0?
欢迎咨询51作业君