Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You decided to use a Microchip microcontroller and a laser finder with an approp

ID: 3828269 • Letter: Y

Question

You decided to use a Microchip microcontroller and a laser finder with an appropriate circuit that provides a voltage value proportional to the height of the crops (voltage=height/10). We assume a PIC18F4520 running at a frequency of 10MHz. The device controls 1 sprayer through PORTD pin RD0. This control is such that if:

-the height is less than 20cm S is open for 40sec (voltage less or equal to 2V).

- the height is between 20cm and 40cm S is open for 25sec (voltage between 2V and 4V .-

- the height is more than 40cm, S is open for 10sec (voltage more than 4V and less than 5V).

White an algorithm for this system

Explanation / Answer

Mov R1 10

Mov R2 40

Mov R1 voltage

Mov R2 height

Div r3 R2 10

Mov R1 r3

Add R1 r3

Compare R2 R1

Compare R1 r3

Compare r3 R2

Main

Exit

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote