Discussion in "Project Help" started by    ppoonamk    Apr 28, 2011.
Thu Apr 28 2011, 02:56 AM
#1
http://img715.imageshack.us/i/cktn.jpg/
This is the circuit diagram of the project im working on. I have a few queries.
1) My Leds connected to P0.0 and P0.1 are not glowing. Is the resistance value too high?
2) The lcd backlight glows but no characters are displayed.
3) Are the 2 reset pins required if you are not using interrupts in your program?
This is my code.. Are there any errors?


busy equ p1.7
rs equ p3.5
rw equ p3.4
en equ p3.3
bzr equ p0.2
ledf equ p0.0
ledb equ p0.1

org 400h

show0: db 'Welcome To All','0'
show1: db 'Current Station','0'
show2: db 'Next Station','0'
show3: db 'Zurich','0'
show4: db 'Milan','0'
Show5: db 'Paris','0'

org 0000h
ajmp main

org 0003h
test: mov c,p3.2
jnc halt
setb bzr
reti
halt:
clr bzr ;till zero blow on the bzr
ajmp test

main:
mov ie,#00h
setb ea
setb ex0
here:
mov p2,#00h
acall ini
mov dptr,#show0
acall read
clr ledf ;p1.0
acall delay

mov a,#01h
acall command; Now make memory clear cursor home
mov dptr,#show1
acall read
setb ex0
mov a,#0c0h
acall command
mov dptr,#show3
acall read
acall delay ;Stopage1 time 3 sec rookee
acall delay
clr bzr
acall delay

mov a,#01h
acall command
mov dptr,#show2
acall read
mov a,#0c0h
acall command
mov dptr,#show4
acall read
setb bzr
acall delay10

mov a,#01h
acall command
mov dptr,#show1
acall read
mov a,#0c0h
acall command
mov dptr,#show4
acall read
acall delay ;Stopage2 time 3 sec shsar
acall delay
clr bzr
acall delay

mov a,#01h
acall command
mov dptr,#show2 ;display ne
acall read
mov a,#0c0h
acall command
mov dptr,#show5
acall read
setb bzr


mov a,#01h
acall command
mov dptr,#show1
acall read
mov a,#0c0h
acall command
mov dptr,#show5
acall read

acall delay ;Stopage2 time 3 sec Meerut
acall delay
clr bzr
acall delay

setb ledf ; p1.0 ;off led at p1.0 for forward journey
clr ledb ; p1.1 ; 0n Led for back ward journey

mov a,#01h
acall command
mov dptr,#show2 ;display ne shar
acall read
mov a,#0c0h
acall command
mov dptr,#show4
acall read
setb bzr

mov a,#01h
acall command
mov dptr,#show1
acall read
mov a,#0c0h
acall command
mov dptr,#show4
acall read
acall delay ;Stopage2 time 3 sec shsar
acall delay
clr bzr
acall delay

mov a,#01h
acall command
mov dptr,#show2 ;display ne roor
acall read
mov a,#0c0h
acall command
mov dptr,#show3
acall read
setb bzr

mov a,#01h
acall command
mov dptr,#show1
acall read
mov a,#0c0h
acall command
mov dptr,#show3
acall read
setb ledb ;p1.1
ljmp here
;routine for stepper motor
; Delay Routine ;one sec delay
delay:
push acc
push 00h
push 01h
push p0
push p1
mov r0,#0eh
loopr:
mov a,#0ffh
loopb:
mov b,#0ffh
loopa: djnz b,loopa
djnz 0e0h,loopb
djnz r0,loopr
pop p1
pop p0
pop 01h
pop 00h
pop acc
ret


;=============== Routine to read data from prog mem

read:
nex: clr a
movc a,@a+dptr
cjne a,#'0',aga
sjmp down
aga: acall display
inc dptr
sjmp next
down:
ret ;LCD strobe subroutines

ini: mov a,#38h
acall command
mov a,#38h
acall command
mov a,#38h
acall command
mov a,#38h
acall command
mov a,#0eh
acall command
mov a,#06h
acall command
mov a,#01h
acall command
mov a,#80h
acall command
ret

command:
acall ready
mov p1,a
clr rs
clr rw
setb en
clr en
ret

display:
acall ready
mov p1,a
setb rs
clr rw
setb en
clr en
ret

ready:
clr en
mov p1,#0ffh
clr rs
setb rw
wait: clr en
setb en
jb busy,wait
clr en
Ret

End
Thu Apr 28 2011, 08:09 AM
#2
Asm Code is diffcult to understand, Go through step by step divide your code to do individual task first then try to combine all.
In LCD, do you see boxes in them, r just blank, adjust the contrast pot so that you can see the boxes and the text.
If there is boxes means LCD hasn't been initialized properly.
Thu Apr 28 2011, 03:15 PM
#3

1) My Leds connected to P0.0 and P0.1 are not glowing. Is the resistance value too high?

ppoonamk


yes resistance should be around 680 ohms.

2) The lcd backlight glows but no characters are displayed.

ppoonamk


As kiran suggested. you can follow LCD tutorial if facing problem.

3) Are the 2 reset pins required if you are not using interrupts in your program?

ppoonamk


what has interrupt to do with the reset pin? and there is only 1 reset on controller not 2. Moreover your reset circuit is wrong. Please correct it.
You need a capacitor (10uF) between VCC and RST; and a resistor (10K) between RST and GND.

This is my code.. Are there any errors?

ppoonamk


You have to assemble your code to find out errors. logical errors can only be corrected once you run the code on hardware to see how its behaving.

Do the changes in hardware as suggested and try again.
Thu Apr 28 2011, 11:12 PM
#4
Thanks for your response.. will get back to after these changes

Get Social

Information

Powered by e107 Forum System

Conversation

ExperimenterUK
Thu Apr 28 2016, 01:15 AM
We don't provide project reports. We try to help you do your project
Wed Apr 27 2016, 06:02 PM
abebe tigabu
help me by sending final thesis project automatoc green house effect control by arduino or by at89c51 microcontroller
Mon Apr 25 2016, 03:40 AM
abhinav kumar
Hey there, i want to project report on the RFID BASED SECURITY SYSTEM using AVR microcontroler.please mail as soon as possible. Thank you
Mon Apr 18 2016, 01:07 PM
umesh parekh
i want c code for rfid based car parking system using 8051 and parking slot indicator.if u have please email me
Mon Apr 18 2016, 10:35 AM
Prakash Rao
i need to work on OCR for Numbers, could not find any such projects done using 8051
Wed Apr 13 2016, 07:27 PM
Sanket GUPTA
hey i am new to embedded system and i want to pursue ms in embedded, i have 2 years before i can apply for ms.. in two years can i gain sufficient knowledge. i know c and c++
ExperimenterUK
Wed Apr 13 2016, 05:15 PM
@Suraj.. the method will work ,but edit to suit your compiler
Wed Apr 13 2016, 01:05 AM
Suraj Sridhar
Can I use the LCD Device driver code for STM32F401RET6?
Mon Apr 11 2016, 04:38 PM
Ankith
Can I get the code to access the file from 8051
Mon Apr 11 2016, 04:37 PM
Ankith
can I access a file or folder from sdcard using 8051 microcontroller?

Downloads

Comments

legomaniak
Thu Apr 28 2016, 03:26 PM
APEGEEKZ
Mon Apr 25 2016, 01:54 PM
aishwar
Sun Apr 24 2016, 10:58 AM
nitring
Sun Apr 24 2016, 09:38 AM
Yuri_Golden
Fri Apr 22 2016, 05:15 PM
asif1990
Fri Apr 22 2016, 12:31 AM
Khairnardm
Tue Apr 19 2016, 04:35 AM
amh
Fri Apr 15 2016, 07:45 AM

Online

Guests: 51, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37757
Newest member: legomaniak
Forum Activity
legomaniak Avatar
Posted By legomaniak
Thu Apr 28 2016, 03:29 PM
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Apr 28 2016, 01:12 AM
Did you read / understand my last post to your oth...
APEGEEKZ Avatar
Posted By APEGEEKZ
Mon Apr 25 2016, 02:54 PM
im sending mail using sim900 to gmail but its thro...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Apr 24 2016, 06:51 PM
This file was hosted by Rapidshare.comRapidshare.c...
aishwar Avatar
Posted By aishwar
Sun Apr 24 2016, 11:02 AM
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Apr 22 2016, 07:29 PM
You will have to post your code and Proteus projec...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Apr 22 2016, 07:19 PM
If the temperature is below the set point, "if (te...
Yuri_Golden Avatar
Posted By Yuri_Golden
Fri Apr 22 2016, 05:33 PM
Hey Guys, I searched in the forum about a similar ...
Yuri_Golden Avatar
Posted By Yuri_Golden
Fri Apr 22 2016, 05:21 PM
Hey Man, I know that it is been a long time... but...
Karan123 Avatar
Posted By Karan123
Fri Apr 22 2016, 11:39 AM
Hello,Many of Thanks for pseudocontrolcode2.zip ....