• Please review our updated Terms and Rules here

Can't get this 20x4 LCD to work

otacon14112

Experienced Member
Joined
Apr 19, 2012
Messages
115
Location
Iowa, United States
I have a blue background with white character 20x4 AMC2004A. From what I've read, it's based on the HD44780U chip. I've read tutorial after tutorial, and the datasheet for both the AMC2004A and the HD44780U.

I really hate to ask this here. It's basically admitting defeat. But I've spent dozens of hours rewiring, and recompiling code, and just can't get this darn thing to work (the way I want it to). I've tried 4-bit, and 8-bit mode.

I've gone back to the drawing board - no kidding - probably 100 times, changing this or that. I wish I could tell you EVERYTHING I've tried, but that's impossible, due to the sheer amount of times I've tried things.

My basic scenario:
I'm working on this 8088-based homebrew computer, and I've been using the 8255 as the output device. At first, I tried using the display in 4-bit mode, using the 4-7 data lines on the display hooked up to the same output lines on the 8255. I used the 8255's pins 0-2 for RS, R/W, and enable.

When that didn't work, I hooked all the data lines to their corresponding lines on the 8255's port C, and I used address lines 4, 5, and 6 for the 3 control signals, and that still didn't work. I suspected it might have been a slight timing issue, so I inverted all (4, 5, and 6) twice with a 74LS04, which made no difference.

I was hoping it was just a bad 8255, but I know it works because I tried both ports B and C, and both work fine with another program hooked up to some 7-segment LEDs.

I'll post some code here to show the last version of the 2 programs I wrote. The assembler I'm using is nasm.

I wasn't able to find any sites explaining how to do this in x86 assembly. All the results I got were for microcontrollers.

But anyway, here is my code:

Code:
;              ************************************************
;              *                                              *
;              *  A PROGRAM TO EXPERIMENT WITH MY LCD DISPLAY *
;              *                                              *
;              ************************************************

;*****************************************************************************
;									     *
;                          USING 8-BIT MODE				     *
;									     *
; Address lines used for control signals:                                    *
; A6  A5   A4			        				     *
; RS  R/W  EN    Hex  Operation                                              *
; **  ***  **    ***  *********                                              *
; 0   0     1     1h  IR write as an internal operation (display clear, etc.)*
; 0   1     1     3h  Read busy flag (DB7) and address counter (DB0 to DB7)  *
; 1   0     1     5h  Write data to DDRAM or CGRAM (DR to DDRAM or CGRAM)    *
; 1   1     1     7h  Read data from DDRAM or CGRAM (DDRAM or CGRAM to DR)   *
;                                                                            *
; Initialization sequence                                                    *
;                                                                            *
; 00111000b         38h                                                      *
; 00111000b         38h                                                      *
; 00001111b          Fh                                                      *
; 00000001b          1h                                                      *
; 00000111b          7h                                                      *
;                                                                            *
;*****************************************************************************

						;0x0AFF = approx. 50 ms
						;  2815 (decimal) 20 Hz

						;0x006F = approx. 2 ms
						;   111 (decimal) 500 Hz

						;0x0037 = approx. 1 ms
						;   55 (decimal)  1 KHz

start:		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.  
		mov	bx,0x0000 
		mov	cx,0x0AFF		;Wait about 50 ms.  

		jmp	begin			;Jump to the main loop.

waitasec:	mov	word [bx],cx		;Reset the countdown timer.
waitasec1:	dec	word [bx]		;Decrement it by 1 each time.

		cmp	word [bx],00h		;If the timer has counted down
						;all the way, return to the 
						;'nextloop' label so that it
						;can move on to the next hex
						;value to display on the LEDs.

		jnz	waitasec1		;If the counter hasn't counted
						;down to 00h yet, keep going.

		ret				;Here is where the zero flag
						;is checked. If the timer has
						;reached 00h, go to 'nexthex'.

init_lcd:	call	waitasec		;Start the timer.  
		mov	al,0x38
		out	12h,al
		
		mov	cx,0x006F		;Wait about 2 ms.  
		call	waitasec		;Start the timer.
		mov	al,0x38
		out	12h,al
		
		mov	cx,0x006F		;Wait about 2 ms.  
		call	waitasec		;Start the timer.
		mov	al,0x38
		out	12h,al 

		mov	cx,0x006F		;Wait about 2 ms.  
		call	waitasec		;Start the timer.
		mov	al,0x0F
		out	12h,al

		mov	cx,0x006F		;Wait about 2 ms.  
		call	waitasec		;Start the timer.
		mov	al,0x01
		out	12h,al

		mov	cx,0x006F		;Wait about 2 ms.  
		call	waitasec		;Start the timer.
		mov	al,0x07
		out	12h,al

		call	waitasec		;Start the timer.

		ret

begin:		call	init_lcd		;Initialize the LCD screen.

		mov	al,0x82
		out	12h,al			;Set DDRAM address to 02h
		mov	cx,0x006F		;Wait about 2 ms.  
		call	waitasec		;Make sure LCD event is done.

		mov	al,0x48
		out	52h,al			;Output "H"
		call	waitasec		;Make sure LCD event is done.

		mov	al,0x69
		out	52h,al			;Output "i"
		call	waitasec		;Make sure LCD event is done.

		mov	al,0x0C
		out	12h,al			;Turn display on
		call	waitasec		;Make sure LCD event is done.

		jmp	$

		times	2032- ($-$$) db 0
		jmp	start
		times	12 db 0


Code:
;              ************************************************
;              *                                              *
;              *  A PROGRAM TO EXPERIMENT WITH MY LCD DISPLAY *
;              *                                              *
;              ************************************************

;*****************************************************************************
;									     *
;                          USING 4-BIT MODE				     *
;                                                                            *
; R   B    W                                                                 *
; D2  D1   D0			        				     *
; RS  R/W  EN    Hex  Operation                                              *
; **  ***  **    ***  *********                                              *
; 0   0     1     1h  IR write as an internal operation (display clear, etc.)*
; 0   1     1     3h  Read busy flag (DB7) and address counter (DB0 to DB7)  *
; 1   0     1     5h  Write data to DDRAM or CGRAM (DR to DDRAM or CGRAM)    *
; 1   1     1     7h  Read data from DDRAM or CGRAM (DDRAM or CGRAM to DR)   *
;                                                                            *
; Wait 40 ms                                                                 *
; 0011 0001b         31h                                                     *
;                                                                            *
; Wait 39 us                                                                 *
; 0010 0001b         21h                                                     *
; 1000 0001b         81h                                                     *
;                                                                            *
; Wait 39 us                                                                 *
; 0010 0001b         21h                                                     *
; 1000 0001b         81h                                                     *
;                                                                            *
; Wait 37 us                                                                 *
; 0000 0001b         01h                                                     *
; 1111 0001b         F1h                                                     *
;                                                                            *
; Wait 37 us                                                                 *
; 0000 0001b         01h                                                     *
; 0001 0001b         11h                                                     *
;                                                                            *
; Wait 1.53 ms                                                               *
; 0000 0001b         01h                                                     *
; 0111 0001b         71h                                                     *
;                                                                            *
;*****************************************************************************

						;0x0AFF = approx. 50 ms
						;  2815 (decimal) 20 Hz

						;0x006F = approx. 2 ms
						;   111 (decimal) 500 Hz

						;0x0037 = approx. 1 ms
						;   55 (decimal)  1 KHz

start:		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.  
		mov	bx,0x0000 
		mov	cx,0x0AFF		;Wait about 50 ms.  

		jmp	begin			;Jump to the main loop.

waitasec:	mov	word [bx],cx		;Reset the countdown timer.
waitasec1:	dec	word [bx]		;Decrement it by 1 each time.

		cmp	word [bx],00h		;If the timer has counted down
						;all the way, return to the 
						;'nextloop' label so that it
						;can move on to the next hex
						;value to display on the LEDs.

		jnz	waitasec1		;If the counter hasn't counted
						;down to 00h yet, keep going.

		ret				;Here is where the zero flag
						;is checked. If the timer has
						;reached 00h, go to 'nexthex'.

init_lcd:	call	waitasec		;Start the timer.  
		mov	al,31h
		out	02h,al
		
		mov	cx,0x006F		;Wait about 2 ms.  
		call	waitasec		;Start the timer.
		mov	al,21h
		out	02h,al
		call	waitasec		;Start the timer.
		mov	al,81h
		out	02h,al

		call	waitasec		;Start the timer.
		mov	al,21h
		out	02h,al
		call	waitasec		;Start the timer.
		mov	al,81h
		out	02h,al

		call	waitasec		;Start the timer.
		mov	al,01Fh
		out	02h,al 
		call	waitasec		;Start the timer.
		mov	al,0xF1
		out	02h,al

		call	waitasec		;Start the timer.
		mov	al,01Fh
		out	02h,al 
		call	waitasec		;Start the timer.
		mov	al,11h
		out	02h,al

		call	waitasec		;Start the timer.
		mov	al,01Fh
		out	02h,al 
		call	waitasec		;Start the timer.
		mov	al,71h
		out	02h,al

		mov	cx,0x0AFF		;Wait about 50 ms.  
		call	waitasec		;Start the timer.

		ret

begin:		call	init_lcd		;Initialize the LCD screen.

		mov	al,81h
		out	02h,al			;Set DDRAM address to 00h
		mov	cx,0x0AFF		;Wait about 50 ms.  
		call	waitasec		;Make sure LCD event is done.

		mov	cx,0x006F		;Wait about 50 ms.  
		mov	al,45h
		out	02h,al			;Output "H"
		call	waitasec		;Make sure LCD event is done.
		mov	al,85h
		out	02h,al			;Output "H"
		call	waitasec		;Make sure LCD event is done.

		mov	al,65h
		out	02h,al			;Output "i"
		call	waitasec		;Make sure LCD event is done.
		mov	al,95h
		out	02h,al			;Output "i"
		call	waitasec		;Make sure LCD event is done.

		jmp	$

		times	2032- ($-$$) db 0
		jmp	start
		times	12 db 0

I know it can display stuff, because when I kept pushing the reset button on my breadboard, it showed random stuff on the screen sometimes. I have rarely been as frustrated with something that I know should work as this. To make matters more complicated, I've seen several different ways to initialize this. I have tried to follow the initialization sequences depicted in the AMC2004A datasheet, as well as the HD44780U datasheet. I tried the troubleshooting suggestions Dennis Che recommended in his ebook "All About Liquid Crystal Displays – Character Models Vol 2".

I'm this close to giving up on the darn LCD. I don't think I should have to waste a microcontroller on something that a computer should be able to control. I'm starting to lean more toward making my own primitive VGA board at this point, modeled closely after the one shown here: http://www.lucidscience.com/pro-vga%20video%20generator-1.aspx

But I still want to beat this thing and make it work. Anybody have any wild ideas about what might be wrong? Oh, and I put a 10 K ohm pot for the contrast, and a 4.7 uF capacitor between the 5V line and the ground line of the LCD. Nothing made a difference. Thanks

I will upload a picture of the schematic later on when I wake up. It's getting late now.
 
I'll wait for your schematic, but your timer count (6F) seems to be somewhat low for a 2000 µsec. loop if you're running your 8088 at anywhere near 5MHz.
 
Here is the schematic of the working 8255 http://www.flickr.com/photos/9114793@N03/7591723308/in/set-72157630379320730/, and as far as the LCD goes, I've had it hooked up different ways to the 8255 as mentioned above. Also, I noticed a few comments in my code weren't consistent with the code. That's because I changed the code a lot, and it was late, and I didn't feel like changing the comments every time. The important comments should be pretty obvious.

My set: http://www.flickr.com/photos/9114793@N03/sets/72157630379320730/

Also, I hooked up my breadboard to my osciilloscope, and that's what it confirmed.

Thanks
 
Last edited:
Looks like here is a data sheet: http://www.betasix.net/wp-content/uploads/2011/02/amc2004a.pdf
It's missing some figures, like the timing diagrams. But there are timing tables that list pulse widths and set up times.

You have to pulse the enable line. It looks like you are just leaving it high all the time?

Data is only read or written when the Enable line goes from high to low.

You need to set your RS, R/W and data with Enable high, then hold RS R/W and data and set Enable low.
 
Hi,

I have tried different things...I did try tying enable to high, but I also tried hooking it up to a data line and address line. In the situation where it was on an address line, I was basically using that address bit to enable the module. I have that exact datasheet. I also have the one for the HD44780U. I know every line is hooked up right. The only one I'm not 100% sure about is the enable line. But I've tried hooking it to various places. I even put a 50 ms delay in between every event several times. I'm pretty sure it can work. I'm just doing something wrong. It might be the code.

I'll try changing some code and study the timing of enable and see if it works.

Thanks
 
Hi,

I have tried different things...I did try tying enable to high, but I also tried hooking it up to a data line and address line. ... It might be the code.

I'll try changing some code and study the timing of enable and see if it works.

Thanks

Huh? Tying the enable to high won't work. Using the address lines probably won't work either, so your 8 bit code won't work. Your 4 bit code looks like you are not pulsing the E line.

Here is a timing diagram from the HD44780U:
Timing.jpg

You have to pulse E. Transfers only happen when E goes from high to low. If you tie E to high, nothing happens.

BTW, you don't really need the 8255. The LCD can be interfaced directly to the microprocessor bus. But that's another can of worms.
 
What xprt is doing his level best to explain is that the inputs are conditioned by the falling edge of Enable. With no edge, nothing happens--the display controller is blind to changes. So your sequence should be:

1. Raise Enable high
2. Make your data input changes
3. Drop Enable low
4. Repeat 1-3 for all subsequent machinations.
 
and "3.5 wait a while!"

The data sheet (for other similar hitachi based LCD displays) shows all sorts of different delay timings for different stages of the setup. Just use the longest suggested delay as standard (I can't remember the timings now 1or 2 mS sounds feasible) & it's generally fast enough.
 
Huh? Tying the enable to high won't work. Using the address lines probably won't work either, so your 8 bit code won't work. Your 4 bit code looks like you are not pulsing the E line.

Here is a timing diagram from the HD44780U:
View attachment 9699

You have to pulse E. Transfers only happen when E goes from high to low. If you tie E to high, nothing happens.

BTW, you don't really need the 8255. The LCD can be interfaced directly to the microprocessor bus. But that's another can of worms.

I was just sharing the fact that I've tried a bunch of different things. I quickly learned that tying the enable line to any permanent level is incorrect. That was my first mistake. The thing that wasn't apparent to me, even after reading the datasheets a hundred times, was that I needed to pulse enable. I just got home from work, and I'm rewriting my code accordingly. I know that I don't need the 8255, but getting this to work is the first goal. Once I get it working, then I can try different device implementations.

I appreciate the advice of all of you. I can't believe that I wasn't able to notice that characteristic. Once I get around to reprogramming my eeprom, I'll let you know how it works. Thanks again guys. :D
 
Last edited:
Well, I wrote code to pulse the enable line, but it's still not doing anything. I was going directly off of pages 42 and 46 of the Hitachi datasheet. All it's doing is lighting up all 5x8 characters on lines 1 and 3. I read that line 3 is just a continuation of line 1, because it continues the addresses of the characters, and line 2 goes onto 4. I set the delay to approx. 50 ms just to be sure I wasn't writing too fast. I'm assuming it's just bad code, but if not, what would you suggest I hook enable up to?

Just a reminder, I have LCD lines D4-D7 hooked up to 8255 port c's D4-D7 lines. RS, R/W, and Enable are hooked up to the 8255 port c's D2-D0, respectively.

Code:
;              ************************************************
;              *                                              *
;              *  A PROGRAM TO EXPERIMENT WITH MY LCD DISPLAY *
;              *                                              *
;              ************************************************

;*****************************************************************************
;									     *
;                          USING 4-BIT MODE				     *
;                                                                            *
; R   B    W                                                                 *
; D2  D1   D0			        				     *
; RS  R/W  EN    Hex  Operation                                              *
; **  ***  **    ***  *********                                              *
; 0   0     1     1h  IR write as an internal operation (display clear, etc.)*
; 0   1     1     3h  Read busy flag (DB7) and address counter (DB0 to DB7)  *
; 1   0     1     5h  Write data to DDRAM or CGRAM (DR to DDRAM or CGRAM)    *
; 1   1     1     7h  Read data from DDRAM or CGRAM (DDRAM or CGRAM to DR)   *
;                                                                            *
; Wait 40 ms                                                                 *
; 0011 0001b         31h                                                     *
;                                                                            *
; Wait for a while                                                           *
; 0011 0001b         31h                                                     *
;                                                                            *
; Wait for a while                                                           *
; 0011 0001b         31h                                                     *
;                                                                            *
; Wait for a while                                                           *
; 0010 0001b         21h  Set to 4-bit operation                             * 
;                                                                            *
; Wait 39 us                                                                 *
; 0010 0001b         21h  Sets 4-bit operation, selects 1 line, 5x8 font     *
; 0000 0001b         01h                                                     *
;                                                                            *
; Wait 37 us                                                                 *
; 0000 0001b         01h  Turn on display and cursor                         *
; 1111 0001b         E1h                                                     *
;                                                                            *
; Wait 1.53 ms                                                               *
; 0000 0001b         01h  Set to auto-increment, shift cursor to right       *
; 0110 0001b         61h                                                     *
;                                                                            *
;*****************************************************************************

						;0x0AFF = approx. 50 ms
						;  2815 (decimal) 20 Hz

						;0x006F = approx. 2 ms
						;   111 (decimal) 500 Hz

						;0x0037 = approx. 1 ms
						;   55 (decimal)  1 KHz

start:		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.  
		mov	bx,0x0000 
		mov	cx,0x0AFF		;Wait about 50 ms.  

		jmp	begin			;Jump to the main loop.

waitasec:	mov	word [bx],cx		;Reset the countdown timer.
waitasec1:	dec	word [bx]		;Decrement it by 1 each time.

		cmp	word [bx],00h		;If the timer has counted down
						;all the way, return 

		jnz	waitasec1		;If the counter hasn't counted
						;down to 00h yet, keep going.

		ret				;Here is where the zero flag
						;is checked. If the timer has
						;reached 00h, go to 'nexthex'.

pulse_low:	mov	al,00h			;Set enable to low
		out	02h,al			;Send the pulse
		call	waitasec		;Wait for a while
		ret

pulse_hi:	mov	al,01h			;Set enable to high
		out	02h,al			;Send the pulse
		ret

prepare:	mov	al,05h			;Set rs, enable to high
		out	02h,al			;Send the pulse
		ret

;write:		mov	al,04h			;Hold rs high, set enable to low
;		out	02h,al			;Send the pulse
;		call	waitasec
;		ret

init_lcd:	call	pulse_hi		;Start of step 1.1
		mov	al,0x31			;Send data, hold enable hi
		out	02h,al
		mov	al,0x30			;Hold data, set enable low
		out	02h,al
		call	waitasec		;End of step 1.1
		
		call	pulse_hi		;Start of step 1.2
		mov	al,0x31			;Send data, hold enable hi
		out	02h,al
		mov	al,0x30			;Hold data, set enable low
		out	02h,al
		call	waitasec		;End of step 1.2
		
		call	pulse_hi		;Start of step 1.3
		mov	al,0x31			;Send data, hold enable hi
		out	02h,al
		mov	al,0x30			;Hold data, set enable low
		out	02h,al
		call	waitasec		;End of step 1.3

		call	pulse_hi		;Start of step 2
		mov	al,0x21			;Sets db5 = 1, db4 = 1, Sets 4-bit
		out	02h,al			;Sends command to the LCD
		mov	al,0x20			;Hold data, set enable low
		out	02h,al
		call	waitasec		;End of step 2
			
		call	pulse_hi		;Start of step 3
		mov	al,0x21			;Sets 4-bit operation and 1 line
		out	02h,al
		mov	al,0x20			;Hold data, set enable low
		out	02h,al
		call	waitasec
		mov	al,0x01			
		out	02h,al
		mov	al,0x00			
		out	02h,al
		call	waitasec		;End of step 3
		
		call	pulse_hi		;Start of step 4
		mov	al,0x01			;Function set
		out	02h,al
		mov	al,0x00			;Hold data, set enable low
		out	02h,al
		call	waitasec
		mov	al,0xE1			;Turns on display and cursor
		out	02h,al
		mov	al,0xE0			;Hold data, set enable low
		out	02h,al
		call	waitasec		;End of step 4

		call	pulse_hi		;Start of step 5
		mov	al,0x01
		out	02h,al 
		mov	al,0x00
		out	02h,al
		call	waitasec
		mov	al,0x61			;Sets auto-inc, shift cursor to right
		out	02h,al
		mov	al,0x60			;Hold data, set enable low
		out	02h,al
		call	waitasec		;End of step 5

		ret

begin:		call	init_lcd		;Initialize the LCD screen.

		call	prepare
		mov	al,45h			;Send data, hold rs, enable to high
		out	02h,al			;Output "H"
		mov	al,44h			;Hold data, rs, set enable to low
		call	waitasec
		out	02h,al
		mov	al,85h			;Send data, hold rs, enable to high
		out	02h,al			;Output "H"
		mov	al,84h			;Hold data, rs, set enable to low
		out	02h,al
		call	waitasec

		call	prepare
		mov	al,65h			;Send data, hold rs, enable to high
		out	02h,al			;Output "i"
		mov	al,64h			;Hold data, rs, set enable to low
		out	02h,al
		call	waitasec
		mov	al,95h			;Send data, hold rs, enable to high
		out	02h,al			;Output "i"
		mov	al,94h			;Hold data, rs, set enable to low
		out	02h,al
		call	waitasec

		jmp	$

		times	2032- ($-$$) db 0
		jmp	start
		times	12 db 0
 
Since you gave me the idea to try it, I just did, and the first and third rows are still 5x8 block characters all the way across the screen. I keep reading everywhere that it's so easy to integrate LCDs into designs, so at this point, all I can do is laugh at my situation. I'm sure that when it's all over, I'll slap myself in the face when I find out what I'm doing wrong. :rolleyes:
 
Remember that the controller starts off in 8-bit mode, so those lines need to be grounded if you're going to put it into 4 bit mode. I'll keep looking at your code, although it's not entirely clear what bits in the C port are mapped to what bits on the LCD input.
 
Just a reminder, I have LCD lines D4-D7 hooked up to 8255 port c's D4-D7 lines. RS, R/W, and Enable are hooked up to the 8255 port c's D2-D0, respectively.

This seems OK.

I'm assuming your segments and stack are set up the way you want them and that your delay is about right. You might want to write a little test program to use your delay routine to pulse a pin on and off repeatedly and check with your scope that it is giving you the delay you want.

It could be that the the power-on initialization of the LCD controller is getting screwed up. All the data book sequences start with an initial delay. You are writing commands immediately. You should add an initial delay before you start writing to the LCD. Page 45 of the Hitachi datasheet has this note:

If the power supply conditions for correctly operating the internal reset circuit are not met, initialization by instructions becomes necessary.

You should probably add a display clear instruction (01h) into your init code. This fills the memory with spaces and resets the address to zero.

Other than that, I don't see any obvious problem. But there's always Murphy's law.:(
 
That HD44780 and its clones are everywhere, it seems. I even have a project that uses one, but in a little ACM0802C (AZ Displays) 2-line LCD. I drive it with a PIC32 MCU. It was pretty easy to work with.

Take a look here if you haven't already for some better explanations at programming the thing.

Oh--I was mistaken; you can let D3-D0 float, apparently.
 
A few things have been bothering me about the code you posted.

First, you have a 2kB RAM and a 2kB EPROM. A19=0 selects that RAM, and A19=1 selects the EPROM. So the bottom half of the real address space is RAM, and the 2k is repeated over and over every 2k, and similarly the top half of the real address space is the EPROM.

When the 8088 resets, it sets CS to FFFF and IP to 0000, so it starts at the real address of FFFF0. It looks like here you have
Code:
jmp start
.

Shouldn't you have a far jump here, specifying a new value for CS? Otherwise, CS remains as FFFF, and your code segment will wrap around to the bottom half the the address space?

I don't know, maybe the assembler magically deals with this.

The other thing is shouldn't you initialize the stack pointer SP?

Just looking for potential problems you might want to check on.:confused:
 
Good point--I'd assumed that the OP had already debugged basic operation, although I'd wondered a bit about the code.

On 8086/88 CS=FFFF, IP=0000. Other registers are undefined at reset. So a CALL may work, but also may not without setting SS:SP.

===================
Take it from an old guy--when you're working with a new hardware setup, the first thing you should get going is a serial monitor. I've done it for years--and very often on embedded devices, you'll even see pads that the original developers included for a serial hookup.

There's nothing quite like a "Hello world" message to raise your confidence.

In your case, a UART, such as a 8250-type chip or even a 2650-type is easy to interface to. Add a MAX232 to shift your signals to RS232 levels and you've got it. I've done it so much that I have a MAX232 as a dongle that I can attach to any board needing comms.

If you need code for a simple serial console, I'd be happy to pass some along.
 
Last edited:
A far jump is for a range extending past a 64 KB segment. The jump is a short, since it's only within 2 KB. Since the EEPROM is only 2 KB, it sees the first 11 address lines. The A19 only selects the chip. The EEPROM doesn't know or care where it is in the memory map. Yes, I should probably use the segment directives, but I'm still relatively new to assembly. I should probably include them in my next programming session.

In the EEPROM, the power-up instruction is at address 07F0h. It's the processor that cares about the absolute value of the memory location, but as far as it's concerned, when the A19 goes high, and the EEPROM is selected, and puts out its data on the address bus, the processor (if it's sentient, o_O) would be none the wiser.

I have a youtube video demonstrating a functioning short jump in a looping assembly program, and it can be viewed here http://www.youtube.com/watch?v=hmTlIxZ5NeY

In the video description is a link to download the assembly/hex file.

But you could be right, xprt, about the need to give the LCD time to power up first. I'm going to take that into consideration when I go back to work on the code.

Thanks again guys, for your help and input. :)
 
Back
Top