Connecting a Parallel Printer to an Apple II (IIgs)

I almost gave up on this project.  It was a project meant to have been a jump-off point for a more ambitious one, but at the rate I end up working on these types of projects, I should probably scale back on my project list.

The Apple II Parallel Interface card (APIC), Apple Product 670-0021, caught my attention a few years ago. It is one of the interface cards that would allow you to connect standard parallel printers to your Apple II/IIgs. It stands out among other parallel interface cards because the cable attached to the card ends in a female DB-25 port instead of a standard 36-pin male Centronics port that connects directly to the printer. That DB-25 port opens up a lot of opportunities for connecting all kinds of peripherals.

Except that… in typical Apple style, the pinout for that DB-25 port, or the 26-pin ribbon connector in the APIC, is arranged in a very… uhm… eccentric way. From what I’ve searched, the only devices that offered this pin arrangement is the APIC and the Apple Lisa parallel port.

If you search for the typical DB-25 connector parallel port pinout offered in the IBM PC and compatibles, there is an almost one-to-one mapping to the 36-pin Centronics port of parallel printers. That DB-25 connector is the IEEE 1284 Type A standard as described here. At the very least, the data pins are in a contiguous arrangement. Pins 2-9 on both the DB-25 and the Centronics connector are the data pins. With the APIC, the following photo shows the arrangement as documented in the manual:

APIC DB-25 Pinout

That insane arrangement was enough for me to temporarily shelve my project for years. Then in 2013, David Schmenk used the APIC for a similar project. He probably wondered about that same peculiar DB-25 pin arrangement on the APIC, and went further to document the necessary mapping monstrosity to hook it up to a QuickCam camera.  I just wanted to hook the APIC up to a parallel printer.

Towards my goal, I dug up the only remaining parallel printer I have in storage. It’s an HP DeskJet 340, a portable printer that originally sold in the `90s for $300. I also had the standard DB-25 to Centronics cable that I used to connect the printer to old PCs.

For those who want to connect the APIC to the parallel printer seamlessly, the standard DB-25 to Centronics cable is not suitable.  Instead, look for a cable that matches Apple Product 590-0042 which compensates for the APIC pin arrangement.  If you want to build your own cable, the mapping is documented in the Apple Peripheral Interface Guide:

AppleProduct-Cable-590-0042

I took the challenge of building my own adapter, even though my soldering skills are way lower than that of David’s. When I paid a visit to Fry’s, I saw this useful RS-232 wiring adapter for adjusting the wiring connections of an RS-232 DB-25 cable:

RS-232 Wiring Adapter

I started to re-map the pins, only to find out that the adapter does not allow re-mapping of Pin 1. In RS-232 connections, pin 1 is always connected to GND.  I really needed Pin 1 because that pin is used for the STROBE signal to the printer. I could have played around with some gender changers, but that would tie Pin 13 to GND which I might need for bidirectional data transfer (Pin 13 is the SELECT line for the parallel connection which is needed for Nibble mode data transfer). I gave up on the adapter, and proceeded with the following embarrassment:

APIC Wiring  APIC DIP Switches 

APIC Pin # Name IEEE 1284 Pin #
2 Signal Ground 18
4 Signal Ground 19
5 Data Out, Bit 0 2
6 Data Out, Bit 1 3
8 Data Out, Bit 2 4
11 Data Out, Bit 5 7
12 Data Out, Bit 6 8
13 Data Out, Bit 7 9
15 Strobe Out 1
16 Acknowledge In 10
20 Signal Ground 20
22 Data Out, Bit 3 5
23 Data Out, Bit 4 6
24 Signal Ground 21

To test the cable, I installed the Harmonie DeskJet printer drivers, installed the GS/OS Teach application, and typed a short sentence. The printouts turned out well. There was an initial run (first sheet) that indicated one of the pins probably being disconnected and always getting a bit value of 1 on the lowest data pin — double checking and tightening the wiring fixed that problem.

Apple IIgs Harmonie  APIC Printouts

The follow-up project that I have in mind is to write software drivers that make use of the Nibble data transfer mode.  This would be similar to David Schmenk’s code for reading image data from the QuickCam camera.  It would make use of the BUSY, PAPER OUT, SELECT, and ERROR signal lines connected to four of the APIC Data In lines.  The data rate limit for Nibble mode is around 100kbps.  Ultimately, it may be enough to use the APIC as a cheap interface card for mass storage devices like the Iomega Zip Drive, whose block transfer protocol is widely documented in the Linux drivers repository (see the PPA3 driver here).

Posted in Retrocomputing | Tagged , , | Leave a comment

Apple IIgs Case Mod

Ever since a tiny little power adapter for the Apple IIgs was made available by James Littlejohn, I’ve always wanted to see what I can put into that cavernous space created by the absence of the old power supply.

The old Apple IIgs power supply takes roughly 1/5 of the internal space of the IIgs case.  In 2007, a tiny 2.5” x 2.5” power adapter called the LittlePower adapter was made available to allow a standard ATX power supply to be used.  I bought my LittlePower Adapter IIgs from ReactiveMicro at that time.  I think it’s now known as the LittlePower Flip and is sold at UltimateApple2.  Combined with the similarly tiny ATX Pico power supply from mini-box, it frees up a lot of space inside the case.

A plan for putting a standard 5 1/4” peripheral in there materialized and stayed in my workbench waiting to be allocated some time.  A recent long weekend gave me that time to grab some tools and start hacking at the case.

AppleIIgsCaseMod-2     AppleIIgsCaseMod-3

I’m not a professional case modder and it shows.  I was experimenting with the attachments on my rotary tool and the mistakes are evident in the top side of the hole.  This was more a proof-of-concept than anything else.

It now allowed me to use my Apple II High Speed SCSI Card to connect both an internal solid state drive (scsi2sd from Michael McMaster) and a SCSI CD-ROM device.  Remember to set the booting drive with a higher ID in the SCSI chain.

AppleIIgsCaseMod-1     AppleIIgsCaseMod-4

Internally, with the 5 1/4” device in there, you would lose the use of Slots 1 and 2.  I was able to squeeze the scsi2sd solid state drive towards the rear of the case, and the IDC cable runs underneath the device into the SCSI card on Slot 7.

AppleIIgsCaseMod-6     AppleIIgsCaseMod-7

I probably violated a dozen of best practices to electronically isolate components from each other.  I didn’t even use cardboard shielding between some cards in the slots.  So please, if you want to do this mod, do it right and take the necessary precautions.

To keep the 5 1/4” device somewhat steady in place, I attached a mounting plate underneath the device.  These mounting plates are the same ones used for these devices in older Macintoshes, particularly the LC series.  You can still readily buy them as spare parts.  I drilled a couple of slits in the mounting plate with a rotary tool.  The slits are positioned in such a way to mate with the two plastic standoffs from the bottom of the case that were formerly used to keep the old power supply in place.

AppleIIgsCaseMod-8     AppleIIgsCaseMod-9

Using the CD-ROM was frankly just the proof-of-concept.  Since I rarely use a CD with my IIgs, it would be more appropriate to use an external SCSI CD-ROM device.  I will probably replace it with the SCSI floptical drive I used in an older post.  Or even with one of those SCSI-PCMCIA devices having the 3 1/2” form factor and having the PCMCIA/CF/SD slots in front for easy access.

UPDATE 11/8/2016:

As originally planned, the SCSI CD-ROM will be rarely used.  Instead, I first tried with a SCSI floptical drive and was able to mount 1.44 MB MSDOS disks.  The GS/OS MSDOS FST driver only has read capability, so I can transfer files into, but not out from, my Apple IIgs.  The drive is also an MFM-encoding drive, and cannot read the GCR-encoding 800 KB disks used with the standard IIgs external disk drives.

AppleIIgsCaseMod2-1     AppleIIgsCaseMod2-2

I suppose I could reformat a diskette as a 1.44 MB ProDos read/write block device, which should make it look like a very small-capacity hard disk.  However, I eventually settled for one of those SCSI-CF devices where I could use higher-capacity cards to transfer files in and out.  The SCM Microsystems PCD-50B provides multiple card readers in a 3.5” form factor.  With the standard adapter bracket and faceplate, it substituted into the 5.25” opening.  The only issue with this model is that the multiple card readers are addressed using multiple LUNs with a single SCSI ID.  I think the Apple II High Speed SCSI card firmware (or driver) only makes use of LUN #0, which is the PCMCIA slot.  In order to use CF or SD cards, I had to put them in one of those PCMCIA-CF-SD adapters.

AppleIIgsCaseMod2-3     AppleIIgsCaseMod2-4

Posted in Retrocomputing | Tagged , | 3 Comments

Remote Controlled EV3 Robot with Dual Gyro Sensors

I’m in the middle of another project involving the LEGO EV3 system.  My 11-year old has been making some inquiries about the gyro sensor that came with the EV3 Education kit.  To make the lesson more interesting, I wrote a simple EV3 project to illustrate the use of the gyro sensors, and as a bonus, also to illustrate the use of Bluetooth messaging.

The most common EV3 robot design we have used is the two-wheeled robot.  The two wheels are controlled by independent motors, and can therefore be used to move the robot forward/backward, as well as steer the robot left/right by varying the speed (and rotational direction) applied to the two motors.

The project is to remote control this kind of EV3 robot to move forward/backward and to steer left/right.  Instead of a joystick-like remote control, I want the controller to use gyro sensors, in the same way some smartphones use similar sensors to determine the phone orientation.  Such a controller can technically be attached to an arm, and the movement of the arm controls the robot, making it a hands-free experience.

A hands-free controller like this can accomodate three separate axis of rotations.  Some of you may be familiar with the concepts of pitch, roll, and yaw, such as those used in joysticks that control airplane movement.  For our EV3 robot to move forward/backward and left/right, we only need two axis of rotations.  I used pitch and roll in my simple controller design because those two concepts naturally fit the intended movements of the robot.

The controller is really very simple, with the two gyro sensors on port 2 and 3 of the EV3 brick, attached with a few hassenpins.

EV3-RemoteControlSender

The core part of the controller program merely measures, in degrees, the pitch and the roll of the controller and sends them out as Bluetooth messages to another EV3 brick.

image

The complete controller program has a few more steps added for robustness, debugging, and a mechanism to reset the gyro sensors because of accumulated errors caused by sensor drift.  It is still a relatively small program.

EV3-RemoteControlSender-Program

The receiving program in the EV3 robot is also simple.  The core part of the program receives the pitch and roll values, applies gain factors to both of them (to translate the pitch and roll degrees to values that can be applied to an EV3 move and steering block), and sets the parameters for the move and steering block that controls the robot wheels.

 image

The complete receiver program also just has a a few additional steps, mainly to limit the resulting values to fall within –100 to 100, which are the values that can be fed into the move steering block.

EV3-RemoteControlReceiver-Program

Here’s what a sample run of the two programs look like:

Posted in Robotics | Tagged , | Leave a comment

Putting an EV3 into a Lego Technic Cruiser, Part 2

Continuing from my previous post, I was ready to put in a second EV3 motor and drive train for the rear wheels of the cruiser.

The Mindstorms EV3 retail set comes with two large motors and one medium motor.  Conventionally, the two large motors are used to drive the wheels of an EV3 robot, using two-wheeled turning (where the wheels along the same axis are rotated in opposing directions to turn the robot left or right).  The medium motor is conventionally used for peripheral movements, such as moving a robot arm up and down.

Note that two-wheeled turning is not typically used in standard vehicles.  In a standard vehicle, the engine drives one axis, either front-wheel or rear-wheel driving, and the steering wheel is used to turn the front wheels left or right.  Most Lego Technic sets, aside from the robot sets, are patterned after a standard vehicle.

I’ve already put the EV3 medium motor as the steering motor for my modified cruiser.  Now I’m trying to find a position for an EV3 large motor to drive the gear that is exposed underneath the dashboard.  These are some of the positions I’ve explored:

LegoCruiser-P2-1  LegoCruiser-P2-2  LegoCruiser-P2-3

That large motor sure takes up a lot of space.  The first two configurations put the motor axis at the front, under the hood, and I would need to have a gear train going backward to the gear under the dashboard.  However, the big part of the motor takes up a lot of space inside the cruiser cabin.

I really wanted to leave some space inside the cabin for future expansion, like a toy figure, a camera, or an Arduino.  So I initially settled for that third configuration, where the motor axis is inside the cabin and have a shorter gear train going towards the gear under the dashboard.  The big part of the motor does take up the whole front and precludes me from putting the hood back onto the cruiser. I also had to borrow a large gear from the EV3 set as part of the gear train.

LegoCruiser-P2-4

Even with that third configuration option properly set up, I felt that the 90-degree angle in the gear train was a weakness.  I tried spinning the motor axis manually to see how it runs, and the gears would often slip at that 90-degree angle.

I was in a bind.  None of the configurations seemed to work out.  Because I wanted the gear train to be stronger, the only other possible solution is to place the motor horizontally inside the cabin.  It would take up the whole cabin space, but the motor axis would fall directly above the gear under the dashboard and there would be no angles in the gear train.

I gave up for the day and noodled over it for a couple of weeks.  One day afterwards, I had a conversation with Claire about the difficulty I’m having with the modified cruiser.  I showed her the different configurations I’ve been trying with the motor and the unsuitability of each of those configurations.  After looking at it for a few seconds, she casually suggested, “Dad, just use another EV3 medium motor.”

o_O

I had been so caught up with trying to fit that EV3 large motor to drive the cruiser, that I never even thought of testing out a different piece.  The EV3 medium motor is not as powerful as the large motor, but after running some tests, we found that it was still enough to drive the cruiser.  Back last summer, when I purchased the EV3 set, I was so hooked into EV3 so that I also purchased additional pieces, additional sensors, and an additional medium motor.  I did have a second EV3 medium motor to use.

Going back to look at the engine space where I can place the second medium motor, I looked for mount points where I can attach the motor.  There is the gray frame at the bottom, there are the black horizontal beams running front to back on each side, and there are a couple of red connector pins at the front.

LegoCruiser-P2-5

One of my goals with this project was to “borrow” as few pieces as possible from other Lego sets.  If I can complete this by utilizing just the Lego Cruiser pieces, plus the EV3 brick and motors, then it would be easier for others to do the same.  I had some leftover pieces from the right angle gear train that I removed, some pieces from the passenger chair, some pieces from the V4 engine, and some pieces from the cruiser rear that I could reorganize.  With all those pieces, I came up with a construct that would rival that of a Star Wars vehicle.

LegoCruiser-P2-6  LegoCruiser-P2-7  LegoCruiser-P2-8

Since these are just leftover pieces, the construct is asymmetrical.  I think I also included too many mount points: four mounts to the bottom frame, two or three mounts to the horizontal beams, and an axle mount to one of the red connector pins.  It came out really stable, but I could have saved more pieces by reducing the number of places where I mounted the motor.  Assembling the construct is pictured as follows:

LegoCruiser-P3-1  LegoCruiser-P3-2  LegoCruiser-P3-3  LegoCruiser-P3-4  LegoCruiser-P3-5  LegoCruiser-P3-6  LegoCruiser-P3-7  LegoCruiser-P3-8  LegoCruiser-P3-9

Attaching this construct into the engine cavity of the cruiser is a little difficult.  It would have been easier to attach it while early in the process of building the cruiser frame.  The number of mount points I used also added a bit to the difficulty.

Once I got the motor in there, the rest is just attaching the decorative parts of the cruiser:  the steering wheel, the driver chair, the hood, the side doors, and the modified rear panel.  There was one beam and a few small pieces left, but I am surely glad I was able to rebuild the cruiser with its own set of pieces.

LegoCruiser-P4-1  LegoCruiser-P4-2  LegoCruiser-P4-3  LegoCruiser-P4-4  LegoCruiser-P4-5  LegoCruiser-P4-6

The drive motor is attached to Port C of the EV3 brick, and the steering motor is attached to Port D.  The USB port used to download a program to the brick is still accessible.  Using the Bluetooth connection is preferable since you don’t have to fiddle with wires nor need to run the program using the buttons on the EV3 brick.  Here’s a link to a video showing the autonomous cruiser running a short EV3 program:

https://www.youtube.com/watch?v=p-XC_OytYgE

In the test runs, I noticed that the 3-gear straight gear train that drives the rear wheels would occasionally slip.  I may have underestimated the weight that the EV3 brick puts on the cruiser and the increased torque requirements to move the cruiser forward.  I don’t think a stronger motor is needed, so I just lowered the speed of the motor to reduce the gear slippage.

Posted in Technology | Tagged , | Leave a comment

Putting an EV3 into a Lego Technic Cruiser

This is the first of few posts about my project in getting an EV3 brick into one of the Lego Technic retail sets.

I’ve always had a Lego Mindstorms robot kit ever since Lego came out with the NXT.  Though I’ve played with Lego bricks since I was a kid, it was only with the NXT that I became interested with these Technic sets.  And I was hooked.  I even purchased the older Mindstorms Robotics Invention System right after I got the Mindstorms NXT.

I have been following the Mindstorms EV3 since Lego announced and showed it at CES 2013.  After months of deciding between the education set and the retail set, I eventually bought the latter last summer (although I’m still keeping an eye for a good deal on the education set).

The EV3 was a radical evolution.  The memory capacity was greatly increased that you don’t have to worry about running out of space for the programs you download to the brick.  The now Linux-based system opens up a lot of possibilities.  Even the motors and sensors were significantly improved.

I’m always on the lookout for things where I can embed the EV3 brick, motors, and sensors.  This time I thought of looking into one of the existing Lego Technic sets.  My initial candidates were the Lego 8070 Supercar and the Lego 8081 Extreme Cruiser.  Both of them are retired sets, and there are other current sets that can possibly substitute, but the 8081 Extreme Cruiser attracted me because it really looks like it was made to be modified the way I was planning to.

I started out with assembling the cruiser, but excluding the parts that are purely decorative.  I call these excluded parts “fluff” because they are not part of the structural or functional aspects of the set.  As I expected, the V4 engine is purely fluff.  I was partly surprised that the steering wheel is fluff and not used to steer the front wheels.  I left alone the suspension system and the differential mechanism for the rear wheels.

LegoCruiser-1  LegoCruiser-2

The wheel/gear at the roof is used to manually steer the front wheels.  The next step is to replace this manual steering mechanism with an EV3 motor.  I removed the gear system with the 90-degree angle rotation and that left a cavity at the bottom almost enough to squeeze in the EV3 medium motor; I eventually had to remove one of the straight horizontal beams in order to snugly fit the motor.  I sacrificed the first of two front seats for the parts needed to attach the motor.  Note that it really helps if you temporarily detach the wheels while you’re working with the vehicle structure.

LegoCruiser-3  LegoCruiser-4  LegoCruiser-5  LegoCruiser-6

Next comes the part of finding the place to put the EV3 brick into.  It’s too bulky to put it in front in place of the V4 engine.  The rear part of the cruiser has a very nice enclosure where the EV3 brick can be inserted into.  I repositioned the couple of angled beams that block the full brick from being inserted.  With that, the brick can be inserted further and its weight is better supported by the vehicle structure.  It was even able to accommodate the brick with a rechargeable battery – the rechargeable battery option adds one unit of measure to the height of the brick.

LegoCruiser-7  LegoCruiser-8  LegoCruiser-9

At this point, the only major piece remaining to be attached is the EV3 motor that will drive the rear wheels.  The Extreme Cruiser set actually exposes the rear wheel drive with a single gear right underneath where the dashboard would be.  The set comes with nothing to turn that single gear, except maybe by reaching in with a finger.  The gear is actually just used to drive the decorative movement of the V4 engine.  However, it was strategically placed so that it can easily be driven by adding a gear train and a motor.

Positioning this gear train and second EV3 motor brought some complications.  More on that, and the solution suggested by my kid, on my next post.

Posted in Technology | Tagged , | Leave a comment

Getting the kid started with Lego Technic and Mindstorms

Last summer, I started to teach my kid about building with Lego Technic, particularly using the EV3 Mindstorms set.  Though she had been building with non-technic Lego bricks for years now, the Technic pieces involve a different mindset, dealing more with beams and pins rather than bricks and studs.

One of the original constructs from Claire is this dog head that we attached to a mini robot we built from one of the Lego books we have:

LegoEV3DogHead

The robot was from Yoshihito Isagawa’s Lego Mindstorms EV3 Idea Book, but the head was Claire’s original design.

Posted in Technology | Tagged , | Leave a comment

Creating an Apple IIgs GS/OS Live CD

The Apple II High-Speed SCSI card is one of my favorite peripheral cards for the Apple IIgs.  I typically install System 6.0.1 into a SCSI hard drive and use that as my boot and mass-storage drive.  Any old “SCSI” hard drive should work, but what I use is the scsi2sd adapter that allows me to emulate the SCSI drive with a microSD card.  It additionally allows me to make a raw backup of the drive contents using any disk imaging tool on a machine that has a slot for SD/microSD (I use the standard dd utility).  With CiderPress, I can even import files into the microSD card.  Files that I later read from within the GS/OS environment.

GS/OS can either boot from a drive containing a raw ProDos file system (maximum size is 65535 blocks, each block being 512 bytes, a little less than 32 MiB in total size) or, with the SCSI card, from a partitioned drive with a ProDos partition (the partition having the same size limits).  For a partitioned drive, it has to be using the Apple Partition Map (APM) style of partitioning, and not the more common MBR or GPT partitioning.  The APM partitioning style was standard with older Macs, those that were before Intel-based Macs came about.

If you treat the CD as a regular block device and lay out the blocks like that of a hard drive, partitioned with APM style partitioning, then GS/OS can be booted from that CD.  Of course, with just APM style partitioning, the CD will not have the ISO9660 file system and will not be natively mountable in systems that do not understand APM-partitioned block devices.  These types of GS/OS-bootable CDs were evident in some popular CDs distributed around that time.  Examples are the Golden Orchard CD and the early Developer CDs made by Apple (like the Phil and Dave’s Excellent CD).

Below are the steps I followed to create a GS/OS-bootable CD.  This is just one of many ways that it can be done; I was just trying to use the simplest, and free, method on a Windows machine.

Third-party utilities.

If you haven’t done so already, download CiderPress.  This used to cost a few dollars, but Andy McFadden has since made it free and open-source.  This utility will let you work with ProDos and HFS file systems, with either raw file systems or an APM-style partitioned drive, and with either a real block device or an image of a block device.

Another utility I used is a drive image overlay/extraction utility.  There is either the Windows port of dd, or the Windows port of busybox (that includes dd as one of the commands).

Another utility I used is a Windows port of mkisofs.  I used this to initially create the APM partition map.  There are other options available to do this, including 1) using pdisk on an OS X machine, 2) using the commercial TransMac software, 3) using a combination of VirtualBox and GParted, or 4) waiting for Andy to include this feature in CiderPress (I saw that it is one of the requested features).

Finally, a hex/binary editor is always useful.  I use HxD because it’s simple and free.

Creating the bootable ProDos file system.

GS/OS needs to be installed into a ProDos file system somehow.  CiderPress easily lets you create an empty 32 MiB ProDos disk image – you then assign the disk image in an Apple IIgs emulator like KEGS/gsport and follow the standard GS/OS hard drive installation process.  Or you could download some pre-built bootable 32 MiB ProDos disk images around the net.  Check out Alex Lee’s What Is The Apple IIGS site.  I will use a ProDos file system image (e.g., P1_BOOT.PO) as the first, and sometimes only, partition in my APM-style partitioned disk image.

Creating the partitioned disk image.

I create a folder containing my file system images (e.g., P1_BOOT.PO, P2_APPS.PO, P3_HFS.PO, etc.) and run mkisofs:

mkisofs.exe -hfs -part -no-desktop -o CD.iso C:\FileSystemImagesFolder

This creates a hybrid ISO9660/HFS CD.  A hybrid CD is one where the CD files can be accessed using both the ISO9660 file system and the HFS file system, with only a single copy of the file data somewhere on the CD.  The files here, of course, are the file system images P1_BOOT.PO, P2_APPS.PO, and P3_HFS.PO; not the individual files within the the file system images.

If you plan to put more than one file system image in the CD, my example makes use of 32 MiB (65535 blocks) file system images so that using the hex/binary editor to modify the partition map will later be easier.

The partition map that mkisofs creates contains two entries only – an entry for the partition map itself, and another for the hybrid HFS file system.  The partition map starts at offset 512 (0x200) of the disc image and each entry is 512 bytes in length.

image  image

Replacing the partition map entries.

If I only had one file system image to put on the CD (e.g., P1_BOOT.PO), then that file system image will be positioned at offset 0xC000 (block 0x60) of the CD image.  We can replace the second partition map entry with the following pre-made 512-byte file:

image

busybox.exe dd bs=1 count=512 if=PRODOS1_65535.PME of=CD.iso seek=1024 conv=notrunc

What ends up is that we keep the CD ISO9660 file system, but we replace the hybrid HFS file system entry in the partition map with the ProDos partition map entry.

If I wanted to put more than one file system image on the CD, I need to enumerate the partition map entries at 512-byte intervals, then I need to edit each partition map entry to reflect the number of partitions and the offset of each partition in the CD.

For example, suppose I also wanted to make the second P2_APPS.PO (65535 blocks) and P3_HFS.PO (65535 blocks) file systems visible in GS/OS:

busybox.exe dd bs=1 count=512 if=PRODOS1_65535.PME of=CD.iso seek=1536 conv=notrunc

busybox.exe dd bs=1 count=512 if=HFS_65535.PME of=CD.iso seek=2048 conv=notrunc

Then edit the disc image to specify the correct count and location of the file system images:

image  image

image  image

Burn the CD image.

The final step is to burn the CD image into a real CD-R.  On Windows, I use ISO Recorder, but any raw-disc-image burning application should work.  For such a small CD image, I sometimes use the smaller 185 MB pocket-sized CD-R discs.  If you have the scsi2sd or other mass-storage devices (e.g., MO drive, SCSI-IDE bridge), you can actually dump the same CD image into those devices.

IMAG1469

Boot the CD from a SCSI CD-ROM drive.

Put the CD into a SCSI CD-ROM drive, attach the drive to the SCSI chain, and boot from the CD.  Remember that the Apple IIgs boots off from the SCSI device with the highest SCSI device ID, and that an unmodified Apple High-Speed SCSI card does not provide termination power to the SCSI bus.  Either mod the card or have another device provide termination power.

Here are some screenshots of one of my Apple IIgs booted from a CD with two file system images (the bootable ProDos file system image and one additional HFS file system image).  Note the block devices are locked/readonly.

IMAG1524  IMAG1525

Caveat with all the above – it should be obvious that because this is a CD, the drive is read-only.  Applications that attempt to write data back to the drive may or may not fail, but will surely lose that data because it is not persisted.

Files.

Posted in Retrocomputing | Tagged | 1 Comment

Explorations with Low-Powered Devices for the Apple IIe/IIgs

I recently posted my experiences with using a Bluetooth module to perform wireless ADTPro transfers with my Apple IIe.  At that time, I was powering the Bluetooth module from an AC adapter.

Seeing that the Bluetooth module power adapter was a standard +5v USB power adapter, I suggested a simple Apple II  peripheral card with a USB female port to provide the +5v power needed by these modules or devices.  +5v is readily available from pin 25 on the slot connectors (maximum of 500mA for all peripheral cards according to documentation).  A few minutes with the soldering iron came up with this contraption:

AppleII-USB-5v-1 AppleII-USB-5v-2

It surely was a product of an amateur, but it was enough for a proof-of-concept so that I could put the Bluetooth module inside the Apple IIe without an additional power line coming out of the case.  And with that, I was again performing wireless ADTPro transfers from my laptop using Bluetooth.

AppleII-USB-5v-SerialBluetooth

One thing to note about this Bluetooth module is that the serial port speed is set to 9600 baud by default.  The recent versions of ADTPro have removed support for 9600 baud.  You’ll have to follow the instructions for the Bluetooth module to configure it to start up at 115k baud.  115k is faster anyway, and the serial transfer speed is still slower than the Bluetooth transfer speed (meaning that it’s still the serial segment that’s the slower part of an end-to-end transfer).

Moving to the IIgs, I pulled out from my stash of devices a tiny Wi-Fi bridge IOGear GWU627.  This acts as a standard Wi-Fi bridge (802.11b, 802.11g, or 802.11n), except that it is very tiny and can be powered by a standard USB power adapter.  I put an Uthernet card in slot 2, my homemade USB peripheral card in slot 3, and wired them altogether with the GWU627 bridge also inside the IIgs case.

IOGEAR-GWU627-1 AppleII-USB-5v-Uthernet-1

With a standard Marinetti installation, my IIgs is now wirelessly connected to my home network.  DHCP works over the wireless bridge, and the IIgs receives an IP address from the home router.  The Marinetti applications Casper web server and Telnet client work as they should.  This could be a good way to run a 24×7 web server from your IIgs and make it available to the Internet – of course, only with the proper port-forwarding rules in your home router and only if your ISP allows hosting a web server and does not block port 80 incoming to your network.

AppleII-USB-5v-Uthernet-2 AppleII-USB-5v-Uthernet-3

Posted in Retrocomputing | Tagged | Leave a comment

Adding Wireless (Bluetooth) Support in ADTPro

It’s been months since I planned to look into adding Bluetooth support in David Schmidt’s fabulous ADTPro software.  I’ve been using ADTPro for years to transfer disk images for use in my Apple IIe using the Apple II Super Serial Card.  Over the years, it has garnered many additional features, such as providing a virtual drive over the wires.

My Windows (8.1 x64) laptop does not have a built-in RS-232 serial port, so I normally use a cheap (~$15) USB-serial cable. One that works for my laptop, because of its Prolific PL-2303 chipset, is the Startech ICUSB232DB25.  Coupled with a null modem adapter, I can use ADTPro to its maximum 115kbps transfer speed.

A few months ago, I wanted to see if I could do away with the physical serial cable.  This was about 20 months ago (I checked on when I ordered the Bluetooth-Serial board and saw an invoice for August 2012).  These Bluetooth-Serial boards come around to each cost about $20.  It’s probably cheaper if you’re willing to just get the Bluetooth-Serial module and wire them directly to the SSC data and power connectors.  However, this was just a proof-of-concept, so my setup looked like the following:

SuperSerialCardII BolutekBlutetoothModule

The Bluetooth-Serial board uses the Bolutek BLK-MD-BC04-B module (pictured on the lower right of the board).  It attaches to the SSC with a straight-through DB9-DB25 adapter, and uses the USB cable for the standard 5v power source.

Alas, at that time, my tests showed that although I can get wireless remote access to the Apple IIe, ADTPro did not fare as well.  Remote access is through Apple’s PR#2 and IN#2 commands and through Windows’ HyperTerminal program.  Everything seems to work properly on the Apple IIe end, but ADTPro’s use of COM ports exposed by the Bluetooth serial SPP services did not work for me (actually, it’s the rxtx library’s use of the COM ports – ADTPro just uses rxtx for serial port support).

I hatched a plan to update ADTPro to accommodate this.  After more than a year of getting de-prioritized, it finally got its due attention.  Starting a few days ago, I’ve finally got something like an alpha version of Bluetooth support working in ADTPro, tested only in Windows.

On the Windows end, any Bluetooth-enabled machine should work using the standard Windows Bluetooth drivers.  WIDCOMM-based Bluetooth controllers should also work.  I first had to pair my laptop with the Bolutek module.  Pairing is straightforward.  Having the Bolutek module in its regular slave-mode setting, it appears when I search for additional Bluetooth devices in my laptop, and the default pairing code is 1-2-3-4.  Once paired, you’ll see that it provides the standard Bluetooth Serial Port Profile (SPP) and creates the virtual COM ports (COM17 and COM18 in my setup).

ADTProBluetooth-1

ADTProBluetooth-2 ADTProBluetooth-3

I put on my software developer hat, and dived into the ADTPro source code within the Eclipse IDE.  David has really gotten the components cleanly modularized, and I only had to create a few classes to add the Bluetooth support.  Once built, Bluetooth is just an additional transport in the ADTPro runtime environment.

ADTProBluetooth-4 ADTProBluetooth-5

The Bluetooth connection is made directly to the SPP service, and not through the virtual COM ports.  Once connected, the standard serial port client on the Apple IIe can send and receive disk images wirelessly over Bluetooth.

ADTProBluetooth-6

It was enough for a proof-of-concept, and I’ll check with David on merging this upstream to ADTPro.  As with any proof-of-concept code, there’s some cleanup work to do.  Like displaying the friendly names, instead of the addresses, of the Bluetooth devices.

Also, on the Apple IIe end, I could probably splice the power wire for the Bluetooth-Serial board and get the +5v directly from the Apple IIe motherboard.  With the inexpensive prototype boards selling around the net, I am also thinking of a generic USB power source slot card like this:

AppleUSBPowerProject

It’s probably just a two-wire setup.  I’m just not motivated enough to look for my soldering iron buried somewhere in the garage for the moment.  If anyone (Bradley?) wants to mass market such a board, I’m one of your potential buyers.

Update 5/16/2014:

I tried my ADTPro build on another machine.  This time, I first tried using the virtual COM ports using the ADTPro Serial transport, and SURPRISINGLY, it works.  There may have been some changes in the rxtx library since 20 months ago, but I remember not getting it to work back then.

The serial port enumeration takes a while with these virtual COM ports, and it might seem like ADTPro is hanging, but just patiently wait for the dialog box to eventually come up, connect to the outgoing virtual COM port, and ADTPro works as it should.  Note that the baud rate you want to set on the ADTPro client is the baud rate of the communication from the Apple IIe to the Bluetooth board, not the baud rate from ADTPro to the virtual COM port.

So there. With other, maybe most, Windows machines or the proper Bluetooth stack, ADTPro correctly works using the rxtx library over the virtual COM ports exposed by the Bluetooth connection.  There’s no need for my ADTPro modifications (which I’ll just use in a separate follow-up project).

Posted in Retrocomputing | Tagged , , | 4 Comments

Updating my cable setup with the Raspberry Pi

I’ve delayed looking into the Raspberry Pi for quite some time now.  I’ve known how awesome it is, but also know that I didn’t have a lot of time to tinker around with it.  However, recent developments in late 2013 convinced me that I needed to spend time with this tiny computer.  Since the past holiday season up to today, I have bought two Raspberry Pis, each with an enclosure, all the nifty tiny USB hardware that extends its functionality, and even a real-time-clock extension attaching to the GPIO pins.

The things that convinced me to look into it are the developments related to cable TV (i.e., Comcast, Time Warner, FIOS).  There’s this cable tuner, called HD Homerun Prime, that you can purchase through the retail market.  Like TiVo devices, it takes in a CableCARD and attaches to your home router.  Cable providers are required by law to allow you to request a CableCARD if you have a subscription with them.  It’s normally free for one CableCARD, or sometimes they charge a minimal fee for it like $1/month.

With this CableCARD and the HD Homerun Prime, your cable tuners (3 in the HD Homerun Prime) are made available to your home network through DLNA/UPnP.  HD Homerun Prime had this UPnP capability made available in its firmware in late 2013.

We have a room in our house that doesn’t have a cable outlet.  Coincidentally, we have a combo TV/DVD there.  The only way we could get cable into that TV was by using a low-tech A/V sender/receiver that uses some RF frequency – the one that is highly susceptible to microwave signals (that is, the A/V signal craps out when the microwave is in use).

In 2013, the media center usage for Raspberry Pi took a dramatic upturn.  First, they made available a per-unit license for MPEG2 decoding for a low price of £2 (about $4).  A lot of cable providers encode their streams as MPEG2 (whilst I think most dish providers use MPEG4).  Another development was that they enabled CEC capability in the HDMI socket on the Raspberry Pi.  With that, the media center distributions for Raspberry Pi, like RaspBMC and OpenElec, provided all that I needed to switch over to a full UPnP solution to my isolated TV.

I installed the OpenElec distribution image.  It’s smaller and customized for a lean media center so a lot of software packages are not present.  But that’s why I bought another Pi just for general-purpose tinkering and relegated the first Pi for my isolated TV.  OpenElec can easily fit in an SD card with a small capacity.  I used a 2GB SD card.  I attached a nano-sized WiFi USB dongle (150Mbps), temporarily attached a USB keyboard/mouse, and connected the HDMI port to our main TV for testing.

OpenElec boots directly into XBMC.  There are several XBMC skins out there to customize its appearance, but I just stuck with the standard out-of-the-box skin “Confluence”.  First thing I noticed is that the HD Homerun Prime is detected as a UPnP source.  So I added the Favorites subfolder as an XBMC video source.  I’ve pre-selected the channels that would appear in the HD Homerun Prime Favorites subfolder through the small web interface exposed by the HD Homerun Prime, the same web interface where you can read the codes off when you set it up with your cable provider over the phone with their tech support.  I set up the Favorites so I could see a list of channels shorter than the full list of channels available to me.  Who watches those home shopping channels anyway?

The Raspberry Pi feature that caught me by surprise is the CEC capability.  With CEC, I actually didn’t even need a temporary USB/mouse keyboard to set up OpenElec. The cursor movement buttons on most modern TV remotes are received by the TV infrared receiver, and passed through the HDMI cable using this CEC feature.  The other device at the end of the HDMI cable, which is the Raspberry Pi, receives the cursor movement and uses that to navigate the XBMC interface.

One hiccup was that when I moved over the setup to the isolated TV, I found that my small TV/DVD device didn’t have the CEC feature.  It was a no-brand small 22” LCD TV, and from what I’ve read, some older smaller TVs do not have CEC.  So what’s available as a remote control for OpenElec/XBMC?  I didn’t want a full keyboard/mouse because it felt too geeky.

First, I tried Bluetooth and it worked.  I had a tiny Bluetooth USB dongle which the Pi readily recognized.  From OpenElec’s Bluetooth setting, I was able to pair an extra Wiimote controller that we have.  I tried pairing a no-name Wiimote clone, but it would only recognize the four cursor keys.  With an original Nintendo Wiimote, it was able to recognize the cursor keys, Enter and Cancel keys, and even the volume keys.  So that would have worked, but using a Wiimote still felt geeky.

I read that certain inexpensive RF remote controls (the ATI All-in-wonder remotes) would work, and it won’t cost more than $15;  I also read that most media center IR remotes would work and are actually less expensive.  In the end, I decided I want to use the existing remote control from that no-brand TV.  I ended up buying Flirc, sort of a universal learning IR receiver.  The Raspberry Pi easily recognized the Flirc dongle, and I was able to program/teach the dongle with the TV remove using the Windows application available from their site.  Very easily too.  I had to pick a remote button that the TV would not recognize.  I picked the “Guide” button and had it mapped to sending a “Ctrl-Home” keyboard equivalent to the Raspberry Pi.  In the Raspberry Pi XBMC layout (I had to use SSH or the command-line to do this), I added a mapping in the keyboard layout to make Ctrl-Home bring up the mapped HD Homerun Prime Favorites source.  What this accomplished was that the “Guide” button on the remote served as a go-back-to-the-top-level-menu command, then with the arrow keys in the remote, you can scroll through and select from your favorite channels.

With the UPnP streaming, I could even access my cable (each of the 3 tuners will be reserved as it is accessed) channels through UPnP players on any of our phones, tablets, or computers.  For Windows, you can easily see the HD Homerun Prime as a UPnP device and browse through the Favorites folder (it plays the cable channel in Media Player).  For Android devices, I use the combination of Skifta and WonderPlayer.

I opted to use the SD channels because it was using the wireless network.  I heard that HD channels, although possible, could put a strain in your wireless network.  Streaming HD channels to the Pi should not be an issue over a wired network though.  Also, I’ve yet to set up a new 802.11ac router to see if it provides enough bandwidth to switch over to using HD for my setup.

I’m now ready to return my cable box to my cable provider, and save on that $10-something they charge me monthly for it.  I will miss the DVR capability right now (also an additional $10-something per month that they charge), but also had set up a small Windows media center box to be my DVR.  I’ve yet to see if I can configure Windows and/or the motherboard to allow the media center to sleep/wake on-demand without the need to use some Wake-On-Lan software to explicitly wake it up.  I’ve tested it with WOL, but I really want it to automatically wake when something else in the home network makes a request to any of its services.  Having that media center setup also means that I could make it host the electronic program guide that can be accessed by my isolated TV.  But that media center setup is another story.

If only the HD Homerun Prime had an additional HDMI socket to directly connect one of the TVs that sit close to it.  But I’m not complaining.

Posted in Around the House | Leave a comment