Question: Question 3 As a junior engineer joining a new company, you have been tasked to analyse an unfinished legacy code left by your predecessor. The

 Question 3 As a junior engineer joining a new company, you

Question 3 As a junior engineer joining a new company, you have been tasked to analyse an unfinished legacy code left by your predecessor. The code is part of an ongoing project. The project includes converting an analogue signal to digital. The analogue input is 3 Vp-p varying between 1 V and 4 V at a frequency less than 100 Hz. The signal source is directly connect connected to pin (ANO) of a 20 MHz PIC18F252 Microcontroller. You have been told by your project manager that "the code is not working as expected". The following is the code used achieving that task: // 1 // 2 1/3 #include void main (void) { TRISC = 0x00; while (1) { ADCONO=0x00 ADCON1=0x85 ADCONObits.GO DONE = 1; while (ADCONObits.GO_DONE); PORTB=ADRESH; // 4 // 5 / / 7 // 8 } You need to answer the following questions: a. Given the settings on ADCONO and ADCON1, is the analogue input being sampled fast enough to avoid any sampling issues such as aliasing? Explain your reasoning. Question 3 As a junior engineer joining a new company, you have been tasked to analyse an unfinished legacy code left by your predecessor. The code is part of an ongoing project. The project includes converting an analogue signal to digital. The analogue input is 3 Vp-p varying between 1 V and 4 V at a frequency less than 100 Hz. The signal source is directly connect connected to pin (ANO) of a 20 MHz PIC18F252 Microcontroller. You have been told by your project manager that "the code is not working as expected". The following is the code used achieving that task: // 1 // 2 1/3 #include void main (void) { TRISC = 0x00; while (1) { ADCONO=0x00 ADCON1=0x85 ADCONObits.GO DONE = 1; while (ADCONObits.GO_DONE); PORTB=ADRESH; // 4 // 5 / / 7 // 8 } You need to answer the following questions: a. Given the settings on ADCONO and ADCON1, is the analogue input being sampled fast enough to avoid any sampling issues such as aliasing? Explain your reasoning

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 Databases Questions!