need help with writing asm code for 8051 project

hi wondering if anyone can help me out with this, ive got the lcd displaying information, but i want it to display the temperature using the lm35 and adc0804 as well, using asm code. Basically i need to get the current reading from the lm35 and convert them in the adc0804 and then display that reading in degrees on the lcd display. I have found some similar projects like this but they were written in C. any help needed, thanks in advance

current embedded image
[url]http://www.flickr.com/photos/60242244@N02/8508718148/in/photostream[/url]

current code:

[code]
$mod51
rw equ P3.1
rs equ P3.0
en equ P3.2

org 0000h

clr rw
acall lcd_init
main:
mov a, #'W'
acall lcd_data
mov a,#'e'
acall lcd_data
mov a, #'l'
acall lcd_data
mov a,#'c'
acall lcd_data
mov a, #'o'
acall lcd_data
mov a,#'m'
acall lcd_data
mov a, #'e'
acall lcd_data
mov a,#' '
acall lcd_data
mov a,#'K'
acall lcd_data
mov a,#'e'
acall lcd_data
mov a,#'i'
acall lcd_data
mov a,#'t'
acall lcd_data
mov a,#'h'
acall lcd_data
sjmp $


lcd_init:
mov a,#01h
acall lcd_cmd
mov a,#38h
acall lcd_cmd
mov a,#0ch
acall lcd_cmd
mov a,#06h
acall lcd_cmd
ret


lcd_cmd:
clr rs
mov p2,a
setb en
acall delay
clr en
ret

lcd_data:
setb rs
mov p2,a
setb en
acall delay
clr en
ret

delay:
mov r0,#5h
l2: mov r1,#0ffh
l1: djnz r1,l1
djnz r0,l2
ret



end

[/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories