dazgupta.com > posts.xml 2> journal.xml

PCB Project + Tiny game

I have been thinking about writing something for the RP2040 in Rust for a long time now. I generally like Rust and I like the RP2040. I recently starting working on a sunflower seed patterned LED lamp thing, but I stopped before fabrication service for a big-ish PCB. I had to learn some of the nuances of building & assembling PCBs. Incidentally, I have been toying with the idea of a electronic sharable card for some time, so I thought what if I build a custom RP2040 board. After reading up, even that seemed to be a tall order. I also had to figure out how exactly to design for manufacturing with parts and supplies etc. PCB makers like JLCPCB do offer services for building and assembling the PCBs, but the process is fiddly, depending on what kind of EDA tools one uses. I use KiCAD, so I wanted to figure out how that process works.

I started builing a barebone unit with a MCU board, a display and three buttons, thinking I could write some games for it. I eventually managed to understand and implement a load sharing circuit; a circuit that would allow me to charge a battery and power the unit via USB, and while not being plugged in it can deliver power from the same charged battery. It took some studying here, but I eventually figured it out (I think). I also learned about BOMs & drill files. And the PCB was ready to be sent for manufacturing and assembly.

PCB

After I submitted the order, I realised there's a high likelihook the transistor to turn on the battery power might never turn on without a particular resistor; a component I did NOT place in my circuit. But it was too late. I later thought about a way to make it work with some manual fiddling.

While I waited, I wanted to start building some sort of game.

I already had managed to run SSD1306 based displays before, so after a little bit of code, I had some sort of nice looking landscape, as much as skills in art would allow me. The Rust Embedded Graphics crate helped a lot, although getting transparent sprites seems to be a challenge (for the future me).

screen with something on

And then once the delivery person finally delivered some bigger screens, I could finally make some moving images and a tiny square bicyclist.

screen with moving images

Maybe I'll actually finish a project this time; can't wait for the PCB deliveries.

03-11-2024