This post is going to have some profanity. If you consent to the warning, click the link below.
Archive for December, 2011
BF interpreters in XSLT and in Scratch
Monday, December 26th, 2011Web server on a 8051 microcontroller
Monday, December 26th, 2011A couple of years ago it was rather fashionable to create a web server in a microcontroller, most often in a Microchip PIC 16F84. The latter has been chosen because of easy programmability, I surmise.
But each implementation had at least one thing about it I disliked: One used a preprocessor to translate web page contents to TCP/IP packet payloads, which required one additional step before compiling, another one used an external EEPROM for storage of the said contents; a third one did not have an external EEPROM, but had much less than 1 kb for web page data storage. Besides, almost all of them had been written in assembler. These implementations impressed me, but they did not have enough appeal for being rebuilt.
All of a sudden, seeing easily programmable 8051 clones from Atmel, which had between 16 and 64 kb flash memory and (as all 8051-based microcontrollers have) a hardware UART, I decided to implement a minimal web server by myself, choosing C as the appropriate programming language. This can be seen as an experiment in compatiblity, both in hardware, because the resulting web server runs on any 8051 clone with enough program memory and in software, because it might be ported to any architecture, for which a C compiler exists.
The first of the mentioned implementations, Miniweb, appeared to be a good starting point before the discovery that fixed TCP/IP packets made it somewhat inflexible. Another implementation, phpstack, by the same author, came as the main inspiration instead.
The results are packed into the file httppong.zip. Much information about the development, as well as the BSD license, under which this web server implementation is published, reside in the file Readme.txt.
Working with the 8051 architecture meant to stick with SDCC. The development was conducted under Windows; instead of using a building utility such as make, two DOS batch files were used, c.bat for compilation and conversion of the resulting file to the programmable Intel HEX format and c-clean.bat for cleaning the directory. The server communicates over a SLIP connexion (therefore you will need a serial port), using the address 192.168.3.2, communicating with 2400 bps at tact frequency of 12 MHz, or 4800 bps at 24 MHz. Internally, the server uses the standard 8051 UART and Timer1 to generate correct timings for the UART. The most basic, characters only, connexion, resides in the file pingpong.c. It answers the input ping with pong (it just translates an i to o, echoing all other characters back), hence the naming of all source files, as all implementations are expected to answer reactively to the input. Next higher implementation, SLIP only, is implemented in the file slippong.c. An implementation using IP is in the file ippong.c. It also implements ICMP, so from this implementation on, you may ping the server and receive answers. TCP is added in the file tcppong.c. The final implementation is in the file httppong.c. The file httppong.hex contains ready-to-flash firmware, working at the aforementioned IP address with the aforementioned parameters.
The implementation uses 76 bytes of RAM and (with current HTML data) 2950 bytes of ROM. To reduce usage of RAM, banking techniques of the 8051 were employed. Useful data is in the array welcomepage, which was placed in ROM. Update this array with new data. Recompile. Flash. Use.
Korg Monotron settings sheet
Thursday, December 22nd, 2011Korg Monotron is a small and, for its size, a very versatile synthesizer. If there would ever be a competition for the title “My first synthesizer ever”, Monotron would surely would have been placed first, as all controls are presented to the musician enface, without any menu diving at all. Currently, two newer models are also available, but the theme of this post is the original Monotron only.
An ability, which, in my opinion, Monotron lacks, is the storage of multiple settings. An on-paper storage would mitigate that, I thought. Searching on the Internet pointed to the Monotron recall sheet, but for my taste, it was too graphic, almost a reproduction of the real Monotron front panel; knobs were too small and the dirty-paper background was not helpful either.
Hence, I redrew the front panel more schematically. Wider knobs allow to see the angle, at which a knob is set, better. The overall picture is smaller, which allows to get ten settings onto a DIN A4 sheet instead of six. The overall ascetic quality of the settings sheet helps to avert distraction of the user. The published materials consist of three parts:
- Korg Monotron settings sheet (PDF)
- Korg Monotron settings sheet source (SVG)
- Korg Monotron front panel (SVG)
The PDF file might be scaled to other paper formats; the crucial condition is the ability of the reader to recognize previously noted settings. The sheet was created using Inkscape.

Korg Monotron settings sheet by Wincent Balin is licensed under a Creative Commons Attribution 3.0 Unported License.
Based on a work at www.tuerkmusic.co.za.
PDQt 0.9 released
Wednesday, December 21st, 2011PDQt is at version 0.9 now.
The issue about freezing screen on Zaurus was solved. The problem lay in too many screen updates.
Aside from this issue, which concerned Qtopia binaries only, the code has been cleaned up only, without changes to the rest. The Win32 binary remained unchanged.
Migration from katastrophos.net complete
Thursday, December 15th, 2011Dear readers,
the migration of this blog from its old address is complete. Please update your bookmarks.