• Screens and sizes

    Aaron4 days ago 0 comments

    I mentioned in a previous log that one of the things that kicked this off for me was the availability of an OLED display that was the right aspect ratio. This display is also quite small, and given the amount of space I have to keep everything to scale, I don't have much room to put other components. 

    This render of my current version of the board shows the display outline where it would sit on the board. my current plan is to fix it in place with some hot glue.  The trick is in connecting the ribbon cable. According to the datasheet, it's 9.8mm from the bottom of the display (the shorter rectangle at the bottom of the cutout) to the end of the ribbon, with a 1.5mm long solderable contact. In most situations, you would fold this under the display or around the back of a PCB where all the support circuitry is.

    Front and back of a display module

    I could make a second PCB as a sort-of "backpack" for my board. In fact, I may need to do something like that anyway. One thing I'm missing from my current version is a means of actually plugging in my SAO to an SAO Header. An SAO without the header is just a weird PCB. I could probably rearrange some of the components but the ribbon cable is getting in the way.

    One solution would be to try to utilize the cutout that exists in the ribbon as it makes a sort-of "I-beam" shape. The space provided here is very narrow: Just 4mm. If you known= your common unit conversions for electronics, you'll know that the 4-pin header for the SAO needs at least 2.54mm (0.1 inches) between pins. It's a tight fit. Additionally, because I'm trying to squeeze some components under there I'm thinking about flexing the ribbon cable a bit, which means that that space will be even narrower. 

    A possible position of the SAO header

    I'm inclined to think that the backpack idea is better than trying to shove everything onto a single board, but it also feels like that maybe goes against the spirit of the SAO.

    SAOs were the result of manufacturing costs getting so low that you could make an electronics art project for the cost of a cup of fancy coffee. Now that chips, PCBs and components are all shockingly inexpensive, are we entering the era of the FAO? The Fancy Add-On?

  • Now working on the little controller

    Aaron07/05/2024 at 01:37 0 comments

    For a bit over the last few days I've been seriously concerned that I wouldn't be able to get this working on the CH32V003. I did a little bit of work myself - and started to poke around in different 003 firmware examples, and deep in the 1306 controller datasheet. 

    I was pursuing using the firmware from the CH32V003 Game console project by Stefan Wagner. Unfortunately I couldn't figure out the magic incantation to build successfully on an Apple Silicon host. I moved onto Charles Lohr's CH32V003Fun which has been highlighted on Hackaday a little while back.

    After having figured out offsets for the column and row in the display ram, I was able to get things on the screen! I've spent the last couple of hours porting my display commands from the u8g2 library running on an ESP8266 to the CG32V003Fun's built-in drawing commands. So far, my code size is about 1/3rd of what it was using the libraries. I still have quite a bit to go, but it's looking very promising.

    The ESP8266 on the bottom, The CH32V003 on top.

  • "I finally invent something that works!"

    Aaron06/27/2024 at 22:42 0 comments

    There are moments in every project where you wonder if what you're doing is going to work at all. I think this is especially true when you have several layers of uncertainty. 

    I got the programmer and compiler to work, so I knew I could program the CH32V003 to do something simple (blink an LED). I didn't know the following with certainty: 

    • If I had the OLED display hooked up correctly
    • If I had the command startup sequence correct
    • If I had transposed the custom commands from an example into Arduino's Wire library correctly.
    • I was pretty sure the OLED display I had worked.

    After messing around with a handful of various items, the display lit up full of random data... I assume it was whatever was hanging out in memory, or something like that. I also got, at one point a pattern... of randomness. 

    But after a few more pokes and attempts, I ended up with this: 

    It doesn't look like much, but those white and black bars were intentional - and that makes all the difference in the world. It's a good feeling when you see the fruit of your labor. You understand Doc Brown's surprised assertion when he sees the Flux Capacitor "It works! I finally invent something that works!"

    Onto actually drawing something on the screen (and keeping it all in 16K)

  • A couple of hiccups

    Aaron06/23/2024 at 22:54 0 comments

    I've run into two hiccups in the last few weeks that are making me adjust course a little bit: 

    1) I had to switch graphics libraries. The Adafruit GFX and SSD1306 libraries are really only built for the displays that Adafruit sells. This is entirely reasonable, but my target display was a different aspect ratio - 64x48 - instead of the 128x64 or 128x32 displays that they offer. I could draw to the screen, but the output wasn't right. So I moved to the very accommodating G8U2 library. This library supports displays of every stripe. It is really impressive. I got all my various "screens" that I wanted to draw rebuilt in that library. 

    2) As I mentioned in my last log, I needed a programmer for the CH32V003. The programmer (A WCH-Link E) arrived


    This is where the new challenges show up: 

    I've been developing on an ESP8266 WEMOS module. It was a quick and easy solution to get to an MVP. Unfortunately I wasn't paying attention and the CH32V003 doesn't remotely have the kind of Flash storage that the module does. 

    The Module's is 1MB. The CH32V003 has a paltry 16KB. This is plenty in relative terms, but it does make using the library a more complex task. It seems like it is compiling unnecessary features into the file. I may just bail on it and implement my own drawing routines.

    Also, due to Apple's aggressive code signing policy I haven't been able to program the chip from my Apple Silicon Mac (it doesn't like that the libusb that the programmer needs isn't signed for that use by the appropriate team). Fortunately My old intel Mac is okay with it all, so I am able to program from there.

  • I guess I need a programmer

    Aaron06/06/2024 at 01:21 0 comments

    I bought handful of CH32V003 boards to play around with running this project off of. My development setup is currently using an Espressif ESP8266, and I was leaning towards the CH552 until I discovered the CH32 line. The latter is very cheap, RISC-V, and has an officially supported Arduino build environment. 

    CH552 above, CH32V003 below

    What these boards don't have is a bootloader. I assumed because the 552 shipped with a bootloader that the 003s would have one as well. Whoops. Short of ordering the appropriate WCH WLink E programmer, there is one potential solution. Charles Lohr did the tough footwork of putting together a build chain for the CH32003 (https://github.com/cnlohr/ch32v003fun) and in that, there's a firmware option built on an Arduino Uno that might be enough to load a bootloader. I guess we'll find out. 

    One of the things that I wanted to do on the display, was draw a little Jolly Wrencher. I'm planning on taking this Supercon '24, and it's a nice callout as I can draw to the display. So I've been experimenting with drawing Jolly Wrenchers

    These were made using the excellent bitmap editor from emutyworks. It takes some getting used to, but once you get the hang of it it's quite nice.

    I think I've settled on a design, but I'm not sure about the wrench lengths. I need to check how much space I actually have to populate.

  • Why not share?

    Aaron06/03/2024 at 17:47 0 comments

    Supercon 2023 was my first supercon, and it was quite a lot of fun. Like many people I was delighted by the weird variety of SAOs†. I was especially inspired by Tom Nardi's Cyberdeck SAO. The integration of the OLED display made it super fun. I wanted to make my own. 

    2024 happens to be the 40th anniversary of the original Macintosh. If you're an 80s child like me, take a moment to stare off into the distance with a look of shock. Back to the project! With that milestone in mind, I thought I would make an SAO that looked like an original Mac and I could put an OLED screen on it and display some fun stuff. 

    This idea has been bolstered by two hardware finds: 

    • A 0.66" OLED 64x48px display. 
    • The unfathomably cheap WCH CH32V003 microcontroller

    The display is the same aspect ratio as the original make (1/8th the resolution) and uses the commonly available SSD1306 driver. The microcontroller is $0.30/pc, runs at 48Mhz, and has an accessible Arduino ecosystem available to it. This makes it super easy to get started.

    Additionally, both JLCPCB and PCBWay now offer full color printing on their PCB production. I haven't committed to it yet, but if I wanted to really match the beige color of the original Mac, I could do it.

    While I await some development boards for the MCU, I'm developing some drawing methods. I have to adapter the common elements to the resolution of the display, so I can't quite make it a Mac, but I hope to evoke the feeling of the original Mac.

    The showman in me is always trying to keep things a secret, and let it all be for the big reveal. In the spirit of open-source and open-ness, I'm publishing the project here, and hopefully as-I-build-it. 

    † I prefer to say shoddy-add-on, but acknowledge what the commonly accepted acronym is.