Scratchpad
A few days back, I thought about if it would be possible to run SQLite on an ARM processor. If you can provide it with a filesystem (say, an SD card for storage), and get the memory usage low enough (or get an ARM with a ton of memory/external memory interface), I do believe that this would be possible.
Another interesting idea: Lua. As in, Lua, the scripting language that powers a lot of games, among other things. It would be interesting to run that from an ARM, again with the SD card for storage (its awesome if you can store your scripts somewhere). The libraries are small enough, if I recall correctly. I think it could work.
Thunderfail
It seems that updating my copy of Mozilla Thunderbird on my laptop involved deleting the main program executable, because that is what the updater did.
Sure, it’s guaranteed bug-free now, but the number of new features is pretty disappointing.
Starcraft 2
I’m not at all a big gamer. I enjoy the occasional game (usually leading to ‘oh crap, it’s 5 AM already?’ moments), but I don’t play a whole lot. But, after all the buzz surrounding it, I wanted to check out Starcraft 2.
I only played the campaign. I usually get kicked big time in multiplayer so I’m not even bothering to try that.
Anyway, I have to say, the campaign is fun to play. The story isn’t particularly good or revolutionary (and pretty predictable), but it serves its purpose of sending you in a direction where you can blow stuff up. (Yay for blowing stuff up.) What I do like is how the campaign is done: usually in an RTS the campaign is linear: you have to do mission A, then mission B, then mission C, repeat until end. In Starcraft 2 you get to pick what you want to do when, and not everything is mandatory. Doing missions does however grant you more types of units, allows you to purchase permanent upgrades for your forces, and there is the research thing which makes things interesting as well.
Most missions are the same in the basic turn of events – ie you go somewhere, you build a base, train forces, attack (or defend) something, and ‘lo and behold, the mission succeeded. It does not however feel repetitive to do so, which is obviously a good thing. Several missions have interesting twists to them – one for instance (and don’t read this if you don’t want a spoiler) involves a wall of fire, caused by a sun about to go nova, that slowly moves accross the maps and forces you to push onwards and relocate your base several times over. This relies on the interesting (though realistically speaking, completely absurd) possibility of letting most of the building in your base take off, fly somewhere else, and land again. You’ll need to rebuild a few structures after each relocation but most can be moved that way.
The campaign plot is pretty generic. Rogue hero fights against evil empire to free the people (and of course the inevitable element of rescueing a long lost girlfriend), slowly gets to his goal, after gaining some sort of a foothold comes the ever-present inspiring speech after which the troops march into almost certain doom and succeed againt all odds. The girlfriend of course is saved, the old friend who betrayed the hero is killed, and they all happily watched the credits roll over the screen.
While theĀ campaign is fun to play, the core of the game is similar to pretty much every other RTS that’s out there. You’ve got the technologically mediocre humans who, of course, are the big good guys who rule over most of the galaxy, there’s the mysterious ancient alien race with expensive but strong units, and the guys that rely on hordes of weak units to flood their way to whatever their goal is. The game mechanics are fairly uninspiring but they work well and do provide a good couple of hours worth of time-spending.
One thing I do love big time is the mech unit called ‘Thor’. Like most mech units it is entirely unrealistic, but it’s voice sounds like Arnold Schwarzenegger and it has some of the more awesome quotes I’ve heard from RTS-game-units in a while. It bothers me that it is not really THAT powerful and you need a bunch of them to really do anything, even though it is supposed to be based of Odin, a really giant mech that pretty much vaporizes anything (where did he go after the broadcast tower mission, anyway?), but the line ‘I am here, click me!’ easily makes up for that. Most of the other units’ speech is less interesting (and especially in case of the marines, starts to annoy really quickly), but who listens to that anyway.
Overall I’ve so far found Starcraft 2 to be enjoyable, but to say that it’s a big revolution that was really worth waiting so many years for… ?
No, not really.
Blue Toys
I got a new toy in yesterday: the NGX Technologies BlueBoard LPC1768-H. As the name suggests it is a blue board with a LPC1768.
What is a LPC1768? Well, it’s a microprocessor. More specifically, an ARM Cortex-M3 capable of running at speeds up to 100 MHz with 512 kb of Flash memory, 32 kb RAM, and a huge load of peripherals: eight DMA channels, Ethernet MAC, USB 2.0 (Device/Host/OTG), four UARTs, 2 CAN channels, SPI, I2C, I2S, 12-bit A/D converter, 10-bit D/A converter, 4 timers, and a real-time clock – amongst others. Disregarding peripherals, it comes with up to 70 GPIO’s (the chip itself is a 100-pin package, part of which is dedicated to things like power, crystal, and the JTAG interface).
It puts any PIC, AVR, or similar small micro to shame.
The reason I went with this particular board is that it doesn’t come with crap. Most development boards out there come with tons of circuits and peripherals (buttons, LEDs, LCD displays and whatnot) and don’t leave a whole lot of room to do what you actually want to do with the board. This one contains just the chip, all the basic supporting circuitry, a few things like a USB connector and an onboard LED for testing/status-displaying purposes, and all other pins are broken out on standard .1″ headers. Yay for that!
The board comes from NGX Technologies. I ordered from them directly – SparkFun also sells the board, but the SparkFun price was about as the total cost of the board and shipping directly from NGX, so that’s an easy choice. They were pretty quick with shipping – I had the package delivered via the EMS service. At first they e-mailed me warning about previous bad experiences with a package getting held up in customs, but that’s not the fault of the shipping service. Since the alternative was a lot more expensive I had them ship EMS anyway and it went fine, the package was here in about a week.
I’m using the Olimex ARM-USB-OCD programmer (starts at about $50, and is really the way to go over the parallel port Wiggler-type interfaces, which tend to be glitchy and slow), combined with Rowley CrossWorks for ARM ($200 for a home use license). Currently also connected to the board are my Saleae Logic (inexpensive, very user-friendly 8-channel USB logic analyzer – very happy with this one!) and some breadboard with RS232 line level converters, hooking up the chips UART0 and 1 to my PC.
I’ve never dealt with these chips before, and there are a few things to be aware of:
- In CrossWorks, you need to create a project (with the LPC1768 as target chip) and have that project open before the JTAG interface will connect to it. If you try to connect without an open project, it will say ‘target not responding’. This had me stuck for about half an hour at first.
- The startup file (LPC1700_startup.s) that comes with the CrossWorks LPC1000 support package by default does does not jump to code execution after a reset. There is a good reason for this (explained in the comments in the file). Your code will only run if you use the ‘Build and Run’ option (from the ‘Build’ menu), or when the STARTUP_FROM_RESET preprocessor directive is defined (at which point the startup code will jump to main() as normal).
- As with most electronics things, the first task is to get a blinking LED. The BlueBoard has a LED at pin 1.29. The initial delay routine I wrote consistently blinked the LED at 333 KHz no matter how long or short I made the delay loop. It turned out that the compiler optimization had a hand in this. After disabling optimization (build configuration under ‘Code Generation Options’), doing nothing for 4 million clock cycles produced a neat 1 second delay. (4 MHz is the default speed from the on-chip oscillator, at which the chip will always run after a reset; I’m not spinning it up to the full 100 MHz just to blink a LED
). - If you buy the Olimex ARM-USB-OCD, it comes with a DC jack outlet and a short cable the purpose of which is to power Olimex-built development boards, but it also works perfectly fine with the BlueBoard, removing the need for a dedicated lab power supply (though I’d prefer to use that anyway, since it can provide much more power than the USB port can and removes the risk of blowing up said USB port in case of a short).
Overall, even though the BlueBoard lacks an on-board RS232 level converter (which is useful, since RS232 is the best invention since sliced bread, or at least, it is when you’re dealing with embedded software) and there is no documentation to speak of (aside from the board schematic, which does contain all the info you need though), there aint much that can beat it, especially at the price. I would definately recommend it to anyone looking for an ARM to play with.


