Intel 8085 microprocessor

Thread Starter

vincent19-mas

Joined Dec 27, 2012
83
Hey guys,

I will be doing a project using this microprocessor.

My title is Temperature sensor using ADC 0804 and display it in a LCD.

So, I have tried to interface the LCD with 8 bit mode of operation with the following coding :
Rich (BB code):
CPU "8085.TBL"
ORG 2000H
LXI SP,3FF0H

MVI A,80H
OUT 83H

MVI A,38H
CALL WR_CMD
MVI A,38H
CALL WR_CMD
MVI A,38H
CALL WR_CMD
MVI A,0CH
CALL WR_CMD
MVI A,06H
CALL WR_CMD
MVI A,80H
CALL WR_CMD
LXI H,MSG_LINE1

LINE1: MOV A,M
CPI 0
JZ NEXT_LINE
CALL WR_CHAR
INX H
JMP LINE1

NEXT_LINE: MVI A,0C0H
CALL WR_CMD
LXI H,MSG_LINE2

LINE2: MOV A,M
CPI 0
JZ EXIT
CALL WR_CHAR
INX H
JMP LINE2
EXIT: RST 1

WR_CMD: OUT 80H
MVI A,00000100B
OUT 82H
MVI A,00000000b
OUT 82H
CALL DELAY2
RET

WR_CHAR: OUT 80H
    MVI A,00000101B
    OUT 82H
    MVI A,00000001B
    OUT 82H
    CALL DELaY1
    RET

DELAY1: MVI C,40
LOOP_1: DCR C
    JNZ LOOP_1
    RET

DELAY2: MVI C,255
LOOP_2: DCR C
    JNZ LOOP_2
    RET

MSG_LINE1: DFB "8085 DEVELOPMENT",0
MSG_LINE2: DFB "SYSTEM-KUKUM",0
END
The output of this code that dispay on the LCD is :
8085 DEVELOPMENT
SYSTEM-KUKUM

Now, because 8255 PPI IC have only Port A, B and C each 8 ports respectively, I might be suffer from insufficient IO pins to be used. So I plan to interface the LCD with only 4 bit.

Anyone knows how am I able to interface a 2x16 LCD(controller: HD47780) using 4 bit mode ?

Thanks and appreciate your help !
 

t06afre

Joined May 11, 2009
5,934
A thing that strike me. Is that it is much simpler to interface both the LCD and the ADC directly to the CPU using a memory or IO mapped approach. If you use some kind of premade 8085 development board. I guess using the IO mapped approach will be preferable. Do you have to use the 8255 for device interface? In any way it would be helpful to see a drawing on how you plan to interface the LCD and ADC
 

Thread Starter

vincent19-mas

Joined Dec 27, 2012
83
A thing that strike me. Is that it is much simpler to interface both the LCD and the ADC directly to the CPU using a memory or IO mapped approach. If you use some kind of premade 8085 development board. I guess using the IO mapped approach will be preferable. Do you have to use the 8255 for device interface? In any way it would be helpful to see a drawing on how you plan to interface the LCD and ADC
Suggested ways of interface

I plan to just connect 4 pins of Data pins of LCD so that I will have more ports to be used

Any guidance ?

Thanks!
 

Attachments

t06afre

Joined May 11, 2009
5,934
Well, Thanks!

Just to ask, besides the initialization part that I should change, probably change the 38H to 20H for 5x7 dot matrix 2x16 LCD , what else should I change ? Thanks!
Can you be more specific on where the change from 38H to 20H is in the process.
 

Thread Starter

vincent19-mas

Joined Dec 27, 2012
83
So does that means I convert the 6 bit number to hex ? DB7, BB6,DB5,DB4, RS and E ?
Cause in 8 bit mode, it involve 10 bits binary number. I am confuse about this.

Anyway, when dealing with ADC 0804, I have to convert the temperature sense in analog to digital then convert it to ASCII then display it on a LCD. I am pretty confuse in binary to ASCII conversion. Let say the temperature it sensed is 30 degree celcius. How am I able to display this 30 to the LCD ? Can provide me some example ?

Thanks !

Anyway, do you mind providing more hints/example coding to deal with LCD in 4 bits ?

Thanks !
 

t06afre

Joined May 11, 2009
5,934
RS and E are more like control signal. Given that you only want to write to the LCD the R/W pin can be tied low. Then you have a low to high transition on the E pin The LCD will read the data on the databus. Then you write to the LCD after setting it in 4 bits mode. You write the upper 4 bits data first to D7-D4, then give a low to high transition on E. Then write the lower 4 bits to D7-D4 and give give a low to high to low transition on E.
 

t06afre

Joined May 11, 2009
5,934
Means I need to modify my wor_cmd and wr_char function ??? Thanks

Can you provide me with a simple example ? Thx
Yes those functions must be changed to fit the four bits mode. As for the example. I can not help much. I did a lot of code on the Z80, but never on the 8085. Was not very fond of 8086 either.
 

Thread Starter

vincent19-mas

Joined Dec 27, 2012
83
How about the 38H??? I should change to 20H?? 38H = 0000111000 which the sequence is RS,R/W, DB7, DB6,DB5,...DB1,DB0.it is 10 bit consisting of 8 data bit and 2 control pins.So for 4 bi data mode, how can I define the binary number ??? RS, R/W, DB7, DB6, DB5,DB4 then it is 6 bit binary number ??? Confuse about this..thanks
 

t06afre

Joined May 11, 2009
5,934
You could also put the LCD and the ADC on the same port. Then use the E(LCD) and CS(ADC) lines to control which device that is accessed on the common port
 
Top