Teensy 3.5 & NCR 5380 based SCSI device emulator.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
ScsiSoundTest2.mp3Sample of the upcoming TSE Sound Emulator addon.MPEG Video - 929.79 kB - 06/20/2020 at 18:21 |
|
|
NCR_53C94_53C95_53C96_Data_Sheet_Feb90.pdfNCR 53c94 DatasheetAdobe Portable Document Format - 2.86 MB - 12/26/2016 at 21:59 |
|
|
K64P144M120SF5RM.pdfKinetis MK64 Reference ManualAdobe Portable Document Format - 19.85 MB - 12/14/2016 at 22:32 |
|
|
SCSI Reference.pdfSCSI Command ReferenceAdobe Portable Document Format - 3.78 MB - 12/14/2016 at 22:32 |
|
|
NCR_5380_SCSI_Interface_Chip_Design_Manual_May85.pdfNCR 5380 DatasheetAdobe Portable Document Format - 2.99 MB - 12/14/2016 at 22:32 |
|
|
As I have had some time to further the project, I've done a redesign of the board (see the pictures section on the left) with room for two Teensy microcontrollers, and a header for a Pimoroni Pirate Audio (or other Raspberry Pi compatible I2S audio hats with optional screens) or a Raspberry Pi and whatever hats you want to use (forgoing the need for the second Teensy). Additionally there is a 20x30 prototyping area, and mounting holes that match up with 3.5" bottom screw positions for mounting (or you can use right-angle hardware.)
The previous OLED menu system is being brought out to a separate microcontroller to allow for some more advanced features.
Once the design has been validated, I'll upload the new design to the project files.
For $50 you should be able to build your own basic board with just the NCR5380, backend Teensy 3.5, and minimal passives / connectors.
For around $100 you can fully populate the board with two Teensy microcontrollers, and a front panel LCD / Audio module.
HDD sound simulator:
The frontend Teensy can generate simulated harddrive sounds (and eventually CD & tape mechanical sounds too!) in realtime, for those who miss such things. There is a sample recording in the Files section.
CDDA emulation:
You can have the frontend Teensy play back wav files from it's own SD card, though I might implement a pass-thru for the backend to send audio that is embedded in a bin/cue image. With a Teensy 3.5, this uses 16-24% of the CPU time on the frontend controller. The frontend Teensy can be a 3.5, 3.6 or 4.1. The 4.1 should be powerful enough to decode MP3 files in realtime, and can do S/PDIF audio (passthru to your sound card!) The backend however still needs to be a Teensy 3.5 to work safely with the NCR 5380.
240x240 UI:
Using the Pirate Audio hat, the screen can be much larger than the previous 64x32 or 128x32 OLED displays, and in 16-bit color too. There are multiple versions of the Pirate Audio hat, one with a line-out, and another with a small speaker. The UI on the front will let you mount/unmount images, change IDs and modes, control CDDA playback, etc. Some basic UI elements are implemented already to allow changing the volume of the CDDA and HDD sound simulation. I'll be uploading a video of the updated UI soon.
So I had some time to play with one of the TSE boards I had built up, and use it with an HP 712/100 PA-RISC system this past week. In doing so I found several bugs, and have made some changes to the project in response. Some of the changes that have been asked for relate to the missing flexbus defines in recent versions of the teensyduino SDK. The firmware repo now has a flexbus.h uploaded with those missing defines. When I get a chance to merge some of the changes between the various trees I have locally, I'll update the repo with the bugs I found last week fixed.
In the handling of SCSI messages, ABORT (6) wasn't handled correctly. Apparently the correct response is to drop everything and release the bus with no messages back to the initiator. And then there were bugs in the handling of reads & writes and conversion between different sector sizes. On classic mac these were not as easy to see, but on PA-RISC it was obvious that too much data was being transferred for the read requests.
As far as multi-target support, it has been made even more obvious to me that selecting one target immediately after deselecting another target when both are handled by the TSE is problematic. This is most evident when a host is scanning for drives at boot and it only finds the first one. I'm not sure yet what I can do there, but if you experience this, try leaving gaps of 1 or 2 IDs between your targets handled by the TSE.
I had planned on a 53c94 port, but as I found previously, that would only support one target ID per chip, and finding examples of target firmware for the 53c94 has been difficult. I do have a board that uses the 53c94 in a target role with a Z80 cpu, which I can run an emulator in circuit or a logic probe and dump all the I/O targeting the 53c94.
So even though this project has been quite dead for the past couple years, I haven't given up on it yet.
The new boards and chips have arrived, and over 200 solder joints later, the Teensy and 53c94 are talking, and menu buttons are working. Now to finish separating the 5380 code from the target service code the rest of the way, and write the 53c94 driver. There is one downside to the 53c94 that I didn't notice before, it only can listen on one device ID at a time. It can still do multiple LUNs per device, but this means most of the modes are mutually exclusive for older software where LUNs are not supported. So you could emulate a harddisk, cdrom, ethernet, or graphics adapter, but not any of them at the same time on a m68k mac. The 5380 is slower, but more versatile on this one point.
On another note, the SuperMac SuperView arrived, and I was able to get it working with the Quadra 630 in my collection (albeit very poorly, as it causes issues with the native graphics). I hope to reverse engineer that protocol soon and start work on the pi Zero software.
The start of the OLED Menu system is underway, you will be able to enable/disable individual devices, change device types (disk, cdrom, tape, ethernet, graphics), start/stop the target mode, eventually perform initiator mode tasks (save/restore disk images from/to real drives) and make various other changes to the device config without needing a computer attached.
I've adjusted the layout of the previous status screen to only take the top 8 pixels, and hopefully be a clearer representation of what is going on. Here you can see IDs 3,4,5 are enabled, and I've just disabled ID 2 from the menu system. There is no activity on any of the devices, as shown in the top row of dots. Detailed status such as SD Card size and partitions will be available via the menus.
I spent the day plotting out the schematic and board layout for the 53C94 based iteration. TSE94Desktop.sch and TSE94Desktop.brd can now be found in the hardware repo to the left.
Boards and parts are now on order and should be in the middle of January. Until then, work will progress on the 5380 based model.
That didn't take very long. Many thanks to MAMEDev, SCSI2SD, and the SCSI CD docs, optical drive emulation is working well enough to mount & verify a Debian install disc on my linux testbed.
This means that virtual disks/discs with sector sizes other than 512 bytes are supported now as well.
I also have a SuperMac SuperView SCSI graphics card on order, which I hope will arrive before things get crazy again at work.
I have assembled one of the first run of boards and it works beautifully, even with my terrible soldering job. I have found an mistake that prevents the OLED display from being mounted on the Teensy side of the board, as the uSD slot overlaps the pins. I suspect anyone who would be using the OLED display would probably have it on cable or would be fine with mounting it over the NCR 5380, so it isn't a huge deal yet.
Many thanks to Hackaday for the writeup: http://hackaday.com/2016/12/25/the-tiny-scsi-emulator/ !
Merry Christmas, Festivus, Yule, Chanukah, Holidays and a New Year!
Rev0 Boards arrived from OSHPark, now I have to dig up some 48 pin sockets from my collection to fit the Teensy 3.5
Just pushed a major change set to bitbucket, adding the initial SCSI/Link emulation and central configuration through config.h
I spent the day rethinking the architecture of TSE, and plotting out the eventual move to support other controllers and device emulations.
Still having issues with the Cabletron emulation, but it is being joined by DaynaPort SCSI/Link which hopefully is a little better documented.
I've split the ethernet controller driver out from the ethernet emulations so it will be possible to mix & match in the near future. Particle Photon / Spark Core have potential as WiFi bridges handling all the network duties and leaving the SCSI to the Teensy. RNDIS over USB is another option to explore.
Initiator implementation has been pushed up the stack a tiny bit, in case I end up implementing RFC 2143, which necessitates being both a target and an initiator, supporting full bus arbitration, and exciting things that direction. Outside of Linux hosts with a specific chipset and driver, I don't know of any other implementations of the standard. I still plan on TSE being usable as a standalone SCSI cloning box.
ScuzzyGraph & PowerView are on the radar for future implementation if I can get any sort of documentation or can reverse engineer one (donors?).
Transport mechanisms are another avenue to explore. Are there any tape / cd vaults that are documented well? It would be interesting to have an entire catalog of ISO images to choose from, and mount them from a native application. Even better if I don't have to write the front end.
I'm still waiting on my first batch of boards from OSHPark, so all testing has continued on the breadboards for now. I've dug out a sacrificial VaxStation motherboard (corroded by leaking caps, rodent contaminants) to steal a pair of 5380 chips from, and have one SCSI floppy controller to steal another from if needed.
With my Quadra 630 attached, (needed to run NetBSD) I have gotten much further with the ethernet support. The Cabletron diagnostics now recognize the device. Likely just due to the incomplete Mode Sense implementation, NetBSD and its related tools don't like my disk emulation. And on the unforeseen complications, I now have to put some form of mutex / locking on the ethernet and oled drivers, which pushes me closer to switching to an RTOS and changing how I handle the SCSI PHY.
UPDATE: I just suck at installing crusty drivers. The Cabletron MacOS driver isn't an extension like you would expect, instead it patches the System file with the actual driver, and has some sort of patched Ethertalk extension. I'm further along than before, but without having the original hardware to compare against, I'm just blindly implementing their protocols by reading the NetBSD driver source code. The driver goes through the process of adding a protocol and a multicast address to the frame filter, and asking for any available frames. If the stats DA is installed, it attempts to poll as well. I suspect the card returns some sort of "No data, ask later" response when there are no frames to retrieve, but can't find any reference in the NetBSD driver.
Create an account to leave a comment. Already have an account? Log In.
Would be ecstatic to purchase one or more of these if that is an option.
As far as I know Zilog are still making 5380 compatible SCSI IC's.
You will have to search on mouser Z53C8003VSG or similar
Really cool project. I am interested in building one for my SE/30. Is the OLED required for operation or is it optional? Thanks!
Great project, David! I used your schematic and board files and had the boards made @ PCBWay earlier this month. Looking forward to populating one and seeing if I can get it working on my SE/30! Thanks again!
the firmware has some issues,the register thing like "drvNCR5380:146: error: 'FB_CSAR0' was not declared in this scope",so I think your project will fall,can you tell me your result?
GREAT Project ! Will follow and buy a board if it commes available
Do you plan on eventually eliminating the NCR 5380? It is a vintage part... and SCSI has been implemented in other devices without using anything similar to it (SCSI2SD doesn't use a hardware PHY).
It is entirely possible, and as far as the SCSI2SD, they implement their own PHY in a second AVR in the rev 5 board. i think the rev6 switched to a FPGA phy implementation. Currently I'm working on making the PHY driver a configurable option, so that you could use either the 53c80 or 53c9x, and eventually move on to better options including FPGA or eliminating the PHY (almost doable with just the Kinetis since every pin has pin change interrupts, and could still abuse the FlexBus interface to read/write the SCSI data bus. You work with whats easy, build up to whats hard.
There are tons of NOS SCSI chips available still in backchannels (ebay etc), in many different kinds.
Hi, do you think using a Teensy 3.6 instead of the 3.5 would cause headaches (i.e. timing problems maybe)?
The 3.6 doesn't have 5V tolerant pins, so depending on the SCSI chip you use, there likely could be problems. Both the 5380 and 53c94 are 5v parts.
Ah, good catch! I have some lvl shifters, but I guess getting a 3.5 would make it easier anyway. Any pointer as to how you've connected the 50pin header? Did you use a breakout?
For the breadboard I just used male to female jumper wires to connect the header pins to the corresponding chip pins.
Yes, there are eagle cad files linked in the hardware repo https://bitbucket.org/tinyscsi/hardware and depending on response I will probably make a large order for PCBs in the coming weeks as I finalize the designs, especially for the 53C94 version.
all im looking for is a compact scsi cdrom emulator that is not scsi2cd
scsi cdrom emulation is just barely starting. It is enough at this point that I have successfully booted a debian live cd from it on my Pentium III linux box. if you have the parts on hand, a breadboard is a good starting place. the eagle schematics should be enough to match up what pins need to be connected where.
Hi David. I commented on your thread in one of the Facebook groups about a 2.5" version for Powerbook drivebays, and IIRC you seemed interested. Just wondering if you ever got around to a layout for that? I think you mentioned it would have to be done without the OLED.
Either way, I'm interested in hearing when you get around to a batch run :)
@clae yes! I have been working on the laptop version in parallel with the new 53c94 based design, but haven't gotten boards made yet and need to find out some specifics for connector placement and mounting holes. There are some - preliminary, unverified, needs work, you get the idea - files in the hardware repo for two different laptop models. the 5380 based model has the firmware working reliably for hdd emulation, and needs some tweaks still for optical emulation. The 53c94 version needs much work still both hardware and software wise and will only be able to emulate one device at a time due to limits of the chip. A CPLD / FPGA phy will be in the works sometime in February, and I have been challenged to get Ultra-320 speeds within a few months (but without specifying the cost of doing so!)
Are you still interested in using existing faster SCSI ICs, or is it full steam ahead to CPLD/FPGA implementation?
im looking to make scsi plug with only 4-6 cdrom images . idea is to get rid of a scsi cdrom drive and have this plug with lcd on the back side . select image and forget it
Is this meant to be a generic SCSI emulator? By that I mean is it platform agnostic or is it targeted at a specific platform?
I ask because the 5380 emulation would likely make it functional for a lot of 16/32bit Motorola 68k era systems like the Amiga and Atari ST et al.
I'm pretty sure there would be significant interest from those communities as well as the classic 68k Mac crowd.
That is the general idea. The first project log notes that I have tested it with Macintosh SE, Adaptec 3940 (in a Pentium III), and the VaxStation 3100 M76's host controller.
LUN support has been tested successfully in Linux on the Pentium III.
Not only is it a generic SCSI harddisk emulator at this point, it should also be compatible with many SASI devices such as X68000 and various S100 bus systems with an appropriate controller.
That's great because I already ordered two SCSI chips in anticipation of this project ;')
Keep up the great work.
Since you seem to be emulating some of the more unusual SCSI stuff..... I'm just going to point out the Scuzzygraph Mac video adapter.. it would be neat to have a clone of it... I have the drivers somewhere I can dig them if if you are curious.
IT was based on a TMS34010... which is interesting in of itself. I gathered up as much info and links as I could awhile back about it.. https://68kmla.org/forums/index.php?/topic/20802-so-what-is-a-scuzzygraph-exactly/
That is one of my longterm goals. I have about 80% of the Cabletron Ethernet emulation written, including the lowlevel hooks that shuffle data back and forth to the W5100 I'm using. There is something making the driver unhappy, and I don't have macsbug installed to figure out where the issue is. For the Scussygraph, I'd have to get some documentation about it, and would probably need a much beefier controller (add a PiZero maybe?)
Become a member to follow this project and never miss any updates
Any Updates?