 I have a new parcel and inside this parcel there is an $18 oscilloscope. What we have here is a Fnersi DSO152 battery-powered pocket oscilloscope. These are available for about 20 francs, euros, dollars from the usual sources. They're currently doing a bit of the rounds of the YouTube channels and I saw them and I thought they look cool, so I decided to get one and have a look at it and I have to say I am honestly quite impressed. It's small as you can see but it is surprisingly well made, solid feeling, it doesn't feel cheap, it's quite heavy in the hands, it's limited in functionality of course but I am not actually interested in this as an oscilloscope in any way because I have a much better actual oscilloscope but before I take this apart let me give you the tour. On the top we have the screen which is covered in hard plastic. It's a bit of a fingerprint magnet but it looks pretty good. You've got a power button and four rubberized control buttons for the user interface. On the top we have a 1D joystick for controlling it, it does up down and press. We have a connection here for the calibration signal which is just a simple square wave and here we have the probe connector which is this cute little coax thing. It actually feels pretty nice. There is a adapter you can get for it to let you connect it to full size BNC stuff for using real probes but for reasons that will become obvious later, I didn't bother to get that. On this side we have USB-C, it's USB-C and the data lines are actually hooked up although the oscilloscope doesn't do anything with them. The other side is a blank so here we have the pop-up stand for standing the thing up. As an oscilloscope it's okay, I mean you get what you pay for and you didn't pay very much for this. I have a simple signal generator here so I'll just power that on and you can see the two tracers for the little scope here and also my proper regal and if I adjust the knobs, that's amplitude, that's frequency, you can see it's actually decently responsive, it updates pretty quickly. Control-wise you use the little toggle here to move the cursor. There are not very many options. If I put the cursor here I can move the whole thing up and down very slowly. This is the wide range. This lets you change the times 10 attenuation for using a proper oscilloscope probe. The probe I got with this is just a couple of crocodile clips so that's set to times 1. We have, oops, put that back, we have the timebase. It goes up to 200 kilohertz which is not a lot. That's not really useful for doing anything microelectronics-wise but for anything analog related it's okay. We have the AC-DC decoupling. This is currently set to AC. If I set that to DC we get a big offset which is correct. This is this signal generator offsets everything to about plus 9 volts so if we change this we can see there is the signal and we can actually do the same on the grigol. If I change that to DC and adjust the trigger position there we go and let me adjust the trigger accordingly here by moving the right hand cursor very slowly and there we go. You do get positive versus negative edge detection for sync which you adjust by, nope not that one, by doing that and there's a little icon there to tell you what it's set to. You get automatic mode where it runs continuously but only when it gets a trigger. If it doesn't get a trigger it's got a bit of a tendency to just like stop dead. You get normal, no idea what that is. The manual is very little use and you get single where it takes a sample every time you press the run button. You put that back to auto and then I need to press run and it set it running again. It's got auto range selection although the last time I tried it the firmware crashed. When I first got this I thought that it was broken and it was just going to be complete junk because I couldn't get it to produce any sensible results at all. Turns out that there is a calibration procedure you have to go through which the manual doesn't say is compulsory but is compulsory and I tried the range selection before then so let me just try that and see if it still crashes. No, it actually picked something relatively sensible, not bad and that is basically all there is to it. It's a very very simple device which is not a bad thing. If you were doing audio stuff, car stuff, that kind of thing I think you'd be fine with this but as I said I have a far more capable Rygol oscilloscope. Instead I have other things in mind. What do you do with interesting pieces of cheap technology? You take them apart of course. It was commendably easy to open with a nice solid chassis and proper screws. Anyway here we are looking at the PCB and there's not a lot on it which is a good thing really. Here we have the USB-C connection and I bet this is the PHY and power controller and charger chip. Here we have the connection for the lithium battery which does say on the outside that it's a thousand milliamp power 3.7 watt hour job. We have a sort of glue chips here but over here is the bit that I'm interested in. I have actually seen this torn down before because if I zoom in a bit further and tilt it a bit the lettering shows up and it is in fact a CH32F103. That's an arm. It's a really well understood and cheap arm and what do we have down here? Well there it says SWD. This is a debugger interface. This is an arm processor with a debugger interface. There must be something interesting I can do with this. The CH32F103 is one of a line of microcontrollers by WCH also known as wind chip head although I've never heard anyone call them that. In Chinese that WCH made the press last year for producing one of the cheapest risk V microcontrollers ever which was also a CH32. That was a CH32V model. This is a CH32F which means it's an arm model. This is in fact a straight copy of ST Microelectronics ubiquitous STM32 which is a cheap capable microcontroller that you find everywhere. I have like this is a generic blue pill even though it's black based on an STM32F103 the same chip that this is although the ST Microelectronics version. I have lots of them. They are super cheap but this is a good thing because it means that any software that runs on one of these should run on this. This particular model has 20k of RAM and 64k of flash. There is a built-in bootloader which is capable of starting the system from SPI flash but I don't believe that this is set up for it. The data sheets are already available there's Arduino support etc etc so I think I have a good chance of doing something interesting with this board. However the first thing that needs doing is of course to solder some pins onto the debug port so that I can actually you know do something with it. So there we go. Soldering the pins on was trivial less trivial was cutting the slots in the case so that I can put it back together and still have the pins exposed. So that should be all the electronics changes I need if you can call that electronics. The only thing to do now is to hook it up to my cheap and nasty ST link knockoff plug it into a computer and see what happens. I have good news and bad news. The good news is that hooking it up to the debugger was almost insultingly easy. It did require me to figure out that what I had bought was not a knockoff ST link clone but was in fact a knockoff Sega J-Link clone but luckily I had a ST link in the back of the cupboard so here it is. So now all I have to do is to go over to ST's clunky software and press the button. And there we go. The debugger is now attached and we're looking at the contents of the flash. So if I go to not that one no I don't want to fill memory read all we then come to the bad news. What this has done is it's read the entire 64k flash of the oscilloscope which if I scroll down you can see is mostly empty. This is because I managed to wipe the oscilloscopes flash by accident. I was hoping to dump the flash in order to reverse engineer the firmware and figure out how all the peripherals worked. Unfortunately the flash on the oscilloscope was read protected which meant that I was unable to see it in the debugger. Real ST STM32 have a bunch of bugs that means it's easy to get past the read protection but it looks like the CH32 version has those bugs fixed and while I was fiddling with it I accidentally pressed the wrong button in pizza software and it reset the read protection and at the same time wiped all the flash of the device. So I now have a completely blank device apart from this stuff at the top which I wrote and no idea how any of the peripherals work. So I am going to have to figure those out the hard way but back to the good news again I am capable of writing programs to the oscilloscope and they work which is nice. I am using the Arduino software for this because life is too short so I shall just fire that up and demonstrate. Here's the Arduino IDE. On the device I have hooked the oscilloscope up to the calibration output from the oscilloscope. This normally produces a square wave signal and they've implemented this in the cheapest and easiest way possible which is to just hook it up to one of the pins of the microcontroller and the microcontroller makes the pin oscillate in software or more more likely using some kind of PWM feature of the microcontroller. So I have traced which pin that is and it is A0 so by slightly tweaking the traditional blinky example in the Arduino IDE we should just be able to press compile and upload. Uploading is quite slow I've seen reports that the CH32 is very slow to flash using standard STM32 software and that if we use CH's own software it's much faster but anyway there we go and you can see on the oscilloscope that the output is oscillating up and down once a second. So that proves that our program here is executing and that we have at least one working output pin. So the next thing to do is to try and figure out the pin mapping of the microcontroller and see if we can actually make it to do something a bit more useful. We do have this which is very handy if I can hook this up to like serial output we can get logging. But I think the next thing I have to do is to try and analyze the PCB to figure out what is hooked up to what. It is about a day and a half later and I have successfully mapped quite a lot of the board. The way I've done this is by sealing a trick from BigClive.com. I photographed the board in as high resolution as I can manage both top and bottom. This is the top you're looking at. This is actually three images stitched together which is why there's these seams and it's not actually stitched together terribly well but it's good enough. The back of the board I flipped horizontally which means I can overlay the top and the bottom and all the components line up. If for example we find a trace for example this one. I believe this is something to do with the power circuitry I'll get on to this later. This runs down to this via here which takes the signal to the other side of the board. I can then flip to the other side and here is the signal coming out of the via. We can follow the trace along. It goes back into a via here over to the other side of the board and here is a transistor that is used to do some of the power control. I believe that this is the thing that actually turns the microcontroller on and off. The power circuitry is still a bit of a mystery. This was all somewhat harder than it should have been because Fnersi in their wisdom have decided to paint the board black over the top of all the tracks meaning that it was really hard to actually get a good picture which is why the lighting is all weird and stuff is over saturated but it's good enough. Some parts of the board I haven't bothered to look into for example all this stuff up here is the analog side of things. I don't think it's particularly complicated but it's just not something that I want to look at at the moment. I believe the signal comes in through this brass connector. It gets routed through various amplifiers and attenuators. This top chip is I believe an op amp. This bottom one is an analog multiplexer and then it gets fed into one of the microcontrollers analog to digital converters but the bit I'm actually interested in is the screen and of course the buttons. The buttons for trivial to figure out like this via here is connected to one of the buttons. This one. So all you do is follow the trace and there it is K2. The screen was a bit trickier. The screen is connected via this 40 pin connector. There are a number of pinouts for these 40 pin screens. However I managed to track down which one it was so these are as far as I can tell the correct pin names. The problem is that this connector and the actual microcontroller on the other side are quite big and the tracks run underneath them and obviously I have no idea what the tracks are doing inside all this. So here is a thing. This via gets routed down and I lose it under the board. What pins is it connected to? I could scrape the solder mask off the top of the track and beep it out using the multimeter but what I did instead was to make an educated guess about what was connected to what and then I wrote a program for the microcontroller which simply sends pulses out along one of the pins and then I can use the oscilloscope to probe the LCD connector on the other side and figure out what goes where. The screen is connected via a rather unusual 16 bit parallel interface so all these DBs are the screen's data bus. You can see that the screen is occupying about half the pins of the microcontroller. The actual oscilloscope side of things probably only using about four. It's this parallel interface that lets it update the screen quite so rapidly because there's loads of bandwidth. Screens for these kind of devices are normally connected via SPI which is a serial protocol where bits are sent one at a time. With this it can send data you know 16 times as rapidly. The other two major bits of functionality that I need to know about is the power control. Power comes into the board through the USB socket. It runs through this chip here which is the lithium battery charger. The lithium battery is connected to this connector here. There are these transistors and this stuff down here which I believe have to do with turning the microcontroller on and off. Now the actual power button is this K7. You can see this is the back of the board therefore the label is flipped. We can follow the track over to this via here. Flip to the other side. There's some stuff. These all appear to be diodes. There's a track that runs through here to the microcontroller to a pin which I've labeled power button. I believe that the way this works is that when you press the power button the microcontroller comes on briefly. It then decides whether the user is actually intending to turn the thing on or not and it then sends a signal down this track which goes through this via here and ends up at the transistors. I think what this is doing is that you press the button the microcontroller wakes up briefly. It latches the power on by turning one of these transistors on and then the thing stays running. But currently I am powering it through the debug connector. This V pin is connected directly to the microcontroller's power rails and because this is basically powering it backwards none of this stuff works properly. The last and dullest bit of functionality are these two pins here labeled USB. These are connected to the USB-C socket data pins and they just work. I didn't have to do anything. I just told the Arduino SDK that I wanted USB support and it just worked. I was both slightly disappointed it wasn't more interesting and glad that I didn't have to debug USB stuff. Now that I know the pin assignment of the microcontroller and what's connected to what regarding the screen I can after a really irritating amount of programming do this. Okay it's not very exciting but it does demonstrate that I'm capable of initializing the screen and writing to the screen's video memory. It is dead slow because currently it's writing one pixel at a time. It needs some acceleration functions but it works. So I have the USB working. I have the screen working. I haven't demonstrated that the keyboard works but I don't think that would be very difficult. I have enough functionality to do something interesting with this thing now. The only question is what? And so here we are. So if I rotate this thing to portrait mode, prop it up on this handy I key so that it's visible on the screen, plug in the power and we have breakout on an oscilloscope. Now I did not write this. This is written by somebody called Enrique Alberto I believe. I pulled it off a Arduino software site and crudely ported it to work with my equally crude graphics driver, adjusted it to work with these buttons rather than the original touchscreen and it just works. This is currently running at 300 frames per second. I had to slow it down to make it playable. This particular chip runs at 72 megahertz. I don't know what device the game was originally intended for but here it is. It's not a very complicated game but it should at least demonstrate that the device is now functioning and programmable and capable of doing non-trivial things even if I can't seem to make the ball go in the right place. So that's the project. There's still stuff to do. Figuring out the power circuitry. Currently the battery is not plugged in. This is being run entirely from the debug port. Figuring out the analog circuitry which is moderately complicated. There's various things you can control to change the analog stuff. I don't do analog so I don't know anything about that. I hope I've demonstrated that this is a decent capable and very hackable little device. The hardest part of the entire project was soaring the slot for the debug cables here. In terms of things to do with this well it's a bit lacking in spare IO pins. Any potential project is going to want to use USB for IO or the single digital output and the single analog input. So I can imagine using this as a USB attached control panel. It's got the buttons for it and the screen for it. As a data logger. As a simple logic analyzer. You know plug it into a serial connection and see the text on the screen or even and I know this is a bit of a stretch. As an oscilloscope there is a project called buck 50 that turns the SDM32F103 into a 1 megahertz remote oscilloscope. So there is at least the possibility of a replacement firmware package for this thing that gives you higher resolution oscilloscoping than the stock firmware which was only 200 kilohertz. One megahertz isn't really enough for microelectronic stuff but it's certainly better than 200 kilohertz. I should point out that the stock firmware does actually allow over the air upgrades without needing the debug modification. Use fire it up with various buttons pressed and it turns into a USB stick. Plug it into a computer via the USB port. Copy a file onto it and it reflashes itself. Anyone who's used an RP2040 will know all about this. However, FNRC haven't actually released any firmware packages for this thing yet and since I managed to trash the stock firmware I can't investigate this anyway but this does open up the potential for flashing a custom firmware on it at least once. Of course if you trash the over the air upgrade stuff you're stuck with the debug port for unbricking it. It's a shame that there aren't any spare GPIOs because being able to plug this into peripherals you know like a SD card would be really useful. The only real option is to reassign the two debugger ports here which can be done but is pretty risky because once you've reassigned them to be GPIOs and not the debugger interface then of course the debugger doesn't work anymore. This means that it's potentially possible to brick the device. A real blue pill has jumpers. These pins here seem to have lost the jumper of that one which allow you to put it into emergency bootloader mode for unbricking it but on this the appropriate pins are hardwired so if you did brick one like that it would require you to modify the board to unbrick it and I don't want to do that. So anyway that is the thing. I hope you found this entertaining at least. I'm going to upload the code and the pinouts and so on to Github. Go look at the YouTube description for that information. If anyone does anything cool with one of these please let me know. Be really interested to see. But anyway that's it for now. As always I hope you enjoyed this video and please let me know what you think in the comments.