Posts

Showing posts from October, 2017

More minor successes

I've been rearranging the VHDL code a lot and it had a positive impact on timing not only in simulation, but on the real hardware, too. The problems with the EPROM 'disappearing' in the middle of the code execution seem to have gone. Also, I rearranged the assembly code for a (hopefully) more efficient driver. I wrote a test routine that writes a 512 byte block to the card, reads it back and compares the two . The test shows that data is written correctly to the card, but is not read back correctly, sometimes. I think it may have to do with the timing (again) how data is read from the Spi bus into the CPLD. That is about the only thing from the original design, I have not touched. It would surprise me, though, if the was nothing to improve...

Minor success

The Apple Super Serial Card uses address line A11 to switch the card's ROM to always to the same page ($700), when any part of the $C000 - $C7FF space is accessed. An access to $C800 - $CEFF is mapped to $000 - $600. This takes place in the first part of the CPU cycle, when the address bus becomes valid, so the ROM has enough time to react. Why hadn't I thought of that myself? I mean, the guys at Apple only did that 40 years ago. But I am just a software engineer, to my own defense. As soon as I got home yesterday, I made the modifications necessary to support the new address decoding for the EPROM. This required only the change of one line of VHDL code and the connection of A11 to a CPLD pin. I repurposed the unused /IRQ pin for that. Now I can access all pages of the ROM again!

Operation successful ...

... patient dead. Or at least in a coma. 😒 I spent all of last week fixing the timing problems I described in my last blog. I cross checked the timing constraints for the different Apple II models and combined them to form a worst case scenario. This includes the long time the II+ takes to establish a valid address and the short data hold time of the IIgs. To verify that timings were by the book, I learned how to write VHDL testbenches (how have I lived without them?). The simulation showed me some flaws but I corrected them and now everything is fine. I even wrote a driver test that writes a block of data, reads it back and checks for errors. However, one thing I did not realize was that 27xx type EPROMs are relatively slow. They take up to 450ns to output data after the address is valid. The select signals that activate the ROM and forward the address bus are valid for 500ns. With my timing redesign, the signal is cut off by about 70ns at the beginning to avoid bus fights. I think

Clocks

Apart from being one of the most obnoxious people I ever met, my professor for digital circuit design at university told us some things that stay in the back of the mind. 👨🏻‍🎓 One of those things was that, in a digital design, you should always make signals that are asynchronous to the system clock synchronously. Usually this applies to signals like pushbuttons or from other devices that are separate. In case of the Apple II peripheral bus there are both synchronous and asynchronous signals. Unfortunately, this is not really clear in the simplified bus timing diagram that appeared for example in the II+ manual. 7M, Q3, Phi0 and Phi1 are really synchronous as they are devided from the 14MHz main clock. In my CPLD design for the AppleIISd card I used 7M as clock, because it is the fastest clock that is available on all slots. The three select signals, /DEV_SEL, /IO_SEL and /IO_STB are related to Phi0/1 but are slightly late due to propagation delays in the logic that generates the

First contact

Image
I managed to put a first prototype together: an Arduino nano is talking to a PS/2 mouse. The adapter on the mouse is an old AT to PS/2 keyboard adaptor. There are no electronics in it and I had the 5 pin DIN sockets here. I think I'll stick with that, because the mounting holes for DB9 connectors in the back of a IIe or IIgs are actually prepared for DIN connectors as well. The A2 can read the XY position register values through a 6522 VIA, because the Arduino is not fast enough to read the address bus and put the information on the data bus. The A2 has to tell the VIA which data it wants to read and that tells the Arduino. That in turn outputs the data that is then latched on the VIA to be read by the A2. Easy, isn't it? A tiny driver represents the READMOUSE routine of the original card. For now, I can read and display some values in Applesoft BASIC when the mouse is moved. This pretty much copies the original design. I think the detour through the VIA is ann

There are never too many Apples

Image
Apple II europlus, ca. 1981 Apple IIe, ca. 1983 Apple IIgs ROM 01, ca. 1987 Not pictured are my nine Macs: Classic PowerBook 180 Performa 460 PowerBook 190cs PowerMac G3 266 MHz PowerBook G4 500 MHz PowerMac G5 dual 1.8 GHz PowerBook G4 1.33 GHz iMac 27" 3.06 GHz I seriously doubt that you can have too many Apples! 😆

Verschlimmbessern

I guess verschlimmbessern is one of those German words most non-native speakers have not heard about. It's in the Duden , so it's an official word. *lecturemode* Actually, it is an oxymoron, two words that are opposite of each other combined in one. The prefix ver- indicates that something is changing. The two words are verbessern , to make something better and verschlimmern , to make something worse. So, verschli mmbessern means making a thing worse by trying to make it better. *lecturemodeoff* Two or three weeks ago the board worked pretty well, so I said I would have the 20 prototypes of my AppleIISd board ready by now. Unfortunately I don't. By trying to add features like a flag for initialization and support for multiple partitions I made things worse and I don't have a working board yet. The trouble is that I can boot the board about every third time on the IIe. It either hangs at the ProDOS bootscreen, says "Unable to load ProDOS" or doe

Mice, everywhere!

A computer mouse is nothing special anymore, but of course, that was not always the case. In the earlier days of home computing everything was done using a keyboard. Then there was this company called Apple with a computer named Lisa that wanted to change the world with a device called a mouse. However, they did not invent the mouse, but I am sure everyone reading this already knows that. What they did was that they completely eliminated the need to have use a keyboard (except for text input, of course). Suddenly, well not so suddenly, because the Lisa failed and the Macintosh did not change the world instantly, either, the user grew accustomed to using the mouse and used it ever since. Even today with all the touch screens and stuff, mouse and keyboard are the primary input device for desktop computers. Today, almost every platform uses USB or Bluetooth, but earlier, PCs usually were equipped with mice that connected to either the serial port, the PS/2 port and Macs used ADB. One th