8085 Assembly for Lcd

Making your program work.
Post Reply
kd5vmf
Posts: 1
Joined: Thu May 22, 2008 3:42 pm

8085 Assembly for Lcd

Post by kd5vmf » Thu May 22, 2008 3:55 pm

Here is my 8085 assembly code. I can use this in a simulator and it displays on my terminal right. But when I put it on my proto all I get is garbage on the lcd. I have tested all my ports and my circuit. Everything looks well. I can use a martix keypad and input the data convert it and send it to the lcd just fine. But I am tring to read a ds1387 clock and convert it the display it. I have done this before with a led hex display. Worked great. Videos on YouTube under Figtronix.
I also hooked up the serial output to a max232 chip and hooked it to my TRS80 MOdel100 for a terminal. I have done this before to. But I still only get trash on my screen. Let me know if you can.

--------------------------------------------------
8085 DISASSEMBLER LISTING
Line Addr Opcodes Label Instruction
--------------------------------------------------

0001 0000 C3 00 03 JMP L0001

0035 0024 C3 00 40 JMP L0002
---------------------------------------------------------------------------------
0765 0300 31 00 F0 L0001: LXI SP,0F000H
0766 0303 33 INX SP
0767 0304 3E 00 MVI A,00H
0768 0306 D3 81 OUT 81H
0769 0308 D3 81 OUT 81H
0770 030A D3 81 OUT 81H
0771 030C 3E 40 MVI A,40H
0772 030E D3 81 OUT 81H initialization
0773 0310 3E 6E MVI A,6EH
0774 0312 D3 81 OUT 81H
0775 0314 3E 15 MVI A,15H
0776 0316 D3 81 OUT 81H
0777 0318 3E 02 MVI A,02H
0778 031A D3 00 OUT 00H
0779 031C 3E 2F MVI A,2FH
0780 031E D3 4A OUT 4AH
0781 0320 3E 0C MVI A,0CH
0782 0322 D3 4B OUT 4BH
-----------------------------------------------------------------------------------
0783 0324 3E 3F MVI A,3FH
0784 0326 32 03 80 STA 8003H
0785 0329 32 06 80 STA 8006H
0786 032C 32 11 80 STA 8011H
0787 032F 32 14 80 STA 8014H
0788 0332 3E 79 MVI A,79H
0789 0334 32 04 80 STA 8004H
0790 0337 32 12 80 STA 8012H
0791 033A 3E 78 MVI A,78H
0792 033C 32 07 80 STA 8007H
0793 033F 32 15 80 STA 8015H
0794 0342 3E 31 MVI A,31H store codes for lcd transimision
0795 0344 32 05 80 STA 8005H
0796 0347 3E 32 MVI A,32H
0797 0349 32 13 80 STA 8013H
0798 034C 3E 35 MVI A,35H
0799 034E 32 08 80 STA 8008H
0800 0351 32 16 80 STA 8016H
0801 0354 3E 1C MVI A,1CH
0802 0356 32 02 80 STA 8002H
0803 0359 3E 3A MVI A,3AH
0804 035B 32 0B 80 STA 800BH
0805 035E 32 0E 80 STA 800EH
0806 0361 3E 2F MVI A,2FH
0807 0363 32 19 80 STA 8019H
0808 0366 32 1C 80 STA 801CH
------------------------------------------------------------------------------------
0809 0369 DB 40 L0007: IN 40H
0810 036B 32 02 81 STA 8102H
0811 036E DB 42 IN 42H
0812 0370 32 01 81 STA 8101H read time date store binary
0813 0373 DB 44 IN 44H
0814 0375 32 00 81 STA 8100H
0815 0378 DB 47 IN 47H
0816 037A 32 03 81 STA 8103H
0817 037D DB 48 IN 48H
0818 037F 32 04 81 STA 8104H
0819 0382 DB 49 IN 49H
0820 0384 32 05 81 STA 8105H
-----------------------------------------------------------------------------------
0821 0387 21 02 81 LXI H,8102H
0822 038A 11 0F 80 LXI D,800FH
0823 038D 7E MOV A,M
0824 038E 47 MOV B,A convert binary to ascii for seconds
0825 038F 0F RRC
0826 0390 0F RRC
0827 0391 0F RRC
0828 0392 0F RRC
0829 0393 CD 06 04 CALL L0003
0830 0396 12 STAX D
0831 0397 13 INX D
0832 0398 78 MOV A,B
0833 0399 CD 06 04 CALL L0003
0834 039C 12 STAX D
-----------------------------------------------------------------------------------
0835 039D 2B DCX H
0836 039E 11 0C 80 LXI D,800CH
0837 03A1 7E MOV A,M
0838 03A2 47 MOV B,A convert binary to ascii for min
0839 03A3 0F RRC
0840 03A4 0F RRC
0841 03A5 0F RRC
0842 03A6 0F RRC
0843 03A7 CD 06 04 CALL L0003
0844 03AA 12 STAX D
0845 03AB 13 INX D
0846 03AC 78 MOV A,B
0847 03AD CD 06 04 CALL L0003
0848 03B0 12 STAX D
-----------------------------------------------------------------------------------
0849 03B1 2B DCX H
0850 03B2 11 09 80 LXI D,8009H
0851 03B5 7E MOV A,M
0852 03B6 47 MOV B,A convert binary to ascii for hr
0853 03B7 0F RRC
0854 03B8 0F RRC
0855 03B9 0F RRC
0856 03BA 0F RRC
0857 03BB CD 06 04 CALL L0003
0858 03BE 12 STAX D
0859 03BF 13 INX D
0860 03C0 78 MOV A,B
0861 03C1 CD 06 04 CALL L0003
0862 03C4 12 STAX D
----------------------------------------------------------------------------------
0863 03C5 21 03 81 LXI H,8103H
0864 03C8 11 17 80 LXI D,8017H
0865 03CB 7E MOV A,M
0866 03CC 47 MOV B,A convert binary to ascii for day
0867 03CD 0F RRC
0868 03CE 0F RRC
0869 03CF 0F RRC
0870 03D0 0F RRC
0871 03D1 CD 06 04 CALL L0003
0872 03D4 12 STAX D
0873 03D5 13 INX D
0874 03D6 78 MOV A,B
0875 03D7 CD 06 04 CALL L0003
0876 03DA 12 STAX D
---------------------------------------------------------------------------------
0877 03DB 23 INX H
0878 03DC 11 1A 80 LXI D,801AH
0879 03DF 7E MOV A,M
0880 03E0 47 MOV B,A convert binary to ascii for month
0881 03E1 0F RRC
0882 03E2 0F RRC
0883 03E3 0F RRC
0884 03E4 0F RRC
0885 03E5 CD 06 04 CALL L0003
0886 03E8 12 STAX D
0887 03E9 13 INX D
0888 03EA 78 MOV A,B
0889 03EB CD 06 04 CALL L0003
0890 03EE 12 STAX D
----------------------------------------------------------------------------------
0891 03EF 23 INX H
0892 03F0 11 1D 80 LXI D,801DH
0893 03F3 7E MOV A,M
0894 03F4 47 MOV B,A convert binary to ascii for year
0895 03F5 0F RRC
0896 03F6 0F RRC
0897 03F7 0F RRC
0898 03F8 0F RRC
0899 03F9 CD 06 04 CALL L0003
0900 03FC 12 STAX D
0901 03FD 13 INX D
0902 03FE 78 MOV A,B
0903 03FF CD 06 04 CALL L0003
0904 0402 12 STAX D
0905 0403 C3 12 04 JMP L0004
---------------------------------------------------------------------------------
0906 0406 E6 0F L0003: ANI 0FH
0907 0408 FE 0A CPI 0AH
0908 040A DA 0F 04 JC L0005 used by all converts
0909 040D C6 07 ADI 07H
0910 040F C6 30 L0005: ADI 30H
0911 0411 C9 RET
---------------------------------------------------------------------------------
0912 0412 21 02 80 L0004: LXI H,8002H
0913 0415 4E MOV C,M
0914 0416 DB 81 L0006: IN 81H output data to lcd
0915 0418 E6 01 ANI 01H
0916 041A CA 16 04 JZ L0006
0917 041D 23 INX H
0918 041E 7E MOV A,M
0919 041F D3 80 OUT 80H
0920 0421 0D DCR C
0921 0422 C2 16 04 JNZ L0006
0922 0425 C3 69 03 JMP L0007


---------------------------------------------
LIST OF LABELS
Sorted by address: Sorted by name:
---------------------------------------------

L0001: 0300 L0001: 0300
L0007: 0369 L0002: 4000
L0003: 0406 L0003: 0406
L0005: 040F L0004: 0412
L0004: 0412 L0005: 040F
L0006: 0416 L0006: 0416
L0002: 4000 L0007: 0369

------------------------------------------------------------PORTS-----------------------------------
8251a mode=81H COMMAND=80H
8155 COMMAND=02H
DS1387 REG_A=4AH REG_B=4BH

Sonovkwf
Posts: 6
Joined: Wed Sep 20, 2017 7:33 pm

8085 Assembly for Lcd

Post by Sonovkwf » Wed Oct 11, 2017 4:17 pm

Does anybody know the HD44780 lcd module will work with the TMS-200 controller since it does not have a display?

Post Reply