Home > Previous Page >  AMI LCD Screen output
Archive Search  

AMI LCD Screen output


A bit of fun now! Using one of AY-8910 ports to drive a 20*2 character LCD/OLED screen. These LCD/OLED screens can be found quite easily on eBay. Make sure the LCD's built in controller is compatible with HD44780 chip, most are. The one we have used has 2 lines of 20 characters 5x8 dots and is a OLED type. Your LCD unit will come with a data sheet check the pin outs, most have 16 pins to interface to. Note that some LCD units have a back light. The OLED display emits light already and does not need a back light

Pin No. Symbol LCD Function
1 Vss GND
2 Vdd 5+ supply
3 VBT LCD Brightness
4 RS H:Data L:Instruction
5 R/W Read / Write signal
6 E Chip enable signal
7 DB0 Data Bit 0
8 DB1 Data Bit 1
9 DB2 Data Bit 2
10 DB3 Data Bit 3
11 DB4 Data Bit 4
12 DB5 Data Bit 5
13 DB6 Data Bit 6
14 DB7 Data Bit 7
15 NC Not used
16 NC Not used


Screen side

solder side

The display operates in 4-bit mode and is controlled by port A. The display needs a single 5v supply, as we have added that to the port it is fairly easy to wire up. Note that in the above image I have soldered some header pins the unit so I can use a header socket.
Wiring of LCD Screen to Port A on AMI V1-f

AMI Port A Pin Function LCD Pin Function
14 0v 1 GND / 0v
15 5+ 2 (Vdd) Power supply
† see below † see below 3 LCD Brightness adjustment
8 PA7 (bit 7) 4 Data & Instructions signal
14 0V 5 R/W signal setting to 0v writes to LCD mode only
7 PA6 (Bit 6) 6 E chip enable signal.
    7 - 10 Not used
1 PA0 (bit 0) 11 Data Bit 4
2 PA1 (bit 1) 12 Data Bit 5
3 PA2 (bit 2) 13 Data Bit 6
4 PA3 (bit 3) 14 Data Bit 7
    15 - 16 Not used


† 10K Potentiometer Brightness Wiring.

pot pin 1 connect to 0V
Pot pin 2 (middle pin) connect to LCD pin 3 Brightness adjustment control.
pot pin 3 connect to 5v

If you like, you can mount the pot with the connections on a veroboard strip, I have also included a jumper here (in yellow) as a switch in the 5+ line to reset the LCD controller. You should also be able to spot the pot in black. A capacitor has also been added, 220uf, across the 0+ and 5v power lines to help to stabilize the supply.

LCD ACEForth Words.

Edwin worked his magic again to come up with some AceForth words to send commands and data to the LCD screen.
  
 : SR ( Select Register)
   65533 OUT 
 ; 

 : WR  (Write Register)
   49149 OUT 
 ;

 : WN ( Write Nibble)
   DUP
   64 OR
   WR WR
 ;

 : WC ( Write Command)
   DUP 16 /
   WN
   15 AND
   WN
 ;

 : WD ( Write Data)
   DUP 16 /
   128 OR WN
   15 AND
   128 OR WN
 ;



 : LCD         (Initialize LCD after power on)
  7 SR 127 WR  (Port A for Output,no sound)
  14 SR 2 WN   (Function set 4-bit mode)
  40 WC        (Function set, 2 lines, 5x8 font)
  1 WC         (clear display)
  15 WC        (display on, blinking cursor) 
  6 WC         (entry mode set)
 ;
 
 
 LCD           (will initialize the LCD unit after power up)
               (this only needs to be done once after a power up)
 65 WD         (will display A to the LCD) 
 
 
Some useful LCD commands.
ACEforth         Function.
 
 1 WC            Clear display.
 2 WC            Cursor home, selects display address 0 and disables scroll.
 4 WC            Write char at cursor and move cursor left mode.
 5 WC            Write char at cursor and scroll display right mode.
 6 WC            Write char at cursor and move cursor right mode.
 7 WC            Write char at cursor and scroll display left mode.

 8 WC            Display off.
12 WC            Display on without cursor.
14 WC            Display on with cursor.
15 WC            Display on with blinking cursor.

16 WC            Move cursor left.
20 WC            Move cursor right.
24 WC            Scroll display left.
28 WC            Scroll display right.  

128+0..39   WC   Select top line column, set character mode.
128+64..103 WC   Select bottom line column, set character mode.
64+0..63    WC   Select graphic ram addr, set graphic mode.