This post is going to have some profanity. If you consent to the warning, click the link below.
BF interpreters in XSLT and in Scratch
December 26th, 2011Web server on a 8051 microcontroller
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
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
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
December 15th, 2011Dear readers,
the migration of this blog from its old address is complete. Please update your bookmarks.
Problem and solution for ez430 RF2500 port of Contiki OS
April 8th, 2011The archive on the page of this port has too many files removed. You will get errors about missing files trying to compile the example. Please read the solution on the same page.
BeepTimer for STM32 Primer released
July 26th, 2010BeepTimer is a successful experiment in Human-Computer Interaction. The question to test was the possibility to control a device using one acceleration sensor and one button. As already mentioned, it is possible even with OS functions intervening (long button press issues a shutdown of the device). The user controls the device by tilting it and by pushing the button. The description of possible gestures is provided on the project page.
GraspForth on STM32 Primer released
July 19th, 2010GraspForth is a simple, portable implementation of a Forth system in C. It works every 32-bit architecture GCC compiles for. The STM32 Primer devices were introduced on this blog earlier. These systems were combined in the GraspForth on STM32 Primer project. If you are interested, read the rest of the project’s description.
PDQt 0.8 released
July 11th, 2010PDQt is at version 0.8 now.
The function of the Action button was divided between the Shift button (Shift key) and the Action button (Return key).
Furthermore, now PDQt recognizes circling gestures. Circling around the center of the program’s screen clockwise increases current value, circling counter-clockwise decreases it.
You may download the new package for Cacko and maybe other Qtopia based distributions from this page. Otherwise you might want to download the source code and compile it for yourself – you will need only Qt3 compilation environment on Win32 or Linux.
PDQt 0.75 released
July 9th, 2010PDQt is at version 0.75 now.
The key map was adapted for a usual computer keyboard; Space is the Play button now instead of C, Shift is the Action button instead of D et cetera. Furthermore, mouse wheel can be used now for changing values. Look into the help dialog for explainations.
You may download the new package for Cacko and maybe other Qtopia based distributions from this page. Otherwise you might want to download the source code and compile it for yourself – you will need only Qt3 compilation environment on Win32 or Linux.