The Mitochondrion Mark 4.2 build is getting to the fun part, the bit where pretty much none of the parts work. However, there are at least parts that don’t work, as opposed to no parts. This counts as progress.
1) The new main board holds all of the electronics and connects them up. The board itself has been made, is currently in the post and, when it arrives, the soldering begins.
2) The centre section of the metal spine needs to be remade. It’s full of bolt holes aligned with the Mark 4.1 main board, but the Mark 4.2 board has holes in different places. Adding those holes to the existing spine would end up with some very weak points, so two new bits of aluminium needed. This is the most trivial task – cut, bend, drill, tap & countersink.
3) There’s wiring to fiddle with. Bastard wiring.
4) For the software, the task scheduler works. I used the world’s most minimal Arduino task scheduler and added bits. Everything is a task, there’s a list of tasks set at compile time, each task has a time when it will run, and a loop just ticks through the microseconds to see if any of the tasks can run yet. My brainwave of an extension is just a boolean flag added to each task to see if it should run, as well as if it can run.
5) I think I’ve got the inter-task communication straight in my head. Messages are just a global pool of flags to describe various overall states (is it spinning, is the battery flat, etc…). Every task can change those messages, but there’s a small enough number of tasks that it shouldn’t be a problem. I think I’ve got the design straight, but there’s going to be drawing of arrows and boxes on pieces of paper today until I’m more certain. Then I’ll write some code and it’ll probably turn to custard.
6) The patten generators working from stored images aren’t working, coz the library that reads the memory storage isn’t working coz the library that controls the network that connects the memory to the microcontroller isn’t working. The I2C library uses 8-bit addressing and my 128 kByte EEPROM needs 17-bit addressing, and buggered if I can get that to work. I’ve asked a few people, but seriously, reading an EEPROM from an Arduino? When that EEPROM is more than 32 kB and you don’t want to use the standard Wire library (coz it can lock up the entire Arduino) Grr… Also argh!
7) The pattern generators working from audio seem fine, except the audio amp seems to have a very narrow frequency range. This needs fixing. It might be down to the op amp, but all this involves analogue electronics, where I really have no idea what I’m doing.
8) The BlueTooth module can be seen by BlueTooth devices, but getting data through it isn’t happening yet. More poking needed. Also, turning the bugger on creates enough noise in the audio amp to drown out audio. Local capacitors on the power lines don’t help, so current plan is just to turn BlueTooth off when in modes that use audio.
9) The code to switch between modes… I think it will play nicely with the task manager, but I’ve just got to write it.
10) Getting it all fast enough. Every millisecond matters when you’re wanting to push new patterns out every ten milliseconds. Magnetometer reads take 3, EEPROM reads currently take 0.5 per byte and I’d like to read 48 at a time. All this needs investigating and accelerating, or squeezing into dead time. There’s not much dead time.
I think my next project may involve no electronics whatsoever.