Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

microcontroller programming PIC18FXX, Write the code for each comment as showing in the right side include cxc.in define user data register count at location 30

microcontroller programming PIC18FXX, Write the code for each comment as showing in the right side image text in transcribed
include cxc.in define user data register count at location 30 define user-data register count2 at 31 PSECT start ORGO Start MOVWF OSCCON configure internal oscillator for 2 MH configure PORTD as output for LEDs whole poms configure RCZ as output for the Fan cungle par configure RAS as input for Temp sensor pin) configure 54 as input for button oper configure AND as analog ng ADCONT configure ADCON2 for left ustified, TAOFOSCH dock configure ADCOND HAND Na and enable DC module MOVWF ADCONI MOWWF ADCON BACK: CALL DELAY call delay subroutine : start ADC conversion : wait for ADC conversion to complete ; display 8-bit ADC result on the LEDs check whether the analog input is greater than 2.5 V :if yes, then switch on the fan check whether the button is pressed if yes, then switch off the motor : go back and repeat the loop DELAY: DECFSZ count? GOTO DELAY DECESZ count2 decrement count until it becomes 0 decrement count2 until it becomes 0 RETURN END ;return from the subroutine include cxc.in define user data register count at location 30 define user-data register count2 at 31 PSECT start ORGO Start MOVWF OSCCON configure internal oscillator for 2 MH configure PORTD as output for LEDs whole poms configure RCZ as output for the Fan cungle par configure RAS as input for Temp sensor pin) configure 54 as input for button oper configure AND as analog ng ADCONT configure ADCON2 for left ustified, TAOFOSCH dock configure ADCOND HAND Na and enable DC module MOVWF ADCONI MOWWF ADCON BACK: CALL DELAY call delay subroutine : start ADC conversion : wait for ADC conversion to complete ; display 8-bit ADC result on the LEDs check whether the analog input is greater than 2.5 V :if yes, then switch on the fan check whether the button is pressed if yes, then switch off the motor : go back and repeat the loop DELAY: DECFSZ count? GOTO DELAY DECESZ count2 decrement count until it becomes 0 decrement count2 until it becomes 0 RETURN END ;return from the subroutine

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

Students also viewed these Databases questions

Question

8. Describe the steps in the development planning process.

Answered: 1 week ago