Code for reading flow & generating led output, Assembly Language

Assignment Help:

Code for Reading Flow & Generating LED Output

The code starts with the scanning of the PORT 3, for reading the flow status to check for various flow conditions and compare to start subroutines for respective flow. The overflow conditions are checked in respective subroutines for LED driving i.e. In flash mode or continuous, the LED are L1, L2, L3 & L4 are used for various combinations.

The details of program code are below:-

MOV P3 , #0FFH ; Define Port 3 as input port

START : MOV A ,P3

      MOV  A ,P3

    ANL A, #1Ch   ;  Masking of    BITs FLOW RATE

    ACALL FLOW00     ;  FLOW RATE 0  SUBROUTINE 

    ACALL FLOW01 ;  FLOW RATE 1  SUBROUTINE

    ACALL FLOW02 ;  FLOW RATE 2  SUBROUTINE

    ACALL FLOW03;  FLOW RATE 3 SUBROUTINE

    ACALL FLOW04;  FLOW RATE 4  SUBROUTINE

     ACALL FLOW05;  FLOW RATE 5  SUBROUTINE

     ACALL FLOW06 ;  FLOW RATE 6  SUBROUTINE

     ACALL FLOW07 ;  FLOW RATE 7  SUBROUTINE

     SJMP   START 

; FLOW RATE   SUBROUTINES SECTION

FLOW00 :    CJNE  A,#00H ,  NEXT0       ;  FLOW RATE   0

MOV A, P3

ANL A,#20h

CJNE A ,#00H ,  FLOWOV      ; LED 1   FLASHING 1Hz

SETB P1.0 ;  LED 1 ON

ACALL DELAY   ;   500ms   DELAY   

CLR P1.0    ; LED 1 OFF

ACALL DELAY   ; 500ms   DELAY

RET

FLOWOV :  

SETB P1.0     ; LED 1 ON  ( 0 HZ)

NEXT0 : RET

FLOW01:    CJNE  A ,#04H  ,  NEXT1       ; FLOW RATE   1

MOV A, P3

ANL A,#20h

CJNE A ,#00H ,  FLOWOV1

SETB P1.0 ;  LED 1 ON

ACALL DELAY   ;   500ms   DELAY   

CLR P1.0    ; LED 1 OFF

ACALL DELAY   ; 500ms   DELAY

RET

FLOWOV1 :  

SETB P1.0     ; LED 1 ON ( 0 HZ)

NEXT1 :RET

 ;    SUBROUTINE FLOW RATE   2

FLOW02:    CJNE  A,#08H ,  NEXT2       ; FLOW RATE   2

MOV A, P3

ANL A,#20h

CJNE A ,#00H ,  FLOWOV2  ; 

MOV P1 ,#03H   ; LED 1 , LED 2  ON     FLASHING 1 Hz

ACALL DELAY   ;   500ms   DELAY

MOV P1 ,#00H   ; LED 1 , LED 2   OFF

ACALL DELAY ; 500ms   DELAY

RET

FLOWOV2 :  

MOV P1 ,#03H   ; LED 1 , LED 2  ON

NEXT2  : RET

  ;  SUBROUTINE FLOW RATE   3

;    SUBROUTINE FLOW RATE   4

;     SUBROUTINE FLOW RATE   5

;     SUBROUTINE FLOW RATE   6

;    SUBROUTINE FLOW RATE   7

 


Related Discussions:- Code for reading flow & generating led output

Lods-stos-string manipulating instruction-microprocessor, LODS : Load Stri...

LODS : Load String Byte or String Word:- The LODS instruction loads AL/AX register by the content of a string pointed to by DS:SI register pair. The SI is automatically modifie

Prepare the assembly code sequence, Problem (a) Prepare the assembly c...

Problem (a) Prepare the assembly code sequence for each of the four styles (accumulator, memory-memory, stack, load/store) of machine for the code fragment: A = B + C;

Code using hla language, You have been hired by the Elbonian government to ...

You have been hired by the Elbonian government to write an Assembly program to help its workforce determine how much their tax will be. The tax laws in Elbonian are very simple. Th

8086 microprocessors, program to find negative and positive integers from g...

program to find negative and positive integers from given signed numbers with output and explanation of every instructions.

Call-unconditional branch instruction-microprocessor, CALL : Unconditional...

CALL : Unconditional Call:- This instruction is utilized to call a subroutine from a basic program. In case of assembly language programming, the term procedure is utilized int

Scas-string manipulation instruction-microprocessor, SCAS : Scan String By...

SCAS : Scan String Byte or String Word:- This instruction scans a string of words or byte for an operand word or byte specified in the register AL or  register AX. The string i

Conditional branch instruction-microprocessor, Conditional branch Instructi...

Conditional branch Instruction When these type of instructions are executed, they transfer control of execution to the address mention relatively in the instruction, provided t

Overview of intel pro-pentium, Overview of Intel Pro-Pentium : The 2 c...

Overview of Intel Pro-Pentium : The 2 chief players in the PC CPU market are Motorola and Intel.  Intel has enjoyed incredible success with its processors since the early 1980

Relocate program and data, ) What is the difference between re-locatable pr...

) What is the difference between re-locatable program and re-locatable data?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd