Posts

8085/88 System Monitor Board

I stumbled on a SMB PCB (V3) for sale on ebay.  This PCB is for a modern design using many old ideas.  It provides address and data bus displays, status LEDs, single stepper, breakpoints, and some other facilities and debug features. To be honest, i thought the blinken lights might add a little visible interest to the 8085/86 system!

I built it up using the info here:

http://www.s100computers.com/My System Pages/SMB Board/S100 Bus SMB.htm

The board was designed by S-100 legend John Monahan.

The frequency display seemed a bit unnecessary, so i skipped that part.

The S-100 bus is quite a loose/adaptable standard, and i’ve found that a card may work well in a particular context but not so well in another. I found this one neede some customisation for my set-up. I’m not super experienced with S-100 so my notes should be taken with a grain of salt and certainly not as a criticism of the original designer. Sometimes too, i am guilty of not RTFM!

I found the breakpoints were unreliable.  I think this was due to the address bus not being stable when the address was captured (a decoded output driving a preset on a flip-flop).  I modified it to use the pstab signal which seemed to settle it down.

When i came back to this a couple of months later, I found that at break the displayed address was always one more than I had requested.  This led to quite an adventure in trying to understand how breakpoints work.  I also noticed that it often broke at random addresses.

When I looked, I found that the breakpoint does not take into account whether the cycles are read or write, or if it was a data or instruction fetch or I/O cycle.

I further learnt that the displays are only accurate when reading.  That’s because they are transparent when the pDBIN signal is asserted.  If the card breaks on a memory write, then the display isn’t meaningful.

The address is latched locally using pSYNC AND pSTVAL.  This seems to be an approach adopted for V3 of the board.  Previously, the lines were just buffered.  The earliest that these can be grabbed is when pSTVAL is asserted.  As far as I can see, this makes it very hard to get a RDY signal asserted before the rising edge of PHI in state BS2, particularly given the standard says that pSTVAL may not be asserted until that clock edge.  Fortunately, the CPU card asserts it much earlier (about 80ns) so there was hope.  Unfortunately, the address registers are triggered when pSTVAL is negated which is too late to guarantee that the XRDY signal will be asserted in time to take effect on the current cycle.  Consequently, it moves on to the next cycle and then stops.  This explains the address being one too late.

I have made some changes to try to salvage some useful operation.  The first was to use the leading edge of the pSTVAL pulse to trigger the address latches, so the address is available locally much sooner.  Getting through the registers, comparators, gates, and flip-flop chews through a lot of the available time.

The V3 design uses PHI_L in place of pSTVAL (apparently this was not uncommon on older boards, but I’m not sure why it was done here).  Given that RDY is negated by an asynchronous set, it is important that the Address comparison is stable before it is gated through to the flip flop.  That’s difficult to organise because that logic is responding to the local address change initiated by pSTVAL being asserted.  I think the only robust way to do this would be to accurately delay pSTVAL beyond the propagation time through the address comparison logic.  Very ugly.

I tried this to some extent by inverting pSTVAL twice but this is not nearly long enough.  Even with an RC network I found it was not perfect – particularly once I attempted to filter out writes using sMEMR.  Spurious pulses were generated as the addresses settled. Using typicals for the comparator network, suggests a delay of at least 50ns is required, and this is hard given the two delay gates only give about 10-15ns and the pSTVAL pulse is less than 100ns. I did find the spurious pulse from the address detection could be suppressed with a 560pF capacitor. This resulted in predictable operation in my system.   

When I added sMEMR I found that a spurious pulse was always generated on the cycle after the write cycle that matched the break address (attempting to suppress with capacitance does not help here).  I have not resolved this, so I have removed the sMEMR signal. This means that breaks will be triggered by writes.

The V1 design, which had buffers for addresses rather than registers, would have been better for my system because the addresses would be available to the comparator logic 70ns earlier – plenty of time to be sorted before pSTVAL arrived and enough time to get XRDY negated (at least with my CPU board).  The standard does not allow any time between pSTVAL being asserted and the critical STVAL edge in BS2, so that would have been really tough.

Looking at the timing diagram in the standard, it dawned on me that pSTVAL may be asserted twice by some cards.  The timing diagram seems to make that a possibility, but not a guarantee.  This would be consistent with a comment on the card site that says that early cards used the inverted PHI as the equivalent of STVAL. So, perhaps the V3 SMB card assumes that PSTVAL is asserted twice.  The Compupro card does not do this.

With two pulses, there is an additional edge available to clock the address registers well in advance of the second mandatory pSTVAL pulse.  I think this must be what the designer had in mind.  The second PSTVAL pulse (or, as in the design, the matching PHI low) is identified by being in association with pSYNC.  I attempted to substitute pSTVAL* with PHI* but I could not get the timing right. 

I reverted to my original solution above (italics) which relies on a capacitor to suppress spurious outputs (very dodgy).

  • 560pF capacitor at U22-12
  • U3-5 connected to U10-11
  • U10-11 pin bent out of socket
  • U10-11 socket pin connected to U10-13

So I think the upshot is that the card assumes a two pulse pSTVAL and the Compupro does not provide it.  It’s possible that I have other cards that do – so I’ll need to bear that in mind if I use it with other processor cards.

Moving on … This board has a daughterboard, for the displays, LEDs, and control switches.  In hindsight, I may have been able to mount it directly on the card, but I didn’t.  Instead, I used ribbon cables.  I made it a little harder by mounting the connecters iaw with the silkscreen, rather than putting them underneath.

The mechanical exercise of doing the front panel was quite time-consuming.  I replaced the existing front panel with 3mm aluminium and 3mm clear perspex. That allows me to put card in between – a graphics design problem in search of someone with some flair. The display is mounted on the aluminium panel. The original panel front panel has been stored.

There are a lot of jumpers on this board:

   
JP10Connects clock to RFU1 for a versafloppy card.Not used
JP101Allows the error circuit to negate XRDY 
JP103Not loaded 
JP11Puts the MWRT signal generated by the card on to the bus. Not used
JP23Slave Clear Switch enable 
JP26Allows onboard reset to drive the bus reset.Loaded
JP27Allows onboard reset and slave clear circuit to drive the slave_clrNot loaded
JP28Hard disk lightNot used
JP30Drives Clock_L 
JP4Allows the Breakpoint circuit to negate XRDYConnected
K101Not loaded 
K102Not loaded 
K2Selects between clearing system tick interrupt with a register write to the interrupt reset register or by the S100 interrupt acknowledge. 
K3Selects between setting the I/O address of xxyy and 00yy (for 16 bit I/O).Using 8 bit I/O. Link 2-3.
P104Not loaded 
P2Something around multimastering? 
P40/P41Something around interrupt vectors I think! 
   

Ampro Little Board Plus

This is one of my current projects. It is based on the Ampro Little Board Plus which is a single board computer designed to be mounted on the back of a 5.25″ floppy disk drive.

It uses a Z80 processor running at 4MHz and includes two serial ports, one parallel port, a floppy disk controller and a SCSI controller. It runs CP/M 2.2 and is happy to boot off a floppy or hard disk. I’ve added a SCSI2SD to emulate several 20MB hard disk drives.

The user interacts with the machine using a serial terminal.

I started off with the two 40 track Mitsubishi drives shown but have been using a gotek (with FlashFloppy) for the software load.

Currently, i’m loading up a whole bunch of software from images created using cpmtools. Eventually this will be mounted in an external drive enclosure.

AMPRO Little Board – SCSI2SD

I used a scsi2sd card with a 256MB sd card.

This took me a bit longer than I expected because I didn’t read the instructions.  CP/M needs to be configured to have some hard disk buffer space, otherwise the format fails mysteriously.  I changed it from 60k to 56k.  That allows room for the maximum 88MB of total disk storage.

The hformat program allowed for different controllers but after some experimenting I found success with the Seagate ST-225N hard disk. 

+-----

Form                 5.25"/HH              Cylinders     615|     |     |

Capacity form/unform    21/   25 MB        Heads           4|     |     |

Seek time   / track  65.0/20.0 ms          Sector/track   17|     |     |

Controller           SCSI1 SINGLE-ENDED    Precompensation

Cache/Buffer               KB              Landing Zone      670

Data transfer rate          MB/S int       Bytes/Sector      512

                      1.500 MB/S ext ASYNC

I set up sd2scsi with 7 drives each with 615 x 4 x 17 = 41820 sectors of 512 bytes.

I used hinit (with burst mode) to set up 2 partitions on drive 0 and drive 1:

  • 8192k
  • 8192k

This needs to be done on every boot (really? yes) but an alias can be created:

alias

HINIT YD010 AF8192 AG8192, YD110 AF8192 AG8192,.

hardinit

then another alias that does this and swaps the drives over:

alias

HARDINIT; SWAP AF BG CH DI; STARTUP

HSTART

Startup can contain whatever is wanted, eg a menu program.

HSTART can be run on boot by adding at item 5 in the config program.

Copy the system track from the boot floppy to the hard disk using SYSGEN (watch out for the letter swapping).

Less than obvious (it’s in a separate section of the hard disk software manual right at the end) are instructions for autostart, noting HGEN in particular.:

When the system starts, it looks for a boot floppy. If it finds it, then it will boot from it.  If it doesn’t find it, in about 10 seconds it will boot from the first hard disk partition.  For some reason it keeps looking for a disk in the first floppy disk drive.  If you give it one it stops but does nothing with the disk.

AMPRO Little Board – Enclosure

The Little Board was designed so that it could be mounted to a 5.25″ floppy disk drive. In keeping with this vibe, it uses a floppy disk drive power connector with just 12V and 5V; -12V for RS232 is generated on the board itself.

With this in mind, i thought that perhaps a disk drive enclosure could be a useful starting point. I had bought a hard disk in an external enclosure at a swap meet, but i was unable to find any information on the interface. I figured that the drive within would not be reliable in any case.

The enclosure has a heavy linear supply providing +5V and +12V. The drive itself is a full height 5.25″ drive, so there is sufficient accommodation for two half height floppy disk drives.

I figured that i could sequester unused parts, including the hard disk, just in case i wanted to return it to its original state.

I wanted to include a physical floppy disk drive, a gotek emulator, the Little Board, and a SCSI2SD card. If i mounted the Little Card to the floppy drive then it would have been underneath which would make it difficult to access the connectors.

Instead, i created a “baseplate” to accommodate the Little Board and the SCSI2SD. I mounted the baseplate on the top cover.

I replaced the perspex front panel with a new aluminium panel with a cutout for the drives and holes for power and hard disk lights and a reset switch.

Both the front panel and the baseplate were earthed. I used metal standoffs and cleared paint so that they would ground the cards.

The front panel got a couple of coats of gloss Bermuda blue.

The enclosure had a couple of cutouts for connectors, which gave enough space for two 9 pin serial ports and the 25 pin printer port. I made up a custom panel to overlay the existing cutouts.

Exidy Sorcerer

This is one of several machines that came from a ARC Group member, Andrew, who was rehoming his brother’s collection.  Andrew has been remarkably generous, and that generosity has made a lot of things possible that otherwise would not have been.

The Exidy Sorcerer represents the transition from S-100 microcomputers to more integrated designs.  The computer unit with integrated keyboard has 48k of memory, rompac cartridge slot, video out, serial and parallel I/O ports, and an expansion bus.  When used alone, the machine typically had a a basic ROM cartridge and programs were loaded from and saved to cassette.  The machine has quite high graphics resolution compared to the other computers.  Graphics were drawn using programmable characters.

Michael Borthwicks’s excellent presentation on the Australian applications of the Sorcerer from VCF Canberra is here:

This machine appears to have been used by a business.  The expansion unit connects to the computer via the expansion port.  It provides 4 S-100 slots.  This was used mainly for a disk controller – in this case a hard sectored micropolis unit that operates with up to four unusual 77 track 100 TPI disk drives.  It boots Micropolis DOS, Exidy CP/M, Lifeboat CP/M and Software Source CP/M (i don’t have a complete system disk for this Aussie rolled version). 

The disks are challenging to read and write, but fluxengine did the job for me, and greaseweazle is now also capable of working with these disks.  Hard sectored disks are unusual.  Fortunately i have enough but i have a virtual sector generator as well so that soft sectored disks can also be used.

I have also added an 8kB memory card to the expansion unit at the same memory location as the rompac slot.  Basic can be loaded into the card so that programs for the rompac basic can be executed.

 

Micropolis Drive Controller ROM Replacement

The Micropolis drive controller is in the expansion unit. It includes two PROMs that hold the 256 bytes of boot code. This is executed from the Sorcerer monitor with GO BC00. I found that the code was not executing as expected and when i compared with PROM images to those discovered on in the TOSEC:

https://archive.org/details/Exidy_Sorcerer_TOSEC_2012_04_23

These 82S129 PROMs are quite difficult to find, so i made up an adapter board for an EPROM. I used wire wrap sockets to connect into the existing PROM sockets. This has been working fine.

Sorcerer/Micropolis Disk Imaging with FluxEngine

My Sorcerer uses a Micropolis hard sectored floppy drive system. It uses 16 sectors, each of which includes a 256 byte data section and 19 bytes of bonus “metadata” used by Micropolis DOS (MDOS). This metadata is ignored by the CP/M implementations (Exidy & Software Source) that i have encountered.

The drives have an unusual track spacing of 100TPI. This is unusual so imaging has to be done using the actual drive units.

FluxEngine is a very low cost imaging solution that support Micropolis hard sector disks as used on my Sorcerer. At the time, Greaseweazle did not support hard sectors. It has since been added. I’ll do a separate post on that.

I followed the instructions here:

https://cowlark.com/fluxengine/doc/building.html

I connected to the drive using a straight through cable and using drive:0.  This selects the second drive in the dual drive unit (drive 1).  For the single drive unit, DS1 (the second drive select) must be selected.

I used FluxEngine on a new PC, so there would be no USB bandwidth issues.  My older machine does seem to work reliably, but if it gets busy then FluxEngine will sometimes throw a bandwidth error.

Initially i used my single drive unit (which I call Drive 2) mainly because it was compact. Once I started working my way through the disks, I found I was getting lots of errors.  I thought that I might do better with the dual drive unit (I call the top drive “Drive 0” and the bottom drive, “Drive 1”).  I found that Drive 0 was a little better than Drive 2 and that Drive 1 was the best drive to use. 

The results were a little disappointing but some further reading of the FluxEngine doco:

http://cowlark.com/fluxengine/doc/problems.html

hinted that I could fiddle with decoder.bit_error_threshold to perhaps get better results.  0.2 is the default.  0.4 improved things a lot.  0.5 was the best.  With the wrong setting, a lot of empty (?) sectors were read.  I also increased the retry limit.

Drive 1 remained the best performing drive.  I tried messing with the alignment on Drive 2, but I could not noticeably improve its performance.  I did some poking around with the scope but no obvious differences between the dual and single units leapt out at me.

Out of 87 disks, I was able to read 19 without any errors being reported. I was able to read another 18 with only a small number of errors.  A further 38 disks didn’t yield anything usable.  Some were shedding oxide, but most 24 were successfully reformatted.  Many were unlabelled, so perhaps no great loss.

fluxengine read micropolis --315 --layout.tracks=77 --layout.sides=1 -s drive:0 --decoder.retries=8 --decoder.bit_error_threshold=0.5 -o exidy_%1.img

Disks that were formatted with MDOS were read using the 275byte sector size.  CP/M disks were read with 256 byte sector size.  My understanding is that CP/M doesn’t use the “metadata”, and the 256 byte size is much easier to view.

fluxengine read micropolis --315 --vgi --layout.tracks=77 --layout.sides=1 -s drive:0 --decoder.retries=8 --decoder.bit_error_threshold=0.5 --decoder.micropolis.sector_output_size=275 -o exidy_%1.img

There were some examples of where I was able to copy a disk on the real machine, but FluxEngine was unable to read the disk without error, eg Disk 24.  The copy read fine.  This meant that there was potential to improve the yield by making fresh copies on the real machine.  Ie The real disk controller is still doing a better job in real time than the flux engine does in slow time.  That’s the advantage of inside knowledge, perhaps.

I attempted to copy all the errant disks to intermediate disks, which I subsequently imaged.  I did this for the CP/M disks using COPYDISK.  This yielded another 13 good images!  I think this confirms that FluxEngine is way less tolerant of problems than the sorcerer system.  Even many disks that had a lot of issues came good.

I repeated the exercise for the MDOS disks, which gave another 8 good images.

I was able to write back both CP/M and MDOS images:

fluxengine write micropolis --315 --layout.tracks=77 --layout.sides=1 --decoder.retries=8 --decoder.bit_error_threshold=0.5 -i exidy_%1.img -d drive:0

fluxengine write micropolis --315 --vgi --layout.tracks=77 --layout.sides=1 --decoder.retries=8 --decoder.bit_error_threshold=0.5 -i exidy_%1.img -d drive:0

The write process verifies each track by reading back so even the writes need the bit_error_threshold parameter.

Writing also work through the virtual sector generator to a soft sector disk.  The disk can be read by the system if the virtual sector generator is used.

I was very impressed with FluxEngine. David Given has done an amazing job.

File Extraction from Sorcerer/Micropolis CP/M Images

In principle the files on the CP/M disks can be extracted using cpmtools.  This, however, requires knowing the disk definitions.

I was able to work out the skew table by looking at the directory sectors on track 2.  I guessed the directory size for the 2.2 format.

There were actually two different CP/M formats for the two different CP/M implementations on the disks: Exidy CP/M 1.4 and Software Source CP/M 2.2.

I was able to make some guesses based on the sector arrangement, and when i looked at the images i could see the order of the directory sectors. They both use a skew of 5 but start with different sectors – which explains why each CP/M only works with their own disks.

The directory size was a guess.

I thought i had nailed the format, but later i realised that there were some issues.

The two CP/Ms that I have use 2kB blocks.  Each directory extent can accommodate 16 block pointers, but they are not all used.  I think there was a rule that an extent could only represent a maximum of 16kB (multiple extents can be used for bigger files) so the CP/Ms that I have only used 8 pointers and just waste off the other 8. 

With the original diskdefs cpmtools would read fine but when writing it would use up to 16 of the pointers.  This befuddled CP/M.  

The fix was not obvious but I found a comment on one of the other diskdefs suggesting that

logicalextents 1

wasted half of the entries (which is what I want) so I gave that a try and it worked.

The diskdefs are here:

# Sorcerer fluxengine micropolis 100tpi 77 track 256 byte/sector (additional bytes ignored)
# The Software Company CP/M 2.2
diskdef exidymicrop22
tracks 77
seclen 256
sectrk 16
blocksize 2048
maxdir 64
skewtab  0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11
#skew 5
logicalextents 1
boottrk 2
os 2.2
end
# Sorcerer fluxengine micropolis 100tpi 77 track 256 byte/sector (additional bytes ignored)
# Exidy CP/M 1.4
diskdef exidymicrop14
tracks 77
seclen 256
sectrk 16
blocksize 2048
maxdir 128
skewtab  5,10,15,4,9,14,3,8,13,2,7,12,1,6,11,0
#skew 5
logicalextents 1
boottrk 2
os 2.2
end

I was then able to extract the files.

cpmcp -f exidymicrop22 "exidy_20_d1_2.img" 0:*.* "\20"

Using Greaseweazle with Sorcerer/Micropolis Disks

The Micropolis disk system uses hard sectored disks. This is particularly challenging for disk imaging systems.

Release 1.20 of Greaseweazle included hard sector support, so i gave it a try. I was able to read and write disk images with moderate success. Without a codec for the disk formats the software could not check each track and retry if necessary.

The Greaseweazle developer, Keir Fraser offered to add the fluxengine codec into the code which he did very rapidly.

I tried it out and found it worked very well.

I did find that some of the default parameters didn’t work well with my drives, but these were changed with the delays option.

The relevant commands are:

Get helpgw -h
Speed testgw rpm –-drive=0
Head cleangw clean –-drive=0
Set some safe drive parametersgw delays –-step=30000 –-settle=10
Reads a micropolis disk into an scp file.  The raw option keeps the sector pulses and allows reprocessing.  Without the raw option the files are more easily viewed with the HxC tools.gw read –hard-sectors –-drive=0 –revs=5 –tracks=”c=0-76:h=0″ –-raw %1.scp
Writes a micropolis scp file to a diskgw write –hard-sectors –-drive=0 –tracks=”c=0-76:h=0″ –-raw %1.scp
Reads a SS 100TPI 256 byte sector micropolis disk and decodes it into an IMG file.gw read –hard-sectors –drive=0 –format=micropolis.100tpi.ss –retries=8 %1.img
Writes a SS 100TPI 256 byte sector micropolis IMG file to a diskgw write –hard-sectors –drive=0 –format=micropolis.100tpi.ss –retries=8 %1.img
Reads a SS 100TPI 275 byte sector micropolis disk and decodes it into an IMG file.gw read –hard-sectors –drive=0 –format=micropolis.100tpi.ss.275 –retries=8 %1.img
Writes a SS 100TPI 275 byte sector micropolis IMG file to a diskgw write –hard-sectors –drive=0 –format=micropolis.100tpi.ss.275 –retries=8 %1.img

CP/M files are read with the 256 byte option format=micropolis.100tpi.ss

When creating the image files, the sector integrity is checked and if the sector is bad it is retried. It was common for multiple retries to be required.

I did try to adjust some parameters (i had to with fluxengine) but i could not get much improvement. Nevertheless, it was quite satisfactory.

The actual system does better, so it often helps to make a fresh copy of a disk on the Sorcerer before trying to image with either FluxEngine or Greaseweazle.

I also tried using Greaseweazle to write micropolis images to soft sectored disks with a Virtual Sector Generator. It also works fine.

What i have not been able to do, so far, is to trick the Sorcerer into using a Gotek/Flashfloppy either with or without the Virtual Sector Generator.

As at V1.22 Greaseweazle includes the micropolis codec.

I use Greaseweazle a lot so i really appreciate the effort that Keir and others have put into its development.