Hacking a Fnirsi DSO152 mini oscilloscope to play Breakout
ฝัง
- เผยแพร่เมื่อ 25 ส.ค. 2024
- In whch yr hmbl svt buys a very cheap battery-powered oscilloscope, promptly breaks it, and then makes it do something stupid.
The Fnirsi DSO152 is a $15-$20 single-channel mini oscilloscope. Inside it's based on a CH32F103 processor, which is a copy of ST's STM32F103... and there's a header for a standard SWD debugger interface. Can I do anything with this? Spoiler: yes. It's essentially a Blue Pill with a high-bandwidth screen, USB-C, battery and charger, and some bespoke analogue circuitry attached. Reprogramming it is trivial, which makes it very plausible for repurposing for other things.
You can find the source code plus the huge gimp PCB scan on github here: github.com/dav...
I've since found that Fnirsi also make the DSO153, which comes in an identical (if blue) case and has higher resolution oscilloscoping and a signal generator. So, both input and output analogue stages. I can't find a high resolution image of the PCB but it looks oddly similar, although with a different microcontroller and a six-pin debug header. The UI looks identical so there's a decent chance it's another CH32, although a bigger one.
Out of curiosity, I just took apart my DSO153 and unfortunately they have scratched off the markings on the processor. It's a smaller 12x12 pin package and there is more going on on the PCB with a large inductor (maybe for the signal generator). It has 6 unmarked pin holes instead of the 4 debug ones on the DSO152. I can send you a pic if you're interested.
@@Nibb31 Bah, I wish people wouldn't do that... given the UI looks the same it's probably another STM32-compatible, and figuring out which debug pins do what is it the very worst a matter of trying all the combinations, and then it should be identifiable through the debugger. I found a teardown with microscope views here: th-cam.com/video/8_s7yX8SnX8/w-d-xo.html Maybe when I see the thing for sale on Aliexpress I'll get one.
Very cool to see it repurposed like this!
This looks pretty good starting point for open-source car diagnostic tool
One thought I had was whether it'd be possible to reassign the analogue input to a digital pin, to get higher bandwidth, and use it as a super logic probe --- you wouldn't get the true waveform but being able to show an actual trace could be really useful.
I honestly thought you were a bigger youtuber. The quality of your videos is so good! Also, you've got great music taste
Nice hacking there ;-) And thanks for mentioning the Buck50 firmware. That will give me something to play with in the coming weeks. I did once make an "oscilloscope" with an Arduino Nano, based on an article I found on a website. It did even kind of work, just not very well and I lost interest. It might be interesting to see how well or how badly a Bluepill will handle this task. I may buy the Fnirsi or something similar as well (though I do have a GW-Instek scope).
I skipped the diy arduionno scope and just bought the dso2512g, its about the same here but looks like it uses customs fpga's and achievs like 8megaherts instead of 200khz which i think is the only drawback of these off the shelf mcu's. I too got a few ch32f103's after playing around with the arduino and wanting to try something more powerful. I had no idea they were this powerful! cool stuff
This looks like an absolutely awesome first scope for someone like me, who would use it with Flipper Zero.
Running arm, exposed uart, easy to take apart, small and solid...
That fits literally every niche a device needs to go in my bag..
Be aware that the stock firmware _doesn't_ give you a UART (or if it does I haven't found it yet). And as I haven't found a way of dumping the stock firmware, once you've released it it's not an oscilloscope any more!
@@hjalfi Flipper should at least be able to give you access to the console to start decoding it. There's probably a custom firmware out there you could flash to turn it back into a scope
A few more games I would be tempted to buy one, well done !!....cheers.
Nice! Thanks for the amount of time spent and the details you put there. It's very encouraging to do the same on every gadget I have now. :)
Hey you made it to Hackaday
Awesome video. It would be hilarious if you could use the analog input connected to a function generator and depending on the waveforms the paddle is controlled hahaha est rube goldberg device ever haha.
Seriously though. Cool video.
I just got mine today and it looks great. I wish you could have gone into a little more detail on updating over USB. I cant get to connect to my PC (Win10 says it is malfunctioning). The instructions are not at all clear to me. What is a U Disk? A USB used as a storage (drive)? Pressing the pwr and and then the OK buttons in any combination of longs and shorts and holds still gets a Win10 complaint as soon as the USB is plugged in. Everything else works fine. I watched 10 or so videos on the DSO152 so far. I guess I will try to go to the company or the website community next.
Anyway, thanks for the video, very interesting though above my head on programming.
I never even tried to make the USB update work, as there's no firmware image available to update it with! All my work was with the SWD debugger.
Is better as a gaming machine than as an oscilloscope 😂
you can flash over swd without being in download mode?
If careful, programming pings can also be used in your sketch
Yes, but I'm very aware of my ability to cock things up and would rather not risk it!
what do you mean USB is working? could it possibly host a thumb drive and dump data to it?
Maybe. It already works the other way around, where _it_ acts as a peripheral to another device. The question is whether it'll work the other way around, where it hosts another peripheral. The CH32F1 supports host mode but I don't know if the connector is wired up appropriately (or whether it needs to be wired up appropriately).
woah a ch32f103? I got some of those too after playing with arduino and wanting to try something more poweful. Didnt get much into them as it was a little more difficult then i imagined with the different toolchain wch uses compared to stm32 , but i did manage to get a white noise generator code example loaded up on it and it worked really well, i thought would be a good mcu for a signal genrator but had no idea it could run an oscilliscope or a game like breakout. Well my 486 25mhz cpu back in the day ran doom2, so it shouldnt be surprsing todays cpu's at 72mhz could so something similar i guess. Can you make it run doom? jk i dont care to tsee that, doom needs 60fps, its a mockery of what doom is making it run on any hardware, i was FPS starved in the game with my fpuless 486, it cant run on any hardware.. it needs an FPU to run good. and you dont get a fpu in the f103 range, you need f403.
I just treated it like a ST32F103. No different configuration, no WCH toolchain, I just installed the std32duino core, set things up, and pressed 'compile and upload'. Also, the ST32F1 absolutely has enough grunt to run Doom. What it doesn't have is the memory. The screen has more memory than the MCU! You may be able to do a limited port of Castle Wolfenstein; raycasting is easy.
But will it run Doom? 🤔
Would you be interested in doing the exact same thing but for the "more expensive" model? (I think it's the dso180h or something, featured by a lot of youtubers, including diode gone wild) it's around 100 bucks but I bet it's quite a lot better than the this one
I found a teardown of it which gave me a look at the motherboard: it's a significantly more complex device, with discrete ADCs, a monster FPGA doing a lot of the work, and the CPU is a Allwinner FC100S which is an 533MHz AMR9 with 32MB of onboard RAM capable of running Linux. Making this run custom code is probably not that hard, but figuring out the FPGA and the analogue side will be a nightmare, and definitely out of my pay grade. Interestingly, I see that the Hantek DSO2000 series of oscilloscopes use the FC200S, so maybe there's scope for a cross-platform oscilloscope firmware package...
@@hjalfi oh the FC100S! I wanted to develop a board with it in the past. if that thing runs linux, it'd be cool to hack it. I hope I'd be able to buy one. Yeah the fpga part might be out my paygrade as well, at least for a quick and dirty hack. But anyway, a great hack!
Sweeeeeeeeeet