Ischa Freimaak!

War am WE mit J in Cuxhaven. Hat sich angeboten, da sie mich im Wortlaut “in den Koffer packen wollte” und sie abgeholt wurde.

Am Samstag waren wir dann auf dem Freimarkt in Bremen mit meiner Schwester Sabine und meinem alten Kumpel Lars. Es war bewölkt und bedeckt, hat aber nicht geregnet. Kalt war es nur auf dem Riesenrad oben (vgl Foto *fg*), aber ansonsten ging es. Wir hatten Spaß, haben uns mit Eis, Mandeln und Nudeln vollgestopft und sind Riesenrad und mit der “Wilden Maus” gefahren. Das war ein wilder Ritt mit G-Kräften und Hopsern im Sessel. Ich mags ja nicht über Kopf oder andere Kotzkometen, aber diese Variante der Achterbahn wollte ich dann doch mal testen. Danach hats innen drinn gepuckert und ich war ziemlich euphorisch drauf. Adrenalin von der speziellen Sorte :D Muss ich nicht jeden Tag haben, aber einmal pro Session ist es witzig und lohnt sich, besonders die abrupten Hosper und Hügelchen haben etwas, während die G-Kräfte in den engen Kurven sicher nicht jedermanns Ding ist. Aber: wer diese Dinger wie Frisbee etc reitet, der hat mit der Wilden Maus keine Probleme.

Die Rückfahrt heute mit der Bahn war auch lustig, haben ein paar Teenies schockiert und einen gegelten Bubi vor seinen Freundinnen blamiert. “Die frisst ihn auf.”, während die Mädels neidisch guckten. *fg*

Hier nochmal ein Foto von J und mir:

J and me auf dem Freimarkt

Diplomarbeit abgegeben

Ich habe heute morgen meine Diplomarbeit beim Papierflieger abgeholt. Knapp 82EUR haben mich 6 Exemplare gekostet. Da es sich um eine Kleinstserie handelt ist der Preis völlig akzeptabel. Die Qualität ist auch sehr gut. Es lohnt die Grafiken hochauflösend im EPS Format einzubinden.

Diplomarbeit - Deckblatt

Diplomarbeit - Deckblatt innen

Exmatrikuliert habe ich mich auch schon, wenn ich am Montag die Bescheinigung hab, ist es amtlich: ich habe fertig studiert. Ein fertiges Diplomzeugnis bekomme ich dann, wenn die Diplomarbeit korrigiert wurde. Vor Januar rechne ich nicht damit.

Ich bin durch: was nicht umbringt, macht hart! :D

FREE AT LAST!

FREE AT LAST! FREE AT LAST! THANK GOD ALMIGHTY, I’M FREE AT LAST!

– Martin Luther King Jr

Ich habe meine letzte Prüfung bestanden. OR1, OR3 und Kombinatorik mit einem alltime favourite highscore (Im Vergleich zu anderen Matheprüfungen) von 2,3. Es lohnt, OR1 bei Klotz ist nicht massiv LA lastig, wenn man das vorsichtig vermeidet. Für die OR3: Satz von Menger und Satz von König kennen ;)

Sehschlange folgt noch!
Es wird gefeiert – und nachher zu Frau Lenk, was klären und dann die DA drucken lassen.

Ich habs tatsächlich geschafft, keine Prüfungen mehr, bis auf einen Vortrag und die Note für die Diplomarbeit habe ich mein Diplom zusammen. :D 😀 :D 😀 :D

Ein Blick in Heim 7

Habe heute in der Lernpause einen Blick in den Umbau von Heim 7 geworfen. Mir scheint, als würden die Zimmer in der neuen Variante kleiner werden. Zumindest bei denen im Innenhof ist die Küche innen, und nicht, wie von mir angenommen, da, wo der große Schrank war. Faktisch geht so der Platz von einem kleinen Schreibtisch für Kühlschrank und Spüle drauf.

Was bin ich froh, daß ich darauf nicht mehr angewiesen bin. Ich finde es schade, wenn der in Wohnheimzimmern sowieso so begrenzte Platz noch künstlich verkleinert wird. Wie Martin so schön sagt: PAL (“Problem anderer Leute”), denn ich muss da ja nicht mehr einziehen.

Diplomarbeit druckfertig

Bis auf die fehlende offizielle Bezeichnung der Diplomarbeit ist die Arbeit druckfertig. Also nur noch auf den Mitteilungsbrief, bzw. eine Email von Kemnitz warten ;)

Habe vorhin noch die letzten Grafiken angepasst. Gerade die Druckvorlagen für die Leiterplatten sollten eigentlich 1 zu 1 erscheinen, damit man nicht aus Versehen maßstabsgetreue Miniaturen erzeugt, wenn man mal neue Elektronik bauen möchte. Natürlich könnte man ebenso mit Eagle neue Vorlagen erstellen, aber es gefällt mir einfach selbst besser, wenn die abgedruckten Vorlagen verwendbar sind. Ansonsten hätte ich die ja auch gleich weglassen können.

Wenn Mathe nicht wär, würd ich ja sagen:
Whole Lotta Shakin’ Goin’ On
:D

Nie wieder AOL CDs

http://www.spiegel.de/netzwelt/web/0,1518,511773,00.html

Wie der Schlußsatz dieses Artikels so schön sagt: “Nie wieder AOL CDs.”

Das hat ja lange gedauert, anachronistisch war die Idee des gängelnden Dienstes ja schon lange. Allerdings kann ich dem Autor insofern zustimmen, Mitte der 90er war es in der Tat ein sinnvolles Geschäftsmodell. Denn mit einer einfachen Zugangssoftware zu einem Dienst, der man wenig mehr sagen musste, als wo das Modem angeschlossen ist, konnten auch DAUs etwas anfangen und Informationen erreichen. Aber da heute jedes vernünftige OS (ja, selbst M$) mit sämtlichen Grundfunktionen für eine Internetverbindung daherkommt, dann bildet eine spezielle Zugangssoftware nur eine Barriere.

Für Rollischäuble hätte das natürlich einen immensen Vorteil: man stelle sich vor, jeder müsste AOL oder dergleichen benutzen. Wieviel einfacher wäre dann die Installation des Bundestrojaners? ;)

Die, AOL, noone will miss you! :D

ASM Software Webseite integriert

ASM Software Logo

Wie aufmerksame Leser sehen, habe ich heute eine große Anzahl von Artikeln eingestellt. Diese stammen alle von meiner alten Homepage für selbstgeschriebene Software. Selbige Seite wird ab heute stillgelegt, ihr (soweit relevanter) Inhalt wurde hier eingepflegt und kann über die Kategorie “ASM Software” abgerufen werden. Natürlich sind alle Progrämmchen, Skripte und Goodies zum Download verfügbar.

Davon ab musste ich auch mal wieder was sinnvolles für mein Blog tun ;)

emu51 under GNU/Linux

ASM Software was able to build and run the 8051 emulator emu51 (http://emu51.sourceforge.net/) under GNU/Linux.

Download the source distribution, make sure you have the Allegro library installed, and now compile emu51 with this Makefile.

The emulator seems to work but keep in mind it is very early alpha and the interface not that easy.

If you use SDCC, make sure to issue the packihx command first. emu51 has problems with reading the .ihx output of SDCC properly.

Once a port to the SDL library was planned but the project was abandoned due to lack of time.

SDCC tutorial

This is a small tutorial how to invoke and use the Small Devices C Compiler (SDCC).
SDCC can be found at http://sdcc.sourceforge.net/. It is a cross compiler for ANSI C with various MCU targets including MCS51, PIC14 and Z80.
All testing has been done under GNU/Linux and the instructions to build and operate SDCC under other operating systems may vary considerably.

Building the compiler

The compiler comes as a standard GNU package as sourcecode licensed under the GNU General Public License. Just go to http://sdcc.sourceforge.net/ and grab a current source distribution. Now follow these simple steps to build, test and install the compiler:

  • change to a directory of your choice to build the compiler ~/src/ might be an optimal choice
  • $ tar xvzf path/to/sdcc/source/sdcc*.tar.gz
  • $ cd sdcc
  • $ ./configure
  • $ make             # this will take some time!
  • $ su -c “make install”
  • now typein your root passwort to install the SDCC system into /usr/local

To build SDCC, you will need GNU Make, GCC, Flex and somemore tools. A standard GNU development and compiling environment should suffice.

First test

The first compiler test is simple: just type at your shell prompt:

  • $ sdcc -v

If you see the following output in your terminal, all went well and SDCC was properly installed on your system.

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.4.8 #977 (Mar 202005) (UNIX)

Now SDCC is installed and should be ready to build programs for any supported MCU.

Your first program

As I have a mcu board with a MCS51 compatible controller, we’ll assume from now on that you will want to develop your C program for a MCS51 target.
Write your C program with your favourite editor, make sure to include 8051.h to gain access to all 8051 SFRs.

#include <8051.h>

Write a simple program like the following:

#include <8051.h>
void main(void)
{
int i=1;
P1=0;  /* clear PORT1  of the MCS51 – P1.7 used as LED output */
for(;;)
{
P1_7=!(P1_7);   /* toggle P1.7*/

for(i=1;i<15000;i++);
/* idle loop – eat CPU time */

}
}
Now save it as porttest.c.

Now build your C program by typing:

  • $ sdcc porttest.c

SDCC will output an awful lot of temporary and listing files while compiling the program. If all goes well, you will get an Intel HEX file called porttest.ihx.

It is a good idea to use the packihx command on the resulting .ihx as the output of SDCC is not compatible with all loaders. It works with IO redirection:

  • $ packihx <input.ihx >output.hex

By default SDCC will relocate your program to address 0x0 including a proper interrupt vector table in case you have defined interrupts from C. That is possible, just refer to the SDCC documentation. Now put the HEX file into your code memory and run it.

Relocating your program to a different location

Sometimes you will not want to relocate your program to run from 0x0. Perhaps you have a board with RAM mapped as code memory and it does not start at 0x0. Using assembly language you would simply put an ORG 0x4000 or similar into your source. SDCC has to be instructed with a compile time parameter to achieve the same effect.
Try:

  • $ sdcc –code-loc 0x4000 porttest.c

SDCC will now compile and build your program as usual but it will now have its reset vector and interrupt vector table relocated to 0x4000 and up. This means to run your program now, you have to run your code with a jump or similar from 0x4000.
Important: SDCC will still generate the interrupt vector table but it will not be initialized at the proper location. Your startup code or some sort of utility has to copy the contents of the C code interrupt vectors into the MCS51 interrupt table by hand to activate it.

Alternate output file format

SDCC cannot only output your program as a Intel HEX file but also in Motorola S-Record format. Just use a commandline like this:

  • $ sdcc –out-fmt-s19 –code-loc 0x4000 porttest.c

In case you need different output formats you can use the SRecord software package to convert from Intel Hex or Motorola S-Record to many lesser known file formats.

Using the C library

SDCC comes with a implementation of the standard C library known as libc under GNU/Linux. You can use it as normal but note that you’ll have to implement your own functions for putchar() and getchar(). All other terminal I/O functions use these and you have to link your program with a serial I/O driver and put proper putchar() and getchar() functions in. Interestingly putchar() and getchar() are no macros but real functions in SDCC contrary to the ANSI C standard.

Last words

For more detailed documentation, especially on usable memory models, inline assembler and interrupt handling, refer to the excellent SDCC documentation which should be included in your SDCC source package.
This concludes our little SDCC tutorial and we hope you will be able to get started with software development in C for your MCU with the SDCC system.

small SDCC projects and sources

This page contains some simple projects and programs for use with the SDCC compiler and a 8051 compatible mcu.

register definition for Atmel T89C51CC02
This register definition include file is for use with the SDCC compiler. It is based upon the faulty one supplied by Atmel.
Download (7k)

A/D convertor access for Atmel T89C51CC02
This sample C file for the SDCC compiler supplies a simple routine to measure voltages with the builtin analog-digital convertor of the Atmel T89C51CC02.
The routine works with simple polling.
Download (0.7k)

register definition for Oki MSM80C154S and MSM83C154S
This is a register definition include file for use with the SDCC compiler. It mainly defines the IOCON register and its different bits.
(NOTE: This register definition comes included with SDCC since version 2.6)
Download (1.8k)

SIO Test
A simple test program to initialize and use the SIO of a 8051 mcu from the SDCC compiler using autobaud detection and polling variants of putchar() and getchar().
Download (3.6k)

Delay
A simple routine which uses inline assembly to give a delay routine. It waits for 100ms on a MCU clocked at 12MHz with default of 12 cycles per instruction.
Download (0.5k)

MicroSIO
A small lib for use with SDCC and a 8051 target for using the SIO in polled mode without disabling a running SIO IRQ. It is intended for use with the Tasking Monitor and a preconfigured SIO. The routines  have been tested with my development board. A Makefile for multiple file SDCC project include.
Download (1.5k)