Instructions for MPEG/CD-player DIY-kit

Dear native speaker:
Please apoligize this poor translation into English language. I would very much appreciate your corrections.

Assembling the hardware

List of parts

Please make shure all listed parts are contained in your package. The kit contains:

Picture 1: Connection material

Picture 2: Contact switches with key caps

PC-components

Power supply

The easiest way is certainly using a standard PC power supply. There are models with a lower maximum power output (for example 65 W) which are smaller in size. They should be sufficient for our purpose. If the power consumption of the processor is moderate, a total power consumption of less than 20 Watts can be achieved. PC power supply units provide +5V (red cable), +12V (yellow cable) and Ground (black) with the drive connectors. Morever, the negative voltages -12 V (might be a blue cable) and -5 V (might be a white or grey cable) are provided to the mainboard. If you do not use a standard PC power supply, you might do without the availability of a -12V voltage if no serial ports are needed. However, for the LCD, a negative voltage (-5V is enough) may be required for the contrast level adjustment.

Mainboard

If you connect the PC-speaker to the mainboard, the control software will generate a short beep every time a key is pressed. The tone is emitted during LCD outputs so no extra delay will occur.
In order to prevent heat problems, the processor should not run at unnecessary high clock frequency. If your CPU has some spare computing power (faster than approx. a Pentium 100), it may be useful to reduce the clock frequency or even the core voltage. Please appreciate that such experiments are done at one's own risk.

Boot drive

After power on, the operation system has to be loaded. There are many kinds of bootable devices, most of them providing an IDE interface. The following table can be an aid for the decision of which storage media to use as the boot device:
 
Storage media pros cons
Floppy disk cheap, easy exchange, no noise when idle. slow, big, small storage capacity
2.5"-harddisk Notebook-harddisks do not need a 12V-voltage (only 5V) and are designed to be switched off and on quite often. Adaptor needed to connect the 2mm-pin rows to a standard IDE-cable.
3.5"-harddisk high storage capacity high power consumption, 5V and 12V required.
Solid-state-disc no noise, very small very expensive, low storage capacity
CDROM No additional boot device needed A special bootable CD has to be inserted on power on and the BIOS must be able to boot from a CD.
Table 1: Comparison of some storage media

Ports

A parallel port is needed to connect both the LCD module and the keypad. Most Mainboards have already integrated parallel and serial ports. If not, an old ISA-I/O-board can be used. Any parallel port should work, even 3.3V-logic is no problem for the LCD controller.
A serial port is not required, but may be useful for data transfer (Music files or software updates).

Sound board

The most important feature the sound board must provide is a playack mode for 16-bit stereo at the commonly used samling frequency of 44100 Hz. This applies to Soundblaster 16-compatible boards but does not to SB-Pro-compatible ones! If your board cannot be configured as SB16 under DOS, you should try to configure it as Windows Sound System.
Even if the described mode is available, this does not guarantee a perfect audio quality. Particularly cheap ISA-sound boards or onboard sound chips often show a bad frequency response, a high level of noise and strong distortions.
Be aware that a soundboard directly plugged into an ISA- or PCI-slot on the mainboard will make quite a big case necessary. To limit the hight of the system, a 90-degree bus adaptor could be used. For the ISA-bus they can somtimes be found in old "slimline"-desktop-PCs.

CDROM-drive

With a data rate of about 1/10 compared to normal audio CDs ("single speed"), MPEG-layer-3 coded data can probably be read fast enough by any CDROM-drive. Due to their low rotation speed, older drives most often produce less noise than modern ones. However, a fast access time can speed up MP3-tag reading. Some device drivers also supply an option for limiting the rotation speed of the drive. For the playback of ordinary audio-CDs, an appropriate audio connection to the sound board must be installed. Eventually, you like to replace the original cable by a better shielded one. For IDE-drives, don't forget to set the Master/Slave-jumpers correctly.
 

Liquid Crystal Module (LCM)


Picture 3: LCM 2x16 characters (here: without backlight)
The LCM has got a TTL-compatible 8 bit bus that can be directly connected to the PC parallel port. The module can display 2 lines of 16 characters built of a 5x8 pixel matrix. The character set of the LCD controller (Hitachi HD44780) consists of ASCII- and special characters, Japanese katakana and 8 user definable characters.

Picture 4: ribbon cable soldered to the LCM
The 25-pin Sub-D-connector must be connected to the 14 pin connector of the module according to table 2 using the supplied ribbon cable. This will be easier if you remove the plastics from the connector first like shown in picture 4. Some of the 14 wires (2, 3, 5) in the ribbon cable could theoretically be left away, however I suggest to connect all 14 wires to the LCM.

Picture 5: Power contacts for the LED backlight
The LED backlight needs about 4 V and 200 mA. It must not be directly connected to the voltage of 5V from the power supply. You need to use the 4.7 Ohm resistor to use 5V as supply voltage (see picture 5).

The power supply for the LCD (not for the backlight) can be taken from pin 14 of the PC parallel port (will be set high by LCDECHO). If there is no backlight, you can come along without the external +5V voltage this way. However, the voltage supplied by the parallel port might be off the range of 4.75V...5.25V which is the specified supply voltage for the LCD.


Picture 6: LCM with cables

The ribbon cable has been soldered to the back of the module in order to prevent difficulties when assembling the chassis. The three lose wires are for 5V, Gnd and -5V.

Picture 7: Gaining the contrast voltage
The contrast level is determined by the voltage applied to pin 3 of the LCM. The lower the voltage, the darker are the pixels on the display. The optimum level can be best adjusted with the potentiometer connected to -5V and +5V like shown in picture 7. For most LCMs, the optimum level of the voltage at pin 3 is negative (around -1 V).
If a -5V voltage is not available -12V can be taken instead. In this case, take care when adjusting the potentiometer because the contrast voltage must not exceed -5V. The potentiometer resistance should be around 10 kOhm.
LCD panel
pin
parallel port
pin
meaning
1
18 [...25]
Gnd (0V). Pin 18 to pin 25 are normally interconnected. Pin 18 is easiest to solder at because it is located nearer to the other used pins.
2
[14]
+5V supply voltage, can be taken from the parallel port (see text!)
3
-
Contrast level. The included LCM needs a negative voltage between 0V (no characters visible or only weak) and -5V (all pixels black). This voltage can be generated out of -5V or -12V using the potentiometer. Note that there are also LCMs which need a positive contrast voltage.
4
16
Register select
5
18 [...25]
Read/Write. Grounded because LCDECHO does only write to the LCD.
6
17
Enable
7...14
2...9
Data (8 bits parallel, Pin 7 = LSB)
[15]
-
LED-backlight anode (+5V)
[16]
-
LED-backlight cathode (0V)
Table 2: Pin layout of the Liquid Crystal Module

The LCM can be easily tested using the LCDECHO utility:

Running LCDECHO without parameters gives a list of the available options. The parameter /W5000 in the above example specifies a delay time. On slow computers, this value can be reduced in order to speed up the output. The default value (if this parameter is not specified) of 1000 is approx. the optimum for a 6x86PR200.

Keypad

The keypad consists of five keys which must be connected to the PC parallel port according to the scheme shown in picture 8. The same parallel port as for the LCM can be used. Picture 8 shows the female Sub-D-25 connector of the PC. If you've got only a 2-row connector on the mainboard, it's probably easiest to use the adaptor cable of the mainboard providing a Sub-D-25 connector. Use the 7-wire ribbon cable to connect the male Sub-D-connector to the LCM. There is one spare wire which can be used for individual extensions.
The pullup-resistors that should be around 10 kOhm are intended to hold the idle levels of the input signals at (nearly) 5 Volts. The open input signal levels of many parallel ports are high even without pullup resistors, so you might not need them.
When pressing a key the connected input line of the parallel port will go low and the corresponding bit in the status register appears inverted.
With the current software, a 5V voltage is provided at pin 14 of the parallel port (GETPORT and LCDECHO switch this control line to high). However a better - softwareindependent - way would be to fetch the 5V voltage directly from the power supply unit. Depending on the location of the pullup resistors (at the Sub-D-connector or at the switches) and the -5V-source, the 7th wire of the ribbon cable could be of use here.
The four switches connected to the status lines 10 to 13 should be mounted in a row directly below the LCD so that the lower line of the display can later show the current key mapping.

Picture 8: Connection of the keypad to the parallel port

GETPORT is a suitable utility to perform a function check. It reads the 5 status lines of the parallel port and displays the bit pattern (1=key pressed) as a number between 0 and 31. The highest value (16) is assigned to the menu key, the other 4 keys represent from left to right the values 8, 4, 2 and 1. This order can be reversed with the option /M to gain compatibility with an old version of the scheme.
 

Software installation

Preparements

First of all, MSDOS (or a compatible product) has to be installed on the boot device. A full setup is not required, the following parts are sufficient: Now all programs and files that are needed for the player can be copied onto the boot device and must then be configured. If possible, this should be done on the final hardware with connected PC-keyboard and monitor so that any error can be detected and corrected easily.
Copy the following files from the supplied floppy disk onto the boot device of your player and keep the directory structure:
\CONFIG.SYS
\AUTOEXEC.BAT
\INIT\*.*
\CONTROL\*.*
\DECODER\*.*

The directories \DOC, \SOURCE and \UTILITY are not necessary.
 

Configuration

Some of the copied files have to be modified:

CONFIG.SYS

Include all device drivers that are designed for your specific hardware. Normally, this applies only to the CDROM-drive.
Take care when editing CONFIG.SYS as an error may prevent the system from booting!

AUTOEXEC.BAT

Especially the section with the sound device initialisation will have to be adapted. Moreover, some global environment variables are defined here for drive letters, paths and other configuration information. The Parameter /W in the assignment to the variable LCD must be adapted to the speed of your computer. Additional hints can be found in the supplied AUTOEXEC.BAT.

\CONTROL\PLAY0.BAT

This file contains the commandline for the start of the MPEG-decoder. It defaults to a call of MPXPLAY:
%WorkPath%MPXPLAY -f0

The parameter -f0 turns off all screen output which also reduces the CPU load considerably. You can add more MPXPLAY options to the above commandline or edit MXPLAY.INI. For additional information, please refer to the MPXPLAY manual.
It is important that the file PLAY0.BAT ends with a blank and without an end-of-line because the name of the MPEG-bitstream to decode will later be appended to a copy of this file and therefore become a parameter to MPXPLAY. Some editors (for example EDIT in MSDOS 5.00) append a CR/LF-sequence to the end of the file! The unwanted bytes (0Dh and 0Ah) have to be removed using a hex editor (or DEBUG).
 

\CONTROL\PLAY1.BAT

With activated "Grabscreen"-option PLAY1.BAT will be used instead of PLAY0.BAT. The only difference is the parameter -fl which activates a one-line screen output. By the aid of the LCDECHO TSR-script-feature the current playback time will be grabbed off the screen and displayed on the LCD.
 

Using other decoders

There are other MP3-docoders besides MPXPLAY (http://members.tripod.com/~padara/) for MSDOS like DosAmp, XTC-Play, Sound of Silence or Cubic. But those are slower and often offer less functionality. However, quite interesting is the program DAMP (http://www.damp-mp3.co.uk/), as it has its own LCD support and can display MP3-tags at playback time ) .
The interfacing to the decoder is done in the batch programs PLAY0.BAT and PLAY1.BAT. They should - as described above - contain a command line to call the desired program, if possible one without and the other with text output. For controlling the program, the parameters of KEYTSR have to be modified in MCP.BAT. If you want to grab a part of the screen and redirect it to the LCD, SCRIPT.LCD would also have to be edited.
 

Using the software

Start procedure

After the system has booted, at the end of AUTOEXEC.BAT the "Master Control Program" MCP.BAT will be launched and never be finished. MCP.BAT invokes a couple of utilities for key detection, controlling the LCD and the CDROM etc. It is suggested to read the help screens of the utility programs before making individual modifications. (Run them without parameter or with /?).

The first job of MCP after startup is to check if there is a CD present in the drive and whether it is a CD-ROM or an ordinary Audio CD. Depending on the result of this "Autodetect"-procedure the user will be opposed to one of the following three situations:
 
Result of the Autodetect-procedure MCP section to be executed
no CD presentk main menu
Audio-CD present Audio-CD-subprogram
CD-ROM (data) present Directory-browser

Menu structure

The menu structure is implemented using conditional jumps in MCP.BAT and can therefore be easily modified to fit your personal needs. The green areas below represent the contents of the LCD with up to four menu items. To select a certain menu item, the corresponding key (preferably mounted below) must be pressed.
Main menu: The main menu appears after startup if no CD is present or after pressing the "menu"-key.
OPEN: Ejects the CD-tray. The eject-key of the drive itself should not be used because this could in some situations cause the operation system to print an error message (Abort, Retry, Fail?) that you will not be able to reply to. 
DRIVE: see below
OPT: see below
CLOCK: Displays a digital clock with 7-segment-digits
    DRIVE  CLOCK
OPEN    OPT   _
    LINK    BOOT
CTTY    CALM   _
Pressing the menu-key again will branch to this tool-menu.
CTTY: A DOS-shell can be run and controlled via a serial port using a terminal(-program).
LINK: This item is intended to run a data transfer utility. By default, LapLink will be called (not included).
CALM: Spins down (most) IDE-diskdrives.
BOOT: Reboots the system.
Drive selection (DRIVE):
CD  HARD    RAM 
ROM DISK   DRIVE
In the DRIVE menu you can choose between CDROM and harddisk (or other drives). 
Optionsmenü (OPT):
"Continous Play" will automatically start the next title (in the directory) after playback has finished. In "shuffle-play" mode a random decision is made again without repeats.
Continous Play: 
OFF  ON*    Skip
Auto Disk-Off: 
OFF* ON     Skip
If you like, the harddisk motor can be switched off after bootup.
Show MP3-tags: 
OFF ON*     Skip
If present, title and author in the MP3-tags can be displayed as a scrolled text.
Grab Screen:   _
OFF* ON     Skip
If a video card (or only some video RAM) is installed and if the computer is fast enough, this option displays the running time when decoding MP3-files.
ISO 9660-Level2:
OFF ON*     Skip
If the MP3-tag has not already been found, the long filename from CD-ROMs in ISO 9660-level 2 format (up to 32 characters, only capital letters, digits and underscore) will be scrolled over the LCD.
Saving Options
The configuration will be saved to disk for the next session. As this is the only write action, the player can be switched off at any other time without any loss of data.

Playing conventional audio-CDs

The Audio-CD mode will be activated, if an Audio-CD was present during the autodetect-procedure. The autodetect-procedure is performed on the following events:
Audio-Track  001
SHUF <-  -> PLAY
After an audio-CD has been sucessfully detected the desired track can be selected or the decision can be done randomly (SHUF). If the "left arrow"-key is pressed while track 1 was selected, the last track number appears. The "right arrow"-key gets you back to the first track (wrapping).
Track 01   00:03
PAUSE << >> STOP
The current track time time will be displayed during playback (after PLAY or SHUF). The fast-forward and fast-reverse keys jump 15 seconds ahead or back.

 

Playing MP3-files

After inserting a data CD-ROM or after selecting the CDROM-drive in the DRIVE-menu, the directory-browser is called. The drive will be scanned for MP3-files and the first occurence will finally be displayed.
01 CAMBODIA 2941
SHUF <-  -> PLAY
The upper display line informs about the file number in the currend directory, the filename and the filelength in kilobyte. The directory can be browsed with the "arrow"-keys. The last file will be followed by the first but when pressing the "left arrow"-key at the first file, subdirectories will occur. This is especially important for "..". Holding an arrow-key down for a longer time will speed up browsing.
PLAY either starts playback of the selected file or changes into the displayed directory.
SHUF starts playback of a randomly chosen file in the current directory including all subdirectories.
01 CAMBODIA 2941
PAUSE << >> STOP
The resident program KEYTSR generates keyboard scancodes for fast forward and fast reverse during the decoding process. The decoder will terminate when the STOP-key is held down.


Have a lot of fun!

Entwicklung und Vertrieb von Hard- und Software
Klaus Peichl
Dornbergstr. 10
91058 Erlangen-Tennenlohe
Telephone (0 91 31) 60 40 63.
E-Mail: pei@01019freenet.de
WWW: http://www.01019freenet.de/pei

The latest version of this text can be found in HTML-format in the directory "DOC" on the supplied floppy disk.
Copying this manual - even partially - requires my permission.  The software (except of shareware and freeware of other authors) must not be copied and distributed.
All trademarks used in this document are acknowledged as being owned by their respective owners.

(C) 1999-11-14 by Klaus Peichl