 and welcome to Slady Aida. Hey everybody, I'm the little woman who's here. Hi everybody and welcome to my desk. It's me, Lady Aida, getting off a little bit of a cold, so it might be a little bit nosy, sniffly, but getting better. And you know, I felt actually, okay, yesterday so I did a little bit of hardware. So not a lot going on. Man, this little piece of hair is really annoying. Oh well, it's hat guard clock. But I did get some work done on the Flopsy board. So let's go to the overhead and maybe I'll show it off and talk about what we're doing. So if you remember last week, we talked about it. You know, a few years ago I did the Apple, the Adafruit Floppy Feather Wing, which allowed feather boards to connect to standard 34 pin floppy disks. And I have a little level shifter and right protect and external power connector. And this was basically, you know, the beginning of like let's get the code that we've written for floppy drives supported on Arduino and circuit Python. And we did actually add quite a bit of code. And then, you know, finally I got around to finishing this prototype for a all-in-one floppy interface. This is much nicer than just a feather wing because it's got display, SD card, STEMI QT, 12 volt power for big drives, five and a quarters need 12 volt, not just five volt. And then 34 pin floppy connector. And then here's a laptop floppy connector, power supply and debug. And basically, you know, a lot of, you know, level shifting and all, where I protect some of the other nice things, basically trying to make it all in one board that does a lot of floppy connectivity and floppy emulation. Like one thing, for example, this is only set up to read floppies. It won't emulate being a floppy. So last week, I think I got, you know, the SD card basically I verified it worked and the display worked and I could program the RP2040 and I verified that, you know, the power supply kind of worked, but I wasn't able to get the floppy disk working. And I think it actually, I don't know what it was. Maybe it was like something in my code or the enable pin, but basically I got that going pretty well. So right now I'll just, I'll show this demo and then I'll go back in time. So on my PC, if you go to my computer, I have this mass storage example that I'm running. And this mass storage example uses the RP2040 code that can act as a mass storage device, a disk drive, and it presents a MFM floppy to the computer. So it's, you know, a 1.4, you know, this is one that kind of assumes a lot. It assumes a 1.44 megabyte floppy drive, but it can, you know, when sectors are read from the mass storage interface, which is actually SCSI over USB, it reads the sectors and then sends that data over. So it actually kind of like emulates basically being a USB floppy interface. And, you know, we've got a USB floppy interface, you know, I actually been using this, you can get these, they use laptop floppy drives to USB, but the problem is these assume that they're only fat interface floppies. Like they will not work with any other interface of floppy, like Apple floppies or whatever they just, like definitely will never work because they assume a lot about the interface. And also, of course, this doesn't work with 5.25 because you, you know, you separate disk drive from that. Looks like this 5.25 drive, beep, beep, beep, beep. So it's good to have this example working. So on my computer, I run this demo and then I can look at the serial monitor and you see here I can open this file and you can see the read callback as it, this is like an old frack file, a text file that I just put on there. Right now, writing isn't supported. So I can't write a file to the, yeah, there's a write callback but it doesn't actually do the writing. That's because I have to figure out how to get, like to do writing, what I have to do is read the whole sector and then the data that I want to write, I have to convert that to flux values and then I have to write that back to the disk. And I just like, we just didn't get to that yet because we were like, well, let's get reading working and then we'll figure out writing. I do have a demo that writes fluxes. I know that I can write flux, I'll show you here. The example is here, floppy write test. So I do an example that will write fluxes but like it doesn't write data, it just writes flux transitions and verifies that like, yes, you wrote the flux transitions that you thought you did but they don't like mean anything and kind of actually ends up corrupting the floppy drive. So definitely don't wanna do this on a disk that it has anything important on it but this is a really good start. And then I didn't actually end up getting to try the Grease Weasel interface, but that's next. I think it'll work just fine, maybe by next week I'll get that tested. But Grease Weasel is a open source software that will read the flux transitions. Again, something you can't do with a USB floppy drive because this assumes, this will not get you raw flux data, it will only give you like sector data from a fat, formatted floppy. But Grease Weasel is designed to get flux data and so you can get like different formatting like Amiga floppies or even Mac floppies if you have like a good enough disk drive. Or of course your standard DOS formatted floppies or even Commodore 64 floppies. And you'll be able to read the raw flux data and then you can convert that into like an archive of your floppy disk. So the good news is that the pinout I have is working. And so some of the things that I've been working on is the web meat of the hardware. So one thing is that I initially had this setup for SDIO interface, but I actually went out of pins and I needed a couple more pins for some of the stuff I wanted to do. So I decided to make the micro SD card back to like plain SPI. And that means it can share the SPI port with the display. So not only do I save the SDIO two pins but I also save the extra two pins from the display as well. So that's like a couple extra pins. And what else did I do? That was kind of like the big save of data. And then the second thing I did is the floppy level shifter that goes from 3.3 volt logic to 5 volt logic using the 74 LVC8T245, which is a bi-directional level shifter. There's a floppy direction pin that basically determines are we going to read and write from a floppy drive or are we going to emulate a floppy drive? Because we're like, you'd obviously have to have all the pins exactly opposite. If you're emulating, then if you're interfacing. So that's floppy direction. But then I had this thing of like, well, which is the safest default value? And then I was like, you know what? Actually, what I should do is just disable the interface bus completely until I know exactly what software, the software wants me to do. Because if I want to be emulating, there's a risk that like, it'll pop into a mode that, you know, collides with the floppy drive. And then like, if something could theoretically get damaged. So the easiest thing to do is just to have a floppy enable pin. So I added, I added that floppy enable. So by default, I'm going to disable both of those level shifters and I won't be either writing or emulating. And then whatever the firmware wants me to do, it'll like turn into that mode. The next thing I wanted to do is, well, it's kind of a two-pacer. So this interface here, this is, there's two floppy disks here because one is the 34 pin standard interface and the other is the floppy interface. And this is the, sorry, the laptop floppy. Laptop floppy doesn't have select pins because you only have one floppy drive and a laptop is you don't, you don't get to select different drives. You only have one and then there isn't like an end use pin. So they have a couple fewer pins. Most of the pins are the same. And the next thing I wanted to do is not just support the MFM 34 pin floppy, but the GCR Apple floppy interface. And so the Apple floppy interface, you know, which we actually have some code for. So again, let's go to the overhead and let's, well, let's show this off because I'll show the difference. So this is your standard 34 pin connector, two by 17, and then here's the power five volt ground. And then this is your connector for disc two. And this is a disc two drive, which I've opened up here. Let's see, nice Apple logo. So this connector, what's interesting is the guts of the floppy drive for the Apple disc two is the same as a five and a quarter. It's the same like Shugart interface, but to save a little bit of money instead of having on the floppy, the 34 pin interface, what we call motor and select. So, and can you go to the computer again? Oh, can you go to the computer? Oh, sorry. Hi. There's like so much floppy. So on the 34 pin floppy interface, we have density index, motor and direction and step. And so, you know, it's much simpler. You just say, hey, step, step, step. And also there's an index pulse. But on the Apple too, to save money, they removed that motor interface and they just implemented it directly. So instead of step and direction, which some people, if you use a step or drivers nowadays, you might be familiar with like the trinamic interface which is, you know, step and direction. They just exposed the three phases, sorry, the four phases. So you'll actually have to like step the motor by hand if you want to move in and out. And then you still have read data, write data, write protect and there's a drive enable and write request. So this is not too dissimilar from here, except there's no track zero. So I guess, I think that's another thing they removed. I think it actually just like keeps going until it hits and then you like make a noise or something. And it's just like, it just keeps stepping and then the step of motor, I guess, doesn't get damaged. You just step in. So we don't have strax zero and we do have Rw gates. I think that's write protect or write request. And we have read data, there's no side, sorry. There's no side, it's very simple. There's no, yeah, there's like only read data, write data, write protect and enable and then write request. The, you know, there's no ready, there's no track zero and there's no index. So it was much simpler. It was much less expensive because they didn't have to interface, it created all these interface signals. So the good news is most of the signals I can reuse but I still need to have those four phase signals. I think I can reuse motor direction and step because those are and maybe, let's see, because I have to ask for the right direction. So, oh, so I can think I can reuse density because that's not used select motor direction step. So I do have four signals that I can use, so that's good. But one thing that is, we might want to add is the ability to do index detection. So I forgot to grab this. So, and this is actually useful for non-Apple floppies as well. And we wrote a guide about this. So, some old computers had the ability to use because they didn't have the index signal. And if you look here, look at this image. This is the index hole. And if we, maybe I'll show really fast. Maybe we'll go to the, let me get this going. I'm assuming this has an index. Well, this doesn't have an index. Hello. I'm checking if this floppy disk has an index pin. This might have been, oh, weird it doesn't. Oh, no, it does. Okay, it was like, it's weird. Okay, so go to the overhead. Go fast, I'll show the index. So there's a hole punched in this floppy, like literally, there's a hole in the casing and then there's a hole in the floppy itself. And that's the index pulse. So when this disk goes around, there's a little optical sensor in, not the Apple II drive, but in your standard five and a quarter drive that detects it. But this is a single-sided floppy. If you see here, single-sided. But there's no real reason that it's single-sided. A lot of floppy goes, the material's on both sides because it's like, it's just made on both sides. So you could use the opposite side, but the problem is that now you're looking for the sensor signal here and there's no hole. And some people would literally cut a hole in the plastic, but you have to be careful because you couldn't cut another hole in the material that uses, that's the magnetic material. You had to keep this whole, you can't have two of these, you only have one of these. So you have to remove the magnetic material. You have to open this up, remove the magnetic material, punch a hole exactly in the right location and put it back. Which is a lot of work, but maybe when the floppy disks were like 10 bucks a piece, it's worth it. All right, so let's go back to the computer. I'll wrap this up. So these are called flippy floppy. So this is like a visual demonstration that you could remove and replace it. And the reason you could do this on some computers, including Apple too, is because there was no index pulse. So they were never looking for that hole. And so if you're not looking for that hole, it doesn't matter if it's there. It's also used for some copy protection and stuff as well because you can never quite tell exactly where you were. But we'll get into it in more detail later. So you can't, you know, you don't want to punch a hole. So what you do instead is, this is a funky idea. What you do is on the drum of the motor that rotates, you would put this black tape, like actual tape, and then you leave a little gap and then you have an optical sensor that will look for the gap and will send a signal to the floppy controller and let it know that like this is when you circled around exactly once. And now it's not gonna get exactly the same location as that hole, but like it doesn't matter. As long as it's like a consistent rotation, it doesn't matter where that hole is. That makes sense because the floppy controller will like usually take all the track, especially if you're reading data from the floppy disks for archival purposes, you're gonna read two tracks and then you stitch it together, which we'll again, we'll cover later. All right, so that's also gonna have to be added. So I'm kind of like, you know, here's my Apple II connector and I'm probably gonna like put it over here and then I'll maybe shove this over here, but I also wanna add that sensor. But the issue is I don't wanna have something complicated like this where you have to like solder or resistor. I wanna have a very simple breakout board. And so I have to find an optical sensor that will do the job and that's what I'm gonna do for the great search. Well, a great search brought to you by DigiKey and a free user power of engineering to help you guys find the things on digikey.com. Sometimes seem to look for things that she's looking for. Yeah, but usually, I mean, I use DigiKey a lot. So this is what I, this is what I, today, actually today, this is what I was looking for. All right, so I was just talking about how I'm going to make a interface into an Apple Disk II drive. And the Apple Disk II drive was a low-cost version of the Shugart five and a quarter disk interface. And to make it low-cost was not Amanda was who's friend of the fruit, but Steve was the echo. We started Apple. What he did is he removed a lot of the drive interface that would add cost. And one of the things that he removed was the index sensor. And the index sensor tells you when you've rotated around one point. So as I was just showing off because this video is cut, I'm gonna cut it quickly. You can fake an index sensor by having some black plastic on the spindle, the motor that goes around. And using a optical sensor as shown here, you bolt it on and then you look for that gap. You just have to have something that it looks for. And as long as it only happens once per evolution, it counts as an index sensor. And then you can tell when your data begins and you have a marker for the beginning or end of the flux data coming from the floppy drive. Because otherwise the thing is that the rotation isn't consistent. It can vary. And so there's no way for you to know where to stitch the data unless you know exactly where the index is. And so like having that, like I did one rotation is really, really valuable. Otherwise you're like, it's like you don't know. Like did I do one rotation or one and a half? Very hard to tell. And also you might wanna also read the data consistently indexed to the index pulse, track to track, which is a security system that was used in Apple to floppies to prevent piracy. So one thing I was looking at today is, I wanted to have a breakout board that would make this easier to mount than the setup because there's like a little bit of like this kind of free wire soldering and then like, oh, there's like a wire here and a wire there and like three wires and then maybe you have a switch as well. And so I wanted to make it easier. I wanted to have an easier to mount version of this sensor, which I love the sensor and everything, but it's not easy to use. So what I want is an optical sensor. I'm gonna use optical because I find that it's a lot easier. The magnetic sensors, it's like, it's kind of risky. You have to put a magnet and then let it use off. And then it erases your floppy drive, your floppy disks. And so I want to be able to integrate all this onto one disk drive, onto one breakout board for the disk drive. And so what I want is a light sensor like this one with a transmitter, there's an emitter and then a receiver and then it bounces light off and then it gives me an analog or digital signal back. And ideally it would be surface mount and ideally it would be right angle because I wanna have the PCB and then I wanna have the sensor coming out like this for easy mounting, right? I would bolt the sensor, PCB, I wanna be fine, like this. And then the sensor would be pointing out, like in the plane of the PCB. Sure that this is actually a little bit more difficult than I thought, but let's go to the key and see what we can find. So I want optical sensor, optical sensor. Lot of options. So there's photo interrupters, slot type. That's not what I want. A slot type is, well, I'll show you. It's the same idea, but it has the emitter and detector on opposite sides of a slot, which is great if you have a disk that's going through but I don't have a disk I'm trying to reflect off of the drum. So while this has the right idea, it's not quite right. There's also a couple, there's two kinds of versions of the reflective. There's photo detectors, but I think that these, yeah, this doesn't have the emitter part. So this is just the detector. And so I don't want that. I want something that's integrated that has both because this assumes that you have some other emitter elsewhere and I wanna have an all in one thing. So that's a different thing. So what I want is again, not the slot type but reflective and analog output because that's basically the sensor I was using before except that version was like panel mount or it was like solder type. So I wanna look for active. So let's look for active. And a lot of the other settings I don't really care about like the current or the DC-4 or the voltage because again, this is all gonna be at low voltages anyways. So everything is within reason and I can always add an op amp if I need better signaling, leveling, whatever, a potentiometer. What I really want is surface mount if possible. So let's look at surface mount. Not a lot of options, which could be good or could be bad. And then let's look. So this is very cute. You can see the emitter and detector but this is pointing up. You can see it's meant to be soldered and it points up. Ditto points up, ditto points up, ditto points up, points up, up, up, up, up. I mean this one's like super cute, right? It's got the two little LEDs but again, pointing up, pointing up, pointing up. So I looked through all of these because there wasn't a filter for right angle and that turned out I actually couldn't, I mean this one is not actually surface mount. I mean it's axial, not surface mount. But of other versions that were available, I did not see any that were right angle. It was kind of a bummer. So sometimes you don't find exactly what you want. So let's get rid of the mounting type. That turned out not to work out. And let's do, if you can't do surface mount, at least do through hole. Because I don't want chassis or panel mount because that's what I had before and that's like even more impossible to connect to the PCB. At least with through hole, it's like I can, you can solder it somehow. And let's just get rid of marketplace for now. Just slowly looking at stuff that stopped. And then actually like what's funny is like, okay, like this one, I actually seen this one. This one's cute through hole clips in but again, vertical style. And then this is also vertical style. You see the two LEDs pointing up, pointing up the two black bars or the emitter and reflector. This is the one that I'm trying to replace. Ditto, ditto, ditto. But, you know, what's funny is like I looked around and actually the best option was the first one. I kind of like flipped through these because again, there was no real filter for right angle style. It was like, you know, you're expected to mount these however you want. But it turns out this one, the TCRT, sorry, it's not getting over this cold, was like the best option. So if you look at the data sheet, it's available in two kinds, but this one will actually do the job quite nicely. It's through hole, but like, you know, we'll solder it and have the legs come out and clip them. And it's very simple. It just has the LED on. So we'll have a, you know, resistor and then the photo transistor that we can have is the signal input. And it's pretty easy to use. And it's perfect for bouncing stuff off. And looks like, let's see, the distance it works at. This is the ratio collector emitter distance. You know, it works best at one millimeter, like very close, but it'll work up to like three or four millimeters. It looks like even up to six millimeters. It's actually quite nice. Like it's exact, you know, that means I have a little bit of space for the mounting. Let me show the mounting now. This is one second. You can see the mounting is actually pretty close. It's a couple, a couple of millimeters. So we should be like totally good on the distance. And the otherwise the signal looks good. So I like this. Oh, it looks like they have a, oh, they have a version that's like bent if you want to have it like pointing that out, you know, up after all, but just make sure that you, I'll get, I'll make sure I get the version that's vertical style. The good news is that there's lots in stock. Sorry, this is the footprint of the Vichier TCRT 1000, 40,000 in stock and they're like super cheap, 50 cents a piece. This is the sensor I'm going to use and I'm going to now design a PCB that will be able to mount on a standard five and a quarter drive or an Apple drive and give me that reflective pulse for the index sensor. That's the great search. All right, thanks so much everybody for joining us this Sunday evening. We're going to watch some superb owls maybe. I don't know, something like that. It is. Yeah. All right. And we'll see everybody throughout the week. Thanks for joining us. Later, buddy. Bye everybody.