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

Rep-string manipulation instruction-microprocessor, REP : Repeat Instructi...

REP : Repeat Instruction Prefix :- This instruction is utilized as a prefix to other instructions. The instruction in which the REP prefix is provided, is executed repetitively

Software interrupts-microprocessor, Software Interrupts Software interr...

Software Interrupts Software interrupts are the result of an INT instruction in an executed program.  It may be assumed as a programmer triggered event that immediately stops e

Web services. , describes vertical and horizontal web services protocols. N...

describes vertical and horizontal web services protocols. Next, identify the similarities and differences between vertical and horizontal web services protocols. Finally, explain w

Second generation microprocessor, IInd Generation Microprocessor : The ...

IInd Generation Microprocessor : The second generation microprocessor by using n MOS technology seemed in the market in 1973.   The Intel  8080, of nMOS  technology

8086 assembly language, write and run a programme using 8086 assembly langu...

write and run a programme using 8086 assembly language that interchange the lower four bits of AL registered with upper four bits.

Motorola 68000 series, Motorola 68000 Series : 68000microprocessor is a...

Motorola 68000 Series : 68000microprocessor is a 16 bit processor that has addressing space of 65536 locations, each of which holds a 64-bits word; In order to address those lo

Modes of 8255 a-microprocessor, The modes are determined by the contents of...

The modes are determined by the contents of the control register, whose format is given in Figure These modes are: Mode 0: If a group is in mode 0, it is divided into 2 sets.

Program of generate a random number, This is a short program to practice as...

This is a short program to practice assembly language loops and if/else statements. You will use various jump commands and the cmp instruction. The program will generate a random

Assignment, Write an assembly program that adds the elements in the odd ind...

Write an assembly program that adds the elements in the odd indices of the following array. Use LOOP. What is the final value in the register?

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