 nice new brother wp-1 word processor. I could connect the Raspberry Pi up to the UART. I am actually going to take the time to write a whole new terminal emulator. Okay, I think I'm going to call this relatively complete. I mean there's more little bugs to fix, but I don't think I'm going to do those on video because it's just not very interesting. I do wish I had hardware flow control. Also the one thing I haven't done anything about is italicite, underlined, and bold text, and of course reverse text. So I'm wondering what I can do about that. I am going to do some experimenting and then I will come back and report. I got a parcel. Let's see what's inside, shall we? Being careful about exposing my address because I really don't want to have to go through and fix late stuff out. Okay, what do we have here? This is, well as you can probably guess, this is a PCB. Indeed you can actually see it's a PCB through the plastic. This is the first time I've ever had a PCB made so I don't know what to expect. Apart from a lot of smell of plastic. Well, super nice. Probably all wrong but it looks super nice. And surface mount components, hopefully correct. This is, if it works, the actual quote production version of that big tangle of wires that is now no longer on my desk. So we've got here the brother PCB. This will push down onto here of our connector. The, where did I put the, so the Raspberry Pi goes on here. This is the wrong Raspberry Pi. The right Raspberry Pi goes on here and, wow, the footprint actually lines up. That's amazing. And this, the PSO interface board, goes on here, upside down. Now there's actually need to be enough space. I made an estimate as to the amount of vertical space but. Okay, well, let's do a little bit of testing. I think. Oh yes. Before we do anything else, let's see what else there is in our bag of goodies. Well, five of these because you can only make five as a lower limit. You can have two assembled but given the small number of components it actually costs something like 50 cents extra to have all five assembled. So I now have quite a lot of these. First that'll be useful if it dies. I was wondering if I would also get the solder mask stencil. I've never seen one. This is, I believe it's a sheet of plastic that goes on the PCB with holes where all the surface mount stuff are, is whatever. As you see, I labeled most of the pins but like an idiot, I didn't label the power pins. That's annoying. I do know that ground is down here and five volts is up there. So if we turn this over, we've got, actually there's an actual power connector which is labeled. I tried to put as many pin headers on as possible. Here we go. Five volts, 3.3 volts and ground. So we have, are we powered on? Now we're powered on. All right. So this is ground and this is five volts. We have a red light. Good. That means I got the diode the right way around which is always a bit of a surprise. Let's turn the voltage down to three volts and we've got ground and this one is 3.3 volts and the other LED comes on. And it looks like I calculated the resistances roughly correctly which is nice. Okay. Well, that shows us at least some of the wiring's up to scratch. I think the next thing I'm going to need to do is to put some pin headers on this thing. Yeah. Just thinking about vertical height. Well, I know that these and these need to have pin headers so I'll do those first. I'm still thinking about this one. All right. Soldering time. That was more annoying than I expected but then it always is. Apparently I am running out of these pin sockets and I'm going to have to order some more. So I had to do quite a lot of careful shaving to let me connect up multiple sockets in a row. Anyway, if you bring the motherboard over, this is supposed to push on here. Actually, I will do that bit last but anyway, this, the PSOCK board plugs on here. I have not soldered up these four because I would have needed to shave another set of headers and I was running out and I couldn't be bothered. The Raspberry Pi pushes on here like so and I need to figure out those bolts. That's actually looking pretty good. Now this then connects on here like so. The control lines which come from the sockets here will then need to get wired up to here. We also need to wire up the reset switch and the power switch. Five volt comes off the board here through the connector and is then used to drive the PSOCK board and the Raspberry Pi. The Raspberry Pi's 3.3 volt regulator is then used to drive the conversion electronics which are on the bottom here and also energize the two LEDs. The power switch connects five volts up from here to the Raspberry Pi and it now occurs to me that I completely forgot to put the PSOCK board down to dream of the power switch so that will always be powered up. The other connectors on the board are for other things that I was, I tried to put as much as possible onto this board because these things are not cheap to make. I think I spent 30 odd francs on these five boards which is only six francs a board which is fine but I needed five of them and more importantly about two or three weeks delivery. So I'm hoping that these will last. I spot here I actually routed those tracks too close to the standoff for the Raspberry Pi and there's no solder mask on them. I think they're all right but yeah so mark two of this board and I'm sure mark two will be necessary we'll have to have that fixed. So anyway the first thing I'm going to do is to take this off again remove the electronics and then we're going to power the bare board up from the brother and see if the various pins are all showing the right voltages. So we've got power wires let me just hook up the okay we're off set the voltage to five volts set the current to let's go for 200 milliamps there's no floppy disk attached so that should be okay and power okay need more current 300 okay all right and I can see there is a led on under there which is good that means that zero and five volts are more or less correct on the brother I haven't bothered to hook up any of the uh I haven't bothered to hook up the screen so we stick this somewhere where it's readable try and disentangle the wires we'll do okay put that on zero and we should be seeing five volts on one side of the power switch not that side not that side either we're doing this right five volts okay so the five volt line should be up here somewhere five volts power five volts there we go there's my five volts so that should be going to I think it's this pin no one of these pins for the Raspberry Pi this one is 3.3 so that should be disconnected which it is I thought I need to I need to get the pin out honestly oh of course I'm not getting in voltage here the power switch isn't connected up okay let's ignore those for time being right now we've got the p-sock I think this one's power it is and ground I think is opposite no it's not not luckily everything's labeled and we have this way up so ground is this one zero power okay that looks plausible so let's power the thing off and the elegy goes out and plug the thing in let's turn this over so that you can see the backside right that was overcurrent presumably because the p-sock is using more I would expect the light to come on actually that's oh of course the p-sock doesn't have a power light it only has a status light and the current software loadout doesn't actually light it up I should probably change that and d1 is lit quite brightly I could have bumped the resistor value up a bit there I'm just wondering at what point do I decide to hook up the Raspberry Pi first I have to wire these up and I've forgotten which one is which so I'm going to have to go figure that out and I need a power switch I have some switches here that will do there's a couple there's a pin header because I had a switch here that will do all right so I've got it all wired up the control lines are hooked up and hopefully the right places I have hooked up the video here and put a nine pin sub d here this should let the p-sock translate the video into mda which I should then be able to route through my ossc hopefully you are seeing on screen now I do not have the Raspberry Pi hooked up because I am not a complete idiot and I've got the keyboard so let's hit the power button and see what happens that was my power supply complaining because it drew more than half an amp trying to remember what it drew last time I think it was actually quite a lot particularly with the floppy drive connected is it that much turn it up a little okay and oh good grief it worked huh I was honestly not expecting that I thought it was going to fail miserably so this is actually booted into the onboard software because I don't have the Raspberry Pi hooked up yet but we've got a relatively decent video I'm afraid I still got capture problems so it looks kind of clunky yep the onboard beeper works which is nice huh well oh yeah let's just try the reset button which is bodged in here perfect so I think the only thing remaining to do is to hook up the Raspberry Pi and the floppy disk drive I'm actually quite nervous okay we have the floppy disk drive we have the Raspberry Pi power switch is off hold down control Q and hit the button okay I expect this to use a lot more current because it's now has to well it's not powering the Raspberry Pi yet but there is a lot of surge in rush from this thing so let's try it at 800 milliamps or not I'm trying to think it was a wasn't amp reasonable for last time yeah that's time the rubber band is still dodgy yeah it's hitting 900 milliamps so let's just crank it up one more notch okay so hold down code Q and boot right we're now into the terminal so moment of truth time oh yes you can see a red light there watch for it to get brighter when I press the switch not what I was expecting but let's try rebooting it okay well I expect the Raspberry Pi yeah I can see the lights in here is it doing anything well the fact that the lights are on in the Raspberry Pi itself and that we've got an extra light here suggests that the 3.3 volt regulator in the Raspberry Pi is working just fine the fact that we're not getting anything coming out here suggests that I may have got my level shifter incorrect okay let's just power cycle the Raspberry Pi yeah turning the Raspberry Pi on causes the brother to reboot I'm also not seeing any flashing lights in the Raspberry Pi as it attempts to boot so let's try plugging the SD card back in also the it's all getting quite heavy so I should really oops I haven't soldered this connector on yet it just pushes into place there's plenty of friction I need to design once I have it working I'm going to design and 3d print a outer well a a complete cartridge with supports in it for going into the brother's case okay now that has plugged in this is turned on so all I need is power and boots do I get am I getting flashing lights in the Raspberry Pi yes I am the Raspberry Pi is booting and we should start seeing output soon if it's going to work that don't look like it's working to me do I get I can't remember whether I get console output and unfortunately the HDMI output for the Raspberry Pi is facing the psox so that is inaccessible but I'll just leave it like this for a couple of minutes and just see what comes out if anything okay that's not working so I am going to power it all off without restarting the without shutting down the Raspberry Pi of course and I'm going to hook the scope up and check for some voltages I think well I've checked the pin out with the help of the schematic which I made and everything looks all right I've also soldered a capacitor across the 5 volt power rail over here in the hope that turning the thing on will not cause the brother to crash so let's give it a try with the Logic Pro which is this thing which will beep uh sorry which will flash lights when it sees logic pulses so it's really useful for watching for activity on things so let us power on okay it's booted now let's let's let's not do anything just yet so if I were to touch it to something that's doing something like say the clock line here you can see uh pulses lit meaning it's seeing pulses one and zero both lit because it's seeing ones and zeros so if we touch this to serial five volts tx and then press keys on the keyboard then nothing happens interesting they would expect to see more than that we would expect to see lots of activity on the various data and address lines as the brother is doing its thing so d zero yes i o e yes read yes right yes interesting so let's try this I did actually figure out how to do flow control that's only working in one direction currently from the brother to the raspberry pi which lets me run everything at 115 kilobord which is nice I didn't bother going in the other direction because the brother cannot send bytes to the raspberry pi fast enough but I am kind of surprised that we're not seeing anything here this suggests that the bus interface is not working now these are should all be hooked up correctly I double check this pen out too okay let's try turning on the raspberry pi and we should see stuff show up on the serial t on the low voltage tx line this is as the raspberry pi does its booting and let's hope it doesn't crash the brother when it does this maybe I need a bigger capacitor anyway it should now be booting there we go pulses this means that the raspberry pi is actually sending serial traffic so let's try that again I've turned it off let's try that again but looking at the rx line on the high voltage on the high voltage side this will tell us the pulses are being translated to five volts correctly there we go so my level shifter does seem to work this suggests that the problem is the bus shifter uh the bus interface in here so I think the only possible things that can be wrong given that it's running the same software on the same psoc board is uh that these aren't wired up correctly but kicad which I designed this thing with shouldn't let me get that wrong okay so all right let's turn everything off and plug all the things yeah I soldered this on now and let's just check the pinouts check the continuity okay actually I do wonder whether my shoddy connectors are in fact too shoddy okay well I'm just going to beep out these connections just to make sure that everything seems to be intact I think well that's annoying everything seems to be fine it's so much easier if it was a simple issue like that um I'm slightly wondering whether the problem is some of my implicit assumptions about things like orientation given that the board pushes down onto the brother mother board I did design the thing with this side here on top so I was looking down on everything that did require me to throw away and redesign the board from scratch when I realized I'd put the psoc device on the top but let's just do a few quick checks to see whether the data lines line up with where I think you see data's over here yes oh oh did I get these wrong I swapped reason right that's what's wrong okay so that's black and red so swap these two and let's get rid of the logic probe and plug this in actually I do want the logic probe and let's turn it on and see what happens I want to boot let's put the reset button is here okay so now if I watch the tx line and press a key ha ha look pulses it works it works let's power on the raspberry pi hold down control and q because of course it's going to boot the reboot the brother uh tell you what let's plug the raspberry pi in first shall we so we are off if this actually works I'll be astonished my first ever pcb working first time that's ridiculous okay power on the brother reboot the brother reboot the brother again and see what I see what happens okay that's kind of garbage that is actually more or less what I expect the flow control stuff I've put in only kicks in after uh you've after the you you log in the problem is I couldn't figure out how to run the command to enable flow control early in boot shut up so you've got to wait for the login prompt you'll get garbage before then as the raspberry pi is sending data to the brother way faster than the brother is capable of accepting it but not expect to see that that looks like terminus crashed to be honest let's try rebooting the terminal that's just powered down everything because with the raspberry pi running and the floppy disk drive and the psoc that hits over current protection let's put that up to 1.2 amps I think okay go now of course the raspberry pi is rebooting I thought I'd fixed most of the terminal bugs but that does not look fixed to me so let's just reboot the brother again while the raspberry pi is booting interesting I suspect that once the while the raspberry pi is starting up it's drawing a lot of current so let's turn that up again and have another go okay raspberry pi start up and garbage and restart the brother I saw the power supply spike at about 1.2 amps so let's just get return a few times there's a login prompt so this off screen okay so it does say configuring serial terminal at the end but we're not getting a prompt why are we not getting a prompt configuring serial terminal is produced by my script that runs a command what I got off github to configure the serial port it turns on flow control in fact I'd forgotten earlier that the blue led on the psoc board that's now of course on the underneath where you can't see it lights up when the buffer from the raspberry pi to the brother is full interesting see I am confused because it should be working there's enough in operation to know that we're getting serial communication from the raspberry pi to the brother and everything should be fine so I do not know why it's locked up at this point let's actually just probe a few voltages shall we let's just see what we're getting so this is five volts provided from the brother to the raspberry pi put this somewhere where people can see it 4.89 volts and this is the 3.3 volts generated by the raspberry pi from that five volts which is dead on as we would expect given the the raspberry pi is regulator so I think the raspberry pi thinks it's working unless it's drawn too much current which I doubt so unless the terminals crashed once more get there are the logic probe out I cannot say the phrase logic probe without thinking of a scene from Tron there will be a great meme to paste in here if I was willing to do copyright things okay serial five volts TX let me type right the terminal is running otherwise that wouldn't work so rx on the low voltage side yep pulses are making it across the border to here pulses yes wouldn't expect to see anything there rts is low so that cts on the brother side is pointing at rts on the pi side that's here which is also low this means that the brother is ready to receive data and cts on this side is pi meaning that the pi is not ready to read data that should end up here which is high and that should end up an rts on the the psoc side which is then being ignored because I haven't written that bit of software that should be here so the raspberry pi is not ready for data that's that's surprising that explains why it's not responding but why is that happening I think I figured out what's going on and the actual fault is trivial which is I've got cts and rts lines the wrong way around but the reason behind that is annoyingly complicated you see which one is which of cts and rts and of tx and rx for that matter depends very much where you're standing there are two types of serial device there's a dte a data terminal device environment dt something this is generally a computer or a actual terminal and there's a dce data communications something which is a communications device like a modem and dce's have these pins inverted relative to a dte so that you can compare like for like so that if you're connecting a terminal to a modem you just wire up the tx lines to each other the rx lines to each other cts rts and so on uh this is made slightly more complicated in the fact that I actually did manage to get rts and cts the wrong way around in my head rts is the output line cts is the input line on a dte of course on a dce it's the other way around now I have no idea why this all worked in my tangle of wires on the desk prototype but possibly I had managed to uh get the semantics backwards and also wire it up backwards therefore resulting in it working of course I have no records of what I did then so I know I've no way of knowing exactly what happened but the fix if I'm right should be simple which is I just need to swap the lines and luckily I don't need to modify the board because I added the extra uh level shifter and wired up the uh the cts line to the psoc I should just be able to reassign pins in the psoc and do it all in software so I'm going to give that a try and see what happens okay let's see what happens power on up code q power on and we boot the raspberry pi is starting up we get serial output we wait for it to get to the login prompt we keep waiting for it to get to the login prompt it's not the fastest booting device okay so let's just log in okay despite the message it has not configured the serial terminal it has enabled uh cts rts and the hardware but I need to turn it on in the tty with uh rts cts okay let's see what happens looking good let's try yes there's a bit of noise at the top of the screen but I can see that the blue light is on which means the buffer is full and we have a nice steady stream of wise with no noise fantastic it works took long enough okay I believe that this is now mostly finished I need to reassemble it in the actual machine I need to 3d print a uh plastic cartridge thing to fill the expansion slot that's got mounts for these switches and buttons and holes for these connectors but I think that all the electrical bits except for a custom harness for the video because I want to be able to route the video to the board so that I can get access to the mda output and also to the internal monitor so that I can actually you know see what I'm doing I think that is all done which is awesome so I think that this is going to be the second last video the last video I will hopefully be showing off the fully reassembled machine and I will walk you through the various fixes I've done to the serial terminal which are extensive and awesome so I will see you next time