Upload
girish19
View
56
Download
0
Embed Size (px)
Citation preview
7 - SEGMENT DISPLAY M.P-8086 1. AIM: TO DISPLAY 8 CHARACTERS (VI MICRO) BY IMPLEMENTING SOFTWARE MULTIPLEXING TABLE DATA CONTL CON: L1: ORG MOV MOV DEC MOV OUT MOV OUT CALL INC CMP JNZ JMP EQU EQU EQU 1200H 00C8H 00C0H 1000H SI, TABLE BL, 08H------for 8 characters on board BL AL, BL------ LSB-0 to MSB-7 CONTRL, AL--- to select the digit position to be displayed AL, [SI] DATA, AL------ to glow the portion as per the data in input DELAY SI SI, 00H L1 CON Following code for delay CL, 02H AL, FFH AL L3 CL L2
which can be altered DELAY: MOV L2: MOV L3: DEC JNZ DEC JNZ RET
INPUT : (To display EEE) 1200 TO 1207--- F9, F9, F9,00,00,00,00,00DATA FORMAT TABLE: dp D7 g D6 f D5 e D4 d D3 c D2 b D1 a D0
2. AIM: PROGRAM TO IMPLEMENT ROLLING DISPLAY A MESSAGE OF 16 CHARACTERS M.P-8086 ---------------------------------------------------------------------------------------TABLE EQU 1200H COUNT EQU 00C0H DATA EQU 00C8H ---------------------------------------------------------------------------------------REP: COM: LO1: ORG MOV MOV MOV ADD MOV DEC MOV OUT MOV OUT CALL INC CMP JNZ DEC JNZ SUB CMP JZ DX COM altered DELAY: L1: L2: MOV MOV DEC JNZ DEC JNZ RET CL, 02H AL, FFH AL L2 CL L1 1000H CH, 0FH------for a display of 16 characters on board DX, 00H SI, TABLE SI, DX BL, 08H------for display of first 8 characters on board BL AL, BL COUNT, AL----- to select the digit position to be displayed AL, [SI] DATA, AL------ to glow the portion as per the data in input DELAY SI BL, 00H LO1 CH COM SI, 07H SI, 120FH REP Following code for delay which can be
INC JMP
INPUT : (To display EEE) 1200 TO 120F--- F9, F9, F9,00,00,00, F9, F9, F9,00,00,00,
F9, F9, F9,00STEPPER MOTOR 3. AIM: TO RUN A STEPPER MOTOR AT DIFFERENT SPEEDS (BY USING 8086) START: L00P2: MOV MOV MOV OUT MOV DEC JNZ INC LOOP JMP DI, 1018H-------- location where the data available CL, 04H---------- initializing count as 4 values AL, [DI] C0, AL------ C0 is the control word to send data to motor Following code for delay which can be altered DX, 1010H DX L00P1 DI L00P2 START
L00P1:
INPUTS: 1018----- 09, 05, 06,0A 4. AIM: TO RUN A STEEPER AT DIFFERENT SPEEDS (USING 8031 OR 8051) START: JO: MOV MOV MOVX PUSH PUSH MOV MOV MOV MOV DJNZ DJNZ DJNZ MOVX POP POP INC DJNZ SJMP END DPTR, #4500H R0, #04H------ initializing count as 4 values A,@DPTR DPH DPL DPTR, #FFC0H---FFC0 is the control word to send data to motor Following code for delay which can be altered R2, #04H R1, #FFH R3, #FFH R3, DELAY R1, DELAY1 R2, DELAY1 End of Delay code @DPTR, A DPL DPH DPTR R0, JO START
DELAY1: DELAY:
INPUTS:
4500 --- 09, 05, 06,0A TRAFFIC LIGHT CONTROLL PORT A:
PA7 D8
PA6 D7
PA5 D6
PA4 D5
PA3 D4 PORT B:
PA2 D3
PA1 D2
PA0 D1
PB7 D20
PB6 D19
PB5 D18
PB4 D17
PB3 DL78 PORT C:
PB2 DL56
PB1 DL34
PB0 DL12
PC7 D16
PC6 D15
PC5 D14
PC4 D13
PC3 D12
PC2 D11
PC1 D10
PC0 D9
DUAL LIGHTS: 0 FOR GREEN 1 FOR RED 8086 26 20 22 24 8051 0FF0F 0FF0C 0FF0D 0FF0E
CNTRL PORT A PORT B PORT C
B: B1:
8086 MOV DI, 0015 MOV DX, 0FFF DEC DX JNZ B1 JNZ B RET
L6: L5: L4:
8051 MOV R5, #12 MOV R6, #0FF MOV R7, #0FF DJNZ R7, L4 DJNZR6, L5 DJNZR5, L6
5. To glow all Red LEDs, neglect dual LEDs by using (8086): i.e. D17, D8, D3, D18 MOV OUT MOV OUT MOV OUT MOV OUT AL, 80 CNTRL, AL AL, 84 PORT A, AL AL, 20 PORT B, AL AL, 10 PORT C, AL
6. To glow all Red LEDs neglect dual LEDs Using (8051): MOV MOV MOVX MOV MOV MOVX MOV MOV MOVX MOV MOV MOVX A, #80 DPTR, CNTRL @DPTR, A A, #84 DPTR, PORT A @DPTR, A A, #20 DPTR, PORT B @DPTR, A A, #10 DPTR, PORT C @DPTR, A
DELAY PROGRAME:
DIGITAL TO ANALOG PORT ADDRESSES: PORT DAC 1 DAC 2 MP-8086 00C0 00C8 MICRO 51 E0C0 E0C8 MICRO - 31 FFC0 FFC8
BY USING MICRO-8051 1. TO GENERATE SQUARE WAVE AT DAC 1 OUT PUT: ORG 4100 MOV DPTR, #FFC0 START: MOV A, #00 MOV X @DPTR, A LCALL DELAY MOV A, #FF MOVX @DPTR, A LCALL DELAY LJMP START DELAY: MOV R1, #05 LOOP1: MOV R2, #FF HERE: DJNZ R2, HERE DJNZ R1, LOOP1 RET SJMP START
2. TO CREATE A SAW TOOTH WAVE AT THE OUT PUT OF DAC 1. ORG LOOP1: 4100 MOV MOV MOVX INC SJMP DPTR, #FFC0 A, #00 @DPTR, A A LOOP1
3. TO GENERATE TRIANGULAR WAVEFORM AT DAC 1 OUTPUT: ORG 4100 MOV MOV MOVX INC JNZ MOV MOVX DEC JNZ LJMP DPTR,#FFC0 A, #00 @DPTR, A A LOOP1 A, #FF @DPTR, A A LOOP 2 START
START: LOOP1:
LOOP2:
BY USING MICRO PROCESSOR -8086 1. TO GENERATE SQUARE WAVE AT DAC 2 OUT PUT: START: MOV OUT CALL MOV OUT CALL JMP MOV LOOP RET AL, 00 C8, AL DELAY AL, FF C8, AL DELAY START CX, 05FF L1
DELAY: L1:
2. TO CREATE A SAW TOOTH WAVE AT THE OUTPUT OF DAC 1. START: L1: MOV OUT INC JNZ JMP AL, 00 C0, AL AL L1 START
3. TO GENERATE TRIANGULAR WAVEFORM AT DAC 2 OUT PUT START: L1: MOV MOV OUT INC JNZ MOV MOV OUT DEC JNZ JMP BL, 00 AL, BL C8, AL BL L1 BL, FF AL, BL C8, AL BL L2 START
L2:
4.
TO GENERATE SINE WAVE WAVEFORM AT DAC 1 OUT PUT MOV MOV MOV OUT INC LOOP JMP BX, 1100 CL, 46H --To initialize a count of 70 D values at input AL, [BX] C0, AL BX L1 START
START: L1:
INPUT (LOOK UP TABLE) 1100 7F AA D1 ED FC FC ED D1 AA 7F 53 2D 10 01 07 1D 3F 69 8A B5 D9 F2 FE FA E7 C8 A0 74 49 25 0B 00 0B 25 49 74 95 BF E0 F7 FF F7 E0 BF 95 69 3F 1D 07 01 10 2D 53 A0 C8 E7 FA FE F2 D9 B5 8A 5F 36 17 04 04 17 36 5F
ANALOG TO DIGITAL 1. The following program selects channel 0. Execute the program. Start the analog to digital by pressing the SOC switch. ADC 0809 converts the analog input at channel 0 to a digital value and 74LS374 latches the data to glow the LEDs accordingly. Thus you can see the converted data Output BY MP-8086 ORG MOV OUT MOV OUT HLT PROCUDURE: 1. Place jumper J2 in B position 2. Place jumper J5 in A position 3. Enter and execute the program 4. Vary the analog input (using trimpot) and gives the SOC by pressing the SOC switch. 5. See the corresponding digital value in the led display. 1000 AL, 10----- Channel 0 intialisation, ALE low C8, AL---- Control word intialisation to send data to ADC board AL, 18----ALE high intialisation C8, AL
2. The following program selects channel 0 and Start the analog to digital conversion by using ALE signal. . ORG MOV OUT MOV OUT MOV OUT HLT PROCUDURE: 1. Place jumper J2 in C position 2. Place jumper J5 in A position 3. Enter and execute the program 4. Vary the analog input (using trimpot) and view the corresponding digital value in the led display. 1000 AL, 10 C8, AL AL, 18 C8, AL AL, 10 C8, AL
BY USING 8031/51 1. The following program selects channel 0. Execute the program. Start the analog to digital convertion by pressing SOC switch. ADC 0809 (U3) converts the analog input at channel 0 to a digital value and 74LS374 latchet the data to glow the LEDs accordingly. ORG 4100 MOV DPTR, #FFC8 MOV A, #10 MOVX MOVX HERE: PROCUDURE: 1. Place jumper J2 in B position 2. Place jumper J5 in A position 3. Enter and execute the program 4. Vary the analog input (using trimpot) and gives the SOC by pressing the SOC switch. 5. See the corresponding digital value in the led display. SJMP @DPTR, A @DPTR, A HERE MOV A, #18 ALE HIGH CHANNEL 0 SELECTION AND ALE LOW
2. The following program select 0 and start analog to digital convertion by making ALE high to low through software. Please ensure that the jumper J2 should be in C position. Thus you can see the digital output through LEDs after execution of program. ORG 4100 MOV DPTR, #FFC8 MOV A, #10 MOVX MOV A, #18 MOVX MOV A, #10 MOVX HERE: PROCUDURE: 1. Place jumper J2 in C position 2. Place jumper J5 in A position 3. Enter and execute the program 4. Vary the analog input (using trimpot) and view the corresponding digital value in the led display. SJMP @DPTR, A HERE @DPTR, A ALE LOW @DPTR, A ALE HIGH CHANNEL SELECTION AND ALE LOW