Vrsiddhartha Microcontroller Programs

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

7 SEGMENT

org 100h
lcd_display: db '3fh,06h,5bh,4fh,66h,6bh,70h,
07h,7fh,67h,77h,78h,39h,79h,5bh,71h,00h'
org 00h
rep: mov dptr,#100h
again : clr a
movc a,@a+dptr
jz exit
mov p0,a
acall delay
inc dptr
sjmp again
exit :

sjmp rep
delay :mov r3,#08
rep2: mov r1,#0ffh
rep1:mov r2,#0ffh
here:djnz r2,here
djnz r1,rep1
djnz r3,rep2
ret
end

LCD DISPLAY

INTERRUPT1
org 00h
sjmp main
org 000bh
sjmp isr1
org 0023h
sjmp isr2
sjmp main
org 000bh
sjmp isr1
org 0023h
sjmp isr2
main:mov ie,#92h
mov th1,#-3
mov tmod,#21h
mov scon,#40h
mov th0,#00h
mov tl0,#00h

INTERRUPT2
mov r0,#14
setb tr1
mov sbuf,#20h
mov dptr,#0ffc0h
mov a,#0ffh
movx @dptr,a
setb tr0
mov dptr,#mydata
setb tr1
mov sbuf,#20h
here:sjmp here
isr1:clr tr0
push dph
push dpl
djnz r0,repeat
mov th0,#00h
mov tl0,#00h

SENSOR

SERIAL
org 100h
mydata: db 'vrsec',0
org 00h
mov scon,#50h
mov tmod,#20h
mov th1,#-3
setb tr1
rep:mov dptr,#mydata
again : clr a
movc a,@a+dptr
jz exit
mov sbuf,a
here:jnb ti,here
clr ti
inc dptr
sjmp again
exit:jnb ri,exit

org 100h
mydata: db 'asif basha',0
org 00h
repeat:mov a,#38h
acall cmdwrt
mov a,#0fh
acall cmdwrt
mov a,#01h
acall cmdwrt
mov a,#06h
acall cmdwrt
mov a,#84h
acall cmdwrt
mov dptr,#mydata
again: clr a
movc a,@a+dptr
jz repeat
mov p0,a
acall datawrt
acall delay

inc dptr
sjmp again
cmdwrt: clr p3.3
clr p3.6
mov p0,a
acall delay
setb p3.6
ret
datawrt: setb p3.3
setb p3.6
mov p0,a
acall delay
clr p3.6
ret
delay: mov r1,#0ffh
here: mov r2,#0ffh
here1: djnz
r2,here1
djnz r1,here
ret
end

org 00h
mov tmod,#20h
mov scon,#40h
mov th1,#-3
setb tr1
again:mov dptr,#0ffc8h
movx a,@dptr
cjne a,#0ffh,pre
mov dptr,#mydata1
sjmp send
pre:mov dptr,#mydata2
send:clr a
movc a,@a+dptr
jz rep
mov sbuf,a
here:jnb ti,here
clr ti
inc dptr
sjmp send
rep:sjmp again
mydata1:db' obstacle not present',0
mydata2:db' obstacle present',0
end

LED DISPLAY1
org 00h
rep:
mov dptr,#0ffc1h
movx a,@dptr
mov r0,#08h
again:clr c
rlc a
jc next
djnz r0,again
next:mov a,r0
swap a
add a,r0

LEDDISPLAY2

TIMER1
org 00h
mov a,#00h
mov p2,a
again: acall delay1
cpl a
mov p2,a
acall delay2
cpl a
mov p2,a
sjmp again
delay1:mov r2,#05h
l2: mov tmod ,#00h

mov dptr,#0ffc0h
movx @dptr,a
sjmp rep
end

INTERRUPT3
cpl a
mov dptr,#0ffc0h
movx @dptr,a
mov r0,#14
setb tr0
pop dpl
pop dph
reti
isr2:clr ti
push 0e0h
clr a
movc a,@a+dptr
jz rep1
mov sbuf,a
inc dptr

TIMER2
mov tl1 ,#98h
mov th1 ,#11h
setb tr1
here:jnb tf1,here
clr tr1
clr tf1
djnz r2,l2
ret
delay2:mov r1,#0eh
l1: mov tmod ,#01h
mov tl0 ,#00h
mov th0 ,#00h

TIMER3
setb tr0
here1:jnb
tf0,here1
clr tr0
clr tf0
djnz r1,l1
ret
end

INTERRUPT4
pop 0e0h
reti
rep1:mov dptr,#mydata
pop 0e0h
mov sbuf,#20h
reti
repeat:clr tr0
mov tl0,#00h
mov th0,#00h
setb tr0
pop dpl
pop dph
reti
mydata:db "vrsec",0
end

clr ri
mov a,sbuf
mov dptr,#0ffc0h
movx @dptr,a
mov dptr,#0ffc1h
movx a,@dptr
mov sbuf,a
here1:jnb ti,here1
clr ti
sjmp rep
end

TRAFFIC 1
org 00h
mov a,#00h
mov p2,a
l1:mov p2,#56h
acall delay
mov p2,#59h
acall delay
mov p2,#65h
acall delay
mov p2,#95h
acall delay
sjmp l1

TRAFFIC 2
delay :mov
r2,#38h
mov tmod,#01h
l2: mov tl0,#00h
mov th0,#00h
setb tr0
here1: jnb
tf0,here1
clr tr0
clr tf0
djnz r2,l2
ret
end

KEYPAD1
org 00h
again1:mov dptr,#mydata
mov p1,0ffh
clr p1.0
jb p1.4,next1
mov a,#00h
acall delay
next1:jb p1.5,next2
mov a,#01h
acall delay
next2:jb p1.6,next3
mov a,#02h
acall delay
next3:jb p1.7,next4
mov a,#03H
acall delay
next4:setb p1.0
clr p1.1
jb p1.4,next5
mov a,#04h
acall delay
next5:jb p1.5,next6

KEY PAD2
mov a,#05h
acall delay
next6:jb p1.6,next7
mov a,#06h
acall delay
next7:jb p1.7,next8
mov a,#07h
acall delay
next8:setb p1.1
clr p1.2
jb p1.4,next7
mov a,#08h
acall delay
next9:jb p1.5,next10
mov a,#09h
acall delay
next10:jb p1.6,next11
mov a,#0ah
acall delay
next11:jb p1.7,next12

KEYPAD3
mov a,#0bh
acall delay
next12:setb p1.2
clr p1.3
jb p1.4,next13
mov a,#0ch
acall delay
next13:jb p1.5,next14
mov a,#0dh
acall delay
next14:jb p1.6,next15
mov a,#0eh
acall delay
next15:jb p1.7,again
mov a,#0fh
acall delay
again: ljmp again1
delay:movc a,@a+dptr
mov p0,a
ret

org 100h
mydata:db
3fh,06h,5bh,4fh,66h,6dh,7dh,07h,7fh,6fh,77h,7ch,039h,5eh,79h,
71h,00h
end

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy