Casio PB-770

This is my second post about a pocket computer outside of the Radio Shack line of pocket computers. Up until recently, my experience with pocket computers was limited to the Radio Shack line. There were some really interesting models around back then that Radio Shack did not choose to rebrand.

I have spent a few weeks experimenting with the Casio PB-700 and the PB-770. I had first started with the PB-700 and stumbled across a PB-770 along the way.

Casio PB-700

In many ways, the Casio PB-700 is a comparable model to the (Sharp) PC-2. It is roughly the same size as the PC-2 and had similar options.

Casio PB-700

The PB-700 was released in 1983, the same year as the PC-2 was released. However, figuring out when it was available in the United States is a bit of a challenge, and might not have been available here until 1986.

Like many other pocket computers, the PB-700 has a printer/plotter with cassette interface as an optional accessory.

Casio PB-700 and TRS-80 PC-2

It is interesting that Casio chose the “Personal Computer” labeling as opposed to Radio Shack’s “Pocket Computer” labeling, as Casio continued to do with other models, such as the PB-1000.

The Casio PB-700 has a “qwerty” style keyboard, with the numeric keys and operands off to the right side. This is a good layout because it allows for quick “calculator” operation without having to use special function or shift keys for calculations. The keys are plastic, not rubber, making this a durable keyboard.

Advertising and Availability

Unlike the Radio Shack pocket computer models, it is not as easy to figure out when and where the PB-700 (and PB-770) were sold here in the United States.

Tam’s LA Times Ad March 1986

It would appear that there was a delay in getting these in the United States, and, judging by the pricing, these most likely were already in markets in other places around the world before being available here.

Memory

Similar to the PC-2, the PB-700 has 4KB of memory built-in, and memory can be expanded by OR-4 modules which are 4KB each, for a total of up to three of them. This provides for up to 16KB of memory total. The OR-4 modules connect to the PCB with a zebra strip connector. There is a locking mechanism that slides up to clamp them in place. This is similar to the 1KB PC-4 memory expansion pack.

The OR-4 modules are added to the locations under the cover on the back of the unit. They are added from right to left, if adding less than three.

The locking mechanism is quite simple and works well, keeping them firmly in place.

Since the PB-700 has 4KB of memory built-in, 2,864 bytes are available after a full reset. With all three OR-4 modules added, 15,152 bytes are available after a full reset.

The OR-4 memory packs look similar to the OR-1 memory packs for the PB-100 (or PC-4):

Tandy PC-4 with 1K RAM Memory Module

One might think the OR-4 (which is still possible to find these days compared to the OR-1) would fit or be usable in the PB-100 (or PC-4). The OR-4 zebra-strip is too tall and the height of the OR-4 is slightly larger than the OR-1. These will not physically fit into the PB-100.

Display

The PB-700 has a 20 character wide by 4 line LCD display which is pixel addressable. The total number of pixels is 160 x 32. The PB-700 supports drawing lines and points directly from BASIC.

There are patterns in the character table for bar charts with varying shading patterns, which allows for simple bar charting, as shown in many of the advertisements at the time.

This display is impressive for 1983. Multiple lines with pixel addressing allows for graphing and more interesting applications and games.

This model has a character table that supports charting or similar effects. Compared to other pocket computers, this character table is impressive.

PB-700 Character Codes

Casio have managed to use nearly all 8 bit combinations for their character set.

Keyboard

The PB-700 has a “qwerty” layout with a dedicated numeric and operand section for use in calculator mode. The keys are plastic and durable and have enough spacing to be easy to type on.

This model, like many of the other Casio and Sharp models I have experience with, can be used as a calculator very easily upon power up, without having to switch modes.

Many of the characters needed for BASIC programming are readily available on the top row of keys, which is very convenient.

Casio PB-770

In my search for a deal on an FA-10, I found a listing that was reasonable and included a PB-700. Looking closely at the picture in the listing, it was actually a PB-770. I purchased it knowing at worst I would have an extensive repair (for the plotter and microcassette), and at best, I could use it just for the ability to load and save programs with the external cassette jacks using a PC.

Casio PB-700 and PB-770

Dead on Arrival

When the item arrived, I checked the PB-770 to see if it had the OR-8 memory expansion packs, and to my surprise it did. I put 4 “AA” batteries in and gave it a go. Nothing appeared on the screen.

I took out the OR-8 memory expansion packs (as I had a similar issue with a Casio PB-1000), still nothing came up on the display. I tried the contrast dial in both directions, still nothing on the display.

Casio OR-8 Memory Packs

I then replaced memory backup battery in case this was required for operation, and still nothing appeared on the display. I verified the batteries were supplying power to the unit (I had a problem with a battery connector on a Casio PB-1000 in the past).

I know the CPU, memory, and keyboard were working because I was able to get the pocket computer to beep (typing BEEP and pressing enter). This isolated the issue to the display, which in many ways made the process quite a bit simpler to diagnose further.

The LCD did not have any indication it was being supplied with enough voltage or driving signals to darken the pixels when turning on the pocket computer. The contrast dial made no difference at all. Visually, it had appeared as if the LCD itself was completely dead.

Since sometimes polarizers go bad after decades, I thought to try to place a polarizer over the LCD to see if I could spot any pixels coming alive when I turned it on. Since I did not have any spare LCDs handy (I could not find my box of donor LCD parts), a friend suggested I try a camera lens polarizer. I gave that a go, but saw nothing on the LCD.

The next step was to open up the PB-770 and have a peek inside.

Opening the PB-770 was fairly easy, especially since there were faint signs on the plastic case where the clip locations were. Only one screw (below the 3rd memory expansion slot) was needed to be removed.

There was no sign of battery corrosion anywhere, which is good. Corrosion can make its way into parts of the PCB and pocket computer that are difficult if not impossible to repair (such as LCD ribbon cables, expansion port connectors, etc).

The PB-700 and PB-770 are almost identical inside and out. They are manufactured with surface mount components, but the soldering process is a bit different than modern methods. It almost looks as if some the components were hand-soldered, as the placement is not precise and the solder joints are not exactly perfect. Further, there are bodge wires everywhere and I spotted a few tiny solder balls stuck to various places throughout the lower PCB.

Solder Ball on Resistor

These solder balls can be problematic if they dislodge as they can cause shorts. I looked very closely over every square centimeter of both sides of both PCBs, removing all solder balls found.

Casio PB-770 Inside

In addition to the solder balls, I noticed on several ICs, some pins appear to have solder bridges. These are not accidental, and are purposely bridged. Often times the bridged pins to not make contact with any PCB traces.

There are two PCBs, the lower PCB has the two processors, RAM, power supplies, voltage regulators, and pads for the memory expansion. The upper PCB has the keyboard and LCD assembly. The PCBs are connected primarily via a flex cable which is fairly rigid. There is a smaller flex cable for the buzzer, and a few bodge wires making connections between the two PCBs. The LCD assembly itself has a smaller PCB held in place by two screws and connected to the upper PCB with a rigid flex cable.

The LCD controllers connect to the LCD via a thin plastic ribbon cable on both the top and bottom of the LCD with an adhesive strip. There is one controller for each half of the display. I cringe a bit as I am writing this, as this type of LCD connection is not easy to repair if this is a source of the problem.

Anyone who has dropped a pocket computer or TI graphing calculator knows the feeling of picking it up off the floor and seeing some newly disconnected LCD rows. Unfortunately this is not a “zebra strip” connection that can be taken apart and cleaned. I was hoping this is not the cause of the problem I was seeing with the LCD not working. Not to mention, even if I get the LCD working, I could still have missing rows or columns on the output due to breaks in this connection.

As I inspected both of the PCBs, I spotted what might be broken traces on the lower PCB, but continuity checked out.

Possible Broken Traces on PCB

I noticed the under side of the lower PCB had four electrolytic capacitors, and I replaced all four caps, and still nothing appeared on the LCD.

At this point I needed more information on the internal workings of these models. Luckily I found a schematic for the PB-700 from Piotr, available here. I have also posted the PDF below, in case the link above disappears.

The schematic proved to be extremely helpful, if not absolutely necessary in order to continue onward. My focus at this point was on the LCD voltage regulator, as I suspected there was an issue there, as not even a single pixel darkened when turning on the PB-770.

At this stage of the diagnosis, it can get quite involved, and end with a mystery remaining unsolved. I have very little to no hands-on experience in electronics repair involving circuit analysis and diagnosis. I can replace components, test components, take measurements, but aside from digital circuits, this is new territory for me.

Because of the relative rarity of finding working PB-700s (or even a PB-770) in good condition on auction sites these days, I continued onward to finding the problem with this PB-770.

The schematic has voltage notations both for the RAM supply voltage (-4.5V) and the LCD voltage supplies (-20V for VLCD1 and -14.5V for VLCD2). It should be noted that the reference here is the GND rail in RED in the schematic, which can be easily clipped onto via pin 13 on the LCD connector. This is not the same as the battery negative terminal.

LCD Supply Voltages

I measured the points for the -20V and -14.5V and while the -20V was correct on my unit, the -14.5V point was only -2.8V. This was a good find, because it points to the possible reason the LCD is dead.

Easily Accessible Measurement Points for LCD Voltages

In looking at the circuit for the LCD voltage supply, specifically the -14.5V output, I checked the diodes as I suspected those can fail. The contrast potentiometer and VR3 were areas of focus at this point, since they can oxidize over time. I turned VR3 a bit both ways while measuring the VLCD2 output (which should be -14.5V). It made no difference at all in the voltage output, which remained at -2.8V.

VR3 Location

I removed the batteries and checked VR3 directly for it’s resistance value. The parts list from Piotr mentions VR3 as a 220K ohm variable resistor. I should see 220K (approximately) across the terminals at one end or the other (if I turn the dial each way). I measured between 0.6M and 1.5M and it was inconsistently measuring various high resistance values.

Now that it appeared that VR3 was suspect and not in the expected resistance range, I tried cleaning it with Deoxit D5. It made no difference. I then removed it from the circuit and tested it again with the same result.

I soldered a few leads to the pads where VR3 was and then connected them to a small breadboard for testing various resistances to see if the LCD would work. With an open circuit where VR3 was, I measured the same -2.8V for VLCD2, which is what I would expect if that part of the circuit had 0.6M ohms instead of 220K or lower.

I added a 220K ohm resistor to the breadboard path and saw a jump to -12V! This was an encouraging result, and definitely the path to getting the LCD working again. I added another 220K ohm resistor in parallel, which should give me 110K ohms total, and the voltage jumped to -13.43V.

LCD Working Again

I was glad to see the familiar “Ready P0” prompt on the screen! This meant the low voltage output on VLCD2 was the reason for the display not working. Now that I confirmed the LCD was now working, I needed to replace VR3 with a similar ranged variable resistor. Since I did not have any variable resistors in the right range on hand, I ordered a kit from Amazon which included a 200K ohm value.

The replacements were 3 pin variable resistors, with the center pin being the tap or wiper. These can easily be wired up to a 2 pin circuit by connecting the center tap to either of the side legs.

There are already so many bodge wires inside the PB-770, nobody would notice one more bodge wire between the center pin of the replacement variable resistor and the pad. I am sure I could have scoured Mouser or Digikey for a low profile variable resistor like the original with only two leads, but there was enough room in the case to support a slightly larger profile.

PB-770 with Replacement VR3

I connected the DMM to the VLCD2 pin and GND pin on the LCD flex cable to monitor the voltage. I initially set the variable resistor to the maximum resistance (about 200K ohms) with the batteries out of the unit. This ensured that the voltage for VLCD2 would be below the -14.5V needed for fine tuning the voltage level. I then put the batteries in and turned the power switch on.

VR3 Calibration for VLCD2

I slowly turned the variable resistor toward a lower resistance value until I saw approximately -14.5V on the DMM.

I verified the LCD output was visible and then assembled the PB-770 back together.

LCD Working Again

Even though I had a working PB-700, I could have used it for voltage and resistance comparisons at various points in the circuit. This would be the only way to troubleshoot the PB-770 if the schematic were not available.

Luckily the part needing replacement was a basic part and nothing custom manufactured by or for Casio. For example if the LCD itself, a display driver, RAM module, or a CPU had an issue, the option would be to pull a replacement out of a donor model.

Memory Expansion

The PB-770 has 8KB of RAM built in and can accept up to three OR-8 memory expansion packs, each one being 8KB. If adding fewer than all three, they need to be added in order from the right side (the bay without the case screw).

Since the PB-700 and PB-770 do not have a dedicated memory remaining screen (like the Radio Shack rebadged models), typing SYSTEM will indicate the amount of memory installed and remaining.

FA-10 Restoration

The FA-10 is the plotter and cassette peripheral for the PB-700 and PB-770. The FA-10 had a microcasssette drive as an optional attachment, and the one I acquired had one attached.

The FA-10 also has jacks for an external cassette recorder either as a secondary unit or as a primary unit if the CM-1 is not installed.

The FA-11 is identical with the exception that it has a built in (non removable) full size cassette drive.

Casio FA-10

The FA-10 is very easy to work on, there is a lot of room inside with each section easily removable. I usually start with the battery pack removal then inspect and the plotter and in this case also the cassette drive.

In order to power this up, I needed to fix the input jack. The DC input jack had the center pin completely broken off, and I was lucky to have an extra jack available. I took the extra jack from a Radio Shack PC-2 plotter/cassette module I had kept as a donor unit.

I recently bought a Hakko desoldering gun, and it was a bit pricey. I had bought extra tip shapes, such as a 3mm x 1mm and it came in handy for removing both DC input jacks from their PCBs. It literally took seconds in total. That Hakko has paid for itself already in terms of time savings with this project as well as a few others.

AC Adapter

Now that I replaced the DC input jack, it was ready for a power up test. The FA-10 I acquired did not come with the AC adapter. From other listings I see that it is 8 volts DC, center pin negative.

If the internal battery pack is not connected, the source power should not exceed 6 volts to be on the safe side. Many of these printer cassette units leverage the battery pack as a simple voltage limiter. If the battery pack is missing or not installed, it is possible the power supply is not regulated, and keeping the input voltage limited to the rated DC voltage is a safe idea.

After replacing the DC input jack and applying 6 volts DC to the input, I heard the signature sound of the plotter mechanism waking up. Seems like the power supply and logic board were working.

Battery Pack

Almost all of these printer cassette units have an internal rechargeable battery pack. Due to their age, they almost certainly leak, and many times cause damage to the unit.

Luckily the one I acquired did not have leakage beyond the pack itself. I had to trim off some of the wiring to the battery due to corrosion.

NiCd Battery Pack

The original pack was well covered which contained the dust that otherwise would have found its way all around the inside of the unit.

6V NiCd Battery Pack

The battery pack is labelled 6V at 1,650mAh. These appeared to me to be the same size as “C” cell batteries. To be sure, I compared the size to an actual “C” cell battery.

5 “C” Cell Battery Pack

The pack is composed of 5 cells, each at 1.2 volts. 5 cells are needed to arrive at 6 volts total. Most of the other battery packs I have made were with “AA” size cells, and I did not find tabbed “C” cells. I ended up using regular NiMh “C” batteries and a spot welder to make a new pack.

This was my first attempt at using a spot welder, and I would say it is a bit more involved than I had thought. These are inexpensive and I would say a bit dangerous, if not used correctly.

Seesii Spot Welder

These spot welders are basically a battery pack with leads. My advice would be to use safety glasses, start at the lowest power level and work up one step at a time until the weld holds. Then you have the correct setting for the job at hand.

I had the power up to the maximum accidentally and it completely blasted apart much of the nickel strip i was holding.

The method that worked best for me was to have one probe on the nickel strip against the battery terminal, then I touched the other probe to a spot on the (same) battery terminal right near the other probe. I would avoid touching the probes together because that can oxidize them and make them less effective. It came with a file that can be used to clean off the probes if needed.

New 6V NiMh Battery Pack

I needed two sizes of shrink wrap to secure it all together. However, the new pack fit perfectly where the old pack was.

The replacement batteries I used are 4000 mAh, and is more than double the original capacity. This means charging time mentioned in the owners manual has to be extended by about 2.5 times.

Plotter Repair

This plotter uses the same Alps designed mechanism the PC-2 and others use. The FA-10 is much wider than the PC-2 printer, but otherwise works the same.

Alps 114.5mm Wide Plotter

It has 2 pinion gears that are known to crack over time (they all do), and luckily Jeff Birt has these on his website for sale. They are brass replacements and will not need to be replaced.

Pinion and Anti-Backlash Gears

It is very easy to determine if these are cracked. Simply try to turn the larger gear on both sides of the printer mechanism. If the pinion gears are cracked, the rolling will appear to stop or be stuck at one point. This is the point where the crack is, and to avoid damage to the other gears, definitely do not force rotation any further.

Cracked Pinion Gear

In my post for the PC-2, I outline and share a link to the replacement process for these gears which Jeff Birt has published.

One thing to look for before replacing these pinion gears is whether the anti-backlash gear is broken. If it is, the printer paper will not move correctly and you will get “jittery” printer output. These are very difficult to repair and one option is to pull one from a donor mechanism.

I could see the anti-backlash gear on my unit had a loose spring and broken “nub” like almost all of my other Alps mechanisms.

Determined to get this plotter working, I experimented with refitting the spring in such a way that one end went through the top gear and hooked into the bottom of the bottom gear. I did this in the area where there is an opening through the top gear. I then hooked the other end of the spring into an existing slot.

I had to trim a few millimeters off the spring to get this just right.

This provided enough flex / resistance to soak up some of the “slack” when the gear switches directions. This hack for the anti-backlash gear worked, I was able to get enough “flex” between the inner gear and outer gear. I had just barely enough clearance between my spring sticking out from the outer gear and the gear that drives this one. When assembling, I pushed the driving gear to first mesh with the outer anti-backlash gear, turned the inner gear in the direction against the resistance from the spring by one or two teeth. Then I pushed the driving gear all the way in, meshing with the inner gear on the anti-backlash gear set.

Of course the spring / broken “nub” issue was not the only issue, as mine had a cracked hub also. Jeff posted a video here on a fix for the hub cracking on these gears. It basically involves placement of a 3mm inside diameter clip onto the hub. This was a bit easier than I thought and it worked.

Of course, none of the repair would be worthwhile unless you have at least one working plotter pen, which are not easy to find. They are certainly not made any more, except for one reseller in Europe who gets them from China and they are quite expensive. I have found a good way to refill these, should you have dried up pens available.

The plotter can use either a 70mm diameter roll of paper or 24mm diameter roll of paper. The width is 114.5mm (4.5”). If using the larger roll, the external paper roll holder is necessary. Otherwise, the 24mm diameter roll will fit inside the unit.

Although this width paper (non thermal) is available these days, it is not cheap. I ended up buying some easel paper which is 15” wide and cutting it to the 4.5” width needed for the printer.

Casio FA-10 Plotter Self Test Mode

The plotter repairs were a success! I loaded all four pens into the plotter and pressed the feed button while turning the plotter switch on. The plotter has a built-in test mode which will use all four pens. It first draws some boxes, circles, rotated text of varying sizes, and then the full character set.

Casio FA-10 Plotter Self Test

Seeing this plotter working was familiar, as the PC-2 also used a nearly identical Alps mechanism. It was interesting to see the larger (wider) format printing, which makes the PC-2 plotter seem minuscule in comparison.

The FA-10 has indicators for pen color on the carousel, which is a nice addition. I do not need to consult the user guide for the pen loading order.

Pen Carousel

Microcassette Mechanism (CM-1)

The FA-10 can be fitted with a microcassette mechanism, the CM-1. It also has jacks to use an external cassette recorder, or for connection to a PC for recording and playback for saving programs. The FA-10 I acquired had the CM-1 installed.

Any cassette mechanism this old likely needs the belt changed by now. Oddly this one looked like the belt was new or replaced at some point. Visual inspection showed no signs of “melting” typically seen with belts this old.

CMT or Micro-Cassette Mechanism

When I turned the CMT switch on and pressed the play button, fast forward, or rewind, an interesting noise could be heard. I did not want to keep using it with this noise so I needed to disassemble it and look into it further.

The CM-1 easily detaches from the FA-10 for servicing without having to take apart the FA-10. The CM-1 mechanism is not easy to disassemble, and the main reasons are due to wires soldered onto the PCB which need to be unsoldered, but also due to a sensor connection which needs to be unsoldered.

Sensor Soldered to PCB

Again, with the help of a video from Jeff Birt here, I learned why the PCB appeared to be stuck without being able to remove it from the assembly.

After removing the PCB, I had access to the belt.

CM-1 Belt Replacement

The belt was not a melted mess but it was no longer as flexible or stretchy. Note the replacement must be 0.5mm not the commonly found 1mm diameter.

After replacing the belt the drive was perfectly quiet.

I did not change the tape counter belt as this seemed to still work without issue.

Cassette Data Storage Features

The PB-700 allows for saving programs in binary (tokenized) format or ASCII format. The ASCII format will take more tape and more time to save and load. I suspect this mode was added for greater compatibility between models.

You can save either the current program selected or all programs at once.

In addition to saving programs, variables can be saved and loaded.

Anything saved to the tape can be verified using the VERIFY command.

FA-4

Casio released the FA-4 for the PB-700 / PB-770 which had the cassette interface jacks as well as a parallel port.

Casio FA-4 Courtesy of pocket.free.fr

Having an FA-4 would in theory allow for printing to any line printer with a Centronics port, such as an inexpensive Epson POS thermal printer.

I suspect the odds of finding one of these is similar to the OR-1 memory expansion or the link cable for the PC-5/PC-6.

Programming in BASIC

The PB-700 is different from the previous Casio models I am familiar with, such as the PC-4, PC-5, PC-6, and PC-7. Those models had a program mode (WRT) and a run mode (RUN). When writing or updating a program, you had to be in WRT mode and to run a program you had to be in RUN mode. Most often I would find myself switching between modes when debugging or fixing a program.

The PB-700 has the enter key on the right side for calculations, and the other enter key to the left for the program input. This avoids the need to switch modes when debugging, writing programs or performing calculations.

I have often forgotten to use the middle enter key when writing programs, and thankfully the RECALL feature can pull back the previous entered statement.

When using the SYSTEM command, the used or occupied program spaces are marked with a “heart” icon.

Maze Generator

Since this pocket computer has a multi-line display which is dot addressable (intended for graphing), I thought it would be interesting to write a BASIC program to randomly generate a maze on the screen.

The LCD on the PB-700 has a total number of 5,120 pixels (160 horizontal by 32 vertical):

All pocket computers have a limited amount of memory, and with 5,120 pixels to work with, and limitations of BASIC, I need to get a bit creative with adapting any maze algorithm for this pocket computer.

The next factor to think about is how to best use the limited amount of memory available. Further, the options available in this pocket computer’s BASIC determine how efficiently the memory can be used.

Two dimensional arrays are supported and can be sized according to available memory. However, each numeric value takes 8 bytes for full precision or 4 bytes for half precision. This is the first pocket computer I have used which supports a half precision option to save memory.

To further optimize memory usage, I can use PEEK and POKE and use single bytes directly (only on the PB-770). All that is needed to do this is to reserve the desired space you need using the CLEAR command.

The PB-700 supports a few helpful commands for graphics in BASIC such as:

  • DRAW – draws a point or line
  • DRAWC – clears a point or line
  • POINT – determines if a pixel is on or off given a location

With support for clearing points or lines and detecting whether a point is on or off, I will not need a separate block of memory to track pixel status for each pixel on the LCD. Of course, some of these functions might be slow due to the bus and how the interface to the LCD controllers works. In an effort to use less memory and keep the program flow simple to understand, I took advantage of the ability to read pixel state using the POINT function.

Backtracking Algorithm

Now that I have an understanding of the BASIC capabilities of this model, I looked for a good algorithm for a maze generator. There are almost a dozen different algorithms for random spanning tree generators, and some are easier than others to implement in BASIC.

I chose the backtracking algorithm because it was simple to implement in BASIC and the easiest to follow for beginners working with spanning trees.

The algorithm starts at a random place in the canvas and walks in a random direction after each step forward. If it hits a “wall” or space already walked upon, then it back tracks until it finds another adjacent spot it did not walk on yet. It repeats this until all adjacent spots have been traveled.

Courtesy of professor-l Elle

I found some sample javascript and animations from professor-l Elle. I converted the backtracker algorithm to BASIC and set the canvas size to 25 x 25. I used the PB-770 because it supported the PEEK and POKE commands and memory allocation to support a basic stack. If using a PB-700, I could convert the stack to an array, and the size of the array would be at worst case about 2/3 of the number of pixels on the canvas needing to be reserved.

Initial Result

The algorithm in BASIC worked! However, it is extremely slow. I set the initial canvas size to 25 x 25, and it took over 6 minutes to draw the maze. If I set the canvas size to 159 x 31, it took over an hour to draw the maze.

Casio PB-770 Maze Algorithm

Printing the Maze

Since I was able to get the plotter working again after replacing the pinion gears and repairing the anti-backlash gear, I figure why not print out the maze?

I added a subroutine at the end of the screen draw for the maze which reads the pixels off the LCD and converts them to a series of horizontal and vertical line draw commands to the plotter. I avoided the approach of drawing boxes for each pixel as that would move the paper and pen actuator too much. The print routine will first draw the horizontal lines, then the vertical lines.

Casio PB-770 with FA-10 Printing Maze
Casio PB-770 with FA-10 Printing Maze

Program Listing

I have included the PB-770 program listing for my conversion of the backtracking maze algorithm in BASIC below. This listing include the printing subroutine. Remove or ignore the highlighted comments in the listing.

I included the PB-770 maze program as a WAV file, if you have an FA-10 or FA-11:

I have added some parameters that should be set before using the program. The width and height should be set (highlighted below in line 20). Note that you cannot exceed the actual screen size here, and the number should be odd. Further, the larger the canvas size, the longer the maze will take to generate.

Once the width and height are set, be sure to edit line 10 for the scale factor. In my video above, width and height were set to 9, and the scale factor was set to 4. The plotter maximum width in points is 100. For example, if the width and height were 25 and 25, the scale factor can be 4. If you increase the width and height to 50 by 50, the scale factor should be cut in half, for a value of 2.

Another parameter which might need adjusting is the address in the CLEAR statement and the initial value of B, which is the “open cell” stack. I have all 3 OR-8 memory packs installed, and I allocated free space toward the end of the PB-770 memory map. If you have less memory than this, you will need to adjust this start address accordingly.

MAZE GENERATOR VERSION 1.2

10 CLEAR 24575 : B = 24575 : A = B : DIM N!(4,2) : CLS
20 W=25 : H=25 : S=4
30 W = W - (W MOD 2) + 1
40 H = H - (H MOD 2) + 1

FILL WORKSPACE WITH CLOSED BLOCKS

50 FOR Y = 0 TO H - 1
60 DRAW (0,Y)-(W-1,Y)
70 NEXT Y

CUT OPENING AT TOP

80 DRAWC (1,0)

RANDOM START SOMEWHERE

100 SY = ROUND(RND * (H-2),-1) + 1
110 IF SY MOD 2 = 0 THEN 100
120 SX = ROUND(RND * (W-2),-1) + 1
130 IF SX MOD 2 = 0 THEN 120 
140 DRAWC(SX,SY)
150 POKE B,SX : B = B + 1 : POKE B,SY : B = B + 1

POP NEXT OPEN SPACE OFF STACK

200 IF A = B THEN 580 
205 B = B - 1 : CY = PEEK(B) : B = B - 1 : CX = PEEK(B)

GET ADJACENT SPACES NOT OPEN YET

210 GOSUB 1000

IF NONE FOUND, POP PREVIOUS OPEN SPACE OFF STACK

500 IF NC = 0 THEN 200

RANDOM CHOICE MADE, OPEN AND JOIN TO PREVIOUS

530 CH = ROUND(RND*(NC-1),-1) 
540 POKE B,N!(CH,0) : B = B + 1: POKE B,N!(CH,1) : B = B + 1
550 DRAWC(N!(CH,0),N!(CH,1))
560 DRAWC((N!(CH,0)+CX)/2,(N!(CH,1)+CY)/2)
570 CX = N!(CH,0) : CY = N!(CH,1) : GOTO 210

CUT OPENING AT BOTTOM, BEEP AND PAUSE, THEN PRINT

580 DRAWC(W-2,H-1) : DRAWC(W-2,H-2)
590 BEEP 
600 IF INKEY$=“” THEN GOTO 600
610 GOSUB 2000
620 END

FIND ADJACENT CLOSED BLOCKS

1000 NC = 0 : YP = CY+2 : YM = CY-2 : XP = CX + 2 : XM = CX - 2
1010 IF YM <= 0 THEN 1030 
1015 IF POINT(CX,YM) = 0 THEN 1030
1020 N!(NC,0) = CX : N!(NC,1) = YM : NC = NC + 1
1030 IF YP >= H THEN 1050
1035 IF POINT(CX,YP) = 0 THEN 1050
1040 N!(NC,0) = CX : N!(NC,1) = YP : NC = NC + 1
1050 IF XM <= 0 THEN 1070 
1055 IF POINT(XM,CY) = 0 THEN 1070
1060 N!(NC,0) = XM : N!(NC,1) = CY : NC = NC + 1
1070 IF XP >= W THEN 1090
1075 IF POINT(XP,CY) = 0 THEN 1090
1080 N!(NC,0) = XP : N!(NC,1) = CY : NC = NC + 1
1090 RETURN

PUT PLOTTER IN GRAPHIC MODE

2000 LPRINT CHR$(28);CHR$(37) 

LOOK FOR HORIZONTAL LINES

2010 FOR Y = 0 TO H
2020 PX = -1
2025 FOR X = 0 TO W
2030 P = POINT(X,Y)
2040 IF P = 0 THEN 2070
2050 IF PX >= 0 THEN NEXT X
2060 PX = X : NEXT X
2070 GOSUB 4000 : PX = -1
2080 NEXT X
2090 GOSUB 4000
3000 NEXT Y

3005 LPRINT “M0,0”

LOOK FOR VERTICAL LINES

3010 FOR X = 0 TO W
3020 PY = -1
3025 FOR Y = 0 TO H
3030 P = POINT(X,Y)
3040 IF P = 0 THEN 3070
3050 IF PY >= 0 THEN NEXT Y
3060 PY = Y : NEXT Y
3070 GOSUB 5000 : PY = -1
3080 NEXT Y
3090 GOSUB 5000
3099 NEXT X

3100 LPRINT “F4”
3110 BEEP : END

PRINT HORIZONTAL LINES

4000 IF PX < 0 THEN RETURN 
4010 LPRINT “D” ; PX * S ; ”,” ; Y * S * -1; ”,” ; X * S ; ”,” ; Y * S * -1
4015 LPRINT “D” ; PX * S ; ”,” ; (Y * S * -1) - S; ”,” ; X * S ; ”,” ; (Y * S * -1) - S
4020 RETURN

PRINT VERTICAL LINES

5000 IF PY < 0 THEN RETURN 
5010 LPRINT “D” ; X * S ; ”,” ; PY * S * -1; ”,” ; X * S ; ”,” ; Y * S * -1
5015 LPRINT “D” ; (X * S) + S  ; ”,” ; PY * S * -1; ”,” ; (X * S) + S ; ”,” ; Y * S * -1
5020 RETURN

Final Thoughts

The Casio PB-700 was released around the same time as the PC-2, which was the Sharp PC-1500. In some ways, with the FA-10 or FA-11, it has some advantages over the PC-2, such as a built in microcassette option, a larger format plotter, and a multi-line LCD. This allowed for plotting and graphing on the LCD directly, which the PC-2’s single line display could not do. The PB-770 likely was released not too long after the PB-700.

On the other hand, the PB-700 was not programmable in assembly, did not have a serial port option, nor optional ROM packs like the PC-2 did.

They both had similar hard cases (the Sharp PC-1500) for their printer cassette interfaces.

When I found the PB-700 on eBay, I started looking for its printer/cassette module for loading and saving programs. In finding a deal on the FA-10, getting the PB-770 with the three OR-8 memory expansion packs with the FA-10 was a bonus. Even though it did not work on arrival due to the VR3 failure, it was quite a rewarding experience finding the problem and fixing it.

The plotter had the usual cracked pinion gears, but in the past when I saw the broken nubs on the anti-backlash gear, I would write off the plotter as unrepairable without a donor part. If it were not for Jeff Birt selling the pinion gear replacements, these printers would not work today. There is yet to be any replacement for the anti-backlash gear.

However, determined to see this working again and rigging up a solution to the broken anti-backlash gear was worthwhile. I could use the same fix on my other pile of Alps plotters which had the same issue.

Lastly, cutting some paper to size was not as difficult as it would seem, and far cheaper than buying the odd sized paper. I ended up using a paper cutter for the job.

Overall, this restoration was the biggest yet for me. There were multiple areas of focus; the microcassette drive, the plotter, the battery pack, the DC input jack, and the computer itself. It was certainly worthwhile, and hopefully it will continue to work for a few more decades to come.

As this is the second pocket computer model outside of the Radio Shack line that I have experimented with. I am quite impressed with the Casio PB-700/PB-770 capabilities given the time they were released. I am curious as to whether these were as popular in the United States as the Radio Shack line was. Were they too expensive for the U.S. market to be more popular? Where and when were these sold in the U.S.?

These really did live up to their advertisements in many ways. Charting and graphing really is easy, whether it be to the screen or plotter. I am curious if there is software out there that has survived, and will keep an eye out for others who may have these working or software archived.

In terms of software or demos, I now have a new signature demo for multi-line pocket computers: the maze generator. For the other models I have been using my banner program in various versions. I will be sure to go back to the Model 100 and the PB-1000 and try the maze generator on those as well, comparing speed.

Leave a Reply