BART
A very simple database viewer for the SHARP PC-E220 Pocket
Computer.

Contents:
History and description
System
requirements, copyright and downloads
Transferring BART to the Pocket Computer
Using
BART on the Pocket Computer
Creating BART databases from text files
History and
description:
In the late 1970’s Sharp introduced the first device of a
series they called Pocket Computers. This first one was really only a glorified
pocket calculator, but later models featured alphanumeric displays and
keyboards, and the ability to run BASIC programs. The things were reasonably
priced, and when I needed a pocket calculator in the early ‘90’s, I decided to
go for one.
The one I bought was a model PC-E220, and had, besides the
aforementioned features, a 24 character by 4 line display, and 32 Kbytes of RAM.
What miracles of software design I performed with this thing at the time is now
forgotten, but the other day I found a new use for it.
I was looking for a compact device to find and display
cocktail recipes, in connection with another project. A modern PDA would, of
course, have met the requirements and then some, but was way outside the budget
for this frivolous a project. My thoughts were turning to purpose designed
hardware for this (a PIC chip, flash memory, alphanumeric display, etc.), when
I remembered the Pocket Computer.
Thus was born Bart (short for bartender, and no relation to
the Simpson family).
As the BASIC dialect spoken by the E220 is
rather, well,
basic, the database had to be embedded in the program itself. Therefore Bart is
really two programs: The first one, written in Visual Basic, is run on a Windows
machine, and produces the second one from a text data file. The resulting file
is a BASIC program with embedded data that can be downloaded to the Pocket
Computer and run there. Thus, you can create a viewer for any data you want. (At
least, if the database is not too big (ca. 25KB max in text form,
for the E220 with it's 32KB memory), and the data
lends itself to a simple textual “card file” presentation.)
System requirements,
copyright and downloads:
What you need for BART:
- Sharp Pocket Computer. I
have only tested this on the PC-E220, but it may run on other models that;
a) have sufficient memory (32KB for the cocktail database), b) have at least
24 characters by 4 line display (data representation may look a bit odd on
bigger displays, but should be quite readable), and c) use standard ASCII
character set.
Please let me know if you try it on other models, so I can tell others of
your success or otherwise.
- Some way to transfer the
final program to the Pocket Computer. RS232 adapters were available for most
models from Sharp at the time; I used the original CE-T801 interface for the
PC-E220. Don’t despair however, even if you don’t have a serial adapter for
your Pocket Computer. Both
Edgar Puehringer and Andrew
Woods have published designs for serial adapters that should work with most types.
Note; I have tested neither design myself, and can therefore not personally
vouch for them.
These, of course, require that you are handy with a soldering iron, and
willing to risk connecting your Pocket Computer to a homebrew circuit that,
should there be any mistakes in either design or build, could easily damage
it.
- A computer to transfer the
program from. If you want to build a new program from different data you need
a PC computer running Windows 95 or later, but if you only want the cocktails
database, you can use virtually any computer with an RS232 port. The directions
below, however, assume you are running a Microsoft operating system.
- The program itself. It is
©2003 by me, Kári Össurarson, but may be used and distributed free of charge.
You may also modify the provided source code, but I reserve the right to be
identified as it’s author, as long as it is recognizably
my code.
This zip file (1432KB) contains
everything; the Visual Basic source code, the compiled Visual Basic program,
the necessary Visual Basic support files, installer for the Visual Basic program,
the cocktails database in
text form, the BART processed database in BASIC form, and this help file.
For those that are bandwidth impaired and/or not interested in the whole lot,
here are the more important parts piecemeal:
This is the compiled Visual Basic program, without support files (9KB,
only required if you wish to create a new database).
This
executable (direct
link to Microsoft) will install the Visual Basic support files (1020KB,
only required for running the Visual Basic program, and even so, may not be
required if you already have a program written in Visual Basic 6 installed
on the computer).
This is the BART processed cocktails database in BASIC form (10KB,
all that is required unless you want to create your own, for which it is not
required).
Transferring BART to
the pocket computer:
The method described here is for transferring from a computer
running a Microsoft operating system to a PC-E220 Pocket Computer, but similar
methods can be used with other operating systems and/or hardware. The transfer
is done from the command line of the host computer, both because that method is
possible on, as far as I know, any Microsoft operating system from the
earliest DOS version and up, and also because it doesn’t require any extra
software to be installed. It is also possible to do this with a terminal
program, such as HyperTerminal, which has been shipped with, I think, all
Windows operating systems since Windows 95, but is often not installed.
-
Make sure there is enough space for the program on
your Pocket Computer. You can enter FRE in run mode to see have much free memory
you have in bytes.
Remember to back up important data and/or programs before deleting.
You can clear a loaded BASIC program by entering NEW in program mode.
You can clear variables by entering CLEAR in run mode.
You can clear a loaded text file by pressing D in the main screen of the text
mode.
You can enter the file handling screen (a sub mode of the text mode) by
pressing F in the main screen of the text mode. From there you can press F again
to see a list of files saved to the Pocket Computer’s RAM disk.
You can delete these files by pressing K in the file handling screen, and
entering the file’s name.
-
Connect the serial interface cable between the host
computer and the Pocket Computer.
Make sure the Pocket Computer is turned off while the connection is made.
Make sure the connector to the Pocket Computer is turned the right way around.
This is specially important if you are using a home-built interface, which
probably doesn’t have the guides of the standard interface, that are supposed to
prevent you from connecting it the wrong way around.
-
Set the transfer parameters on the Pocket Computer:
Enter text mode and press S to get to the SIO (Serial In/Out) screen.
Press F to modify the parameters, and press ENTER to get past the initial
screen. You can browse the parameters with the up and down keys, and modify them
with the left and right keys. Use ENTER to confirm after modifying each
parameter. Exit this mode with the C/CE key.
The parameters should be as follows:
baud rate=4800 (Try a lower setting if you have problems with the transfer)
data bit=8 (7 should be ok if you don’t use any extended characters in your
database.)
stop bit=1
parity=odd
end of line=CR LF
end of file=1A
line number=yes
-
Set the transfer parameters on the host computer.
From the command line, enter “mode
com1: 4800,o,8,1”.
If you are not using com1, you will have to specify the port you are using
instead.
The parameters are, in order, baud rate, parity, data bits and stop bits, and
should always match what you have set on the Pocket Computer. The possible
values for parity are n for none, o for odd, and e for even.
-
Do the transfer.
Prepare the Pocket Computer by pressing L in the SIO screen. The display will
read --- RECEIVING ---.
Enter “copy filename com1:” from the command line on the host computer.
Replace filename with the name of your processed database file (cocktails.bas,
if you are using the provided cocktails database). Remember to give the full
path, if you are currently not in the same directory. Replace com1 with the name
of the port you are using, if it is not com1.
The transfer will now be performed. Due to the low speed it will take some time
(about one minute for the provided cocktails database at 4800 baud). You will
get the command line prompt on the host computer again, once the transfer is
done. The Pocket Computer may still be receiving. Press BREAK/ON to get back to
the SIO screen, --- CONVERTING --- may be displayed for a couple of seconds.
-
Convert the downloaded text file to BASIC program
pseudo-code on the Pocket Computer.
Go to the text mode main screen (if you are still in the SIO screen, press
C/CE). Press B to get to the basic conversion screen. Press B again to do
Basic<-text conversion. The display will read
-- CONVERTING --.
If the program is too big to hold both the text and BASIC versions in memory at
the same time, you will be presented with TEXT DELETE OK? (Y). Press Y to
confirm.
The conversion can take a few seconds. Once it’s done, you will be returned to
the text mode main screen. You can now go to run mode and enter RUN to start the
program.
Using BART on the
Pocket Computer:
Once downloaded to the Pocket Computer, BART can be started by entering RUN in
run mode. You will first be presented with a title screen. When you press ENTER,
you will get the first of two simple help screens. Press ENTER again to see the
second one, and again, and you will see the titles of the first three items in
the database, and below it an input line.
Enter + or nothing to see the next three titles. Enter – to
see the previous three.
Enter a number of an item (1 to 3) to view it. It will be
displayed four lines at a time. Use ENTER to step through.
Enter *, followed by an upper case alphabetic letter to
search for the first item who’s title starts with that letter.
Any other input will display the same help screens that are
displayed when the program is started.
Creating BART
databases from text files:
Bart.exe
is the utility used to create new BART databases. It is a command line utility,
written in Visual Basic. (I know, I know, Visual Basic is not the ideal
programming language to create command line utilities in. It was just the one I
happened to have handy, and was familiar with.) It should run on any Windows
version from Windows 95 and up.
If you
downloaded the complete BART package, you should start by running Setup.exe to
install the Visual Basic dependencies. Bart.exe will, by default, be copied to
C:\Program Files\Bart, but you can provide a different path during install, if
you wish.
If you
downloaded Bart.exe alone, you can try running it. If you get an error you will
probably need to download and install the Visual Basic support files direct from
Microsoft (see the download chapter above).
When
processing the text file, certain rules are applied, which define how the text
file must be formatted:
-
The database items must be separated by some
recognisable text, that can not be used for any other purposes within the text
file (the Cocktails.txt file provided in the complete BART package uses ********
(8 asterisks)). Leading and trailing spaces will be ignored, but no other text
may be present in the same line.
-
Leading and trailing spaces, empty lines and empty
database items, will all be ignored. This is done to make the most of the Pocket
Computer’s limited display space.
-
The first line of each database item will be assumed
to be it’s title. It will be truncated to a length of 22 characters, if
necessary. It should start with a capital alphabetic letter, to make sure that
BART’s somewhat primitive indexing system works.
-
Any subsequent lines in the item that start with the
(truncated) title will be ignored. Again, this is done to preserve display and
memory space (prevent unnecessary repeats of text).
-
All other subsequent lines in the item, will be added
to it’s text. Line length should not be limited, as BART will automatically
adjust the text to the 24 character width of the Pocket Computer display.
-
The text should preferable be in 7-bit ASCII, as the
extended characters of the Pocket Computer are completely different from the
host computer.
To perform the conversion, enter “bart sourcefile
dest.file separator” from the command line. sourcefile is the text
file to be converted, dest.file is the destination file, and separator
is the separator text used in the source file (see above). Example: “bart cocktails.txt cocktails.bas ********”. Each parameter can be enclosed in quotes,
and must be so if it contains spaces.
If Bart.exe is used without parameters or with parameters
missing, it will display a message detailing usage.