otacon14112
Experienced Member
Hi guys, I've been trying to figure out what's wrong for over a year. I can get this screen to work P E R F E C T L Y on a PIC microcontroller, PIC16F690 to be exact. I'm trying to use an 8255 Programmable Peripheral Interface and output the data through its ports. I've tried 4-bit mode on port 1, 4-bit mode on port 2, and 8-bit mode with D0-D7 on port 1, and RS and EN as D4 and D0, respectively, on port 2. I have a 74LS373 latch on both ports.
I can't believe I can't get this ****ed thing to work on the 8088. There is this to consider: most of the time when I power on the breadboard, there are random LEDs that light up (when I have LEDs plugged into the 16 output pins on the 2 8-bit ports). I have to hit the reset button several times, and if that doesn't work, I have to turn the power supply off and back on a few times until the program in ROM runs.
I've been following Robert Grossblatt's 8088 Project Book very closely.
Here is my code in 8-bit:
I've done pretty much everything I can think of to the board, changing capacitor values, swapping chips, etc. There is actually a program I can run almost all the time on the first try if I hold in the reset switch while I turn on the power supply, so at this point, I'm thinking it's software-related. It's quite possible I'm doing something completely wrong. If so, please show me what I'm doing wrong. I would prefer to figure it out on my own, but I'm completely out of ideas, and it works effortlessly with my PIC, so I KNOW it should be able to work.
If it helps, here are some pictures I took of the system and my oscilloscope:
8284 pin 8 CLK when the system is not working: http://www.flickr.com/photos/9114793@N03/sets/72157634880600574/
8088 pin 25 ALE when the system is not working: http://www.flickr.com/photos/9114793@N03/sets/72157634874156595/
8088 pin 25 ALE when the system is working: http://www.flickr.com/photos/9114793@N03/sets/72157634874292649/
Schematics: http://www.flickr.com/photos/9114793@N03/sets/72157634881520510/
I've kind of posted a duplicate thread from another board, but after more investigation, I feel it's software-related, so I decided to put it here.
Well, if anyone can help me, that would be awesome. Thanks
Oh, and I'm using NASM as my assembler, if that helps.
I can't believe I can't get this ****ed thing to work on the 8088. There is this to consider: most of the time when I power on the breadboard, there are random LEDs that light up (when I have LEDs plugged into the 16 output pins on the 2 8-bit ports). I have to hit the reset button several times, and if that doesn't work, I have to turn the power supply off and back on a few times until the program in ROM runs.
I've been following Robert Grossblatt's 8088 Project Book very closely.
Here is my code in 8-bit:
Code:
; ************************************************
; * *
; * A PROGRAM TO EXPERIMENT WITH MY LCD DISPLAY *
; * *
; ************************************************
;*****************************************************************************
; *
; USING 8-BIT MODE *
; *
; Lines used for control signals on port 2: *
; B4 B0 *
; RS EN Hex Operation *
; ** ** *** ********* *
; 0 1 01h IR write as an internal operation (display clear, etc.) *
; 1 1 11h Write data to DDRAM or CGRAM (DR to DDRAM or CGRAM) *
; *
;*****************************************************************************
USE16
section .text
start: xor ax,ax
mov ss,ax
mov sp,2048
mov al,90h ;This sets the 8255 to operate
;in Mode 0 (basic input output)
;with port 0 as an input and
out 03h,al ;ports 1 and 2 as outputs.
call LongDelay
mov al,0x00 ; Clear the pins on ports 1 and 2
out 01h,al
out 02h,al
call LCDinit
mov al,0x01
out 02h,al
; call Delay100us
call Delay2ms
mov al,0x80 ;Set DDRAM address to 00h
out 01h,al
mov al,0x00
out 02h,al
; call Delay100us
call Delay2ms
mov al,11h
out 02h,al
; call Delay100us
call Delay2ms
mov al,0x48
out 01h,al ;Output "H"
mov al,10h
out 02h,al
; call Delay100us
call Delay2ms
mov al,11h
out 02h,al
; call Delay100us
call Delay2ms
mov al,0x69
out 01h,al ;Output "i"
mov al,10h
out 02h,al
; call Delay100us
call Delay2ms
jmp $
LongDelay: mov word [bx],0x2FFF ; Reset the countdown timer.
Delaya: dec word [bx] ; Decrement it by 1 each time.
cmp word [bx],00h
jnz Delaya ; If the counter hasn't counted
; down to 00h yet, keep going.
ret
Delay100us: mov word [bx],0x0009 ; Reset the countdown timer.
us100: dec word [bx] ; Decrement it by 1 each time.
cmp word [bx],00h
jnz us100 ; If the counter hasn't counted
; down to 00h yet, keep going.
ret
Delay2ms: mov word [bx],0x008f ; Reset the countdown timer.
ms2: dec word [bx] ; Decrement it by 1 each time.
cmp word [bx],00h
jnz ms2 ; If the counter hasn't counted
; down to 00h yet, keep going.
ret
LCDinit:
mov al,01h
out 02h,al
call Delay2ms
call Delay2ms
mov al,00111000b ; 8-bit, 2 lines, 5x8 characters
out 01h,al
mov al,00h
out 02h,al
call Delay2ms
call Delay2ms
mov al,0x00 ; Clear the pins on ports 1 and 2
out 01h,al
out 02h,al
mov al,01h
out 02h,al
call Delay2ms
call Delay2ms
mov al,00001100b ; Turn display on, cursor off, and do not blink the character at cursor
out 01h,al
mov al,00h
out 02h,al
call Delay2ms
call Delay2ms
mov al,0x00 ; Clear the pins on ports 1 and 2
out 01h,al
out 02h,al
mov al,01h
out 02h,al
call Delay2ms
call Delay2ms
mov al,00000001b ; Clear the screen
out 01h,al
mov al,00h
out 02h,al
call Delay2ms
call Delay2ms
mov al,0x00 ; Clear the pins on ports 1 and 2
out 01h,al
out 02h,al
mov al,01h
out 02h,al
call Delay2ms
call Delay2ms
mov al,00010100b ; Set cursor to move and display to shift to the right
out 01h,al
mov al,00h
out 02h,al
call Delay2ms
call Delay2ms
mov al,0x00 ; Clear the pins on ports 1 and 2
out 01h,al
out 02h,al
mov al,01h
out 02h,al
call Delay2ms
call Delay2ms
mov al,00000110b ; Increment, and no display shift
out 01h,al
mov al,00h
out 02h,al
call Delay2ms
call Delay2ms
out 01h,al ; Clear the pins on ports 1 and 2
out 02h,al
mov al,01h
out 02h,al
call Delay2ms
call Delay2ms
mov al,00000010b ; Return the cursor to home
out 01h,al
mov al,00h
out 02h,al
call Delay2ms
call Delay2ms
mov al,0x00
out 01h,al
out 02h,al
ret
times 2032- ($-$$) db 0
DB 0EAh
DW 0000h,0FF80h
times 10 db 0
I've done pretty much everything I can think of to the board, changing capacitor values, swapping chips, etc. There is actually a program I can run almost all the time on the first try if I hold in the reset switch while I turn on the power supply, so at this point, I'm thinking it's software-related. It's quite possible I'm doing something completely wrong. If so, please show me what I'm doing wrong. I would prefer to figure it out on my own, but I'm completely out of ideas, and it works effortlessly with my PIC, so I KNOW it should be able to work.
If it helps, here are some pictures I took of the system and my oscilloscope:
8284 pin 8 CLK when the system is not working: http://www.flickr.com/photos/9114793@N03/sets/72157634880600574/
8088 pin 25 ALE when the system is not working: http://www.flickr.com/photos/9114793@N03/sets/72157634874156595/
8088 pin 25 ALE when the system is working: http://www.flickr.com/photos/9114793@N03/sets/72157634874292649/
Schematics: http://www.flickr.com/photos/9114793@N03/sets/72157634881520510/
I've kind of posted a duplicate thread from another board, but after more investigation, I feel it's software-related, so I decided to put it here.
Well, if anyone can help me, that would be awesome. Thanks
Oh, and I'm using NASM as my assembler, if that helps.
Last edited: