The Floppy Emu Macintosh Disk Emulator is finally available for sale! Get one now for $89. Each one is hand-assembled, programmed, and tested by me. After more than two years in development, and two months of preparation for “production”, I’m very excited to share this with you today. The initial inventory is quite small, but should grow over the next few weeks as more boards get built.
Edit: Sold Out! I should have more in a few days. Email firstname.lastname@example.org to be notified when more Floppy Emus are ready.
Floppy Emu is a prototype floppy disk drive emulator for vintage Macs, compatible with everything from the original Mac 128K through the Mac II and Power Mac series. It uses an SD memory card and custom hardware to mimic a 400K, 800K, or 1.4MB 3.5 inch disk drive and floppy disk. It plugs into the Mac’s external or internal floppy connector, and behaves exactly like a real disk drive, requiring no special software on the Mac. Floppy Emu is perfect for setup or troubleshooting of a Mac without a hard drive or a working OS. Just plug in the Floppy Emu, and you’re booting up in seconds. Keep it as a permanent solution, or use System 6/7 installer disk images to do a new hard drive installation. The hardware is also great for moving files between vintage Macs.
As always, you can also build your own if you’re comfortable with SMD soldering and have the necessary programming tools.
Thanks to everyone who offered feedback, advice, and encouragement over the long course of development. It’s great to be part of such a positive community!Be the first to comment!
I’ve been looking at options for shipping to locations outside the United States. Wow, the choices are terrible! For comparison purposes, I’m assuming an 8 x 4 x 3 package that weighs 4.5 ounces (about 125 grams). I calculated hypothetical shipping charges to Canada, the UK, Norway, and Australia using the US Post Office, UPS, or Fed Ex. The results were not encouraging.
UPS and Fed Ex provide detailed tracking info for packages, but the costs are through the roof. The cheapest option through UPS is $104, and with Fed Ex it’s $84. These are both for 5 business day delivery – they don’t seem to offer anything slower. Hello? $100 for a four ounce package the size of my hand? Forget it.
US Postal Service Priority Mail Express International (I love these names) looks a little better, but it’s still bad. It provides package tracking information, with a cost of $33 for Canada and $48 for the other countries. Delivery is promised to be 3-5 business days. That’s a lot better than UPS and Fed Ex, but it still seems like too much money to ship a little lightweight box.
US Postal Service Priority Mail International (non-express version) is cheaper still, with a cost of $20 for Canada and $24 for the other countries if you use their small-sized flat rate box. It promises delivery in 6-10 business days. But for reasons unknown, the small-sized box is ineligible for package tracking. You have to step up to the medium-sized flat rate box for that, which then costs more than Priority Mail Express International. Thanks, but no thanks.
That finally brings us to lowly First Class Mail. This is just plain old mail, with no fancy features, and no promise of delivery speed – though anecdotally the speed is essentially identical to Priority Mail International (6-10 business days). It’s just $8.55 for Canada and $12.75 for the other countries, but there’s no package tracking or insurance. If your package disappears into a black hole in some foreign mail sorting facility, too bad.
I’m thinking that the best option may be to self-insure, charging something like $20 flat rate for international delivery and shipping via US Postal Service First Class Mail. Then I could make good on any lost deliveries out of my own pocket. Of course there’s the risk that some unscrupulous person could order 20 units delivered to Burkina Faso, then claim they never arrived, and I’d be out a lot of money.
Or I think it’s possible to get delivery confirmation with Priority Mail International, but only for some countries. And delivery confirmation isn’t the same as package tracking – if the package gets lost, it’s still lost. But at least it would protect against the guy in Burkina Faso claiming he never received his delivery.
This stuff is hard. Now I understand why real businesses use shipping logistics services!Read 11 comments and join the conversation
Here’s my long-overdue review of the Rigol DS1074Z four-channel oscilloscope, which I purchased a couple of months ago. At around $550, the DS1074Z occupies a unique place in today’s oscilloscope market between the $300 entry-level scopes, and the $850+ higher end scopes like Rigol’s new DS2000 series. It’s also one of the only scopes in this range to offer four channels.
I felt a little unprepared to do a review, since during the time that I’ve had the scope, I’ve really only scratched the surface of its features. If there’s something not covered in the video or something else you’d like me to test, leave me a note in the comments. A quick summary of what’s covered in the video:
Likes - display, menus, measurement features, memory size, SPI decoding
Dislikes - fan noise
If you’re shopping for a new oscilloscope and can stretch your budget beyond the entry-level choices, the DS1074Z is definitely worth a look.Read 1 comment and join the conversation
There’s a big difference between building one of something, and making a repeatable process to build 10 of them, or 100. Unfortunately I’m learning that the hard way while I try to get some more Floppy Emu boards ready to sell. If I had any hair, I’d be pulling it out! I never thought this would be so hard.
If you haven’t been following the earlier posts, Floppy Emu is a floppy disk drive emulator for vintage Macintosh computers. I built the first Floppy Emu for my personal use about a year ago, and while the soldering was a little challenging, everything worked once it was done. I posted the design on the BMOW web site, and since then I’d estimate about 10 other people have built their own Floppy Emu boards. Then in October I built two more boards from my remaining parts stock, and sold them on eBay. I tested those thoroughly before I sold them, so I’m confident those boards were working well.
The eBay sale generated lots of interest and requests for more boards, so in late October I created board revision 1.1 in preparation for a small hand-made “production run”. The board layout changed slightly to make room for mounting holes, and some board traces were moved or added. I switched to a different PCB supplier, changed to a different brand of 3.3V LDO regulator, and substituted the Atmega1284 for the Atmega1284P to save a few pennies.
I built four of the rev 1.1 boards, and initially none of them worked. As described in my previous post, the new brand of 3.3V regulator proved to be unstable when combined with the output capacitor I’d been using. The oscillations on the 3.3V and 5V supply lines caused all kinds of crazy behavior and malfunctions that drove me crazy. I’ve since found that replacing the 10 uF ceramic output capacitor with a 33 uF tantalum solves that particular problem. Yet even with the capacitor fix, one of the boards exhibited occasional random write errors, and I somehow toasted another one during assembly.
Later I discovered a flaw in my CPLD firmware that was shorting the Mac’s PWM drive speed control input to GND. Floppy Emu doesn’t actually use that input, but shorting it to ground is not very nice, and may have damaged the CPLD, the Mac, or both. This only affected the rev 1.1 boards. That firmware flaw is now fixed, hopefully without any permanent damage.
I’ve since built two more of the rev 1.1 boards. One worked fine, but the other showed the same pattern of occasional random write errors. Of the six rev 1.1 boards I’ve built, that means I only have three working boards. Arghh! 50% yield is not good. The random write error is maddening. It doesn’t happen very often, so it’s necessary to do a LOT of testing before I can be confident a particular board does or doesn’t have this problem. I spent a long time with a lens, an oscilloscope, and a debugger trying to explain what’s going wrong, but failed. My best theories are:
Software Bug – Perhaps there’s a problem with the Floppy Emu software, like a timing bug or uninitialized variable, and tiny variations in boards or components cause the bug to appear or disappear. This was my first guess, but if true I would expect a continuous distribution of bugginess across boards, rather than two groups of “working” and “not working” boards. I tested the working boards heavily, and they really do work 100%. I also made many experimental software changes that I thought might cause the problem to appear or disappear, but there was no change in behavior. And to my knowledge none of the rev 1.0 boards have this problem, even though they use the same software.
Soldering Mistake – I may have created a bad solder joint somewhere, leading to flaky behavior. That’s possible, but it seems pretty unlikely I’d make the exact same soldering mistake twice in six boards. And I’ve visually inspected the problem boards carefully with a 10x magnifier, and touched up all the likely problem points with an iron, without any success.
CPLD Damage – Some of the CPLDs might have been damaged by the firmware bug that shorted PWM to GND, resulting in buggy behavior even after the firmware was fixed. That’s certainly possible, but then why weren’t all the CPLDs damaged? Why just two of them? If this is the true explanation, then future rev 1.1 boards should all work OK now that the firmware bug is fixed.
Atmega1284 vs Atmega1284P Variation – Maybe some minor difference between the two types of the AVR microcontroller is causing unexpected problems. As far as I know, the only difference is that the “P” version uses Atmel’s Pico-Power system to enable very low power sleep modes. Since I’m not using those sleep modes, that difference shouldn’t matter.
Board Design Flaw – The rev 1.1 board could contain a design mistake not present in the original board, like substantial coupling between neighboring traces, signal reflections, or other noise that leads to intermittent problems. While the layout changes between rev 1.0 and 1.1 were minor, I can’t rule this possibility out.
Manufacturing Flaw – The rev 1.1 boards from Smart Prototyping might not be built to the same tolerances as the original boards from Dorkbot PDX. In terms of published specs like minimum trace width and spacing, the Smart Prototyping process should be fine, and I used their design rules file to verify my board in Eagle. I know other people have been successful with rev 1.0 boards not made by Dorkbot PDX, though I don’t think any have used Smart Prototyping specifically.
Unfortunately I’m at one of those points where I really don’t know where to go next. I could build a few more boards to test the CPLD damage theory. Or get some more Atmega1284P’s and build a few boards with those, or experiment with going back to the original PCB manufacturer or the rev 1.0 board design. But each of those experiments would require more time and money to test the theory. I’d need to see at least five good boards and zero bad ones before I had any confidence that I’d solved the problem. Spread across all the possible problem causes, I could end up building several dozen test boards, and still come up empty-handed if the true cause is a software bug or something else I haven’t considered.Read 11 comments and join the conversation
I finally got the new Floppy Emu revision 1.1 boards! Rev 1.1 has a few minor tweaks to prepare for selling assembled hardware. I built four of them with a soldering mini-marathon, and three of them work. The fourth I think I toasted somehow, but I’ll check it in more detail later. 75% yield isn’t so good.
Unfortunately something isn’t quite right. With the new boards I’ve built so far, I’m seeing anywhere from 3X to 10X more noise on the 5V and 3.3V supply lines, and I think this is causing random resets and spurious interrupts and other phantom problems. The noise is very regular, with a frequency of between 80 kHz and 130 kHz on both supplies. I was able to bring the supply noise under control by soldering an extra 10uF capacitor between the 3.3V and GND pins on the LCD, but it shouldn’t need one, since there’s already a 10uF cap between 3.3V and GND on the main board. Yet the difference with and without the extra cap is like night and day:
new LCD (with extra 10 uF cap) and SD card: 80 mV noise on 5V supply, 100 mV on 3.3V supply
new LCD and no SD: 60 mV on 5V, 50 mV 3.3V
old LCD and SD card #1: 380 mv on 5V, 100 mV on 3.3V
old LCD and SD card #2: 840 mv on 5V, 280 mV on 3.3V
old LCD and no SD: 900 mv on 5V, 340 mV on 3.3V
new LCD and SD card: 100 mV on 5V, 120 mV 3.3V
new LCD and no SD: 80 mV on 5V, 120 mV 3.3V,
old LCD and SD card: 100 mV on 5V, 120 mV 3.3V
old LCD and no SD: 80 mV on 5V, 100 mV 3.3V
I guess I could just go with the extra capacitor on all new boards, and call it done, but I’d really like to understand what’s going on. Quite a few things changed between revisions, any of which could affect supply noise:
- New board design relocated some parts and re-routed some traces
- Boards were manufactured by a different fab
- Using an ATMEGA1284 instead of ATMEGA1284P
- Different brand of 3.3V regulator
I’m going to do some more experiments before deciding how to proceed. If you’ve got any ideas on what to check, please leave a note in the comments!
Read 12 comments and join the conversation
I’ve been aware of the Bus Pirate for several years, but never had a clear understanding of precisely what it is, beyond being a serial adapter of some sort. Its name suggests a black-hat hacking tool, or maybe something for defeating DRM locks. The official home page only says “The Bus Pirate is an open source hacker multi-tool that talks to electronic stuff”, but that one sentence explanation doesn’t help very much. Links to the Bus Pirate Manual just show an advertisement, and the few “Bus Pirate for Dummies” style of guides I found weren’t super helpful either. I finally got curious enough that I decided to just buy one, and get the sense of the Bus Pirate through hands-on experimentation.
My conclusion is: it’s great! Imagine every hardware programmer, debugger, serial cable, and interface tool you’ve ever used, rolled into one. That’s the Bus Pirate. But it’s even better than that, because the Bus Pirate also offers interactive diagnostic features those other tools never dreamed of. If you like to tinker with digital electronics, the Bus Pirate is the tool you’ve always needed, without realizing how much you needed it. Here’s some of what it can do:
- program or read an AVR microcontroller (replaces the AVRISP mkII)
- program or query CPLDs, FPGAs, ARM micros, and other JTAG devices (replaces tools like Altera’s USB Blaster)
- connect to serial devices over a USB to serial connection (replaces the FTDI USB-to-serial cable)
- read or write Flash and EEPROM memory chips
- communicate with virtually any SPI- or I2C-based chip through an interactive command line console or a binary API
- passively sniff the SPI or I2C bus while other chips are using it, and record traffic
- other goodies like a low-speed logic analyzer and oscilloscope mode, raw digital (bitbang) mode, and more
To be fair, the Bus Pirate probably isn’t the best tool for any of these purposes – it won’t replace your high-end logic analyzer or expensive JTAG debugger – but it offers an amazing breadth of functions in a single device.
The Bus Pirate was originally developed in 2008 by Ian Lesnet for Hack a Day, and his post introducing the Bus Pirate remains the best overall summary of what it is and what it does. Ian later founded Dangerous Prototypes and took the Bus Pirate with him, releasing the design into the public domain, but continuing to improve the hardware and software with the help of others. Making it public helped build a robust community around the Bus Pirate, and today there are several companies selling variants of the Bus Pirate hardware, including Seeed Studios and Sparkfun.
Unfortunately, the public nature of the design has led to fracturing of the hardware, and some neglect of the software and documentation. For example, Dangerous Prototypes and Sparkfun use different naming conventions when describing versions of the hardware, leading to confusion when reading that a particular feature is available in version 3.5. And depending on whose Bus Pirate and cables you buy, the mapping of wire colors to signals may be backwards relative to other hardware versions. Be careful if you’re using somebody else’s color-coded wiring diagram! To confuse things further, there are also two major versions of the hardware in simultaneous development: 3.x and 4.x. The 4.x version is supposed to be the “new” Bus Pirate, but despite having been released in 2010 it’s still officially beta hardware, and new users are encouraged to buy the 3.x version. In practice, the community seems about evenly split between 3.x and 4.x hardware users.
The software and documentation suffer from not having a clear owner or maintainer. Those things take a lot of work, so it’s not surprising that a public domain project has some hiccups there, but it does make things difficult for a new Bus Pirate owner trying to get oriented. There are tons of Bus Pirate wiki pages on the Dangerous Prototypes web site, but many of them are out of date or inaccurate, or duplicates of other pages, or contradict other documentation on the site. The software harbors a few more potential points of confusion, with different sets of files contained in each firmware archive, and much ambiguity about which firmware is the right one to use.
But ultimately these are just minor bumps in the road. It may take a bit of extra reading and experimentation to get everything configured, but once the Bus Pirate is set up, it’s definitely worth the trip.
I bought the Seeed Studio version of the Bus Pirate, hardware revision 3.x, along with the female-to-female jumper cable. Other people seem to prefer the cable with grabber probes. Consider what you’ll be connecting to most often, and buy accordingly. Or get both cables – they’re cheap. I also purchased the optional clear acrylic case. Shipping from Seeed took about two weeks to the United States.
Nokia 5110 LCD
After connecting the Bus Pirate to my PC, and installing the recommended terminal software (TerraTerm Pro), I connected to COM4 at 115200 bps and was on my way! The interactive terminal was a little daunting at first. The basic idea is to use simple text commands to choose an interface mode like SPI, I2C, or UART, configure the options for speed, pull-ups, and such, then type in data values to be sent to the device. Any incoming data from the device is displayed in the terminal window as well.
After plowing through a tutorial, my first test was interfacing with a Nokia 5110 graphical LCD. This 84 x 48 LCD has an SPI interface, and I’ve used it on several past projects. The Bus Pirate can optionally supply 3.3V or 5.0V to the connected device, so I turned on the power supplies and connected 3.3V to the LCD. The LCD’s SPI pins were connected to the corresponding pins on the Bus Pirate, and its D/C (data or command) pin was connected to the the Bus Pirate’s AUX pin. Finally, I tied the LCD’s reset pin to 3.3V.
From past experience with this LCD, I knew the magic series of command bytes necessary to initialize the display. In Bus Pirate terminal mode, they translated to:
a[0x21 0xBF 0x14 0x20 0x0c]
a - set the AUX pin low (puts LCD in command mode) [ - asserts LCD chip select 0xNN - data bytes to send ] - deasserts LCD chip select, ending the transfer
It worked! After a little more fiddling around, I was able to clear the display, set the cursor position, and print the “hello” message you see in the leader photo. In this case, my experimentation merely confirmed what I already knew about the LCD’s communication interface, but if I’d never used the LCD before, the Bus Pirate could have been a life-saver. Human-speed interactive communication with an unknown device like this is a much easier way of learning its behavior, compared to writing code for a microcontroller, or building a protoype PCB.
My second test was an accelerometer module that I bought a few years ago, then put in a drawer and never used. Unlike the LCD, I had no prior experience with this chip. The ADXL345 can operate in either SPI or I2C mode, so for the sake of variety I chose I2C. Unlike SPI, I2C devices have a unique address used for bus communications, sort of like an Ethernet MAC address. Two addresses are needed: one for writing and one for reading. I could have read the datasheet to learn what addresses are used by the ADXL345, but I’ve got a Bus Pirate! So I connected up the pins, ran the Bus Pirate’s I2C address search macro, and voila! 0xA6 write address, 0xA7 read address.
OK, to go further I did need to peek at the datasheet. I learned that internal register 0 is the product ID register, and should return the value 0xE5. To read an I2C register using the interactive terminal, the syntax is not especially intuitive. To read the product ID register the command was:
[0xA6 0x00 [0xA7 r]
You’re probably thinking something’s wrong with those mismatched brackets, but it’s correct as written. [ sends an I2C start bit. 0xA6 0x00 identify the chip address and register number. [ sends another start bit, which is a restart, and is necessary for switching the chip from write to read mode. 0xA7 is the chip read address, and r reads a byte from register 0. Finally ] sends an I2C stop bit and ends the transfer. I ran the command, and saw happy 0xE5 come back as the read result.
Reading the datasheet a bit further, I found that the accelerometer XYZ axis data is in registers 0×32 – 0×37. It’s two bytes per axis, with the low byte first. See the screenshot for the data from my test. The first time I queried the registers, the module was lying flat on my desk, with gravity nearly aligned with the chip’s Z axis. The measured axis values were 0×0027, 0x000D, 0x00FD. For the second test, I stood the module on its edge, with gravity nearly aligned with the chip’s X axis. This time the measured values were 0xFF0C, 0×0005, 0×0001. Pretty neat!
For my final test, I decided to try some JTAG programming. There are three different ways to use JTAG with the Bus Pirate, so it’s easy to get confused. The first method is from an interactive terminal session similar to the SPI and I2C examples. This isn’t very useful in practice, and support for it has been removed in recent firmwares, but it’s still mentioned in the documentation. The second method is to use the Bus Pirate as a JTAG dongle with OpenOCD software. I didn’t try this, but apparently recent versions of OpenOCD have Bus Pirate support built in, but it only works if you’re running the right firmware. I used the third method: using the Bus Pirate as a stand-alone XSVF player. XSVF files are a type of pre-recorded JTAG sequence, created by the Altera and Xilinx development tools for programming FPGAs and CPLDs.
Here’s where things get a bit complicated. My first two tests were interactive terminal sessions, running Terra Term on my PC with the default firmware 5.10 installed on the Bus Pirate. The XSVF player isn’t an interactive terminal mode, though, but a binary-only API requiring different firmware for the Bus Pirate. That meant I needed to learn how to update the Bus Pirate’s firmware and replace it with something different.
Poking around on the Dangerous Prototypes site, I found links to various firmware tools and downloads, but no indication of which one I should use. My Bus Pirate shipped with firmware 5.10, which seems to be the standard, even though it’s quite old and the latest firmware is 6.3. I eventually found what I was looking for, hidden inside the firmware 6.2 download archive: a firmware image named bpv3-xsvf-vb.hex, which provides the XSVF player functionality on the Bus Pirate. But how do you talk to the Bus Pirate when it’s in XSVF player mode, and send it the XSVF file you want to play? This requires a Windows program that’s inexplicably not included with the corresponding firmware, but must be downloaded separately. One I grabbed that as well, I was finally able to get started.
I’ve had an old XC9572 gathering dust in my parts box for years, and I’ve never actually used it, because I don’t own anything that can program it. Or I didn’t until now! I used the Xilinx ISE to create a simple design for the XC9572 – just a couple of AND and OR gates to prove that it worked. I then exported this as an XSVF file, connected the Bus Pirate, ran the XSVF player, and I was in business. It wasn’t fast, taking about 30 seconds for JTAG programming what must be the simplest part in Xilnx’s entire product lineup, but it worked. I hooked up some LEDs and jumper wires to exercise my AND and OR gates and make sure everything was working as expected. Hooray, new life breathed into this old CPLD!
The Bus Pirate is a remarkable tool. It’s a shame that the hardware, software, and docs have become somewhat muddied and difficult to follow, but it’s worth the effort to dig through and get it working. If you’ve got a box full of single-purpose programmer/adapter devices, then this is for you. I expect the Bus Pirate will occupy the top spot in my electronics toolbox for a long time to come.
Read 3 comments and join the conversation