Question: Problem 1 8 : ( 4 5 points ) A voltage - controlled oscillator ( VCO ) is an electronic oscillator whose frequency is controlled

Problem 18: (45 points)
A voltage-controlled oscillator ( VCO ) is an electronic oscillator whose frequency is controlled by an input voltage. The C-code in Figure 2 implements a VCO using the dsPIC33EP64MC502-I/SP microcontroller.
(7 points) Complete lines 23 and 24 to specify the peripheral pin to which the analog control voltage is applied. Justify your answer in one or two short sentences.
(6 points) Add comments to lines 26,46, and 48.
(12 points) Specify an equation for PTPER in line 51, ensuring the output frequency linearly changed from 10 kHz to 2 kHz as the control voltage rises from 0 V to 3.3 V . Explain your logic in complete sentences and demonstrate relevant calculations.
(3 points) Specify an equation for PDC2 in line 52 so that the duty cycle of the square-wave output remains approximately 40% regardless of the square-wave frequency. Justify your answer in one or two short sentences.
(10 points) Modify the codes to accommodate the ADC module in 12-bit operation mode. Provide the line numbers and corresponding modified codes. Explain your logic in complete sentences and show appropriate calculations.
(7 points) Compare the advantages and disadvantages of 10-bit and 12-bit operation modes.232425 AD1CHSObits. CHOSA2=1;26 AD1CON1bits.ADON =1;void Init_PWM_module(void){PTCONbits.PTEN =0;PTPER =737;PDC2=368;IOCON2bits.PMOD =1;IOCON2bits.PENH =1;FCLCON2bits.FLTMOD =3;PTCONbits.PTEN =1;}int main(void){Init_ADC();Init_PWM_module();while (1){__delay_ms(50);AD1CON1bits.SAMP =1;__delay_us(10);AD1CON1bits.SAMP =0;while (!AD1CON1bits.DONE);PTPER;PDC2;}}
Figure 2: C code for Problem 18.
Problem 1 8 : ( 4 5 points ) A voltage -

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!