Small microcontrollers and tiny systems-on-chips are getting more and more popular these days as the price comes down and the ease of programming goes up. A Raspberry Pi is relatively inexpensive and can do pretty much everything you need, but not every chip out there can do something most of us take for granted like output video. For a lot of platforms, it’s next to impossible to do while saving any processor or memory for other tasks besides the video output itself.
[Dave] aka [Mubes] has been working on the Blue Pill platform which is a STM32F103C8 board. While they don’t natively output video, it’s a feature that provides a handy tool to have for debugging in order to see what’s going on in your code. However, if the video code takes up all of the processor power and memory there’s not much point. [Dave]’s video output program, on the other hand, takes up only 1200 bytes of RAM and 24% of the processor for a 50×18 text display over VGA, leaving a lot of room left for whatever else you need the tiny board to do.
Video output on a device this small and lightweight is an impressive feat, especially while saving room for other tasks. This brings it firmly out of the realm of novelty and into the space of useful tools to keep around. If you want to try the same thing on an ATtiny, though, you might have to come up with some more impressive tricks.
Pretty darn amazing. I am a great lover of the blue pill boards. My hat is off to Dave, but ….
As with all truly great Hackaday projects, it is fundamentally useless, abeit incredible.
The pill has a serial port already, a bunch of them as I remember, and these do just fine
for most needs. Hard to beat a serial port as a “handy tool for debugging”.
Even better, it has SWIO, so you can just step your code line by line or print debug information without using those 3 serial ports or any of the other ports (you lose 2 GPIO though). Programmers cost about $5 (st-link).
Yes, trace works well on a bluepill. I ported Petteri’s code over to Ada. There is a lot you can do with a sub 2$ board.
http://www.hrrzi.com/2018/04/tracing-bluepill_21.html
Agree completely! SWO (and Trace) are _much_ more useful than a video screen. This was an exercise in Reattime programming, not really in producing VGA output. Any mistiming in the order of 3nS or greater on a VGA signal will result in visible artefacts, which makes it a very good vehicle for this kind of thing. I’m much more interested in getting that 24% figure than I am in getting video output!
If you’re interested in SWO and what can be done with it then it’s worth starting at http://shadetail.com/blog/debug-communication-with-an-arm-cortex-m-target/ and reading the following few articles which lead up to the use of the Orbuculum suite (https://github.com/orbcode/orbuculum) which can do stuff like ‘top’ for embedded and integration with KCacheGrind …. who knows, one day perhaps Hackaday will discover that stuff in the blog too :-) (Apologies BTW, I just realised that it’s pretty hard to find older blog entries…I’ll try to fix that).
Agree completely! SWO (and Trace) are _much_ more useful than a video screen. This was an exercise in Reattime programming, not really in producing VGA output or Debug. Any mistiming in the order of 3nS or greater on a VGA signal will result in visible artefacts, which makes it a very good vehicle for this kind of thing. I’m much more interested in getting that 24% figure than I am in getting video output!
If you’re interested in SWO and what can be done with it then it’s worth starting at http://shadetail.com/blog/debug-communication-with-an-arm-cortex-m-target/ and reading the following few articles which lead up to the use of the Orbuculum suite (https://github.com/orbcode/orbuculum) which can do stuff like ‘top’ for embedded and integration with KCacheGrind …. who knows, one day perhaps Hackaday will discover that stuff in the blog too :-) (Apologies BTW, I just realised that it’s pretty hard to find older blog entries…I’ll try to fix that).
Mubes
… especially if you spice your debug output with some vt100 controll sequences to use your beloved serial terminal programm as a “screen” :)
that’ costs nearly zero resources on your mirco…
however, stand-alone debugging can be quite a thing!
73
A Propeller can output a VGA signal and still do 7 other things (including generate other VGA screens) at the same time. Just saying.
A Propeller chip alone costs $8 and a fully populated bluepill board is less than $2. Just saying :)
I bought into the Propeller but got wrong advice from the community, did not get documentation, got the wrong products shipped to me so I moved on. Their forum is not growing because they aren’t reproducing themselves in others and learning is more caught than taught over there.
I bought a Propeller board at RadioShack (remember them?) for $20, but it didn’t work.
But a Propeller isn’t sub 2€. :)
Cool little hack!!!!
Remind me of the old 8 bitters like the Timex Sinclair and Ataris. if someone wanted to they could use this as a video controller for a 8 ot 16 bit homebrew sbc.
“it’s a feature that provides a handy tool to have for debugging in order to see what’s going on in your code”
Debug, you’re doing it wrong.
I’ve got colour VGA, sound, joystick and SD/MMC running in 32 K of SRAM on a Cortex-M4. It’s all written in Rust too. Even runs Microsoft BASIC through a 6502 emulator.
GitHub.com/thejpster/monotron
Now, _that_ is cool. In a sensible language too.
Wow! That’s impressive.
ColorMax computer. Color VGA, SD, 40 i/o pins, keyboard, BASIC (no line numbers), RTC, I2C, SPI, Serial, CAN, etc.
http://circuitgizmos.com/documentation/hardware-datasheets/cgcolormax2-technical-information/
See also….
https://stm32duino.com/viewtopic.php?f=2&t=3318&hilit=vga&start=10