Retrochallenge 2017/4 – Interak CF card – Part 2

In part 1 I was able to build a CF card adapter for the Interak. Mostly this involved using RC2014 parts.

Now it’s time to tell you about the testing and things are pretty weird.

A bit of background.

At the moment, my Interak-1 has no mass storage at all. No hard drive or floppy. Nor does it have a serial port that I can connect to my PC.

It only has cassette, screen and keyboard. This is making testing challenging.

In an earlier post, I described a USB keyboard adapter that I had built during last year’s Retrochallenge. This gives me a USB keyboard. At the end of the post I mentioned adding USB serial in so that I could use a serial terminal emulator to “squirt” data at the Interak as if it had been typed in.

I did that mod and this is the method I am using for testing because no one wants to type in a couple of hundred bytes of hex manually that may well crash.

It has no handshaking and so I have to be careful not to send too much at once but it’s working well.

First steps.

I am following in Scott Baker’s footsteps a bit here. Scott has added CF to the RC2014 and it’s his board design I am using. He describes the process of setting up the card and reading a sector as follows…

read register 7 until the busy bit (0×80) is unset
write 1 to register 1
write 0xEF to register 7
write 0×82 to register 1
write 0xEF to register 7
0xEF is the “set feature” command. Feature 1 enables 8-bit mode. Feature 0×82 disables any write caching. You should do this whenever the compactflash is reset or power cycled.
Read a sector
read register 7 until the busy bit (0×80) is unset and the ready bit (0×40) is set
write 1 to register 2, to set the sector count to one sector
write bits 0..7 of the block address to register 3
write bits 8..15 of the block address to register 4
write bits 16..23 of the block address to register 5
take bits 24..27 of the block address, or them with 0xE0, and write to register 6
write 0×20 to register 7. This is the “read sectors” command.
read port I7 until the busy bit (0×80) is unset and the DRQ bit (0×08) is set
read 512 bytes from register 0

By using the PORT command (P) of Zymon 2 (the Interak’s ROM monitor) I can carry out the above instructions and it seems to work well.

Just a note. Zymon is a little quirky and it’s not the easiest thing to follow. I can’t put blank lines in for clarity, they get ignored. Also, the P command reads from (no parameter) or writes to (one parameter) an I/O port. However, if I type, for example “P 67” to read the status byte on the CF card, Zymon puts the byte on the same line making it impossible to see whether or not I wrote to the port or read from it.

In this photo I set up the card ending with the line “P 67 EF”. I then do the read (up to line “P 67 20”). I get the status with “P 67”, the result is “58” – Drive ready + Drive seek complete + Data request read.

The, the following “P 60″s show data being read from the first sector of the drive.


Now the weird. I have tried doing this using a bit of assembler code and it doesn’t work.

I’ll put the full details in my next post.

Leave a Reply

Your email address will not be published. Required fields are marked *