USING AN ARDUINO TO DRIVE TEST SIGNALS INTO THE EMULATOR BOX
I will use an Arduino to simulate key signals to do the next steps in testing. The circuitry of the RK-05 Emulator handles 5V inputs and outputs, using level converters, perfectly suited for using an Arduino to test the emulator box.
I selected eleven signals to be generated by the Arduino as input to the emulator box, and observed another four that are output from the emulator box. My generated signals included ones that would be produced by the 13SD disk drive in the IBM 1130 and signals that would be emitted from the disk controller logic in the 1130.
MINIMAL SIMULATION TO TEST THE EMULATOR
All the input signals that affect the operation of the emulator must be put at an appropriate default level, only changed when being asserted. For example, Read Gate and Write Gate, which request reading or writing to a sector, must be high to be inactive, only pulled low to assert the function. Real Drive is on to indicate we have the normal hybrid mode where the 13SD drive performs some functions as we emulate the virtual cartridge. These are set at startup of the Arduino test code.
The tester produces signals to emulate the Sector and Index pulses that normally come from the 13SD disk drive, as they would occur with it spinning at the correct speed.
Asserting the File Ready while keeping Disk Fault off will allow the facility to be open to commands. It will then respond to other requests from the controller for disk actions.
CHECKING LOAD AND UNLOAD OF A VIRTUAL CARTRIDGE IMAGE
This will let me repeat the testing I did before, loading a cartridge so its data is down in the SDRAM, then unloading the cartridge to rewrite the file on microSD card. Assuming it ends up with the proper content matching the original cartridge image, I can assume the RAM is working well.
Everything worked exactly as it should as far as loading and unloading the data. The file that was rewritten when we switched off the simulated drive and unloaded the cartridge was an exact match to the virtual cartridge file on the SD card.
However, the state of the RDY lamp was opposite to what I thought I was driving. This highlighted something I got wrong in my setup. I also noticed the WR lamp steadily illuminated, which should flicker on and off when we are doing a write operation but be steadily off otherwise.
The WR issue was because my test code in the Arduino didn't set up the output pin to drive Write Gate. It was corrected, along with some logic.
I saw the proper data both downloaded and uploaded to rewrite to the virtual cartridge file. The state machines interlock correctly with the state of the disk drive as simulated by the Arduino. I also verified that I can toggle the machine between normal and Read Only mode, where it would skip writing back the changed contents, essentially making the virtual cartridge image on the SD card remain as it was, ignoring any writes done by the 1130 during operation.
FIXING DESIGN WEAKNESS RELATED TO READ-ONLY MODE
The read only condition is reset when the Cart Ready state is revoked, which happened BEFORE I interrogated the state of the read only flag. Thus my state machine didn't see it and instead wrote the cartridge image back. I reorganized the code a bit and had it performing as intended.
No comments:
Post a Comment