Just as a quick note to myself: the UDN2981 requires pull down resistors as the inputs are not allowed to float when Vcc is powered. A SIP resistor pack should sort that without taking up too much space.
I recently picked up an embedded project that I hadn't touched for a few months, so I could add some new features. I was disappointed to note that it no longer compiled - nothing in the code had changed, but it only compiles with Nightly Rust and that had recently had a bunch of changes that completely broke my build. This is then a tale about what I'd like to see from Rust in 2018.
I know there's been a lot of interest in WASM and other 'high level' applications, but Rust also lends itself very well to embedded development. I have a demonstration project for the Texas Instruments Stellaris Launchpad (now rebadged the Tiva-C Launchpad). This project comprises approximately three Assembler instructions (to bounce into the hardfault handler), and the rest is Rust - no C required! Exception handlers, setting the stack pointer and initialising the .data and .bss segments can all be done in pure Rust. Thanks to brilliant work by the likes of @japaric, with the Xargo cro…
It's a couple of months on from my talk at RustFest on Monotron, so I thought it was worth a quick catch up on where we're going next.
Graphics and Text
As a recap, Monotron currently generates an 800 x 600 VGA signal at 60 Hz (with a pixel clock of 40 MHz). It does this using three synchronised SPI peripherals, a timer generating the horizontal-sync pulse and a GPIO pin for the vertical-sync. With the CPU running at a clock speed of 80 MHz, the SPI peripherals are clocked at 20 MHz producing 400 horizontal pixels per line. This is half the nominal 800 pixels, but we needed to sacrifice resolution to double the amount of CPU time we have to 4 clocks per pixel (i.e. 32 clocks per 8-bit character column).
The pixels are generated from a 48 x 36 character buffer. Each cell can store one 8-bit character (in MS-DOS CodePage 850) and one 8-bit attribute value. Currently the attribute value stores a 3-bit (1 red bit, 1 green bit, 1 blue bit) background colour and a 3-bit foreground c…
So now @rustbeltrust is over, I thought it was worth writing down a few details about what Monotron can do. It's had a few upgrades since @RustFest Paris! I tried to keep them under wraps to avoid spoilers but I can share them now. This is an un-roll and re-edit of my Twitter thread, and the features listed here are in no particular order:
1. You can upload binary apps into RAM over serial. 24 KiB is reserved
for apps, leaving 8 KiB for stack and character RAM. The ROM passes a
structure full of function pointers so that apps can access useful
functionality, including a vsync function for smooth gameplay.
2. You can write apps in C and in Rust! Example apps include Tiny Basic,
a little slideshow about the system, Snake and even a 6502 emulator
running an unmodified copy of 6502 Enhanced BASIC.
3. There is a three channel 8-bit wavetable synthesiser running at 37
kHz (the scan-line frequency). It has four 256 byte samples - square,
sawtooth, sine and noise. Snake has multi-t…