-
The actual game, isn’t that the easy part?
09/10/2024 at 18:56 • 0 comments(Bangs head against table) Who thought using 8 KiB RAM to drive a 240×240 colour display was a good idea? Oh it was me myself. Never mind then… (^ ^;)
The reason I picked the STM32G030 was simple: I had spare pieces from a previous project lying around. With hardware issues out of the way, memory space shouldn’t stop me. All I need to do is simply to divide the screen into tiles sized 30×30 and implement a generic drawing interface to mark the dirty (changed) tiles, and blit and redraw them in order. One single remaining issue is that screen tearing happens, and DMA hardly helps with such small bursts of intermittent transmissions. But really, I don’t know why I chose to go through all this hindrance when I can just spend another 2 CNY (quarter USD) to get 16× as much RAM with a ’G0B1. That will hold an entire 16-bit framebuffer!
Compared to everything so far, the actual game was straightforward. It collects entropy from clock jitter and internal ADC channels, and generates a random pattern comprising three dots marked dark/light, which the player is asked to match with lights and shades. The pattern is chosen so that the nearest dots are at least 1/8 of the circle apart and have different dark/light markings.
This is actually only the most basic gameplay I had planned — as is present in previous photos, a compass is always on the display; there is also an accelerometer/gyroscope IC on the board. And finer sounds and graphics? There’s 2 MiB of flash sitting there! All those possibilities I think I need to leave for the next few days to come.
With everything going on in life (a concert band competition and a conference presentation!) and so few days remaining, this felt much like a little game jam. I had to hastily make choices among endlessly growing ideas and balance between a polished product and a minimally working prototype. That could be quite stressful, but now it’s playable! It is now a functional game, yet another time!
Unfortunately, it has been really cloudy all these days, so I am yet to find a great opportunity to put it into field test. For now, let’s ditch all the contest rules and just ship it 🎩🐿️
-
Assembly
09/10/2024 at 17:33 • 0 comments23 Aug
A few days ago I had the device partially assembled, and had the light sensors and the LCD display working. Sadly, before I could take any picture of it, I slipped it onto the floor and smashed the glass. (T-T)
It wasn’t long before I made another decision that I would surely regret: after I had replaced the LCD, I washed the entire assembly with cleaning agent and water. This should really be done before soldering it, or at least with great care, but I wasn’t aware until I found out that only the backlight worked and the screen stayed black, while every signal connection checked good. Maybe water had ruined it? I suspect so.
Anyway, what else could I do? I sat again at the workbench with what remains to be done, while new replacement display parts navigate their way through more than a half of the vast land of China.
At least the LEDs were working. This is the model HD107s produced by Rose Lighting, an addressable LED which takes a two-wire CLK/DATA serial signal, similar to SPI, with data rates up to 40 MHz. It also has an auto-sleep feature that reduces no-drive quiescent current, overcoming the limitation of idle WS2812’s, which takes around 1 mA each even when the lights are completely off.
26 Aug
If there is to be a single hardest issue in troubleshooting assemblies, it would be power-rail shorts. Not to mention that I do not have a micro-ohmmeter at hand. It took me a full-board migration to elevate this issue, and another to get around an unknown defect in the board. At the end of the day everything works, but what happened with the first two boards remained unknown — the first board, with everything removed, still yielded that mystical DMM beep; and on the second, apparently a pad was connected to the wrong net. Was it a manufacturing defect or was it the reckless me crushing the copper? I rushed past it and did not bother. For the time being, I was daunted by the idea of looking back on that whole unsettling experience.
2 Sept
Soldered on the new LCD. It looked as I had imagined in the first place. I could hardly wait to see a game growing out of this.
4 Sept
Put on the remaining bits — flash storage and the speaker. Pardon the messy tapes, but this side was supposed to be hidden in a casing, so never mind.
Autumn strides across the land in its robe of overclouding puffs, but here we are at another precious morning of sunlight. The LCD display doesn’t seem bright enough to break through the gorgeous 20000 lux, but hey, what better day to step back and take a moment to cherish all these miracles of nature and humankind?