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

Sun Oct 26 2014, 02:51 AM
sandeep bankar
dear sir I m facing problem about..how to read number of incoming call in gsm 900 a. pls help how to read it in atmel avr microcontroller.
ajay_bhargav
Mon Oct 20 2014, 11:22 AM
@skrishna, please post in forum so we can help you better.
Tue Oct 14 2014, 01:45 PM
skrishna
how do i write an ALP equivalent 7segment display interfacing embedded c program (both 8051 microcontroller)
Sat Oct 11 2014, 06:41 PM
vaidehi
want details of seven segment LED display common cathode ( IC CD 4026)
Fri Oct 03 2014, 12:52 PM
Narsim
Rickey you inspired me a lot ... I am also planing like you ...
ExperimenterUK
Wed Oct 01 2014, 09:33 PM
We're back.. we had a bug, but posting is back to normal
ExperimenterUK
Sat Sep 13 2014, 04:34 PM
jaimin1212,Pimpalkhare Create a thread for your question
jaimin1212
Sat Sep 13 2014, 06:35 AM
i want to make self balancing robot using MPU6050 using atmega8.. please help to get data of gyro and accelerometer from this sensor through atmega8.
Thu Sep 11 2014, 01:00 PM
Sunil Pimpalkhare
Hello sir, I am trying to make Wearfin project https://www.youtube.com/watch?v=iZ6PVBvQf-g so can u help me in teaching how to built the program???
Thu Sep 11 2014, 06:21 AM
hariom panday
plz hlp me in my project

Downloads

Comments

toypoy
Sun Oct 26 2014, 01:06 AM
hiswe
Thu Oct 23 2014, 04:18 PM
pddung93
Sun Oct 19 2014, 01:56 PM
msideal
Thu Oct 16 2014, 08:48 AM
robotgirl
Tue Oct 14 2014, 06:23 PM
BRV64
Mon Oct 13 2014, 05:48 AM
menadjelia
Mon Oct 13 2014, 02:47 AM
kulbhushan
Sun Oct 12 2014, 12:20 PM

Online

Guests: 34, Members: 0 ...

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

Members: 37533
Newest member: toypoy
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Oct 24 2014, 08:55 PM
Try holding STB high all the time.You might as wel...
msideal Avatar
Posted By msideal
Fri Oct 24 2014, 07:14 PM
Assembly Language Code:.INCLUDE "M16DEF.INC" LDI R...
msideal Avatar
Posted By msideal
Fri Oct 24 2014, 07:12 PM
Hi Friends,I changed my approach and now i'm using...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Oct 22 2014, 03:22 AM
Okay, it seems to be a simple serial connection.Th...
jona Avatar
Posted By jona
Tue Oct 21 2014, 10:29 PM
I found this slightly different data sheet on a pu...
majoka Avatar
Posted By majoka
Tue Oct 21 2014, 06:35 PM
after this Accept-language:en-us\r\n...
majoka Avatar
Posted By majoka
Tue Oct 21 2014, 06:33 PM
@ aksharAT89C51AC3 can bebut the final decision wi...
majoka Avatar
Posted By majoka
Tue Oct 21 2014, 06:29 PM
@ Okechukwubefore starting this project you should...
majoka Avatar
Posted By majoka
Tue Oct 21 2014, 06:18 PM
@ kirangowleyou have to set the microphone level a...