Home
Cabinet
Computer
Control panel
  LCD
  spinner
Circuits
Software

LCD

OK, here goes. Many people out there are wondering how you get an LCD to work with ArcadeOS. It is an intimidating endeavor at first, but in the end it's incredibly easy to setup. You will go through several steps in your quest for Liquid Crystal Domination.

1. Selecting an LCD Module
2. Connecting the Module to your computer
3. Figuring out how to talk to the LCD Module
4. Configuring ArcadeOS to use LCD files and your LCD Module
5. Creating an LCD File

I will take each of these steps one by one and show you how I did it.


1. Selecting an LCD Module
The first step is to pick an LCD Module. There are quite a few LCD manufacturers who make quite a few different kinds of LCDs with quite a few different kinds of interfaces. I'll save you some time and say that the serial interface is orders of magnitude easier to connect to your computer than any other interface out there. With a serial interface you send data out your serial port to the LCD Module and it shows up on the LCD screen. It is simple enough that you can even use windows' hyperterminal to send text to the device. After the interface, there are a few other factors that you will want to consider when selecting the LCD Module.
  • Physical Mounting Space (don't forget to add space for the serial data cable header)
  • Graphical or Text (big price difference)
  • Resolution or Characters/Lines
  • Backlighting (must have)
  • RS232 speed (might not be too important in this application)
  • Power requirements (5v and 12v are easily obtainable in an arcade/pc)
  • Command Set Features (Scrolling, software controlled backlight, graphics, graphing)
The Physical Mounting Space is critical. If it won't fit, no use purchasing it. Be sure to allow extra space for the data cable header.

There are two different type of LCD Modules based on the LCD driver (which you don't care too much about because we get to use the one pre-attached to the serial interface provided instead of rolling our own). Graphics modules are really nice because they allow more flexibility with what you can display, but that comes at a price monetarily and also increase the complexity of the LCD file slightly. You have to send special commands to the LCD to draw the graphics instead of simple text.

If you decide on a graphics over text you will want to compare the resolutions of various modules, otherwise the comparison is Characters and Lines. I chose a 20x4 LCD module, mostly on a cost basis. Next time I will probably go for the biggest graphical one I can find.

Do be sure that your LCD has backlighting. Additionaly it might be useful to take a look at the viewable angle. Most LCD's have the best view from straight on. I built a 45 degree angled box on my control panel so that the LCD is facing the seated player directly.

Any RS232 speed should be fine. You will probably find the speed adjustable somewhere around 9.6 to 115kbps. As long as your computer's serial port can be set to this range/value you are OK.

Check the LCD Module to be sure that you will be able to supply the proper voltage. I was able to use 5volts from my computer to power the LCD module that I purchased. Some modules have special lighting options or extended voltage ranges which may effect what voltage needs to be used. Some even require two separate voltages; one to power the LCD, and one to power the backlight.

The fun part is the command set. Try to get a manual in advance of purchasing the module to see what commands are available. The commands may allow you to turn the backlight on and off from software, set options such as scrolling, backlight duration, allow bar graphs, draw shapes (graphical LCD modules), load fonts, create graphical symbols, etc. These commands may look very confusing, but we will cover those in the last section of this guide when we start working with LCD files.

The following is a partial list of manufacturers that provide serial LCD modules. You may have to look for a vendor that sells the module you want. I purchased a Matrix Orbital LCD2041 from a vendor (Bipom) who seems to have a virus in their web page currently.

2. Connecting the Module to your computer

To connect the LCD module to your computer you need two things, power and data. The data cable is simply a straight through serial cable. The power cable will depend on the LCD module. You may have to do some cutting and splicing to hook it up to the power supply. Follow the instructions that came with the module. In most cases connecting the power incorrectly will destroy the LCD module. Many manufacturers have cables that you can purchase to help you avoid that mistake. The matrix orbital manual for my module has some good information about how to hook it up to power.

3. Figuring out how to talk to the LCD Module

Once everything is connected and powered on you need to determine 2 things. The first is which com port is the module attached to and the second is what speed is the module expecting. Both of these things need to be right or nothing interesting is going to happen. The Matrix Orbital web site has a number of useful utilities in the download section for determining and setting the speed and port that the module is using. (The whole site came on a CD along with the module that I bought) Use the tools to get the sample text appearing on your LCD. It can take a lot of trial and error and not many of the applications are super intuitive. If you have trouble let me know and perhaps I can extend this guide to cover a couple of the applications.

4. Configuring ArcadeOS to use LCD files and your LCD Module

The next step is taking the settings you discovered and configuring ArcadeOS. At the very bottom of the Arcadeos.cfg file you will find 3 options that need to be set.

#LCD Screen Support (0=NO 1=YES)
lcdscreen=1


#LCD Screen Serial COM Port (1-4)
lcdserialport=1


#LCD Screen Baud Rate (50,300,600,2400,4800,9600,19200,38400,57600,115200)
lcdbaud=9600
Make sure that lcdscreen=1 and that the lcdserialport and lcdbaud are set to what you found in the previous step. There are 3 other LCD settings that exist in the arcadeos.cfg file. They store the AOS LCD Logo start up file (aos.lcd), the shutdown LCD file(shutdown.lcd), and the directory to look in for the LCD files when launching a game (lcddir).

5. Creating an LCD File

If you got excited and started arcadeos before this step you will see that nothing happens. We need to create a file that Arcadeos can stream out over the serial port. The easiest test is to create a file called aos.lcd in the arcadeos directory and use notepad or dos edit to store some text in it. Be sure to use just a couple of text words to start with. The LCD likely has a default method of storing the text that will make it appear incorrectly on the LCD. You will have to send it a few commands to get multi line text to come out correctly.

Well, now it's time to get a little more advanced. This section may not work for modules other than the LCD2041. The command set will vary from Module to Module, but this should give you an idea of what is involved.

You are going to need a hex editor to create the LCD files. A hex editor allows you to put in strange command characters by typing in their hexadecimal equivilants. In the start of each of my lcd files I start with
 FE43FE51FE4BFE58
  • FE43 - Auto Line Wrap On
  • FE51 - Auto Scroll On
  • FE4B - Cursor Off
  • FE58 - Clear Display
These commands came from the command reference from the matrix orbital web site. After these initial commands I add text (actual readable characters instead of the hexidecimal equivilants) to say something about the game being run, or about my arcade (for the start up file). Put what ever you like. I am currently looking at putting game instructions and high scores in. The only contraints are the size of your screen and the fact that excess information will spill the first part of the information off the screen. Eventually I would like to modify mame and arcadeos so that the information is continuosly being sent to the lcd panel so that the information scrolls by repeatedly.

Well, that's all I have for now. If this made no sense or if you have any comments/criticism please send me an email. JoelRSimpson@hotmail.com I would appreciate any feedback you have.