Instruction book
Part 2
Programming – Experimenting – learning playfully
how a computer works.
Errata in the Microtronic Instruction Book, Part 2
On page 44: Timer with two switch-on and switch-off times.
The input command at address 57 must correctly read: 529 (instead of D29).
Page 62: Computer counts frequencies
The program printed in the book ends at address 1B. It must be extended as follows:
Please excuse the oversight.
Instruction book
Part 2
Introduction to
microprocessor technology.
Programs for
experimenting
with the microcomputer.
By Jörg Vallen
Production and distribution:
BUSCH-Modellspielwaren
P.O. Box 1360
D-6806 Viernheim
In cooperation with the
ELO-Magazin Franzis-Verlag
P.O. Box 370120
8000 Munich 37
For some experiments,
additionally required:
A 9 V battery (IEC 6 F 22)
or power supply 2059
Copyright 1981 by
BUSCH GmbH. + Co. KG, Viernheim
All rights reserved.
Illustrations
Atelier Wuthe, Weinheim
Printed in W.-Germany
10/81

In this part of the instruction book, a small selection of programs is demonstrated from the large palette of application possibilities of the Microtronic computer system. The program explanations assume that Part 1 of the instruction book has already been worked through.

Thanks to the introductory explanations, however, it is also possible — even without detailed computer knowledge — to enter the listed programs in order to get to know interesting computer games and other possibilities.

The following programs are available:
Computer GamesPage
Tic-Tac-Toe4
Sea Battle6
Code-Breaker (a thinking and skill game)9
Nim 212
Computer Functions with Decoder Tasks
Morse-Code Decoder18
Morse Trainer21
Resistor Colour-Code Calculation24
Computer Calculations
Pocket-Calculator Program (with all arithmetic operations)26
Sine Calculation (something for mathematicians)32
Calculating the days between two dates34
Calculating a weekday from entered dates36
Calculating your personal biorhythm37
Computer Functions with Peripheral Electronics
These experiments require additional BUSCH switching relays or BUSCH Electronic Studios.
Connecting relays42
Timer with two switch-on and switch-off times44
Alarm clock with two alarm times47
Alarm clock with snooze radio48
Further „timer“ possibilities48
Computer organ52
The composing computer54
Computer controls an electronic music box54
Acoustic effects for computer games56
The computer counts people and objects57
Data transmission with only 3 lines59
Data transmission using the „handshaking“ method61
The computer counts frequencies62
Reaction-time meter65
Digital voltmeter68
Computer-controlled model railway71
These programs serve as inspiration for how the computer can be reprogrammed again and again for the most diverse tasks.
Microtronic computer beginners, please note:
Before programming, always press the keys HALT – NEXT – 00 first. Then enter the command codes according to the program table. After each command-code entry, don't forget to press the NEXT key. After entering the last command code of a program, press the NEXT key once more, then start the program with HALT – NEXT – 00 – RUN. If the program does not work correctly, go back to the start of the program with HALT – NEXT – 00 and, by pressing the NEXT key, compare the entered commands with the program table and correct them if necessary (re-enter). After making the correction, don't forget to press the NEXT key and then restart the program with HALT – NEXT – 00 – RUN.

Tic-Tac-Toe is a well-known, simple board game. It has a playing field of 9 squares, with 3 × 3 squares arranged in a square (see illustration). Each player has 4 stones. Players take turns, and each player may place one stone on a free square. The winner is the player who is first to arrange 3 stones in a horizontal, vertical or diagonal row.

Among the computer accessories we find a Tic-Tac-Toe board with 4 black and 4 red playing pieces each.

First, after HALT – NEXT – 00, we must enter the program according to the table.

Connecting the piezo buzzer
Program: Tic – Tac – Toe
LabelAddr.CodeMnemonicJump to
00F08CLEAR
01F0DEXRL
02F08CLEAR
03FE0DOT 0
04198MOVI 9,8
05F28DISP 2,8
06FF9KIN 9
0751AADDI 1,A
0894ACMPI 4,A
09E21BRZ 21„EE“
0A09DMOV 9,D
0B51DADDI 1,D
0CB2BCALL 2B„BERE“
0D0C8MOV C,8
0EFF9KIN 9
0F08DMOV 8,D
1054DADDI 4,D
11B2BCALL 2B„BERE“
1289CCMP 9,C
13E07BRZ 07
140C8MOV C,8
151CAMOVI C,A
161CBMOVI C,B
17F48DISP 4,8
1810FMOVI 0,F
19FEFDOT F
1A516ADDI 1,6
1BD1FBRC 1F
1C1FFMOVI F,F
1DFEFDOT F
1EC18GOTO 18
1FFF0KIN 0
20C00GOTO 00
„EE“2109DMOV 9,D
2255DADDI 5,D
23B2BCALL 2B„BERE“
240C8MOV C,8
251EAMOVI E,A
261EBMOVI E,B
271FFMOVI F,F
28FEFDOT F
29F48DISP 4,8
2AC1FGOTO 1F
„BERE“2B0DCMOV D,C
2C71DSUBI 1,D
2D10EMOVI 0,E
2EF03HXDZ
2F0D0MOV D,0
300E1MOV E,1
31F0DEXRL
32180MOVI 8,0
33F0CDIV
34F0DEXRL
35101MOVI 0,1
36180MOVI 8,0
37F0BMULT
3860CSUB 0,C
39F07RET
Now connect the piezo buzzer (see fig. below). Then start the program: HALT – NEXT – 00 – RUN
The display shows: 09. This means the computer places its first playing stone on field 9. We help it by placing a red marker on field 9.
We place a white stone on field 3 and enter the digit 3. The display now shows: 34. The computer thus confirms it has registered our field 3, and that it wants its own red stone on field 4.
So the computer cannot complete the diagonal row of stones, we place a white stone on field 8 (enter 8). The display reports: 81 – the computer wants a red stone on field 1.
We place our white stone, say, on field 6 (enter 6). The display reports: CC65 and an interrupted buzzing tone sounds.
The message CC65 means the computer will place its next red stone on field 5, so that 3 red stones now form a diagonal row. The computer has won.
As soon as any number key is pressed, a new game can begin, with the computer again placing its first stone on field 9.
Should we manage to force a „draw“, the display reports EE and twice the digit we last entered. This would also have been the digit the computer needed for a win. Since neither player can complete a row, the game ends in a „draw“. A continuous tone sounds until a new game is started by pressing a number key.
We will find it is impossible to win against the computer. A „draw“ is the best result we can achieve.
This is of interest to the programmer:
The computer's actual calculations are carried out in a subprogram (from address 2B to address 39). This subroutine „BERE“ (CALCULATION) is also shown in the program flow chart. The subroutine „BERE“ is called from addresses 0C, 11 or 23.
First, the value of register D is stored into register C. Then the computer calculates the following formula:
RC (Register C) = RC – 8 × ((RD – 1) : 8)
The value in register D is reduced by 1 and divided by 8. Suppose register D holds the value 4; reduced by 1, this leaves 3. 3 ÷ 8 gives 0 remainder 3. The remainder is not needed in the following calculations, so the next step gives 8 × 0 = 0. Since register C held the value 4 and 0 is subtracted, 4 remains. This clever formula ensures that a field between 1 and 9 is always occupied, preferably in a row or a diagonal.

Comparing the program table with the program flow chart shows us the individual functions.

In the program table, the „Label“ column marks the addresses at which the jumped-to program parts or subroutines begin. The „Jump to“ column likewise marks the addresses at which the jumps begin.

Program flow chart = Tic-Tac-Toe
„Sea Battle“ or „Battle in Space“

One could give this game many names. The strategy is as follows: on a playing field of 5 × 5 = 25 squares the computer hides 4 enemy ships. By entering the field coordinates, the ships must be found and shot down, i.e. sunk.

First, the game must be programmed. After HALT – NEXT – 00 we carefully make the entry (disconnect the piezo buzzer):

Program: Sea Battle
LabelAddr.CodeMnemonicJump to
00F02DISOUT
01F08CLEAR
02FE0DOT 0
03B53CALL 53„RND“
040D0MOV D,0
050E1MOV E,1
06B53CALL 53„RND“
07B6DCALL 6D„V1“
08D06BRC 06
090D2MOV D,2
0A0E3MOV E,3
0BB53CALL 53„RND“
0CB68CALL 68„V2“
0DD0BBRC 0B
0E0D4MOV D,4
0F0E5MOV E,5
10B53CALL 53„RND“
11B63CALL 63„V3“
12D10BRC 10
130D6MOV D,6
140E7MOV E,7
1510DMOVI 0,D
1610EMOVI 0,E
1710FMOVI 0,F
18F28DISP 2,8
19FF9KIN 9
1AF28DISP 2,8
1BFF8KIN 8
1CF02DISOUT
1D51DADDI 1,D
1EFBEADC E
1F880CMP 8,0
20E22BRZ 22
21C24GOTO 24
22891CMP 9,1
23E38BRZ 38„R0“
24882CMP 8,2
25E27BRZ 27
26C29GOTO 29
27893CMP 9,3
28E3ABRZ 3A
29884CMP 8,4
2AE2CBRZ 2C
2BC2EGOTO 2E
2C895CMP 9,5
LabelAddr.CodeMnemonicJump to
2DE3CBRZ 3C„R4“
2E886CMP 8,6
2FE31BRZ 31
30C33GOTO 33
31897CMP 9,7
32E3EBRZ 3E„R6“
331FCMOVI F,C
34FECDOT C
3510CMOVI 0,C
36FECDOT C
37C18GOTO 18
„R0“38100MOVI 0,0
39C40GOTO 40
„R2“3A102MOVI 0,2
3BC40GOTO 40
„R4“3C104MOVI 0,4
3DC40GOTO 40
„R6“3E106MOVI 0,6
3F1FCMOVI F,C
401FAMOVI F,A
41FEADOT A
4210AMOVI 0,A
43FEADOT A
4471CSUBI 1,C
45E47BRZ 47
46C40GOTO 40
4751FADDI 1,F
4894FCMPI 4,F
49E4EBRZ 4E
4A1AAMOVI A,A
4B1ABMOVI A,B
4CF48DISP 4,8
4DC19GOTO 19
4E10FMOVI 0,F
4FF03HXDZ
50F3DDISP 3,D
51FF0KIN 0
52C00GOTO 00
„RND“53F05RND
5490DCMPI 0,D
55E59BRZ 59
5695DCMPI 5,D
57D59BRC 59
58C5BGOTO 5B
5959DADDI 9,D
5AC54GOTO 54
5B90ECMPI 0,E
5CE60BRZ 60
5D95ECMPI 5,E
5ED60BRC 60
5FC62GOTO 62
6053EADDI 3,E
61C5BGOTO 5B
LabelAddr.CodeMnemonicJump to
62F07RET
„V3“638D4CMP D,4
64E66BRZ 66
65C68GOTO 68
668E5CMP E,5
67E74BRZ 74„STC“
„V2“688D2CMP D,2
69E6BBRZ 6B
6AC6DGOTO 6D
6B8E3CMP E,3
6CE74BRZ 74„STC“
„V1“6D8D0CMP D,0
6EE70BRZ 70
6FC72GOTO 72
708E1CMP E,1
71E74BRZ 74„STC“
72F0ARSC
73F07RET
„STC“74F09STC
75F07RET

Reconnect the piezo buzzer, then start the program: HALT – NEXT – 00 – RUN.

The display stays dark for 2 to 3 seconds. The computer is working, as can be seen from the blinking Carry and Zero flags. The display then shows: 00.

Meanwhile the computer has — invisibly to us — distributed the 4 ships across the playing field. The distribution is made using the random-number generator. The ships are therefore hidden in a different arrangement in every game. Let us assume that the ships are located at the positions marked with crosses on the playing plan (see fig.).

We can enter two digits. The first digit applies only to the vertical playing-field numbers, the second digit to the horizontal playing-field numbers. As an example we enter 42. The computer responds with a short tone and shows 42. In our example this shot was not a hit.

If we were now to enter, for example, 15, the computer produces an interval tone and the display reports: AA15. The first ship has been sunk. If we then entered the same number combination once more, no hit would be reported at this point, because the ship has already been sunk.

As soon as the fourth ship has also been hit, the computer reports back with the interval tone and 3 digits are shown on the display. We can read off how many attempts were needed to hit all 4 ships.

After pressing any number key, 4 ships are hidden again, the display shows 00 once more, and a new game can begin.

This is of interest to the programmer:

We compare the description with the program flow chart and the program table.

The game is relatively easy to program, because there is no special winning strategy. First the ships must be distributed. Random numbers between 1 and 5 are stored in registers 0 to 7. The coordinates of the first ship are in registers 0 and 1, those of the second ship in registers 2 and 3, and so on.

By means of the subroutines designated V1 (V = COMPARE), V2 and V3, it is ensured that no square is occupied twice when the ships are distributed.

The entered coordinates are then stored in registers 8 and 9. Comparison commands are used to check whether the entered coordinates match the coordinates of a hidden ship.

By means of the subroutine RND a random number is stored in registers D, E and F. The random numbers in registers D and E yield the coordinates of the hidden ships, which is why only the numbers between 1 and 5 are usable. Comparisons are used to check whether a random number of 0 or greater than 5 appears in these registers. If „yes“, the value 9 is added to register D (or the value 3 to register E) for as long as it takes until both random numbers have values between 1 and 5.

Flow chart Sea Battle (see page 8)
Program flow chart Sea Battle

In the program table, the „Label“ column has been used to indicate the addresses at which the referenced program sections — or subroutines — begin. In the „Jump to“ column it has likewise been indicated at which addresses the jumps begin.

Code Breaker

Code breakers are puzzle games. The best-known kinds of such code games are, for example, Master Mind and Super-Hirn.

In our Code Breaker, a 4-digit number code must be guessed.

Using its built-in random-number generator, the computer determines a 4-digit number combination, which is stored invisibly. It is not only the correct numbers that must be guessed, but the entire number combination in the correct order. The computer provides all information — for example whether a correct number has been found, whether it is in the correct position, and so on — and at the end of the game it announces how many guessing attempts were needed.

To be able to try out this interesting game, after HALT – NEXT – 00 we enter the following program:

Program: Code Breaker
LabelAddr.CodeMnemonicJump to
00F08CLEAR
01F49DISP 4,9
02FFCKIN C
03FFBKIN B
04FFAKIN A
05FF9KIN 9
06F02DISOUT
07F05RND
084D9ADD D,9
094EAADD E,A
0A4FBADD F,B
0B4DCADD D,C
0C579ADDI 7,9
0D999CMPI 9,9
0ED0CBRC 0C
0F57AADDI 7,A
1099ACMPI 9,A
11D0FBRC 0F
128A9CMP A,9
13E0FBRZ 0F
1457BADDI 7,B
1599BCMPI 9,B
16D14BRC 14
178B9CMP B,9
18E14BRZ 14
198BACMP B,A
1AE14BRZ 14
1B57CADDI 7,C
1C99CCMPI 9,C
1DD1BBRC 1B
1E8C9CMP C,9
1FE1BBRZ 1B
208CACMP C,A
21E1BBRZ 1B
228CBCMP C,B
23E1BBRZ 1B
2410DMOVI 0,D
2510EMOVI 0,E
2610FMOVI 0,F
LabelAddr.CodeMnemonicJump to
27F61DISP 6,1
28FF0KIN 0
299A0CMPI A,0
2AE33BRZ 33„Vergl.“
2BD31BRC 31„Zahl“
2C034MOV 3,4
2D023MOV 2,3
2E012MOV 1,2
2F001MOV 0,1
30C27GOTO 27
„Zahl“31F49DISP 4,9
32C60GOTO 60
„Vergl.“33F02DISOUT
34105MOVI 0,5
35106MOVI 0,6
36017MOV 1,7
37098MOV 9,8
38B65CALL 65„SR“
390A8MOV A,8
3AB6ACALL 6A„ZR“
3B0B8MOV B,8
3CB6ACALL 6A„ZR“
3D0C8MOV C,8
3EB6ACALL 6A„ZR“
3F027MOV 2,7
40B6ACALL 6A„ZR“
410B8MOV B,8
42B6ACALL 6A„ZR“
430A8MOV A,8
44B65CALL 65„SR“
45098MOV 9,8
46B6ACALL 6A„ZR“
47037MOV 3,7
48B6ACALL 6A„ZR“
490A8MOV A,8
4AB6ACALL 6A„ZR“
4B0B8MOV B,8
4CB65CALL 65„SR“
4D0C8MOV C,8
4EB6ACALL 6A„ZR“
4F047MOV 4,7
50B65CALL 65„SR“
510B8MOV B,8
52B6ACALL 6A„ZR“
530A8MOV A,8
54B6ACALL 6A„ZR“
55098MOV 9,8
56B6ACALL 6A„ZR“
5751DADDI 1,D
58FBEADC E
59FBFADC F
5A946CMPI 4,6
5BE5DBRZ 5D
LabelAddr.CodeMnemonicJump to
5CC27GOTO 27
5D1E0MOVI E,0
5E1E5MOVI E,5
5FF60DISP 6,0
60FF0KIN 0
61F03HXDZ
62F3DDISP 3,D
63FF0KIN 0
64C00GOTO 00
„SR“65878CMP 7,8
66E68BRZ 68
67C69GOTO 69
68516ADDI 1,6
69F07RET
„ZR“6A878CMP 7,8
6BE6DBRZ 6D
6CC6EGOTO 6E
6D515ADDI 1,5
6EF07RET

Program start: HALT – NEXT – 00 – RUN.

The display shows: 0000. Now we have to help the computer find a random number combination. To do this we enter 4 arbitrary numbers or letters (this entry has nothing to do with the number combination to be guessed later). The display switches off for 1 second – then 000000 is shown. The computer has determined the number combination to be guessed and stored it invisibly.

For the guessing process we can always enter 4 numbers between 0 and 9, for example 1 – 2 – 3 – 4. The entered numbers are displayed. By pressing key A, the computer compares the entered number values with the invisibly stored number combination. The display shows a 6-digit readout, in which the four rightmost digits continue to show the previously entered number combination (e.g. 1 – 2 – 3 – 4). If, for example, 00 is shown on the two left digits, this means that no number was guessed correctly.

If the display shows, for example, „01“ on the two left digit positions, this would mean:

0 = no correctly guessed number in the correct position.
1 = one correct number, but in the wrong position.

A reading of, for example, 21 on the two left display positions would mean that we have guessed 2 correct digits in the correct position, and that we have guessed 1 further correct number which, however, is in the wrong position. After we have entered the number combination 1 – 2 – 3 – 4, it would be established that three of these numbers were guessed correctly, of which two are in the correct position, while one is in the wrong position and one number in the combination invisibly fixed by the computer still has to be guessed.

The following small table once again demonstrates to us how the display shows the values:

= entered number combination
= correct number, but in the wrong position
= correct number, in the correct position

We keep guessing. Enter four new numbers – press key A. As soon as the display reports correct numbers on the two left digit positions, we should write down the entered number combinations, so that by shifting and re-entering the individual digits we can guess the correct number combination step by step.

The Code Breaker is an interesting game and it requires a lot of logical thinking to find the correct number combination. With every new entry, do not forget to press key A.

If after some time we were to find the correct number combination, for example by entering the numbers 6 – 8 – 5 – 7 (then key A), the display reports: E6857E. If we then press key A once more, the display shows in three digits how many attempts were needed.

If key A is pressed again, the display reports, as at the start of the game: 0000, and as soon as 4 arbitrary number keys have been pressed, a new Code Breaker game can begin.

If the course of the game takes too long for us, we can have the computer display the number combination it has fixed by pressing key B. However, this aborts the game, and when key A is pressed again the number of guessing attempts made so far is shown on the display.

The program must be entered very carefully, because if a command is entered incorrectly the computer’s ongoing calculations will not be right and thus incorrect results will be displayed. We can test this very easily if, at the beginning after a few guessing attempts, we have the number combination to be guessed displayed by pressing key B. If necessary, check and correct the program with HALT – NEXT – 00 and further presses of the NEXT key.

This is of interest to the programmer:
Program flow chart: Code Breaker

We again compare the program table and the flow chart. The first part of the program (addresses 00 to 23) provides the four different random numbers that have to be guessed later. Although we determine these random numbers with the help of the random-number generator integrated in the microprocessor, it is difficult to effectively obtain four independent (mutually different) random numbers. Suppose one were simply to store the resulting random numbers in the 4 registers by means of 4 RND commands placed one after another – then numbers „dependent“ on one another would arise. If, for example, the first random number were the digit 1, the next 3 digits would depend on this number; i.e. every time the first random number turns out to be the digit 1, the same number combination would result. This happens because the execution times of the commands are always equal in length, and so the „random counter“ also counts on by the same number of steps within this same time interval.

To obtain four mutually independent random numbers, the following trick was used: 4 arbitrary digits are entered, and to each of these a random number is added. It is then checked whether these numbers are smaller than 9. If this is not the case, the value 7 is added repeatedly until values result that are 9 or smaller than 9. In this way the hexadecimal digits A to F are eliminated.

In addition, the four random numbers are checked to see whether perhaps an identical number is present twice. If so, the value 7 is again added until all 4 random numbers are different. In this way four different and mutually independent random numbers are determined.

At address 28, the „guessing numbers“ are entered.

At address 31 the random numbers can be displayed. At addresses 57 to 59 the number of guessing attempts is counted hexadecimally in registers D to F. The comparison command at address 5A checks whether register 6 contains the value 4. If so, the correct number combination has been guessed.

In the program table, the first column also gives notes on the addresses at which the individual jump targets begin, while the last column contains notes on the addresses at which corresponding jumps – for example to the subroutines – are carried out.

The individual working steps can be seen from the program flow chart. In registers 1 to 4 the „guessing number“ devised by the player is entered, and then each individual entered digit is compared with the computer’s random numbers stored in registers 9 to C. This gives rise to the jumps to the subroutine „SR“ (= position correct?), or to the subroutine „ZR“ (= number correct?). The subroutine „SR“ checks whether the correct number is in the correct position. If this is the case, the value 1 is added to register 6.

In the subroutine „ZR“ it is checked whether a correct number has indeed been entered but is in the wrong position. If so, the value 1 is added to register 5.

The number of attempts is counted hexadecimally in registers D, E and F. Only when the number of attempts is to be displayed is the hexadecimal result converted into decimal numbers.

It is impossible, with these longer programs, to explain every single program step (as in the first part of the instruction book). Anyone who takes the trouble to work through the program flow chart consistently, however, will quickly understand the meaning and the operation of the program.

„Take 2“

In the first part of the instruction book we got to know a simple version of the Nim game (fixed program PGM 7). The following program is a far more interesting variant of the Nim game. Whereas in the simple version we had only one pile from which the matchsticks were to be removed, there are now three piles, from which the matchsticks can be removed alternately, one pile at a time. At least 1 matchstick must be taken, but a whole pile may also be removed. The winner is the one who can take the last (or the last few) matchsticks. Note the difference from the earlier Nim-game version, in which the player who had to take the last matchstick lost the game.

The new version „Take 2“ can be played at three different skill levels. To say it in advance: at skill level 3 it is almost impossible to win against the computer.

Before the course of the game is explained, first enter the program according to the table after HALT – NEXT – 00.

Program: Take 2
LabelAdr.CodeMnemonicJump toExplanation
00F08CLEAR
01FE0DOT 0
02F10DISP 1,0
03FF8KIN 8Entering the skill level
04F61DISP 6,1
05FF3KIN 3Entering the pile sizes
06FF2KIN 2
07FF1KIN 1
08FF6KIN 6From which pile?
09FF5KIN 5„how many?“
0A905CMPI 0,5Zero?
0BE23BRZ 23„SCOMP“Yes, then the computer’s first move
0CC12GOTO 12
0D105MOVI 0,5
0EFF6KIN 6„which pile?“
0FF61DISP 6,1
10FF5KIN 5„how many?“
11E10BRZ 10if zero, repeat „how many?“
12916CMPI 1,6Pile 1?
13E1EBRZ 1E
14926CMPI 2,6Pile 2?
15E1ABRZ 1A
16815CMP 1,5Is the entry greater than pile 3?
17D0EBRC 0EYes, then re-enter
18651SUB 5,1
19C21GOTO 21„SPGEW“
1A825CMP 2,5Entry greater than pile 2?
1BD0EBRC 0EYes, then re-enter
1C652SUB 5,2
1DC21GOTO 21„SPGEW“
1E835CMP 3,5Entry greater than pile 1?
LabelAdr.CodeMnemonicJump toExplanation
1FD0EBRC 0EYes, then re-enter
20653SUB 5,3
„SPGEW“21B5CCALL 5C„GEW“All three piles zero?
22D4EBRC 4E„SPGEW“Yes, then the player has won
„SCOMP“23F02DISOUTCalculation of the computer’s move
2401DMOV 1,DPile 3 (register 1) and pile 2 are stored in reg. D and E and added without carry
2502EMOV 2,E
26B66CALL 66„XOR“
278D3CMP D,3Result (reg. D) smaller than pile 1 (reg. 3)?
28E35BRZ 35„-1“(if equal, then jump to „-1“)
29D42BRC 42„E1“Yes, jump to „E1“
2A03DMOV 3,D
2B01EMOV 1,E
2CB66CALL 66„XOR“
2D8D2CMP D,2
2EE35BRZ 35„-1“
2FD48BRC 48„E2“
3002DMOV 2,D
3103EMOV 3,E
32B66CALL 66„XOR“
338D1CMP D,1
34D4ABRC 4A„E3“
„-1“35901CMPI 0,1„Default move“: take one away from one of the three piles
36E39BRZ 39
37711SUBI 1,1
38C3EGOTO 3E„CGEW“
39902CMPI 0,2
3AE3DBRZ 3D
3B712SUBI 1,2
3CC3EGOTO 3E„CGEW“
3D713SUBI 1,3
„CGEW“3EB5CCALL 5C„GEW“All three piles zero?
3FD59BRC 59„CGEW“Yes, then the computer has won
40F31DISP 3,1Otherwise display the piles anew
41C0DGOTO 0D
„E1“42918CMPI 1,8at skill level 1 or 2 (which is in register 8) carry out only one „default move“
43E35BRZ 35„-1“
44928CMPI 2,8
45E35BRZ 35„-1“
460D3MOV D,3Otherwise RD is the result
47C3EGOTO 3E
„E2“480D2MOV D,2RD is the result (pile 2)
49C3EGOTO 3E
„E3“4A918CMPI 1,8Skill level 1?
4BE35BRZ 35„-1“Yes, then default move („-1“)
4C0D1MOV D,1Otherwise reg. D is the result (pile 3)
4DC3EGOTO 3E
LabelAdr.CodeMnemonicJump toExplanation
„SPGEW“4E1F0MOVI F,0Display: player has won
4FFE1DOT 1
50519ADDI 1,9
51E54BRZ 54
52FE0DOT 0
53C4FGOTO 4F
541E5MOVI E,5
551E6MOVI E,6
56F61DISP 6,1
57FF0KIN 0
58C00GOTO 00
„CGEW“591F0MOVI F,0Display: computer has won
5AFE0DOT 0
5BC54GOTO 54
„GEW“5C901CMPI 0,1Subroutine „GEW“ checks whether all three piles are zero
5DD64BRC 64
5E902CMPI 0,2
5FD64BRC 64
60903CMPI 0,3
61D64BRC 64
62F09STCall piles zero: set carry flag
63F07RET
64F0ARSCotherwise reset carry flag
65F07RET
„XOR“660ECMOV E,CSubroutine „XOR“: registers D and E are added without carry. The result is in reg. D
672DCAND D,C
68AEDOR E,D
69F8DINV D
6AACDOR C,D
6BF8DINV D
6CF07RET

Now the piezo buzzer should be connected as usual. Then start the program: HALT – NEXT – 00 – RUN.

The display shows 0. The computer wants to know the skill level – we enter, for example, a 1. The display now shows: 000000.

It must be specified how many matchsticks are to lie on the three piles. Example: pile no. 1 has 3 matchsticks (enter 3). Pile no. 2 has 4 matchsticks (enter 4) and pile no. 3 has 5 matchsticks (enter 5). The display now shows 000345.

We want to take 1 matchstick from the second pile (entry 2 1). The display should now show: 335 – but in fact the display shows: 334, because the computer has likewise taken 1 matchstick, namely from the third pile.

We now take the remaining 4 matchsticks from the third pile (entry 3 4). The display should read: 330. But after the computer likewise takes 1 matchstick from the second pile, the display actually shows: 320.

We now take 1 matchstick from the first pile (entry 1 1) and, taking into account that the computer simultaneously takes 1 matchstick from the second pile as well, the display shows: 210. Since the computer too can only ever take from one pile, we arrange things so that, after our removal, 1 matchstick remains on each of the remaining first and second piles.

So we take 1 of the 2 matchsticks of the first pile away (entry 1 1). The computer takes the last remaining matchstick from the second pile, and the display shows: 100. Now that we can take the last matchstick, we are the winner; the display reports: EE0000, and the piezo buzzer sounds an interval tone, which is switched off automatically after a short time.

As soon as any number key is pressed, 0 appears on the display again – a new game can begin.

We can choose a new skill level (entry: 1 or 2 or 3). The pile size to be entered now must be at least 1 or at most 9. On each move, any number of matchsticks may be taken, but always only from one pile. On the next move the removal can be made from a different pile. If the computer is to begin the game (to take the first matchsticks), after entering the pile size we enter: 00. The following 3-digit display then shows the three remaining pile sizes for our entry (as described).

If the computer wins (because we have given it the chance to take the last matchstick(s)), the display likewise shows the message: EE0000. At the same time a continuous tone sounds until the start of the game is reached again by pressing a key. For a new start of the game, always enter the skill level first.

If we make an incorrect entry (e.g. taking more matchsticks from a pile than there are), the computer notices that cheating has occurred – the program stops. We enter the pile number and the number of matchsticks to be removed once more (but without cheating). The program run can then be continued. Or restart the program with HALT – NEXT – 00.

If we enter skill level 2 at the start of the game, we already have to concentrate a little more to win the game. If skill level 3 is entered, we will hardly succeed in beating the computer. Here it becomes very clear that, through intelligent programming, we can bring the computer to the point where it beats us with our own weapons. An interesting prospect – reminiscent, for example, of science-fiction films in which computers and robots programmed by humans defeated intelligent humankind.

This is of interest to the programmer:

In the program table, the first column again marks the addresses at which the jump targets begin. In the second-to-last column (next to Explanations) the addresses can be recognized from which the jumps to the jump targets are made. For this, a few abbreviations are used:

„-1“ = carry out „default move“
„CGEW?“ = computer wins?
„SPGEW“ = player wins
„XOR“ = subroutine „XOR“
„GEW“ = subroutine win-calculation
„E1“, „E2“, „E3“ = entry of the skill level (1 or 2 or 3).
„SCOMP“ = computer’s move

For the game „Take 2“, similar to the simple Nim-game version, there is an „optimal winning strategy“ which allows either the player or the computer to win. There is no draw.

As in the Nim game, there are „winning numbers“ or „safe positions“. A typical example of these are the so-called „pairs“, as for instance with the display reading: 033 (33 = pair). In this example the game state would be: first pile 0, second pile 3 and third pile likewise 3. In this situation the opposing player has the following three options:

1. From 033, after removal: 032 or 023.
2. From 033, after removal: 031 or 013
3. From 033, after removal: 030 or 003

From the first and second options a new „pair“ can again be formed. With the third option the player will win, because the opponent leaves only 3 matchsticks remaining on one pile, which remain for the last move (i.e. for the winner).

For the computer there is a relatively simple way to determine whether it has reached a winning position. We recall the chapter „logical operations“, in which it was demonstrated that with the AND and OR commands the individual bits within the binary number system can be changed.

Let us assume that the values 1 – 2 – 3 are still present on the three piles; represented in binary, this looks as follows:

1= binary0001
+2= binary0010
+3= binary0011
binary0000
An AND/OR combination yields

In the preceding example the columns of the individual binary numbers were „added“ (without carry), which yields an overall result of 0000. The overall result 0000 means a „safe position“!

Another example: the following matchsticks still remain on the three piles: 033. Represented in binary, the following situation results:

0= binary0000
+3= binary0011
+3= binary0011
binary0000
An AND/OR combination yields
Simplified program flow chart for calculating a „safe position“
HF = pile size

At the start the piles are: 2 – 4 – 5, so HF 1 = 2 matchsticks, HF 2 = 4 matchsticks, HF 3 = 5 matchsticks.

Calculation examples: Decimal Binary
HF 1=20010
HF 2= +40100
Result=60110

No! Since the result 6 is greater than HF 3 (5 matchsticks), continue calculating:

HF 1=20010
HF 3= +50101
Result=70111

No! Since the result 7 is greater than HF 2 (4 matchsticks), continue calculating:

HF 2=40100
HF 3= +50101
Result=10001

Yes! The result 1 is greater than HF 1 (2 matchsticks). A safe position results if the computer takes one matchstick from HF 1, because then:

HF 1=10001
HF 2=40100
HF 3=50101
Result=(1)00000
no carry

With an „unsafe position“ the result would not be 0000. This is to be shown likewise in binary with the pile sizes: 2 – 4 – 5:

2= binary0010
+4= binary0100
+5= binary0101
binary0011
An AND/OR combination yields

From the examples we see that with the binary values, an „addition“ gives the following: 0 + 0 + 0 = 0. Or: 0 + 1 + 1 = 0. Or (see the third example with pile sizes 2 – 4 – 5): 1 + 0 + 0 = 1. Or: 0 + 0 + 1 = 1. Three times 0 added gives 0. A 0 and the digit 1 twice, added together, likewise gives 0. However, the digit 0 twice plus a 1 added together gives 1.

The binary digit positions were „added without carry“. An addition without carry is a so-called XOR (exclusive or) operation, which can be achieved by means of several AND and OR commands.

In a simplified program flow we have shown which arithmetic operations the computer must carry out in order to arrive at a „safe position“. To the right of the flow chart, the calculation examples are shown in decimal and binary. We assume that the three pile sizes have the values (number of matchsticks): 2   4   5.

When skill level 1 was entered, it was easily possible to win against the computer. From the preceding presentation we know that the computer always tries to compute a „safe position“ by forming „pairs“. If at skill level 3 we enter, for example, pile sizes for which a pair results (e.g. 0 6 6), it is no longer possible to win against the computer. Let us try it out!

Insight: A „safe position“ for the player against the computer cannot be reached if, already at the start of the game (or during the course of the game), the computer has reached a „safe position“ through „pair formation“. As long as the computer does not reach a „safe position“, it makes a „default move“ by taking only 1 matchstick from one of the three piles, in the hope that the opponent does not pay attention, so as to still reach a „safe position“ during the course of play after all.

To better understand the entire program flow, let us look at the program flow chart in individual sections.

Figure 1 shows, on the left side, the entry of the skill level and the entry of the pile sizes. On the right side it is demonstrated what happens as soon as a player takes a matchstick from a pile. Above all it is checked whether the removed number of matchsticks is permissible at all (e.g. whether 0 is taken, or whether more matchsticks are taken from a pile than are present). Then the corresponding number of matchsticks is subtracted from the corresponding pile, and a jump to the subroutine (subprogram) „GEW“ (= WIN-CHECK) takes place, where it is checked whether the player has won.

„Take 2“ Figure 1

Figure 2 shows the calculation of the computer’s moves. The flow chart is constructed similarly to that for the „calculation of a safe position“. Additionally, in this part of the program the queries are built in as to which skill level was chosen (register 8 = 1? or register 8 = 2?). If, for example, skill level 1 or 2 was entered, the computer does not

always make the „optimal move“, but rather a „default move“. The default move is calculated in program part „-1“ at the program transition point ⑤, by subtracting the value 1 from a register that does not have the value 0.

In Figure 2 we also recognize the reference to the subroutine „XOR“, in which the binary addition without carry is carried out.

Figure 3 shows the subprograms: subroutine „GEW“ and „XOR“.

Regarding the subprogram „XOR“ the following should also be noted: An „addition without carry“ is a so-called XOR operation. By this it is achieved that the result of a binary digit to be added gives the value 1 only if either the one or the other digit of the binary numbers to be added is 1. If both digits to be added are 1, or both digits to be added are 0, then the result must also be 0. This was already explained at the beginning of the program description. The XOR operation is achieved in the subprogram by the successive logical commands AND, OR and INV.

„Take 2“ Figure 2
„Take 2“ Figure 3

For program specialists, the following table with the register assignment should also not be uninteresting:

Register assignment „Take 2“
HF = pile size
Register assignment „Take 2“
Register no.0123456789ABCDEF
Register contentfreeHF 3HF 2HF 1freehow many?from which pile?freeskill levelfreefreefree„XOR“„XOR“„XOR“free
Complete program flow chart „Take 2“
Morse Code Decoder

After HALT – NEXT – 00 the large program is entered very carefully. The piezo buzzer still connected from the previous experiment is disconnected during programming and reconnected after the program entry. In addition, a connecting lead is to be made between the TAKT/CLOCK socket and INPUT 4.

During programming we notice that, for example, at addresses 1D and 1E the NOP command is used, and that especially in the second half of the program the same commands have to be entered several times in succession. These repeated, identical commands are necessary. An explanation is found in the following chapter „Morse Trainer“.

Program: Morse Code Decoder / Trainer
LabelAdr.CodeMnemonicJump
to
Explanation
00F01NOPInput routine
01F02DISOUT
02F08CLEAR
03FE0DOT 0
04FF1KIN 1
059D1CMPI D,1
06D29BRC 29„BUCHS“„BUCHS“ = letters
079A1CMPI A,1
08EA2BRZ A2„PUNKT“
099B1CMPI B,1
0AEA9BRZ A9„KOMMA“
0B9C1CMPI C,1
0CEBEBRZ BE„AUTO“„AUTO“ = automatic Morse
0DDB0BRC B0„SOS“
0E155MOVI 5,5
0F951CMPI 5,1Entered number greater or less than 5?
10D1FBRC 1F„>5“
11901CMPI 0,1
12E18BRZ 18
13615SUB 1,5Generation of the Morse sign for the digits 1 to 5
14BD7CALL D7„•“
15711SUBI 1,1
16E18BRZ 18
17C14GOTO 14
18905CMPI 0,5
19E00BRZ 00
1ABE3CALL E3„—“
1B715SUBI 1,5
1CC18GOTO 18
1DF01NOP
1EF01NOP
„>5“1F751SUBI 5,1Generation of the Morse sign for the digits 6 to 9
20615SUB 1,5
21BE3CALL E3„—“
22711SUBI 1,1
23E25BRZ 25
24C21GOTO 21
25BD7CALL D7„—“
26715SUBI 1,5
27E00BRZ 00
28C25GOTO 25
LabelAdr.CodeMnemonicJump
to
Explanation
„BUCHS“29FF2KIN 2
2A9F1CMPI F,1
2BE46BRZ 46„BU 2“Key „BU 2“
2C902CMPI 0,2Formation of the auxiliary code for the letters
2DE60BRZ 60„A“
2E912CMPI 1,2
2FE64BRZ 64„C“
30922CMPI 2,2
31E68BRZ 68„E“
32932CMPI 3,2
33E6CBRZ 6C„G“
34942CMPI 4,2
35E70BRZ 70„I“
36952CMPI 5,2
37E74BRZ 74„K“
38962CMPI 6,2
39E78BRZ 78„M“
3A972CMPI 7,2
3BE7CBRZ 7C„O“
3C982CMPI 8,2
3DE80BRZ 80„Q“
3E992CMPI 9,2
3FE84BRZ 84„S“
409A2CMPI A,2
41E88BRZ 88„U“
429B2CMPI B,2
43E8CBRZ 8C„W“
„Y“441B2MOVI B,2
45C96GOTO 96„4“
„BU 2“46902CMPI 0,2
47E62BRZ 62„B“
48912CMPI 1,2
49E66BRZ 66„D“
4A922CMPI 2,2
4BE6ABRZ 6A„F“
4C932CMPI 3,2
4DE6EBRZ 6E„H“
4E942CMPI 4,2
4FE72BRZ 72„J“
50952CMPI 5,2
51E76BRZ 76„L“
52962CMPI 6,2
53E7ABRZ 7A„N“
54972CMPI 7,2
55E7EBRZ 7E„P“
56982CMPI 8,2
57E82BRZ 82„R“
58992CMPI 9,2
59E86BRZ 86„T“
5A9A2CMPI A,2
5BE8ABRZ 8A„V“
5C9B2CMPI B,2
5DE8EBRZ 8E„X“
„Z“5E9C2MOVI C,2
5FC96GOTO 96„4“
LabelAdr.CodeMnemonicJump
to
Explanation
„A“60142MOVI 4,2„2“ = 2 tone sequences
61C92GOTO 92„2“
„B“62182MOVI 8,2
63C96GOTO 96„4“
„C“641A2MOVI A,2
65C96GOTO 96„4“
„D“66182MOVI 8,2
67C94GOTO 94„3“
„E“68102MOVI 0,2
69C90GOTO 90„1“
„F“6A122MOVI 2,2
6BC96GOTO 96„4“
„G“6C1C2MOVI C,2
6DC94GOTO 94„3“
„H“6E102MOVI 0,2
6FC96GOTO 96„4“
„I“70102MOVI 0,2
71C92GOTO 92„2“
„J“72172MOVI 7,2
73C96GOTO 96„4“
„K“741A2MOVI A,2
75C94GOTO 94„3“
„L“76142MOVI 4,2
77C96GOTO 96„4“
„M“781C2MOVI C,2
79C92GOTO 92„2“
„N“7A182MOVI 8,2
7BC92GOTO 92„2“
„O“7C1E2MOVI E,2
7DC94GOTO 94„3“
„P“7E162MOVI 6,2
7FC96GOTO 96„4“
„Q“801D2MOVI D,2
81C96GOTO 96„4“
„R“82142MOVI 4,2
83C94GOTO 94„3“
„S“84102MOVI 0,2
85C94GOTO 94„3“
„T“86182MOVI 8,2
87C90GOTO 90„1“
„U“88122MOVI 2,2
89C94GOTO 94„3“
„V“8A112MOVI 1,2
8BC96GOTO 96„4“
„W“8C162MOVI 6,2
8DC94GOTO 94„3“
„X“8E192MOVI 9,2
8FC96GOTO 96„4“
LabelAdr.CodeMnemonicJump
to
Explanation
„1“90111MOVI 1,1
91C97GOTO 97
„2“92121MOVI 2,1
93C97GOTO 97
„3“94131MOVI 3,1
95C97GOTO 97
„4“96141MOVI 4,1
97FA2SHL 2Generation of the Morse signs for the letters from the auxiliary code
98D9DBRC 9D
99BD7CALL D7„•“
9A711SUBI 1,1
9BE9FBRZ 9F
9CC97GOTO 97
9DBE3CALL E3„—“
9EC9AGOTO 9A
9F906CMPI 0,6
A0E00BRZ 00
A1CC7GOTO C7„AUMO“„AUMO“ = form automatic Morse signs
„PUNKT“A2BD7CALL D7„•“
A3BE3CALL E3„—“
A4BD7CALL D7„•“
A5BE3CALL E3„—“
A6BD7CALL D7„•“
A7BE3CALL E3„—“
A8C9FGOTO 9F
„KOMMA“A9BE3CALL E3„—“
AABE3CALL E3„—“
ABBD7CALL D7„•“
ACBD7CALL D7„•“
ADBE3CALL E3„—“
AEBE3CALL E3„—“
AFC9FGOTO 9F
„SOS“B0BD7CALL D7„•“
B1BD7CALL D7„•“
B2BD7CALL D7„•“
B35FFADDI F,F
B45FFADDI F,F
B5BE3CALL E3„—“
B6BE3CALL E3„—“
B7BE3CALL E3„—“
B85FFADDI F,F
B95FFADDI F,F
BABD7CALL D7„•“
BBBD7CALL D7„•“
BCBD7CALL D7„•“
BDC00GOTO 00
„AUTO“BE116MOVI 1,6
BFF17DISP 1,7
Program continued on page 20
LabelAdr.CodeMnemonicJump
to
Explanation
C0FF7KIN 7
C1F27DISP 2,7
C2FF8KIN 8
C3EC6BRZ C6
C4F60DISP 6,0
C5CC7GOTO C7
C6F02DISOUT
„AUMO“C71FFMOVI F,FGeneration of the random Morse signs
C871FSUBI 1,F
C9ECBBRZ CB
CACC8GOTO C8
CB4ADADD A,D
CC87DCMP 7,D
CDDD5BRC D5
CE0D2MOV D,2
CF90ECMPI 0,E
D0ED3BRZ D3
D11E1MOVI E,1
D2C2AGOTO 2A
D31F1MOVI F,1
D4C2AGOTO 2A
D557DADDI 7,D
D6CCCGOTO CC
„•“D71F4MOVI F,4Subroutine for „•“
D8FE4DOT 4
D95FFADDI F,F
DA5FFADDI F,F
DB104MOVI 0,4
DCFE4DOT 4
DDFDEDIN E
DEEE1BRZ E1
DF53AADDI 3,A
E0F07RET
E15CAADDI C,A
E2F07RET
„—“E31F4MOVI F,4Subroutine for „—“
E4FE4DOT 4
E5714SUBI 1,4
E6EE8BRZ E8
E7CE5GOTO E5
E8FE4DOT 4
E9FDEDIN E
EAEECBRZ EC
EBF8AINV A
ECF07RET
Program start as usual with HALT – NEXT – 00 – RUN.

When key 0 is pressed, a long tone sounds five times. If, for example, key 7 is pressed, the result is twice long and three times short.

If we have not learned the Morse alphabet, we compare with the alphabet table, and with each press of a number key the computer produces the corresponding Morse sign.

Morse Code

Of course we can represent not only numbers but all the letters of the alphabet in Morse code. For this, the available keys must be used multiple times. To make this multiple assignment easier for us, among the accessories of the Microtronic computer we find, among other things, a silver keypad mask with the inscription (bottom left) „Morse Decoder“.

Place the keypad mask on the keypad with the smoke-glass-colored cover hood open, and close the hood again. In the top row (second key from the left) we have SOS. When this key is pressed, the computer automatically produces the international distress signal „three times short – three times long – three times short“. The key that was previously used only for the digit 0 is now also responsible for the letters A and B.

If we press this key (in the bottom row on the left), the result is, as before, five times long. If in the top row we press the key labeled BU 1 and then the key OAB, the result is „short-long“, i.e. the Morse sign A. If at the top right the key BU 2 and then again the key OAB is pressed, the result is „long – three times short“, i.e. the Morse sign B. One quickly gets used to the fact that, for representing the letters, one of the keys BU 1 or BU 2 is additionally required in each case.

Even if we cannot do Morse, after a short time we are able to put together complete „radio messages“. Many an amateur radio operator might turn pale with envy.

The special function of the key at the top left with ↑YZ is explained in the following chapter.

The entire experimental setup and programming remains in place for the following chapter.

Morse Trainer

The preceding program „Morse Code Decoder“ offers us the possibility of learning the Morse alphabet within a short time. Even if a learning effect is not desired, it is interesting to try out this program variation.

We press the key at the top left, ↑YZ. The display shows: 0. If we now press the key OAB twice, the computer automatically sends the Morse signs A and B in irregular order.

We abort the program with HALT and start again with NEXT – 00 – RUN. Press the arrow key again, then the key „OAB“ and after that „1CD“. All 6 digits light up on the display and the computer repeats the Morse process of the letters A and B very slowly, which makes it possible to write the signs down. Conclusion: with an entry of 00 (key „OAB“ twice) the signs are sent quickly. With the entry (key „OAB“ and „1CD“) slow Morse signs result.

We abort the program once more and restart with HALT – NEXT – 00 – RUN, press the arrow key again, then „1CD“ and either „1CD“ again (1 = slow) or „OAB“ (O = fast); the computer automatically sends the Morse signs A, B, C and D in irregular order.

If, after HALT – NEXT – 00 – RUN, we again press the arrow key, then „2EF“ (and again 0 for fast or 1 for slow), the computer sends the letters A, B, C, D and F in irregular order.

After HALT – NEXT – 00 – RUN we now press the arrow key twice in succession and additionally 0 for slow or 1 for fast. The computer now sends the entire Morse alphabet with letters, signs and numbers in irregular, random order. A Morse machine for arbitrarily long radio messages, whose content, because of the random sequence, will not always be meaningful. For learning the Morse alphabet, however, an excellent training device.

Should the computer stop the automatic Morse-sign playback by itself after some time, it has ended up in an „endless loop“, i.e. an error has crept in during programming. The entire program would have to be checked carefully once more.

This is of interest to the programmer:

To convert all letters and numbers into Morse signs, various „program tricks“ are necessary.

In the program table we have, at addresses 00 to 0D, the „input routine“. By querying whether, or which, letter key was pressed, a jump is made to the corresponding parts of the program. If no letter key was pressed, the entered value is a number (0 to 9) that is to be converted into Morse signs.

The conversion is relatively easy to solve. For example, all the numbers from 0 to 9 consist of five Morse signs (short or long, i.e. dot or dash). The numbers 1 to 5 each begin with dots and are continued with dashes (e.g. 1 = „• – – – –“, or once short and four times long).

For the numbers 1 to 5, the number of dots (short tones) is stored in register 1 (input register). In register 5 the number of dashes (long tones) is stored. The number of dashes (long tones) is 5 minus the input value. Example: the number 1. Five dashes minus the input value (key value) 1 gives four dashes and one dot. By jumping to the subroutine „•“ a short tone is generated and the value contained in register 1 is decreased by „1“. Then another short tone is generated, whereby again the value „1“ is subtracted from

the content of register 1. This repeats until the content of register 1 has reached the value 0. After that, in the subroutine „–“ a long tone is generated and the value in register 5 is likewise decreased by „1“. This process too repeats until the content of register 5 has reached the value 0. If, for example, the digit 3 was entered to generate the corresponding Morse sign, register 1 is responsible for the three dots (short tones) and register 5 for the two dashes (long tones).

For the digits 6 to 9, at the beginning of the Morse sign there is in each case a dash (long tone) followed by a corresponding number of dots (short tones). In this case the total number of long tones is the entered value minus 5. For the number 7, for example, first two long tones and then three short tones must be generated.

The „decoding“ of letters becomes more difficult. Here too a trick can be applied. The longest Morse sign for letters consists of four „tones“ (i.e. dots or dashes).

The tone sequence short or long (dot or dash) can be achieved by means of a binary number. Example: the Morse sign F = „• • – •“

If we use a binary 0 for dots and a binary 1 for dashes, then for the Morse sign F the binary representation 0010 results, which corresponds to the binary number 2 (see the bit-pattern table).

If the binary arrangement 0010 is shifted to the left by the SHL command, the first shift gives the carry flag 0, and for this a short tone (dot) must be generated. On the second shift to the left the carry flag is again 0. On the third shift a carry flag of 1 results (a long tone must be generated), and on the fourth shift to the left the carry flag becomes 0 again (i.e. a short tone).

The letter A has the Morse sign: „• –“, and for this the binary arrangement 0100 (binary number 4) can be used. However, this binary arrangement may be shifted to the left only twice, because for the representation only one short and one long tone are needed.

So we must convert the letters into a two-digit code. The first digit of the code indicates the number of tones, the second code digit the binary number (which is also called the „bit pattern“). The bit pattern (binary number) is used for the tone sequence (long or short). The letter A thus has the code 24 (2 = 2 tone sequences, 4 = binary number 4 = 0100). The letter F has the code 42 (4 = 4 tone sequences, 2 = binary number 2 = 0010).

The Morse sign F should be self-evident. The binary arrangement 0010 gives the Morse sign: „• • – •“

Less self-evident is the method for the letter A. The binary arrangement 0100 gives a Morse sign „• – • •“. An A, however, has the Morse sign „• –“ (i.e. that we have 2 dots too many).

Here the two-digit code helps, in which the first digit states how many tones (short or long) are to be generated. For the Morse sign A, therefore, only the first two bits (0 and 1) are used.

The conversion of the letters into a corresponding code is handled by the program from address 2B. The binary number (bit pattern), from which the tone sequence long or short results, is stored in register 2. The number of tone sequences (regardless of whether short or long) is stored in register 1. The table „bit pattern“ shows us how the letters of the alphabet are divided into a special code.

Table: Bit Pattern

From address 97 onward, by shifting the binary values in register 2 to the left (SHL command), either a long or a short tone is generated. The number of tones is determined by counting down (reducing the values) in register 1.

The actual Morse tone is generated in the subroutines (SUB routine) „•“ and „–“. In addition, in these subroutines a „random number“ arises in register A, depending on whether or not a signal (from TAKT/CLOCK) is present at the INPUT. This controls the irregular repetition of the Morse signs A and B.

The program part „Auto“ (automatic Morse-sign generation) begins at address BE. The keyboard entry normally required is replaced by the generation of random numbers. The random number is generated in register D by adding register A. Since the value in register A is relatively random, a constantly changing random number results in register D, by which the entire Morse alphabet is sent in random order.

In this program the integrated random-number generator is not used. This has the following reason: the generation of the Morse signs requires a certain amount of time, during which the random-number generator counts on by a certain number of steps. This number of steps depends on the Morse-sign length. If one were to use the integrated random-number generator, the constant repetition of a certain letter sequence would result. By using a specially programmed random-number generator, which is controlled by the 1 Hz clock, such a repetition is almost ruled out.

We can try this out by removing the connecting lead TAKT/CLOCK to INPUT 4 and replacing the command ADD A,D (4AD) present at address CB with the RND command (F05). Now the computer will only send a certain letter sequence.

Why was a NOP command inserted at addresses 1D and 1E?

It was merely intended to demonstrate that, with such long programs, it is expedient to enter a few NOP commands now and then, because this gives the possibility of subsequently inserting a command that may have been forgotten during input, without having to re-enter the entire program.

Perhaps we are also surprised by the repetition of identical commands? This arises, for example, at the program locations „•“ and „–“. Here, each time, a jump is made to the corresponding subroutine that is responsible for generating a long or short tone. If, for example, for „SOS“ three short – three long – three short tones result, the subroutine „•“ beginning at address D7 is jumped to three times in succession, then the subroutine „–“ beginning at address E3 three times, and so on.

This program can give us various hints for future program considerations, such as how, by using the binary values and reducing the binary digits, a large number of different signals can be generated. Such signals can be brought to the outputs and used for the most varied possibilities.

Program flow chart:
Morse Code Decoder
(Morse Trainer)
For hobby electronics enthusiasts:
Resistance Code Calculation

The value of a resistor is indicated by colored rings. For those who do not constantly work with these color markings, it is often difficult to determine the correct resistance values from the color rings.

The following program demonstrates how the computer can calculate the correct resistance values from the entry of various colors.

The piezo buzzer still connected from the last experiment is not needed. Remove the keypad mask that may also still be present, and enter the program according to HALT – NEXT – 00.

Program: Resistance Code Calculation
LabelAdr.CodeMnemonicJump
to
Explanation
00F19DISP 1,9Input routine
01F08CLEAR
02FF0KIN 0
039B0CMPI B,0
04D0DBRC 0DSTARTKey: ↑
05519ADDI 1,9
06949CMPI 4,9
07D00BRC 00
08034MOV 3,4
09023MOV 2,3
0A012MOV 1,2
0B001MOV 0,1
0CC02GOTO 02
START0D922CMPI 2,2
0ED14BRC 14KILO
0F902CMPI 0,2
10E1EBRZ 1EPRO(PRO = percentage tolerance)
11B34CALL 34MORI
12712SUBI 1,2
13C0FGOTO 0FJump to subroutine MORI
KILO14952CMPI 5,2
15D1ABRC 1AMEGA
16B34CALL 34MORI
171A3MOVI A,3
18732SUBI 3,2
19C0FGOTO 0F
MEGA1AB34CALL 34MORI
1B1B3MOVI B,3
1C762SUBI 6,2
1DC0FGOTO 0F
PRO1E911CMPI 1,1
1FE2CBRZ 2C1 → E
20921CMPI 2,1
21E2EBRZ 2E2 → E
229B1CMPI B,1
23E30BRZ 305 → E
249A1CMPI A,1
25E32BRZ 321 → F
2612FMOVI 2,F
ANZ27F63DISP 6,3
28FF0KIN 0
29F2EDISP 2,E
LabelAdr.CodeMnemonicJump
to
Explanation
2AFF0KIN 0
2BC00GOTO 00
1 → E2C11EMOVI 1,E
2DC27GOTO 27ANZANZ = show display
2 → E2E12EMOVI 2,E
2FC27GOTO 27ANZ
5 → E3015EMOVI 5,E
31C27GOTO 27ANZ
1 → E3211FMOVI 1,F
33C27GOTO 27
MORI34078MOV 7,8„Subroutine“ MORI = move right, i.e. shift the zeros in reg. 3 to 8 to the right, equivalent to shifting the display digits to the left.
35067MOV 6,7
36056MOV 5,6
37045MOV 4,5
38034MOV 3,4
39993CMPI 9,3
3AD3DBRC 3D
3B103MOVI 0,3
3CF07RET
3D104MOVI 0,4
3EF07RET

Program start: HALT – NEXT – 00 – RUN. The display shows: 0.

Place the silver-colored keypad mask labeled „Widerstands-Code“ on the keypad with the cover hood open, and close the hood again.

Most resistors have 4 color rings, one of which is silver or gold. For the resistance-value calculation the gold or silver ring must be on the right. The entry therefore begins with the colors (see figure): yellow – violet – black – gold. The display counts the key presses and now shows the digit 4. The color entry is concluded by pressing the key ↑ (top key row).

The display shows 0047. The entered color values correspond to a resistance value of 47 Ω (ohms). Pressing the ↑ key again shows: 05, i.e. that the calculated resistance value has a tolerance of ± 5%.

Pressing the ↑ key again brings 0 back on the display. A new entry can be made.

Color values of a resistor
Resistor color-code table
yellow
violet
black
gold
(points to
the right)

On the computer board, a whole lot of resistors are arranged whose values can be calculated in this way. It is important that, on principle, 4 colors are always entered. For resistors that have only three color rings, black is entered as the fourth color.

If, for example, the display shows, after entering: yellow – blue – violet – silver: 00460B, then the designation B means that this is a resistor of 460 MΩ (megohms). One megohm is one million ohms.

The entry: red – orange – yellow – gold yields the result 230A. A means kΩ (kilohms), i.e. that the calculated resistance value is 230 kΩ. One kilohm is one thousand ohms.

This is of interest to the programmer:

The function of this program quickly becomes clear to us when we look at the resistor color-code table below. We see that the first and second rings each represent a certain value depending on the color. The third color ring indicates by how many zeros the values are to be supplemented.

Ring
Gold
Silver
Black
Brown
Red
Orange
Yellow
Green
Blue
Violet
Gray
White
(tolerance)

If we were to enter, for example, the color red three times, the result is 2200. A resistor with the three color rings red thus has 2200 Ω.

If we enter, for example: yellow – violet – red – gold, then we have actually entered the values 4 – 7 – 2 – B. (For this observation, only the attached keypad mask would have to be removed.)

The display thus shows us the first two entered digits directly. For the third entered digit, the number of zeros must be determined, and only for the tolerance specification B must the corresponding values be determined.

The entry is made into registers 1 to 4. Registers 3 and 4 are displayed directly. Register 2 holds the number of zeros to be shown. The displayed values of registers 3 and 4 must therefore be shifted to the left on the display by the corresponding number of zeros. With the entry yellow – violet – red, the correct result is obtained immediately: 4700 Ω.

So that the 6 display positions available on the display are sufficient, an A (kilo) is used for three zeros, or a B (mega) for six zeros. The displayed result is in registers 3 to 8.

The tolerance is determined by comparison and stored in registers E and F until it is displayed by pressing the arrow key again. See also the program flow chart.

The program example „Resistance Code Calculation“ shows how, through logical reasoning, ideal problem solutions can be achieved with a very simple program.

Program flow chart:
Resistance Code Calculation
The „Pocket Calculator“ Program

That our computer can add, subtract, multiply and divide is known to us from the experiments of the instruction book, Part 1.

These individual programs are now combined into a convenient calculator program with which all 4 basic arithmetic operations can be performed.

The rather extensive program should be entered very carefully after HALT – NEXT – 00 and checked.

Program: „Pocket Calculator“
Label
Adr.
Code
Jump to

Program start with HALT – NEXT – 00 – RUN. The display shows: 000000.

With the cover hood open, place the keypad mask labeled „Taschen-Rechner/Calculator“ on the keyboard and close the cover hood again.

The function keys (on the right-hand side) are not used for the arithmetic operations. This concerns above all the C/CE key, which is now present and to be used as a „clear key“ (in the second row from the top).

As with a pocket calculator, the values to be calculated are entered. The entry of the number values must not be made too quickly. The arithmetic operations are triggered by pressing the keys +, –, ÷, × and the result is determined and displayed by the = key. With the C/CE key, a single press clears the most recently entered number; with a double press, all entered numbers are cleared.

If a negative result arises, the upper carry-flag LED lights up at the same time as the result display.

We first carry out the following calculation: 25 × 3 + 80 – 300. The entries, the keys to be pressed, and the display result as follows:

Entry
Display
1st intermediate result
2nd intermediate result
Final result
Glowing carry flag = negative result,
i.e. final result = –145

If a result is larger than the 6-digit display permits, EEEEEE appears on the display.

For a division, a maximum of 4 digits may be entered. Division results are therefore always displayed with 4 digits. Since the display of decimal places is not provided, division results are generally rounded down: example: 17 ÷ 2 = 8 (instead of the correct result 8.5).

This is of interest to the programmer:

For better understanding, the register assignment will first be presented in the following table:

Register Assignment:
Reg.
No.
Register functions
0
1
2
3
4
5
Display register
for number entry,
for intermediate results
and final results
6Input register for numbers that are shifted onward into reg. 0 to 5
* 7Plus-/minus index register (storage of whether the number values present in reg. 0 to 5 are positive (+) or negative (–).
8
9
A
B
C
D
Register for the intermediate storage of the „to be further processed“ number values (value storage until the arithmetic operation with the numbers in reg. 0 to 5 is performed).
EMemory register for the arithmetic operation to be performed ( +  –  ×  : )
* FPlus-/minus index register (storage of whether the number values present in reg. 8 to D are positive (+) or negative (–).

The plus/minus index registers (registers 7 and F) have the content 1 when the number values are negative, or 0 when the number values are positive. Index register 7 additionally receives the value 4 as soon as the C/CE key has been pressed once, or it receives the value 8 as soon as a new number is entered.

To demonstrate the program function clearly, the addition of two numbers is shown in a part of the program flow chart. Example: the numbers 24 and 32 are to be added:

1.
Entry of the first number, e.g. the number value 2. Since the entered number is not greater than 9, and index register 7 has the value 0, the number value (2) entered in register 6 is stored in register 0. At the same time, registers 1 to 5 are set to zero. Index register 7 is now loaded with the value 8.
2.
The second number entry (e.g. 4) is entered. Since index register 7 has meanwhile received the value 8, the query takes place: „Is the content of register 7 greater than 4?“ – „Yes“ – thus a jump occurs and the entered number values are shifted one place to the left on the display.
3.
Before the next numbers to be added are entered, the ⊕ key is pressed. This corresponds to the hexadecimal value C, so the entry now made in register 6 is greater than 9. Through the comparison command (is the content of register 6 greater than 9?) a jump occurs. Since the content of register 6 does not have the value A (see comparison command), the value 8 in index register no. 7 is cleared by the command ANDI 1,7. Register E still has the value 0 at the moment and a jump occurs. As a result, the content of register 6 is stored in register E. Register E now receives, through the value C, the information that an addition is intended (see also the Register-Assignment table). The contents of registers 0 and 1 (or, if multi-digit numbers are entered, up to register 5) are buffered in registers 8 and 9 (or, for multi-digit numbers, in registers 8 to D).
Now the numbers to be added (in our example 32) are entered, whereby the processes described under 1. and 2. repeat.
4.
The addition is to be carried out, the ⊝ key is pressed. It has the value B, so a jump occurs as described under 3. After the value C (through the ⊕ key entry) has been stored in register E, a jump now results to the program part „AD“ (Addition), which is marked in the overall program flow chart by the circle ⊕.
At the beginning of the program part „Addition“ a comparison takes place as to whether one of the two numbers to be added has a negative value – if „yes“, a jump occurs to the program part „SU“ (Subtraction), marked in the program flow chart by the circle ⊖. Since this is not the case in our example, the decimal addition of the individual registers takes place (reg. 8 + reg. 0, reg. 9 + reg. 1 etc.). The result is displayed. If the result were larger than the 6-digit display capability on the display, a jump to the program part „EE“ would occur. The result display would then be EEEEEE.
Overall Program Flow Chart: „Pocket Calculator“
The subtraction part likewise begins with a comparison. If positive numbers are to be subtracted (example: 8 – 5 = 3), the individual registers are subtracted and, if necessary, „decimally corrected“, as described in Part 1 of the instruction book. If a subtraction is carried out with negative numbers (example: – 3 – 5 = – 8), then the overall result is indeed negative, but the two negative number values must be added. With a resulting negative overall result, a carry arises, whereby the individual digits are decimally inverted and then the value 1 is added in the addition program, in order to obtain a correct result (see instruction book Part 1, pages 51 to 54).
For multiplication ⊗ and division ⊘, the subprogram „+/–“ first determines whether the result is positive or negative, so that the corresponding value can be stored in index register no. 7. For programmers, the following table shows how positive or negative results are calculated:
For a positive result, the value 0 is stored in index register 7, for a negative result the value 1. Then the values present in registers 8 to D are brought into registers 0 to 5 by the subprogram „Swap“. Now the multiplication or division is carried out.
All 4 calculations are concluded by the program part ⊝ or „EE“, and a return to the display routine occurs.
Most program parts correspond to the explanations in Part 1 of the instruction book. New, however, is that we can also continue calculating with negative numbers. For this, the computer must know whether and which numbers are negative.
For this, registers 7 and F are available.
Example: a calculation yields the negative result –7, and the value + 5 is to be added to it. This cannot be achieved by the usual addition, since 7 + 5 = 12 would result. Through the query of registers 7 and F, a jump occurs to the subtraction program „⊖“ and the computer then calculates: 5 – 7 = –2.
A similar case arises when, for example, the last result was –7 and –5 is to be subtracted from it. By comparison, the computer finds out that both numbers are negative, i.e. that the overall result must also be a negative number. It therefore adds both numbers, which yields the result 5 + 7 = 12. But since it was stored that both numbers are negative, the carry flag is set, whereby the negative result –12 is displayed.
If one wishes to program such a complex program oneself, like this calculator program for example, it is necessary to think through and mentally follow every single program step.
A program especially for mathematicians:
Sine Calculation
Program: Sine Calculation
This is of interest to the programmer:
Label
Adr.
Code
Jump to
For mathematical calculations, trigonometric functions (angle functions) such as sine, cosine or tangent are often needed.
There are technical/scientific pocket calculators that solve such calculations at the press of a button. These pocket calculators too usually contain a microprocessor that can only add and perhaps just barely multiply. Therefore the sine calculation must be derived from additions, multiplications, etc.
For those interested in mathematics, it is certainly not uninteresting to learn how, for example, a pocket calculator performs a simple sine calculation.
After HALT – NEXT – 00 we enter the following program:
Program start with HALT – NEXT – 00 – RUN. The display shows: 00.
The sine of an angle of 20° is to be calculated. For this, 20 is entered. After a brief calculation, the display shows: 3415. Since our calculator works without a decimal place, this result means: 0.3415. It is expedient to enter the examples for the program test, so that the correct result can be checked. If the computer does not produce the aforementioned result, the program entry must be checked and, if necessary, corrected.
Before entering a new calculation, press any number key; the display shows 00 again. A new calculation can be carried out. Since a 2-digit entry is required, for a sine calculation of 5° the two-digit entry 05 must be made. In this case the display shows: 0870, i.e. 0.0870.
We should also note that the entered angle must not be greater than 45°, because calculations going beyond 45° are no longer carried out correctly.
Before we deal with the actual program sequence, we must know how a sine function can be calculated through additions, multiplications, etc.
The angle functions can be calculated with the help of so-called „series“. The series for calculating a sine has the following formula:
[Translator’s note: in the German original the decimal separator is a comma, e.g. the figures show 0,3415 for 0.3415.]
A sine to be calculated becomes the more accurate the more terms the series to be calculated has. So that the program does not become too elaborate, the series was terminated after the third term (boxed formula).
For an example, let us calculate the sine of the angle of 20°. However, we cannot insert „20“ directly for „x“ in this formula. First the angle must be converted into radians, by multiplying „20“ by the number „π“ (3.1415) and then dividing by the number 180:
20° corresponds to a radian measure of 0.349
0.349 can now be inserted into the „series“. In order to make it easier for non-mathematicians too to follow these calculations, the calculations are carried out step by step in the following representation:

Our calculation yields the result 0.3419, while the computer calculated 0.3415. This slight deviation arises from the computer's rounding up and down. Since the maximum deviation is only 0.3%, however, our computer's accuracy is sufficient for most applications.

From the examples above it is evident that many multiplications must be carried out. Since their result is always smaller than 1, decimal places would be needed. The microprocessor, however, is not designed for this. By rounding the multiplications up and down, the computation uses whole numbers, saving much programming work.

The angle values are entered into registers 0 and 1 and then converted to radians by multiplication with 174 (3.1415 : 180 = 0.0174).

The result is stored in registers C to F. The first two digits (registers E and F) are multiplied, then divided by 6 and multiplied again with registers E and F. In this way we obtain the second term of the series: x3 ÷ 6.

Next, registers C to F (the entered value in radians) are copied into registers 8 to B. Then the result of the last calculation is subtracted. The result of the second term (x3 ÷ 6) is then again multiplied with registers E and F, divided by 20, and multiplied once more with E and F. In this way we obtain the third term of the series (x5 ÷ 120).

This result is added to the one held in registers 8 to B; the total now stands in these registers and is displayed.

Note, too, that the calculation does not always continue with all the digits of a result; in part only the first two or three digits are used further.

The program flow chart contains some further explanations on the basic program function.

Program flow chart: Sine Calculation

Our Sine-Calculation program can also be „rebuilt“ for other trigonometric-function calculations. Here are a few suggestions:

The COSINE function can likewise be calculated with the aid of a „series“:

Note that „x“ must be the angle converted into radians. Most pocket calculators can internally compute only angles from 0° to 45° of a sine or cosine. To find the sine of 60°, for instance, the calculator computes the cosine of 90° minus 60°, i.e. of 30°. This is possible because the following relationship holds:

or

Through this simple trick, a good deal of computational work can be saved.

The TANGENT function can be obtained by computing the sine and cosine and then dividing the two results by each other:

Through such considerations and manipulations, the microprocessor can and must perform enormous computational feats.

It is no problem to calculate the days that fall, say, between the 3rd and the 17th of a month. It becomes harder when we want to know how many days lie between 5 March 1981 and 24 December 1985.

For calculating these days, the following program helps us, automatically taking any leap years into account. The calculations are based on the Gregorian calendar.

Before we start programming, the entire program memory should be cleared, because the „day calculation“ is the first part of a super-program that is completed by the two following chapters. Note also that after address 5C we continue the second program part at address 88. The two parts are later completed by the Bio-Rhythm program.

Clearing the program memory: HALT – PGM – 5.

After HALT – NEXT – 00, carry out the programming very carefully:

Cosine and Tangent Calculations
A three-part super-program!
Part 1:
Calculating the days between two dates
Program: Calculating the days between 2 dates
Label
Adr.
Code
Jump to
„HALT-NEXT-88“.
Then continue programming =

Program start with HALT – NEXT – 00 – RUN. The display shows: 000000.

To calculate how many days fall between 5 March 1981 and 24 December 1985, we must first enter the „earlier“ year, i.e.: 1981. Then the month 03. The display shows: 198103.

Press key A – after a few seconds the display shows: 00. Now the day is entered as well: 05. The display now shows 000000 again. The second entry follows: first the year (1985), then the month (12). The display shows: 198512. After pressing key A, enter the day of the month (24).

The computer performs the calculation. If the data and the program were entered correctly, the display shows the number of days lying between the two dates: 1755.

After pressing any number key, the display shows 000000 again, and the days between two other dates can be calculated.

It is important always to enter the earlier (smaller) date first. Months and days always require 2-digit entries, so a 0 must be prefixed to entries smaller than 10 (for July = 7th month – enter 07). The date entry must not be made too quickly, and the correct entry should be checked on the display.

With this program the display can show a maximum of 5 digits, i.e. at most 99,999 days. That is 273 years and 10 months. If the two dates to be calculated lie more than 274 years apart, the missing sixth display digit must be added in.

Example: For an entry between 1 January 1800 (180001 – 01) and 1 January 2200 (220001 – 01), the computer gives the result: 46097. In reality, however, 146097 days lie between the two dates.

The program you have entered is also needed for the two chapters that follow, so do not delete or change it.

Calculating a weekday within any year
Program change: Calculating the weekday
Weekday table
Program supplement: Weekday calculation
Label
Adr.
Code
Mnemonic
Jump to

With this program we can, by entering a date, calculate which weekday (Sunday, Monday, etc.) it was at that time.

The program already entered must be changed at a few program steps from address 51 onward. We make the entry after HALT – NEXT – 51 by entering the new commands in place of the existing ones (entering a new command code erases the code entered before):

After we have entered the last command at address 6D, the program is started again: HALT – NEXT – 00 – RUN.

The display shows 000000 again.

First we want to test an easily verifiable date:

On which weekday does Christmas Eve fall in the year 1982?

As with the previous program, the date 24 December 1982 is again entered as follows: year and month (198212) – press key A – then the day (24). The display shows 6. From the weekday table we see that the number 6 is a Friday.

The program is designed so that weekday calculations can be made from 1 January 1918 up to 31 December 2189. If the entered dates lie before or after these years, the displayed results are wrong.

0 = Saturday
1 = Sunday
2 = Monday
3 = Tuesday
4 = Wednesday
5 = Thursday
6 = Friday

The program is still needed for the following chapter, so please do not delete or change it.

Calculating the Biorhythm
Supplementary program: Biorhythm
Label
Adr.
Code
Mnemonic
Jump to

The theory of biorhythm holds that in every person 3 different, constantly repeating cycles run their course, all beginning on the day of birth.

The first cycle, also called the physical or bodily rhythm, has a length of 23 days. The second cycle, the psychic or emotional rhythm, has a length of 28 days. The third cycle, an intellectual rhythm, has a length of 33 days.

Since the biorhythm assumes that a person's physical, emotional, and intellectual life runs in wave-like highs and lows that can be precisely delimited by the day, the „better“ and „worse“ days can be derived from the biorhythm.

If we are in the first half of the biorhythm, we are in a good phase. In the second half of the rhythm, our intellectual and physical constitution is supposedly somewhat poorer.

For an athlete the physical rhythm might be of primary interest, while for someone who works intellectually the intellectual rhythm can play a more essential role. In general, a person feels better the more rhythms are in the first half of their cycle.

How far the controversial doctrine of biorhythm (by W. Fließ and H. R. Früh) is reliably applicable shall be left open. For the computer, determining the personal biorhythm gives rise to very manifold arithmetic operations.

We can determine our biorhythmic constitution with the following program.

The program already entered, „Calculating the days between two dates“, stays in place. However, from address 51 up to address 87 it is changed or extended.

We begin the modification programming after HALT – NEXT – 51:

By entering this part of the program, our program memory is now „filled“ from address 00 up to the last possible address FF.

Program start with HALT – NEXT – 00. The display shows: 000000.

As an example, we want to calculate the biorhythm of a person born on 2 July 1952. The calculation should show us whether better or worse cycle-days are to be expected on 24 December 1982.

As in the previous experiments, the birth year and month (195207) are entered first. After pressing key A, wait until the display shows 00, then enter the birthday (02 – the 0 must not be forgotten). The second date of interest now follows in the same way: first the year and month (198212) are entered. Press key A – wait until the display shows 00, then enter the day (24).

Once we have entered the dates mentioned above, the display now shows E, as the digit for the physical rhythm.

Bio Circle
This is of interest to the programmer:
Peak form
good days
critical days
low point
Register
No.
Register functions
0
1
2
3
4
5
Computation registers and input registers for the day-date
6
7
Storage for the first two digits of the year
8
9
A
B
C
D
Factor calculation (Reg. 8 to C)

Storage for month numbers (Reg. C and D)
E
F
Storage for the last two digits of the year

The computer outputs the bio-values one after another:
• Physical condition forecast
• Emotional condition forecast
• Intellectual condition forecast

When we look at the Bio Circle, we find the E on the left side, i.e. our test subject has physically left the critical days and is approaching the peak-form period.

We press key 0 – the display shows: 5. This is the value for the emotional condition, and we see from the Bio Circle that the emotional state is moving toward the low point.

After pressing key 0 again, the display shows: 3, the value for the intellectual condition. The Bio Circle shows that the test subject is in good shape for intellectual activity. According to the doctrine of biorhythm, our test subject could overall reckon on a very good intellectual, physical, and emotional condition if all three determined values lie between 0 and 4 on the Bio Circle.

After pressing the 0 key once more, the computer is ready for a new biorhythm calculation. The input order is generally: birth year and birth month (don't forget a leading 0 if needed), key A, then the birthday. The second date to be calculated is entered in the same way.

The dates to be calculated must not lie more than 273 years apart.

In the last three program experiments, time calculations had to be carried out. From the entered dates a factor is calculated. With this factor the final results are determined.

The factor is calculated by the following formula if the entered date falls in the month of January or February:

Factor = 365 × Year + Day + 31 × (Month − 1) + INT((Year − 1) ÷ 4) − INT(3/4 × INT(((Year − 1) ÷ 1) + 1)).

The notation INT (integer) means that, in the result of the following calculation, the digits after the decimal point are to be ignored. This simplifies our programming.

If the entered date falls between March and December, the factor is calculated by the following formula:

Factor = 365 × Year + Day + 31 × (Month − 1) − INT(0.4 × Month + 2.3) + INT(Year ÷ 4) − INT(3/4 × (INT(Year ÷ 100) + 1)).

As an example, the factor for 24 December 1982 is to be calculated. Into the formula we must substitute 1982 for the year, 12 for the month, and 24 for the day:

Factor = 365 × 1982 + 24 + 31 × (12 − 1) − INT(0.4 × 12 + 2.3) + INT(1982 ÷ 4) − INT(3/4 × (INT(1982 ÷ 100) + 1)).

Factor = 723430 + 24 + 341 − 7 + 495 − 15.

Factor = 724268

In the program „Calculating the days between two dates“, two factors are calculated from the two entered dates. The two factors are subtracted from each other, and the result is the number of days.

The principle is thus relatively simple, but it requires a fairly large amount of computation.

In the program „Biorhythm“, the number of days between the birth date and the date to be calculated is determined by the same principle. This result is divided by the number of days of the corresponding rhythm (the rhythm days are 23, 28, and 33). The remainder of this division is multiplied by 10 and then divided by the number of rhythm days. This result yields a digit between 0 and 9 or E, which is shown on the display.

In the „weekday calculation“, the factor is likewise calculated from the entered date. This factor must then be processed further by the following formula:

Weekday = Factor − (INT(Factor ÷ 7) × 7).

If we again insert the factor calculated for the date 24 December 1982 into the formula above, the following calculation results:

Weekday = 724268 − (INT(724268 ÷ 7) × 7).
Weekday = 724268 − (INT(103466.8571) × 7).
Weekday = 724268 − (103466 × 7).
Weekday = 724268 − 724262 = 6
Weekday = a Friday (6 − see weekday table).

Although this calculation, too, is relatively easy to understand, it results in an elaborate program, because many computation steps have to be carried out. To simplify the program, the computer works with only 5 digits. In the factor 724268, the first digit (7) is not included in the calculation. However, we see from the representations of the weekday calculation that the first digit (7) does not change and therefore has no influence on the result.

Program flow chart: Factor calculation
Program flow charts:
Calculating the days
between two dates
Calculating
a weekday
Calculating
the biorhythm
An important note for programmers!

The greatest programming effort is required for calculating the „factor“ (see also the program flow chart). To keep the programming effort as low as possible, several subroutines are used that we have already met in other programs. These subroutines are therefore not listed again in the program flow chart. For the sake of completeness, however, they shall be mentioned briefly:

The subroutine SUB performs a 5-digit subtraction. Registers 0 to 4 are subtracted from registers 8 to C. The result is left in registers 8 to C. All calculations are carried out in decimal. Decimal subtraction was discussed in the „pocket calculator“ program.

The subroutine ADD adds registers 0 to 4 to registers 8 to C. The subroutine ADD performs a 5-digit decimal addition.

The subroutine SUBI adds 1 to a number present in registers 0 to 3.

The subroutine ADD 2 adds registers 4 and 5 in decimal to registers 1 and 2.

The subroutine MOVI 0 clears registers 0 to 5.

The subroutine MOV J (move-years) brings the year values temporarily stored in registers 6, 7, E, and F into registers 0 to 3.

The program section INT calculates the formula part INT(3/4 × (INT(Years ÷ 100) + 1)).

The individual formula segments of the INT program section are calculated one after another and added to or subtracted from registers 8 to C. As the result of these calculations, registers 8 to C then hold the factor, which can be processed further by the following program.

The subroutines ADD (5-digit decimal addition) and SUB (5-digit decimal subtraction) can be used for a wide variety of programs you develop yourself.

We entered the subroutine ADD in the program „Calculating the days between two dates“ from address BC to address DE. The subroutine SUB begins at address DF and ends at FF.

Both subroutines are located at the end of the program memory and can be called at any time (provided the computer is not disconnected from mains power). We recall that with the CALL command we can jump from a program into a subroutine. With the command CALL BC we reach the subroutine ADD; with the command CALL DF, the subroutine SUB.

Part 3:
Computer experiments with additional electronic components
Important to observe for circuit experiments:

The computer’s capabilities are considerably expanded by additionally connected components. Such add-on circuits are called „peripheral electronics“.

When experimenting, under no circumstances may voltages above 9 V DC be used. Therefore always experiment only with the intended 9-volt battery or with the BUSCH power supply 2059 (which likewise delivers 9 volts DC). Voltages above 9 volts — and AC voltages in particular — can destroy individual computer elements.

The computer outputs must never be connected directly to the plus or minus pole of a 9-volt voltage source (battery or power supply).

At the computer outputs, only small control voltages (maximum 15 mA) are available. Therefore only elements with low power requirements can be driven directly from the computer outputs, such as piezo buzzers, light-emitting diodes, transistors, ICs, and so on. With one transistor and 1 to 2 resistors, however, small amplifier circuits can very easily be built, through which other circuit parts can then also be controlled by the computer outputs. On the following pages, various connection options are demonstrated.

Since the computer inputs, too, need only small voltages for the input signals, using a series resistor is advisable in every case, because this considerably extends the life of the connected battery. On page 54 of the instruction book, Part 1, the arrangement of such series resistors (4.7 kΩ) in connection with the red keys was shown.

Connecting relays
BUSCH low-current switching relay no. 5964
Connecting the 5964 relay to a computer output

From various experiments (instruction book, Part 1) we know that the computer can take over switching functions. For this, with the DOT command and appropriate programming, we put „a voltage“ on the computer outputs. With this small control voltage, however, we can drive only, say, the piezo buzzer or a light-emitting diode.

Larger current consumers get their power supply via a switching relay. The switching relay is driven from the computer output. Since the relay function too needs more current or voltage than is available at the computer output, the output voltage must be amplified by a transistor circuit.

Two relay options are available:

All kinds of devices capable of low-current operation (up to a maximum of 24 volts, 8 A) can be switched on or off — on a model-railway layout, for example, lighting, cranes for automatic loading and unloading, bells, horns, sirens, and so on. Setting or switching points is also possible if points with automatic end shut-off are used.

The 5964 relay works as a „changeover switch“. Two separate circuits can be switched.

The figure shows how the relay is driven, e.g. from computer output no. 1 with a 1 kΩ resistor and a transistor. As soon as the DOT command puts „a voltage“ on the output, the relay’s switching action is triggered: circuit 1 off – circuit 2 on. This state is held until „no voltage“ is present at the computer output any longer. The relay springs back: circuit 1 on – circuit 2 off. The corresponding circuits can be connected at the relay’s contacts. A detailed description is supplied with the relay.

For experiments — e.g. with a model railway — it is essential that live parts never come into contact with a computer connection. The model-railway transformer voltage of 16 V AC will inevitably destroy individual components.

This relay is also offered, among other places, in the BUSCH model-railway accessory range. It can be used for a wide variety of switching and control functions.

BUSCH mains-power switching unit 2087
Connecting the 2087 mains-power switching unit to a computer output

Since each computer output can be driven individually with appropriate programming, up to 4 relays can be connected. Each relay requires one 1 kΩ resistor and one transistor.

Besides many other uses, the computer — together with BUSCH Electronic Studios and the 2087 switching unit — can, for example, simulate the presence of a house’s occupants during a holiday absence. A photoresistor switches a light on at nightfall, which switches off again at dawn. A noise-sensitive circuit provides temporary extra lighting whenever a certain noise level is exceeded. Programmed as a timer, the computer can also handle two further on/off actions, with separate times settable. A secured door triggers an alarm tone as soon as the door is opened.

The following program examples are meant only as suggestions. Listing and explaining every possible application would go beyond the scope of this instruction book. For owners of additional BUSCH Electronic Studios, countless possibilities open up.

This switching unit, too, can be driven with low current (6–9 volts). Via a relay it triggers switching operations in the 220 V mains lighting circuit (220 V, max. 1000 watts). With two resistors and a transistor (see figure), the unit is connected to a computer output.

The 2087 switching unit complies with the VDE regulations. It is completely safe to use, because the 220 V mains section is fully isolated from the low-current side.

The 2087 switching unit is an „on/off switch“. As soon as a small control voltage is present, the relay closes a 220 V circuit; this circuit is switched off again when the control voltage is interrupted. The relay is designed for 20 million switching operations and can run continuously. It switches radios, tape recorders, warning systems, fan heaters and all electrical devices rated up to 1000 watts on and off. If devices with a higher rating are switched, a considerable drop in switching capacity must be expected, so when connecting fan heaters and the like it is essential to ensure that the 1000-watt limit is not exceeded.

Up to 4 mains-power switching units 2087 can be connected to the computer outputs. Each unit requires two resistors and one transistor.

Timer clock with two on- and off-switching times

With the following program, two separate on- and off-switching times can be achieved. In this way, two different functions at different times are possible.

After HALT – NEXT – 00, enter the program:

Program: Timer clock for two on- and off-times
Label
Adr.
Code
Mnemonic
Jump to
Explanations
Clear working registers
Swap working/memory registers
Clear working registers
Switch off outputs
Display R8
Input into R8
Swap memory/working registers
Swap working/memory registers
Swap memory/working registers
Swap working/memory registers
Subroutine „S EIN“
Entry of the switch-on time
Subroutine „S AUS“
Entry of the switch-off time
10-hour comparison
If outputs 1 and 2 are „low“ (0), the zero flag is set, so output 3 also becomes „low“.
Evaluation of button G
Evaluation of button H
Clear clock pulse from R8
Entry of buttons G and H into R8
Timer-clock mode
Outputs switched off
Clock mode without switching function

After the program has been entered, the two red buttons G and H must be connected to INPUTS 1 and 2, and in addition the TAKT/CLOCK connecting lead to INPUT 4. The piezo buzzer is connected to OUTPUT 3 and GND. The connecting leads of the piezo buzzer must not be interchanged. (See figure.)

After the keys HALT – PGM – 3, enter the current time of day. Then start the program with HALT – NEXT – 00 – RUN. The display shows 0. Now the following options arise:

Button B: The clock is shown on the display. The timer clock is still working without switching functions. If one of the two red buttons G or H is pressed, the display shows 0 again and the computer waits for the next entry.

Button C: The first switch-on time can be entered (hours and minutes). If a wrong time was entered by mistake, repeat the correct entry until the desired hours and minutes are shown on the display. Finish the entry by pressing button C again. The display shows 0 again – the computer waits for a new entry.

Button D: Entry of the first switch-off time (hours and minutes). Finish the entry by pressing button D again. The display shows 0 again.

Button E: Entry of the second switch-on time. End the entry by pressing button E once more.

Button F: Entry of the second switch-off time. End the entry by pressing button F once more.

Button A: The timer-clock functions are put into operation. The display shows the current time of day in hours and

Connecting the buttons & piezo buzzer for the timer clock
Hour comparison
10-minute comparison
Minute comparison
Set carry flag (1)
Reset carry flag (0)
10-hour comparison
Hour comparison
10-minute comparison
Minute comparison

minutes (without seconds). The piezo buzzer sounds as soon as the first switch-on time is reached. The buzzer can be silenced with the red button G. The red button has to be held down for about 1 second. During the first switch-on minute, however, the buzzer sounds again after one second — i.e. during the switch-on minute the red button must be held down continuously if the buzzer is not to sound. As soon as the next full minute is shown on the display, the buzzer can be switched off for good, or switched back on, with the red button G. This switch-on option, independent of the set time, is of interest for the following experiments.

When the first switch-on time has been turned off by pressing G, the computer signals again as soon as the second switch-on time is reached. The buzzer can now be silenced with the red button H, where again button H must be held down continuously during the set switching minute in order to stop the buzzing. After the switching minute has elapsed, button H likewise serves to switch the buzzer off or on for good.

At the first switch-on time, the LEDs at output 1 and 3 light up. At the second switch-on time, the LEDs at outputs 2 and 3 light up. With the red button G, outputs 1 and 3 can thus be switched on or off, and with button H outputs 2 and 3.

Practical application: alarm clock with 2 alarm times

Our timer clock is an ideal alarm clock for anyone who doesn’t leap out of bed at the very first tone in the early morning.

Example: with button C, set the first alarm time to 06:30.

With button D, enter the first switch-off time 06:31. With button E, enter the second alarm time 06:45. With button F, enter the end of the second alarm time 07:00. Put the alarm clock into operation with button A.

The alarm goes off at 6:30 in the morning. It buzzes for one minute. Anyone who wants to sleep on must hold button G down between 6:30 and 6:31. If the buzzing doesn’t disturb you, the alarm clock switches off by itself at 6:31. At 6:45 the second wake-up begins. If button H is not pressed, the alarm buzzes for 15 minutes and then switches off automatically. If the alarm times are not changed, the computer signals again at the set time the next morning.

Changing the switching times

To change the switching times, both buttons G and H must be pressed at the same time. The display shows 0 again, and we can now use buttons C, D, E and F to display the set times, or change them by entering new ones. After finishing the display or the change, the corresponding letter button is pressed once more in each case. With button A, the timer clock is put back into operation.

MW radio for connection to the timer clock
Computer-controlled timer clock with many variation options

For the following experiments, the „Schaltuhr“ program from the previous chapter continues to be used. By connecting additional components, the following variations arise, for example:

Radio alarm clock
(BUSCH Electronic Studio 2070 required).

With the BUSCH Studio Center 2070, a radio receiver is built. (See figure.) In radio circuits, the connecting cable normally runs from the minus pole of the battery to the slide switch of the Electronic Studio. Since the radio is to be switched on by the computer, the „Überspielkabel“ (patch-cable) module is connected in between, as can be seen from the figure. We can now connect the Electronic Center 2070 with the assembled radio to the computer by joining the two devices with a standard patch cable (available at any radio shop). This patch cable runs from the patch socket of the Studio Center to patch socket no. 1 of the computer.

In the computer housing, a simple amplifier circuit is built with a transistor and the 1 kΩ resistor, connected to the „Überspielkabel 1“ module. Since we cannot operate our radio set with the low voltage of the computer output, building the small transistor amplifier is necessary. The transistor amplifier circuit is connected to OUTPUT 2 of the computer. The piezo buzzer is connected to OUTPUT 1 of the computer. The arrangement of the buttons stays the same as in the previous experiment. The figure shows all the required circuit assemblies and changes.

Entering the switch-on and switch-off times, as well as putting it into operation, still follows the instructions in the „Schaltuhr“ (timer clock) chapter.

It makes sense to check the assembled radio set for perfect operation before connecting the „Überspielkabel“ module in between.

Entering the first alarm time will now trigger the piezo buzzer, while the second alarm time switches on the radio receiver.

We can now operate the two interconnected devices (computer with radio receiver) as follows:

The first alarm time is again entered as 06:30, the first switch-off time as 06:31. As the second switch-on time we again enter 06:45, and as the second switch-off time 07:15.

The computer signals at 6:30 in the morning with a buzzing tone lasting one minute. After a 14-minute pause, the radio set is switched on at 6:45. If the radio receiver is not switched off by pressing a red button, it switches off automatically at 7:15.

Timer clock for MW radio connection
Alarm clock with snooze radio

If we like to fall asleep to quiet music in the evening but wake up again a few hours later because the radio is still playing, we can turn our radio alarm clock into a snooze radio by changing the time entry. For this, the entire arrangement of the radio alarm clock described above stays in place. We merely make a change to the times.

Example: we go to bed at 22:00 and want the radio to switch off at 23:00. Only the second switch-off time (button F) is changed, by entering 23:00. As a result, our radio receiver does not switch off automatically at 7:15, as with the radio alarm clock described earlier, but only at 23:00.

If we switch on at 22:00 by pressing the red button H, automatic switch-off occurs at 23:00. Since we have not changed the other switch-on times, however, our „Schlummer-Radio-Wecker“ (snooze-radio alarm clock) will pre-wake us at 6:30 with a buzzing tone lasting one minute, and at 6:45 the radio switches on. Once we have got up, a single press of the red button H is enough to switch off the receiver. In the evening it is switched on again with button H, and switches off automatically at 23:00 (or at any other entered time).

If the radio is not needed during the day, we can additionally switch it off at the slide switch of the Studio Center, because our transistor amplifier circuit draws a very small operating voltage from the battery, which we can save by switching off.

Incidentally, we can achieve the same effect with a mains-powered radio receiver or a stereo system. Instead of the home-built radio and the transistor circuit, we use the BUSCH mains-power switching unit 2087. In this case the piezo buzzer stays on output 1 of the computer, while the mains-power switching unit is connected to output 2 (as was shown in the figure on page 43). The radio receiver is connected to the mains-power switching unit.

More „Schaltuhr“ possibilities

The entered „Schaltuhr“ program stays unchanged.

The figure shows that we have connection options at three computer outputs for the „Schaltuhr“ program.

At output no. 1, the simple transistor amplifier circuit, with which, for example, a home-built radio or other circuits can be driven — circuits that are possible with the BUSCH Electronic Studios 2060, 2065, 2070 or 2075.

At output 2, the low-current relay 5964 is connected, for time-dependent control tasks such as model-railway lighting, etc.

At output 3, the BUSCH mains-power switching unit 2087 is connected. Output 3 is switched on whenever output 1 or output 2 or both outputs are switched on. Of course, instead of the variations shown with three different connection options, we could also connect, for example, 3 relays 5964 or 3 mains-power switching units 2087 to the outputs.

Application example

During our absence, a 90-minute radio broadcast is to be recorded. The maximum playing time of an ordinary cassette is 45 minutes (if it is not turned over). If we own two cassette recorders, we connect three mains-power switching units 2087 to outputs 1 to 3. The first cassette recorder, with 45 minutes of playing time, is connected to the mains-power switching unit on output 1; the second cassette recorder to the mains-power switching unit on output 2. The radio set needed for the recording is connected to the mains-power switching unit on output 3.

The radio broadcast is to last, for example, from 15:00 to 16:30. The first switch-on time is 15:00, the first switch-off time 15:45. The second switch-on time is 15:45, the second switch-off time 16:30. The radio receiver is in operation the whole time, because it is connected to the mains switching unit on output 3.

„Schaltuhr“: of interest to the programmer

For the „Schaltuhr“ program, all 16 available working registers and the 8 memory registers 0 to 7 are used. The memory registers 0 to 7 hold the switching times for output 1; the working registers 0 to 7 hold the switching times for output 2.

This gives the following register allocation:

Since the seconds are not shown in timer-clock operation, register A can also be used for further calculations.

Register
no.
Register functions
0Minutes (ones)Switch-on time
(working or memory register)
1Minutes (tens)
2Hours (ones)
3Hours (tens)
4Minutes (ones)Switch-off time
(working or memory register)
5Minutes (tens)
6Hours (ones)
7Hours (tens)
8Input register (for keypad and inputs)
9Output register (bit pattern for outputs)
ASeconds (ones)Time of day (TIME command)
BSeconds (tens)
CMinutes (ones)
DMinutes (tens)
EHours (ones)
FHours (tens)
Connecting relays etc. to the „Schaltuhr“
Program flow chart: Timer clock

The functions follow from the flow chart. At START (first column) we find the usual input routine. The abbreviations used are:

EIN 1= first switch-on time
AUS 1= first switch-off time
EIN 2= second switch-on time
AUS 2= second switch-off time
S UHR= timer clock
UHR= clock operation without switching
The switching times are entered by means of the two subroutines:
SUB-routine S EIN = setting the switch-on time
SUB-routine S AUS = setting the switch-off time

In program part 3, the clock runs without switching capability. The SHL command (shift left) removes the clock pulse present at input 4 from register 8, so that no jump back to START occurs.

The timer-clock function is in program part 2, S UHR. The current time is compared with the entered switching times in the subroutines V EIN (compare switch-on time) and V AUS (compare switch-off time). There the carry flag is set (value 1) while a switching time does not match the current time, and reset (value 0) when it matches. Querying the carry flag, the main program switches the individual outputs on or off via the AND/OR commands.

In program part 2, S UHR, it is checked whether one of the two red buttons was pressed, and the outputs are switched accordingly. As long as neither red button G nor H is pressed, register 8 holds 0 and the following program part is skipped.

If, however, both red buttons were pressed, register 8 has the value 3 (binary: 0011) and a jump back to the program part START occurs.

The next comparison, „Is the value 1 present in register 8?“, determines whether the red button G or H was pressed. When button G is pressed, a jump to program part TA G (button G) occurs. Since the command MOV 9,A occurs earlier at address 51, the content of register A is identical to the content of register 9. In program part TA G, the command SHR A determines whether output 1 is „high“ or „low“, i.e. switched on or off. With a „high“ at output 1 (binary: 0001), the SHR command (shift right) sets the carry flag and the command ANDI E,9 (binary: 1110) switches the output off. If, however, the output was „low“, it is switched on by the command ADDI 1,9 (binary: 0001).

The same applies in principle to program part TA H (button H).

In program part OR, it is determined whether one of the two outputs no. 1 or 2 is „high“, i.e. switched on. If outputs no. 1 or 2 are switched on, output 3 is also switched on.

The computer makes music
A mini-organ
Mini-organ: long-tone version
Mini-organ: short-tone version
Mini-organ from components of the Electronic Studios 2060 or 2065

(BUSCH Electronic Studio no. 2060 or 2065 or 2070 required).

After HALT – NEXT – 00 we enter the short program:

Program start: HALT – NEXT – 00 – RUN. The display shows 0. Now briefly press the number key 0. Then build the small additional electronic circuit as shown in the figure.

Owners of an Electronic Studio 2060 or 2065 build the circuit directly in the computer housing. Owners of the larger Electronic Studio 2070 build the circuit in the studio housing and run the corresponding connecting cables to computer outputs no. 1 to 4. Since both the Studio Center 2070 and the computer have dubbing sockets, the lines intended for the computer outputs can first also be routed to the „Überspielkabel“ (patch-cable) module. In this case the „Überspielkabel“ module is also used on the computer, and from there the connecting lines to the computer outputs are made. Care must then be taken to use the same numbering for the connections on both „Überspielkabel“ modules. The two devices can now be connected to each other with a standard patch cable.

If we now press number key no. 4 on the computer, a tone sounds. Entering the number 5 gives a higher tone. If we press the number and letter keys one after another, 12 tones are available. When key 0 is pressed, tone generation is interrupted until a number or letter key is pressed again.

The pitch can be adjusted with the rotary knob of the potentiometer. This is necessary in order to obtain a scale-like arrangement. With keys 1 to 3, no „usable“ tones result.

Our mini-organ has the disadvantage that, in the version now programmed, continuous tones are produced. We can change the programming so that a key press generates only single tones. After HALT – NEXT – 00 we enter the following program:

Address
Code
Address
Code
This is of interest to the programmer
Mini-organ built with the Electronic Studio 2070. The four connecting leads go to the computer outputs.

Program start: HALT – NEXT – 00 – RUN. The display shows 0, and the computer produces a continuous tone until key 0 is pressed. If the various number and letter keys are now pressed, tones result that switch off automatically after a short time. We can shorten the tone sequence further by changing the ADDI command at address 03 from 511 to 521 (or 541, or 581).

We already got to know the first program entered on page 16 in Part 1 of the instruction book (binary system). Depending on the key pressed, a binary value is placed on the outputs. The corresponding LEDs at the outputs light up. Outputs with lit LEDs are „high“, i.e. a small voltage of about 3 to 5 volts is present there.

In the additional electronic circuit, transistors T1 and T2 are connected as an astable multivibrator. A base voltage reaches the base of transistor T2 via computer outputs no. 1 to 4, and is varied by the various resistors. This gives a variable tone frequency.

If all outputs are „low“ (LEDs off, display shows 0), transistor T2 lacks the base voltage, so no oscillations can be generated. If key 1 is pressed (LED at output 1 lights up), the 10 kΩ resistor (22 kΩ in the Studio 2070) produces a very small base voltage, not yet sufficient to generate tone oscillations. By pressing the various number and letter keys, however, different resistor combinations arise, through which oscillations are produced in the various tone-frequency ranges.

The sound volume can be improved with the amplifier module of the inexpensive Electronic Studio add-on set „IC-Verstärker-Technik 2072“ (IC amplifier technology 2072). The 2072 instruction book shows how the amplifier module is arranged in such circuits.

It has already been explained that, for additional electronic circuits, the voltages available at the computer outputs must be amplified — i.e. that an additional voltage source (battery or BUSCH power supply 2059) is required. In all such circuits, the minus pole of the battery must also be connected to the minus pole of the computer. The minus pole of the computer is called „ground“ (GND). On the computer board we find a GND socket both on the left and on the right. For electronic circuits, the left GND socket should always be used. The right GND socket is only for the battery connection, to power the RAM during a mains-power interruption.

The computer has a socket labeled Uin. This must never be connected to the minus pole of the battery (danger of short circuit!).

In the second program version (mini-organ with short-tone generation), the ADDI command at address 03 is responsible for the tone length. The constant value 1 is continuously added to register 1 (an automatic counter) until a carry results, which triggers the zero flag. If the ADDI command is changed so that, for example, the constant value 2 is added, the counting process is accelerated and tone generation is shortened.

The experimental setup also remains in place for the following experiment.

The composing computer (melody generator)
Computer controls electronic music box
Program: The composing computer
Program: Music box
(Subroutine)
(„Sentimental Journey“)
This is of interest to the programmer:

The computer is to compose melodies on its own, with long and short, high and low tones. An interesting experiment, for which the same circuit setup as for the preceding mini-organ is used.

Only a new programming is required. So that the computer's tone generation does not disturb us while programming, one of the connecting leads to the battery is disconnected. After HALT – NEXT – 00, enter the following program:

Program start with HALT – NEXT – 00 – RUN. The display shows: 000000. Reconnect the connecting lead to the battery. As soon as a number or letter key is pressed, the computer composes random melody sequences.

The program is stopped with HALT – NEXT – 00 – RUN. The melody generator carries on working as soon as a number or a letter is entered. Ever-new melody variations result.

Further variation possibilities arise by changing the DISP command at address 02. We change the entry F60 there to F10. Don't forget the NEXT key, then a new program start. Now completely different melody sequences result. We can change the DISP command several times, and again and again new variations result.

A very easily surveyable program. By means of the RND command, a random number is loaded into registers D to F, and to help chance along a little, the numeric value entered after program start is added into register D.

The value in register D is responsible for the pitch. By counting the random number down in register E, the tone length is produced.

The experimental setup also remains in place for the following experiment.

In the preceding experiments we produced tones by pressing keys, or got the computer, with the help of the random generator, to compose melodies on its own.

With this program we want to teach the computer to play „proper melodies“ automatically. So that flawless tone sequences result, the circuit setup with the Electronic Studio 2070 (see page 53) is required. Anyone who owns the smaller Electronic Studio 2060 can obtain the two still-missing components via the BUSCH spare-parts service (see page 53 for this):

Order no. 206691 disc capacitor 100 nF
Order no. 206891 resistor 22 kΩ

(Please transfer DM 3.50 incl. postage and packing to postal-cheque account Karlsruhe no. 57 614-751, Busch GmbH & Co. KG, and state the order numbers on the payee section).

With the following program the computer, together with the connected electronic circuit, plays the three well-known melodies one after another: „Sentimental Journey – Hänschen klein – Du, Du liegst mir am Herzen“.

Before we begin the programming after HALT – NEXT – 00, the electronic circuit is put out of operation by disconnecting the battery cable.

Address
Code
Addr.
Code
(„Hänschen Klein“)
(„Du liegst mir am Herzen“)
This is of interest to the programmer:

Reconnect the battery cable to the electronic circuit. Program start with HALT – NEXT – 00 – RUN.

The computer immediately begins to play the 3 melodies one after another, repeating them until the green RESET button on the computer board is pressed. A new program start is made as usual with HALT – NEXT – 00 – RUN.

With the rotary knob of the potentiometer, the pitch can be trimmed a little if the melodies are not played in the correct key.

If the owners of the Electronic Studios 2060 or 2065 do not have the two aforementioned components sent to them, this experiment can still be carried out; however, wrong tone sequences must then be accepted in some places.

Through hexadecimal entries, binary values are placed on the outputs, whereby the desired „high“ and „low“ states arise there. Depending on which outputs — and how many of the outputs — are „high“, the various pitches are played.

To get the computer to play particular melodies, the required tones must be produced in the correct order by the corresponding binary values at the outputs. We must know which resistor combination of our circuit produces the desired tone. The programming of the tone sequences follows accordingly.

Since the 3 melodies consist of a whole host of individual tones, a longer program is required, because every single tone has to be programmed.

Nevertheless, even without a program flow chart, a simple and clear presentation results, because the entire „tone program“ is carried out with pitch in register 0 and tone length in register 2.

Acoustic effects for computer games:
Program addition:
Acoustic effects for „Moon Landing“

The MOVI commands bring the hexadecimal values for the binary representation at the outputs into register 0. The CALL commands cause a jump into the subroutine (from address 02 to 0A), whereby the corresponding outputs are activated for a short time.

The MOVI commands also take care of the tone lengths, by bringing either the value 0 (short tones) or the value 1 (long tones) into register 2. If register 2 has the content 1, a continuous tone results, which changes only with the next following tone. If register 2 holds the value 0, a short tone arises — i.e. a short pause results between two tones. The melody „Sentimental Journey“ begins at address 0B. The command MOVI 1,2 brings the value 1 into register 2, i.e. all following tone commands produce continuous tones. With the following command MOVI 8,0, the value 8 is brought into register 0 (binary: 1000), i.e. output 4 becomes „high“ and the corresponding tone is produced by the electronic circuit. Each MOVI command is followed by a CALL command. Through this constant jumping back and forth between the „melody program“ and the „subroutine“, the melody sequence results.

The melody „Hänschen klein“ results from address 4E onward, where the command MOVI 0,2 brings the value 0 into register 2, so that all following tones are „played short“.

In the melody „Du, Du liegst mir am Herzen“, registers 0 and 2 are addressed alternately, because both long and short tones are required for this melody.

It should not be difficult for us to program the computer ourselves with a melody that we particularly like.

The „computer games“ offered in shops are often bought because of their acoustic effects. Many a game can be made more interesting through an acoustic representation of the score reached.

The game „The Moon Landing“ (page 23, instruction book Part 1) becomes considerably more effective through acoustic signals at the end of the game.

Let's try it out!

We enter the Moon Landing program once again. Apart from a few commands, the program can be taken over from page 24:

At address 56 (FE6), the change to CA5 is required. At address 6D (1FF) it is changed to C99. At address 7F (C6D) it is replaced by C90, and address 84 (C6D) by C9F.

Then the program is extended from address 90 onward. We carry out the additional reprogramming after HALT – NEXT – 90:

Address
Code
Mnemonic
Explanations
Tone generation for
„lunar module crashes“
Tone generation for
„fuel used up“
Tone generation for
„lunar module drifts off“
Tone generation for
„soft moon landing“
The computer counts people and objects
(BUSCH Electronic Studio 2065 or 2070 required)
Program: Light-barrier controlled counter

The tone-generating circuit from the preceding experiments is also used unchanged for this experiment.

After HALT – NEXT – 00 – RUN, the program is put into operation in the same way as described on page 23 of instruction book Part 1. At the end of the game, additional acoustic effects now result, which are matched to the game result by a corresponding tone sequence:

Soft landing of the lunar module = melodic tone sequence of high and low tones.

Lunar module has smashed on the lunar surface = simultaneously rising and falling melody sequence.

Fuel supply used up = repeatedly falling tone sequence.

Lunar module vanishes into space = rapidly rising tone sequence.

The game „Moon Landing“ is now perfect. The short additional program shows how such games can be made even more interesting through acoustic effects. The individual tone-program parts can also be adopted afterward for other game programs. (Note the command changes for the jumps to the subroutine!)

Where there is light, there is also shadow! Through this effect, counting effects can be achieved with light barriers, in that an illuminated photoresistor passes on the change between light and dark to the computer input by changing the voltage.

We build the electronic circuit according to the figure. The photoresistor should be illuminated by daylight or by the light of a lamp. By slowly turning the potentiometer knob, the circuit is adjusted so that the light bulb just goes out. If the photoresistor is then darkened somewhat — e.g. by the shadow of a hand held over it — the little bulb must light up.

After the electronic circuit has been connected to the computer, we carry out the programming after HALT – NEXT – 00:

Program start: HALT – NEXT – 00 – RUN. The display shows 00.

As soon as we bring a shadow onto the photoresistor (e.g. with the hand), this light–dark change is counted. The display shows 01 (i.e. how often a shadow was registered by the photoresistor). With the red button H, the counter can be reset to 0 again.

If the connecting cable is extended, the photoresistor can be mounted, for example, on a door. The computer then counts how many people have entered a room through this door.

With a focused beam of light, objects can be counted, e.g. on a conveyor belt. The circuit can also be used as a lap counter for model railways or electric slot-car tracks, and so on, and so on.

Address
Code
Mnemonic
Explanations
Clear all registers
Show registers 1 and 2
Store input value
in Reg. 0
Clear value at
inputs 3 and 4
Reg. 0 = Reg 3?
Yes, then jump to 02
Reg 0 → Reg. 3
Reg 0 = 1?
Yes, jump to 02
Greater than 1, jump to 00
Decimal counting program
in registers 1 and 2
similar to page 25
(described from address 08 on)
Wait
loop
Light-barrier circuit assembly

We can also use two light barriers, by slightly modifying the existing program and programming a second counter.

If two light barriers are mounted next to each other — e.g. at the entrance of a building — it could be determined in the evening how many people have entered and left the building again. A compare command could check on which of the two light barriers a shadow was registered first, whereby the first shadow triggers an up-counting effect and the second shadow a down-counting effect. If a difference appears on the display, it would be possible to determine, for example, that a certain number of people are still in the building.

On the basis of the knowledge acquired so far, it should be possible, with a little thought, to program suitable applications for light barriers yourself.

With a slot-car racing track, for instance, the possibility arises — by incorporating the BUSCH relay 5964 — to automatically switch off the driving current for the cars at a certain preset number of laps, etc.

This is of interest to the programmer:
Principle of data transmission
Data transmission with only three lines

(BUSCH Digital Studio 2075 required)

We enter the program as usual:

The circuit setup of the light barrier is familiar to us from instruction book 2065 or 2070. In addition, only the two 4.7 kΩ resistors have been inserted, in order to achieve the lowest possible current consumption of the battery.

By means of the command DIN 0, the input value is stored in register 0. With ANDI 3,0, the third and fourth binary digit (i.e. at inputs 3 and 4) are set to 0, so that, for example, a clock connected to input 4 (if we happen to be running the clock program alongside) does not destroy the subsequent comparisons.

Then a comparison is made as to whether the same value is present in registers 0 and 3. If „yes“, the input value has not changed and a jump back to address 02 occurs. If „no“, the input value is stored in registers 0 and 3. By means of the compare command CMPI it is determined: the value 1 is in register 0, i.e. the light barrier was not interrupted, and a jump to address 02 occurs. If the register content is greater than 1, the red button H was pressed, and a jump to address 00 occurs, to clear all registers. Otherwise, register 0 gives the value 0, i.e. the light barrier was interrupted. In the following decimal counter program, the interruption is counted as value 1.

Why does an interrupted light barrier give the value 0 in register 0?

The electronic circuit is designed so that, with an uninterrupted light barrier, a small voltage is present at input 1 of the computer — the input is „high“. With an interrupted light barrier (when the lamp on the circuit lights up), no voltage is present at the computer input. This gives a „low“, i.e. the value 0, which is stored in register 0.

For the many interesting experiments with electronic peripheral circuits, appropriate basic knowledge is a prerequisite. The BUSCH Electronic Studios explain a broad palette of electronic possibilities which, in conjunction with the computer, lead to ever-new applications.

In practice, it is often necessary to transmit data from one data-processing system (EDV) to another.

With the IC counter module from the Digital Studio 2075, we can make a register content of our computer visible on the large 7-segment display of the counter module. There are two possibilities for data transmission:

Address
Code
Mnemonic
This is of interest to the programmer:
Data transmission with 3 lines

The IC counter module is connected to the computer as shown in the figure.

After the program start, the display shows 0. If a number is entered, it is shown both on the computer display and on the IC counter module.

As long as we enter only numbers, these numbers are also visible on the large 7-segment display. If we enter, for example, C, the number 2 appears on the large 7-segment display.

The IC counter module works only in the decimal range. The hexadecimal C corresponds to the decimal number 12. Since the IC counter module displays only single-digit results, only the last digit — namely the digit 2 — is shown.

If we had several IC counter modules, it would be readily possible to transmit multi-digit results as well. How several IC counter modules are connected can be seen in instruction book 2075.

From instruction book 2075 we know that the IC counter module can „only“ count. The counter module always counts up by one as soon as the voltage at its clock input changes from „high“ to „low“. The counter module can be reset to zero as soon as its RESET input becomes „low“.

So that the IC counter module displays the same number that is entered into the computer, a corresponding number of „high“ – „low“ – „high“ pulses are passed one after another to the IC counter module, which are then

counted by it until the result is displayed. The number of pulses is also counted internally by the computer in register no. 1, so that the computer knows what count the IC counter module has.

By means of the entered program, the value 3 (binary: 0011) is first stored in register 2. In register 3 the value 2 (binary: 0010) and in register 4 the value 1 (binary: 0001) are stored. If a numeric value is now entered into register 0 via the keyboard, register 1 is set to the value 0, and by means of the commands DOT 4 (0001) and DOT 2 (0011) the IC counter module is also set to 0.

Now the comparison follows as to whether the content of register 0 is identical to the content of register 1. If „yes“, then the value shown by the counter module is identical to the entered value. If „no“, the value 1 is added to register 1, and by means of the command DOT 3 (content of register 3 = binary 0010) output 1 is set to zero. By means of the change of the „high“ – „low“ state, the counter module counts up by one, and by means of the command DOT 2 (0011) output 1 becomes „high“ again. This process is continued until the contents of registers 0 and 1 are equal.

This method has two disadvantages.

If, for example, the line connection to the IC module is interrupted by a fault, a wrong result display arises there.

Or if, for example, the value 9 is entered at the computer, the IC counter module begins to count up from 0 to the entered value, which requires a certain amount of time. The advantage of the method, however, lies in the fact that only three lines are necessary for the data transmission.

Data transmission by the „hand-shaking“ method
Data transmission by „hand-shaking“
This is of interest to the programmer:

The following program serves to demonstrate this method; it is entered as usual:

The IC counter module is connected to the computer as shown in the figure. We now need twice the number of transmission lines compared to the previous experiment.

Start the program and enter a number. Compared to the previous experiment, it is displayed considerably faster on the IC counter module. If we now enter a letter, the counter module is „at a loss“ — it counts on infinitely, because it cannot display letters.

We see that a line runs from computer output no. 1 to the clock input of the counter module. The four outputs of the counter module (A, B, C, D) are connected to the four computer inputs. The four outputs of the counter module pass on the displayed number as binary values. These are taken into register 1 of the computer by means of the command DIN 1. The entered program compares this number with the number entered via the keyboard (in register 0), and if both are equal, the result has been reached. Otherwise, by means of the commands DOT 3 and DOT 2, the IC counter is incremented by one and the comparison is repeated until the result is reached. Thus a feedback from the IC counter to the computer results, by which a wrong data transmission is ruled out.

The experiments show that, for example, ICs can be connected directly to the computer inputs and outputs. Since the ICs work with low voltages, no additional amplifier circuits are required for the control.

Incidentally, our IC counter module too has a carry signal (a kind of carry flag) for controlling a second counter module. The output MAX is constantly „high“ and only becomes „low“ when the value 9 is reached, in order to become „high“ again on the transition to 0. With this carry signal, a second counter module — or several — can be controlled.

Address
Code
Mnemonic
Computer counts frequencies
Program: Frequency counter
Circuit of the astable multivibrator for frequency measurement

(BUSCH Electronic Studio 2065 or 2070 required).

Frequency measuring instruments are needed in electronics for checking oscillation-generating circuits. With them, one can determine, for example, the transmitting frequency of a radio transmitter, or the audio frequency of an astable multivibrator.

The measuring principle is the same for all frequency counters. During a defined time (e.g. one second), the number of frequency pulses is counted and evaluated. Our experiment works on this principle too.

Before we start the program, the circuit is to be built up as shown in the figure. The connecting lead marked with ⊕ is connected to INPUT 4 of the computer. The lead marked with ⊖ leads to the GND socket of the computer.

On the computer board, TAKT/CLOCK is to be connected to INPUT 1.

This is of interest to the programmer:
TAKT/CLOCK signal

The assembly plan (figure) is authoritative when the large Electronic Studio 2070 is available. If only the Electronic Studio 2065 is present, the 3 components shown directly to the left of the battery are omitted (loudspeaker, transistor and 22 kΩ resistor). In this case, the earphone is to be used (drawn in the plan with a dotted line). The connecting lead between the two 22 kΩ resistors is omitted, and the connecting lead from the plus pole of the battery leads directly to the 1 kΩ resistor (top center).

Start the program and put the electronic circuit into operation (slide switch in position A). As long as the potentiometer knob is at the far left stop, no tone is produced in the loudspeaker (or earphone). The computer display shows 00.

Now we turn the potentiometer knob a little to the right until a slow crackling becomes audible in the loudspeaker (earphone). The computer display shows the frequency of the crackling tone in hertz (oscillations per second). If the potentiometer is turned further to the right, the tone sequence becomes faster — the frequency increases, which is also shown on the display by a higher hertz value.

The potentiometer should always be turned only a small step further, because the computer needs a measuring time of about 2 seconds until the result is displayed.

The further the potentiometer knob is turned to the right, the faster the tone sequence and the higher the frequency display. We will reach a point at which the computer no longer counts along (or shows fluctuating results), although, due to the faster oscillations, the pitch rises and therefore the frequency display ought to be higher.

The frequency generated by our circuit has now become too large (on the display this will be between 30 and 50).

For a following experiment, we should note up to which frequency reading the experiment works. The accuracy of the experiment that follows later depends on as precise a value as possible.

The limit frequency is determined by turning the potentiometer only a very small step further at the critical point, while observing the display. At a certain setting, the displayed value will fluctuate strongly. The potentiometer setting is now reduced just enough that the displayed value no longer changes by more than 3 Hz. We record this value in the following table.

The limit frequency was determined as: . . . . Hz.

It is not possible to determine the frequencies by means of a simple counting program in which the pulses at an input are counted. Our computer works too slowly for high frequencies.

Already at 3 to 4 pulses (oscillations) per second, the computer can no longer count along. This is because our microprocessor is programmed for very versatile applications. It does not only have to count; it monitors the keyboard, it handles the clock program running on in the background, and, and, and…

By means of a simple trick, we can outwit the computer: in the operating system, the time of day runs continuously. This clock program too is a „counter“, which counts the clock pulses at INPUT 4 and evaluates them for the time of day.

This „clock counter“ in the operating system works relatively fast. Therefore, the pulses to be measured are connected to INPUT 4. There, the pulses are counted along and further processed into a kind of „time of day“.

This process can easily be checked by calling the clock program with HALT – PGM – 4 and, at the same time, generating a tone with the connected circuit. We can observe that, depending on the clock frequency of the circuit, the seconds display on the display is shown at considerable speed.

The computer program brings the „time of day“ into registers A to F by means of the TIME command, whereby the values are stored in registers 2 to 7 by means of the EXRA command. Exactly one second later, the „time of day“ is taken over again and stored. If one subtracts the two „times“ from each other, the frequency in hertz (oscillations per second) results.

It must also be ensured that the measuring time between the two TIME commands is exactly one second. For this, the pulses of the 1 Hz TAKT/CLOCK output are used. As soon as the program is started, the computer waits in a wait loop until the clock signal is „high“ (1) present (see figure, section A).

In a second wait loop, the computer waits until the clock signal becomes „low“, i.e. 0, again (in the figure, section B).

1 second measuring time

Capture of the 1st time

Capture of the 2nd time

Program flow chart
Frequency counter

At the same moment when the clock signal becomes „low“ (0), the computer takes over the first time reading. With the second wait loop, it is achieved that the signal change to „high“ and back again to „low“ is waited for (exactly 1 second), in order to then take over and evaluate the second time reading.

The two wait loops (sections A and B in the figure) are necessary in order to achieve a defined start of the measuring time. The individual program functions can be seen from the program flow chart. It is not the complete „times of day“ that are subtracted from each other, but only the seconds. When subtracting the tens-of-seconds digit, the decimal correction, on the occurrence of a carry, is carried out by subtracting the hexadecimal value A (decimal 10), because the tens-of-seconds only go up to 5.

The electronic construction of the multivibrator (also called an astable multivibrator) should be familiar from the experiments with the Electronic Studios 2065 or 2070. In our frequency-measuring experiment, the loudspeaker is operated with an additional transistor. This is necessary because the computer needs clean square-wave pulses for the counting process. If the loudspeaker were operated without the second transistor, the coil windings of the loudspeaker could severely distort the square-wave pulses.

The arrangement of the electronic multivibrator circuit also remains in place for the following experiment.

Wait loop A: Is only exited when input 1 goes „high“. By means of the „shift-left“ command, the pulses present at output 8 (the frequency to be measured) are shifted out of the register, so that only the TAKT/Clock pulse is processed.

Wait loop B: Is only exited when input 1 goes „low“.

Capture of the time into Reg. A–F

Storage of the time in Reg. 2–7

2 wait loops for a 1-second measuring time

Capture of the 2nd time

The seconds are subtracted from each other.

Result (frequency is stored in registers 8 and 9 for display. Storage into registers 0 and 1 is necessary so that, after the EXRA command, the frequency display is retained.

Clear all registers

Display R8 and R9

A highly interesting experiment
Reaction-time meter
Program: Reaction-time meter
Connection of the astable multivibrator (from page 62) to the computer
to the astable multivibrator

The multivibrator (astable multivibrator) of the previous experiment remains in place unchanged. On the computer board, make the connections as shown in the figure. The plus and minus leads of the multivibrator to the computer board are also shown in the figure. The piezo buzzer is connected only after programming. The program is entered as usual.

Program continues —
please see next page!

Address
Code
Mne-
monic
This is of interest to the programmer:

If any number key is then pressed, the frequency measurement reappears on the display, and we can check whether the set frequency number „20“ is still correct. As soon as the red button G is pressed again, the next reaction-time measurement begins.

If the red button G is not pressed before the signal tone sounds, or button H is pressed prematurely, an interrupted signal tone sounds to demonstrate that the measurement was not carried out correctly. Incorrect measurements are not counted and are also not included in the calculation of the average time.

False readings (wrong times) can occur if the reaction time of a test subject amounts to several seconds (which hopefully does not apply in our case).

In the previous experiment, „Frequency meter“, we determined the limit frequency of our computer. This can be around 30 Hz (sometimes even 40 or 50 Hz).

At the moment, our reaction-time meter is set to 20 Hz. The accuracy is thus 1/20 second. If our computer has a limit frequency of 30 or 40 or perhaps even 50 Hz, an even more precise reaction-time measurement results, because we can then operate with 1/30, 1/40 or 1/50 seconds.

At a limit value of 30 Hz, a program change at address 44 is required. The existing command MOVI 2,0 (entry 120) is to be changed to MOVI 3,0 (entry 130). The multivibrator is to be adjusted so that the display shows exactly „30“.

If our limit frequency was at or above 40 Hz, the MOVI command is changed to the entry 140. The multivibrator is to be adjusted so that exactly „40“ is shown on the display. At 50 Hz, the MOVI entry is 150 and the display must show „50“.

Up to address 1A, the program is structured similarly to the previous „frequency counter“. However, the SHL commands were replaced by ANDI commands, so that no nonsense can arise in the wait loops when a red button is pressed.

The subtraction of the two „times of day“ is carried out in the subroutine „SUB“.

After the „frequency counter“ program part follows the query as to whether the red button G is pressed. If „yes“, the value 5 is loaded into register 8.

With the RND command (random generator) and the corresponding subtractions, a random waiting time until the start of the signal tone results. Then it is checked whether the red button G was pressed and whether button H was not yet pressed. By means of the command DIN F, the value resulting at the 4 inputs is taken into register F, and by means of the command ANDI 6,F (binary: 0110), the signals at inputs 1 and 4 are cleared. The value 2 (binary: 0010) is then still present in register F if only button G was pressed. If this is not the case, the outputs are switched on and off several times (a rapidly interrupted signal tone as a demonstration that the button operation was not carried out correctly). Otherwise, the continuous tone is switched on by means of the command MOVI F,F and DOT F, and the first „time of day“ is taken over. In a wait loop, the pressing of button H is awaited. Then the second „time of day“ is likewise taken over.

Connect the piezo buzzer. Start the program.

The computer first works as a frequency counter. With the potentiometer knob, the frequency is set until the display shows exactly 20 Hz. In case of any fluctuations in the reading, it must be readjusted until exactly 20 is shown.

With this program, we are able to measure our reaction time very precisely. Perhaps it is interesting to repeat a measurement under unfavorable conditions (lack of sleep, alcohol consumption) as well.

We press the red button G and hold it down until the computer signals with the randomly starting signal tone. Now the red button H must be pressed as quickly as possible. The display shows the reaction time with 3 digits. The left display digit shows the seconds, the middle one the 1/10 seconds, and the right display digit the 1/100 seconds. „040“ therefore means 0.4 seconds.

5 reaction-time measurements in succession are provided for, which is why the red button G is pressed again until the start of the signal tone. The switch to the red button H brings the second measurement.

After the fifth measurement, the display shows: EE XXX. For „X“, 3 numbers are displayed – an average value of the five reaction-time measurements.

Address
Code
Mne-
monic

In the subroutine „SUB“, the number of counted pulses (frequency measurement) is determined by subtracting the two times of day. At a frequency setting of 20 Hz, the measured pulse count is divided by 2, whereby the reaction time is determined. (At a frequency of 40 Hz it is divided by 4, etc. – command change at address 44).

The determined reaction time is added into the memory registers 8 to A, i.e. after five reaction-time measurements the total time is stored there.

The program waits until button G is pressed. Then the value 1 is subtracted from register 8 (in which the value 5 was present at the start) each time. The measurements are ended as soon as the value 0 is reached in register 8. The sum of the reaction times (in the memory registers 8 to A) is divided by 5, and the average reaction time is displayed.

Digital voltmeter
(BUSCH Electronic Studios 2065 or 2070 required)
Astable multivibrator for the digital voltmeter
Program: Digital voltmeter
Measuring leads
to the computer

A digital voltmeter is a voltage-measuring instrument in which the measurement results are displayed digitally, i.e. in directly readable numerical values. Compared with an analog measuring instrument, in which the measurement result is shown by the deflection of a pointer, digital displays are easier to read. In addition, digital measuring instruments work more accurately. However, a greater circuit complexity is also required.

In a digital voltmeter, the voltage (an analog quantity) must be converted into a digital quantity. For this there are special integrated circuits, so-called A/D converters (analog-to-digital converters).

The display accuracy of a digital measuring instrument depends on how many parts the quantity to be measured can be divided into. If, for example, a 10 V voltage is divided into 20 parts, the smallest displayed value (or the smallest voltage difference) works out to a range of 0.5 V. If 10 V is divided into 100 parts, an accuracy of 0.1 V already results.

For the analog-to-digital conversion we again use an „astable multivibrator“, whose construction, however, changes compared with the multivibrator used up to now. We rebuild the circuit according to the figure. TAKT/CLOCK must again be connected to INPUT 1.

The construction plan is authoritative when the large Electronic Studio 2070 is available. When using the Electronic Studio 2065, the 3 components shown directly to the left of the battery are omitted (loudspeaker, transistor and 22 K Ohm resistor). In this case the earphone is to be used (drawn in the plan with a dotted line). The connecting leads to the unused components

are omitted, and the plus pole of the battery is connected directly to the 1 K Ohm resistor (top center).

The leads leading to the computer are again marked with ⊕ and ⊖. As in the previous experiment, the ⊕ lead is again connected to INPUT 4 of the computer board. The ⊖ lead leads to the GND socket. The red buttons G and H that may still be connected are not required.

So that we can „calibrate“ our digital voltmeter, the program must first be entered according to the table.

Addr.
No.
Code
Mnemonic
Explanations
Jump to „MOVI 0“
Jump to „MOVI 0“
Jump to „MOVI 0“
Subroutine „MOVI 0“
Command change
at 40 Hz frequency
Command change
at 40 Hz frequency

* At these addresses, note the command changes in the 2nd part of the experiment.

Start the program. The display shows 00. To calibrate the voltmeter we need a 9 V battery that has already been in operation for some time. We deliberately do not use a factory-fresh battery, because such new batteries (despite the corresponding label) usually have 9.6–9.8 V, whereas batteries that have already been in use show quite exactly 9 V when no current is being drawn. The battery is connected to the measuring leads marked with ⊕ and ⊖ (see figure). We turn the potentiometer knob back to the left stop. Nothing can be heard in the earphone or loudspeaker. Now the potentiometer knob is slowly turned to the right in small steps. The loudspeaker (earphone) again produces the familiar crackling sound. We keep turning to the right until the display shows, as exactly as possible, 90 (9.0 V). The computer needs about 2–3 seconds for the measuring process, which is why after each potentiometer setting one must wait for the changed display value.

We will probably find that we will not succeed in calibrating precisely at 9 V. The display may show fluctuating values between 8.4 and 9.5 V. This should not bother us for now.

With our digital voltmeter we can now measure DC voltages up to 9 V. We surely have 1.5 V batteries available in another electrical device (e.g. in a portable radio), so that when using 2 batteries we can measure 3 V, or with 3 batteries 4.5 V, and so on. If we own the Electronic Studio „Digital-Technik 2075“, the very accurately working 5 V socket of the IC counter module can also be used for calibrating and measuring.

In its current form, our digital voltmeter has a measuring accuracy of 0.4 to 0.5 V. With voltages that have intermediate values, the mentioned display fluctuations result.

If, however, in the „Frequency counter“ chapter we found that the limit frequency of our microcomputer is above 40 Hz, the measuring accuracy of our digital voltmeter can be substantially improved. For this, the commands marked with a * in the program table must be exchanged for the commands given in parentheses. So, for example, at address 25 we change the command entered as „170“ to „150“, and so on.

After this program change, the device must be recalibrated as described above. The measuring accuracy of our digital voltmeter is now already about 0.2 V. However, at voltages above 6 V there will still be certain display fluctuations.

Attention! The digital voltmeter can only be used for direct-current measurements up to 9 V. Alternating-current voltages are not displayed. Connecting alternating-current voltages of over 9 V to the measuring leads can lead to the destruction of components.

How does the digital voltmeter work?

Owners of the Electronic Studio „Digital-Technik 2075“ are familiar with the principle of converting an analog voltage into a digital measurement result.

In our experiment, the astable multivibrator generates a frequency which is low at low voltage (slow crackling) and becomes higher as the voltage rises (fast crackling). The computer counts the frequencies and reports them on the display as the voltage measurement result.

Example: The frequency amounts to 20 Hz at a connected voltage of 9 V. The voltage at a frequency of only 10 Hz results from the following formula:

U = 9 V20 Hz × 10 Hz = 4.5 V
or at a frequency of 11 Hz:
U = 9 V20 Hz × 11 Hz = 4.95 V (rounded up to 5 V).

In our currently constructed experiment, the calculation is unfortunately not quite so simple, because the higher or lower frequency is not generated linearly in relation to the connected voltage. If, at a voltage of 9 V, the 20 Hz mentioned in the example are generated, then at a 5 V connection 11 Hz would have to be generated in order to arrive at a correct result. In reality, however, our astable multivibrator does not generate 11 Hz at a connected voltage of 5 V, but 12.5 Hz. If we were to apply the same formula again, we would arrive at the following (incorrect) result:

U = 9 V20 Hz × 12.5 Hz = 5.6 V (5 V would be correct)

For the conversion of the frequency into a voltage, we must find a different formula for the astable multivibrator that is available. Taking into account the non-linear frequency generation, the following formula was found through experiments:

U = 0.0067 × f2 + 0.3160 × f

If the corresponding frequency, e.g. 20 Hz, is substituted for f, we arrive at the following result:

U = 0.0067 × 20 × 20 + 0.3160 × 20 = 9 V.

At 12.5 Hz the result is:

U = 0.0067 × 12.5 × 12.5 + 0.3160 × 12.5 = 5 V.

Since our computer cannot measure 12.5 Hz (but only either 12 or 13 Hz), a connected 5 V measuring voltage produces fluctuating display values between 4.7 and 5.2 V.

This is of interest to the programmer:

Up to address 1B, the same program section results as in the „Frequency counter“. The generated frequency is taken into registers A and B. These values move into registers 0 and 1 and are stored in the memory registers 0 and 1.

Then registers 0 and 1 are once again loaded with the contents of registers A and B, and the command MULT is executed. Registers 0 to 5 now contain the square of the frequency. This result is multiplied by 67 (instead of 0.0067 in our previously mentioned formula). The first three digits of this result (in registers 2, 3 and 4) are stored in registers D, E and F.

Registers A and B still contain the measured frequency values, which are now multiplied by 3160 (instead of 0.3160 in our formula).

The result is added into registers D, E and F.

The final result in registers E and F is transferred to registers 8 and 9 (or registers 0 and 1) for the result display.

The program sequence is to be presented clearly once more:

1. Measure the frequency (e.g. 14 Hz)
2. Square the frequency14 × 14= 196
3. Multiply the result by 67:196 × 67= 13132
4. Store the first three digits:= 131
5. Multiply the measured frequency
   14 Hz by 3160:
14 × 3160= 44240
6. Add the first three digits to the
   result of 4:
131 + 442= 573
7. Display the first two digits

We compare with the formula found earlier:

U = 0.0067 × 142 + 0.3160 × 14 = 5.737

The computer's calculations agree with this formula. It would be pointless to display the result with 3 digits, because the frequency generated by the astable multivibrator is not accurate enough.

If the frequency is increased to 40 Hz (at 9 V), the formula changes as follows:

U = 0.0025 × f2 + 0.125 × f

This formula change was taken into account in the command changes given in parentheses.

A supplementary pack for exact measurement results is in preparation. This pack contains, among other things, a special A/D converter, temperature sensor, etc., in order to be able to carry out very accurate measurements of voltages, temperatures, light, and so on. By incorporating these measured values – which, for example, are reported by the computer to the outputs when values fall below or rise above set limits – many further application possibilities of the Microtronic computer system arise.

Program flow chart: Digital voltmeter.
Computer-controlled model railway
First expansion stage
It is essential to note:

The monitoring and control of a model-railway layout is an interesting application for our computer.

Computer control offers great advantages over the relay circuits customary up to now: if, for example, the control sequence is to be changed, only a change to the computer program is necessary. A correctly executed „hardware wiring“ remains in place unchanged. The computer takes over the fully automatic model-railway operation, and by means of a small additional program this automatic mode can be switched over to semi-automatic or manual operation. One can also intervene in automatic operation, for example when a point setting controlled by the computer is to be changed manually. This point changeover is registered by a computer input. The computer checks whether an „accident“ could occur and diverts the possibly „threatened“ train onto another track – the point in question can be set. If this is not possible, the planned point setting is held back until the endangered train has passed the possibly threatened spot. Only then is the manual point setting released.

The control of so-called „point routes“ can also be a task for the computer.

Some model-railway enthusiasts are of the opinion that only a few connecting cables need be attached to the computer in order to achieve a fully automatically controlled model-railway operation. Now that we have in the meantime occupied ourselves intensively with the possibilities of a microcomputer, it is clear to us that various preparations must be made for such a conversion.

Since the computer works only with direct-current voltages and very small currents, in the following experiments no currents (voltages) from the railway transformer may reach the inputs or outputs of the computer. Points, track sections or other electrical items supplied by the railway transformer may therefore never be connected directly to the computer board.

The danger is great that a careless connection will lead to the destruction of our valuable microcomputer. Thus the computer must be told, via its inputs, which tracks are occupied, in which directions the points are set, and so on. For this, no track contacts or the like may be connected to the computer. By „interposing“ the special BUSCH relay 5964 and the BUSCH light barrier 5962, suitable aids are available to us for the computer-controlled model railway.

First, some consideration is necessary as to how a model-railway layout is to be prepared for computer control. This is to be demonstrated on a simple track oval with a pair of points.

On this circuit with a passing siding (station), three trains can run fully automatically and without accidents. While one train arrives at the station and stops there, the train waiting on the second track is released. The third train is on the „line“.

Circuit diagram: IR light-barrier amplifier
Assembly plan: IR light-barrier amplifier
Light-barrier amplifier symbol

The circuit is divided, as shown in the figure, into three „blocks“. The computer must then check and calculate which track block is to be blocked or released and how the points are to be set.

All manufacturers of model railways offer easily realizable ways of dividing the track routes into individual block sections by means of appropriate insulating pieces.

The BUSCH light barriers No. 5962 are ideally suited for the „monitoring“ of the individual track blocks. They are not only relatively inexpensive, but also provide the contactless data transmission required for the computer. A light barrier consists of a small infrared transmitter and receiver, which are mounted opposite each other on a track section to be monitored. When a train passes through, a signal is triggered which is evaluated by the computer. For this, a simple amplifier circuit consisting of one transistor and three resistors is required. Owners of a BUSCH Electronic Studio can easily build the circuit by using the corresponding BUSCH plug-in modules. Since all components are also available individually, they can be obtained from the BUSCH customer service. You will find a parts list at the end of this chapter.

Assembly plan of the amplifier circuit for light barriers. Several amplifier circuits can be built on one plug-in board and supplied from the same voltage source.

The small amplifier circuit (as per the figures) supplies the computer with a „1“ signal (voltage present) when the light barrier is interrupted (train passing through), or a „0“ signal when the light barrier is not interrupted. To simplify matters in the overall circuit diagram of the model layout, the small amplifier circuit is represented by the following symbol:

Instead of the battery module, the BUSCH power-supply unit 2059 or BUSCH series regulator 8627 can also be used.

Running currents and points are switched with the BUSCH relay 5964. In the chapter „Connection of relays“ it was shown how the relay 5964 can be driven by the computer by means of a simple transistor stage (1 resistor, 1 transistor).

For the power supply of the light-barrier amplifier and for the simple transistor stage of the relay 5964, a 9 V battery block has been provided in each of the assembly plans. Instead of the battery module, the BUSCH power-supply unit 2059 can also be used, which likewise delivers a 9 V DC voltage (250 mA). For the relay, a DC control current of 9 V is required in every case. Under no circumstances may 9 V AC be connected. The light barriers work in a range of 5 to 9 V DC. The BUSCH series regulator No. 8627 is also suitable for this. When connected to an AC transformer of 12 to 16 V, this series regulator delivers a 5 V DC voltage.

IR transmitter
IR receiver
green
grey
red
grey
input
grey
grey
red
green
Connection
IR transmitter
(light case)
Connection
IR transmitter
(dark case)
to a
computer
input
Connection to
computer GND ⊖

We need electromagnetic points with a stop function and end cut-off. The end cut-off is necessary because the points receive a longer switching pulse via the relays, which – in the case of points without end cut-off – can lead to overheating and, with prolonged use, to the destruction of the electromagnetic drive.

Now we can carry out the wiring of our – for the time being still simple – model layout. We need four light barriers and three relays, which are to be wired according to the overall circuit diagram. We note that the cables responsible for the straight-ahead setting of the points lead to contact point 3 of relay No. 1, while the cables for the branch setting are to be connected to contact point 1. This is important because both points must be operated in unison, i.e. both points are set either to straight-ahead or to branch. Now we still need a computer program that takes over the monitoring and automatic control. The following prerequisites result from this:

A train passes light barrier 4 (L4). The track block No. 3 lying behind it must be switched off (de-energized), so that a possible second following train does not come too close to a train travelling ahead.

A train passes light barrier 1 (L1). Track block 2 must be switched off. At the same time, track block 3 is released again. Depending on the point setting, light barriers 2 and 3 (L2 and L3) must be monitored until a train arrives. Light barriers 2 and 3 have the following task:

When a train arrives at the station, the two points must be switched over. When stop points („thinking“ points) are used, this switches off the running current of the incoming train and releases the opposite track. In addition, track block 2 must be switched on again.

In order to be able to incorporate these considerations into a computer program, a whole series of so-called „logical operations“ (ANDI or OR commands) are necessary, in order to address, of the 4 computer inputs or outputs, only the one that is required for the control of the respective situation.

If, for example, the state of light barrier 4 (light barrier interrupted or light barrier free, i.e. „1“ or „0“) is to be taken over, then all values of the 4 connected light barriers must be stored in a register by means of the DIN command. By means of the command ANDI 8, the current state of light barrier 4 can then be processed. The value of the 3 remaining inputs is briefly set to 0.

The explanations in the program table should be sufficient to understand the program. It works through the conditions formulated above one after the other. In register 0, the value of the light barriers is taken over. In register 1, it is stored which outputs are switched on or off. In register 2, an intermediate storage takes place if light barrier L1 was interrupted, until light barriers L2 or L3 are interrupted. It must be pointed out that the connecting lead – possibly present on the computer board from earlier experiments – between

Overall circuit diagram, first expansion stage
Direction of travel
Computer inputs
Computer outputs
Transformer for
running current
Transformer for
points
Relay 1
Relay 2
Relay 3

TAKT/CLOCK and an INPUT must be removed without fail, because otherwise program malfunctions arise. We enter the program according to the table:

Program: Model-railway control, first expansion stage
Adr.
No.
Code
Mnemonic
Explanations
Value of R1 to outputs
Take over value of light barriers
By ANDI 8,0 take over only value of L4
If L4 equals 0, then jump to address 08
By ANDI B (1011) switch off block 3
Take over value of light barriers
By ANDI 1,0 take over only value of L1
If L1 equals 0, then jump to address 0F
Store that L1 was interrupted
By ANDI D (1101) switch off block 2
By OR operation of 4 (0100)
release block 3
Was L1 interrupted?
Yes, then jump to 12
No, then jump to 03
Determine whether the points (output 1)
are set to straight (0) or branch (1).
Take over value of light barrier
By ANDI 2,0 take over only value of L2
If L2 equals 0, then jump to 03
By ANDI E (1110) set points
to „straight“
By OR operation of 2 (0010)
release block 2
Clear storage of L1
Jump to 03
Take over value of light barriers
By ANDI 4,0 take over only value of L3
If L3 equals 0, then jump to address 03
By OR operation of 1 (0001)
set points to branch
Jump to 19
Additional program for manual operation

For fully automatic model-railway operation, the program is started with HALT – NEXT – 00 – RUN. Two trains expediently stand on the two tracks at the station (block 1); a third train stands opposite in block 3. Logically, no locomotives or wagons may stand on the points. After switching on the running current, fully automatic model-railway operation sets in. The display is switched off, because the computer must partly react (compute) very quickly.

Circuit diagram, second expansion stage, with an additional outer loop
Transformer for
running current
Computer
output 4
Second expansion stage – model-railway control

Without changing the entire electrical wiring, our small layout can also be run in „manual operation“ at any time. In this case we stop the program at address 25 with HALT – NEXT – 25 – RUN. Track blocks 2 and 3 are now no longer monitored, but are permanently switched on. For the point setting, any number key can be pressed.

If the green RESET key on the computer board is pressed, all outputs are switched off immediately. This blocks track blocks 2 and 3. The RESET key can be used as an „emergency-stop key“.

Even with this small and simple layout, the manifold possibilities of a computer control can be recognized, which with the means customary up to now (block-post control, etc.) are not achievable with this precision. As with all automated function sequences, care must be taken that, for example, all wagon couplings work perfectly, so that no unforeseen breakdowns occur due to wagons that have come to a standstill.

Our small model-railway layout becomes even more interesting when it is completed by an additional outer loop.

With additional track material and two further pairs of points, the layout is built up as shown in the figure. The inner loop corresponds unchanged to the previous setup. All light-barrier and relay connections remain in place. It is only necessary to ensure that the light barrier L1 is arranged to the right of the newly inserted point.

Since we still have one computer output free, we can set up a „stopping point“ on the new outer loop in the station area, which is driven by a further relay via the 4th computer output. This outer loop is intended for long-distance trains, which only occasionally stop at the station for a certain time and then automatically continue. To achieve this, the already entered program is completed from address 2C. Additional program entry after HALT – NEXT – 2C:

Additional program: model-railway control, 2nd stage
Address
Code
Mnemonic
Explanations
Stop time at station, outer loop
Stop before station, inner loop

Before we start the program, the following changes must be made to the first program part: with HALT – NEXT – 06 make the first command change, and then move on with the NEXT key to the next address to be changed, and after the last command change do not forget to press the NEXT key once more:

At address 06, change the command entry to E2C (BRZ 2C)
At address 15, change the command entry to B35 (CALL 35)
At address 1D, change the command entry to B35 (CALL 35)

All other functions remain unchanged. Program start with HALT – NEXT – 00 – RUN.

On the outer loop, a fourth train can be operated either with the same running-current transformer with which the three other trains already run, or with an additional running-current transformer. On our layout, „a busy hustle and bustle“ will now develop. Since the train on the outer loop only stops occasionally, the four trains running simultaneously create a fascinating impression for a layperson who does not know that it is a computer-controlled layout.

The stopping time of the express train on the outer loop is variable. It can be shortened if the command at address 2C is changed by entering 526 or 536 or 546, etc.

When all four trains are travelling in the same direction, a train can be switched from the inner loop to the outer loop by manual operation or by the usual remote-control point switches. As soon as a train leaves the inner loop, a train immediately following it stops in track block 2 for about 5 seconds, which gives enough time for the points to reset. This time can also be extended if the command at address 36 is changed by entering 539 or 529 or 519. Since there is no light-barrier monitoring on the outer loop, only one train should run there at a time, i.e. when switching from the inner loop to the outer loop, one of the two trains temporarily running there should soon switch back to the inner loop.

The additional program contains, from address 2C to 34, a two-digit counter by which computer output 4 is switched on or off depending on the counter reading. Since this is a „random counter“, the train running on the outer loop stops at irregular intervals. From address 35, there likewise follows a counter which releases block 2 (computer output 2) after about 5 seconds, and not, as normally, after a train has passed through light barrier L2 or L3. Thus 2 programmed timers have been integrated into the program sequence.

Of course, we can expand our layout further with sidings not monitored by the computer, etc. On relays No. 2 and 3, one connection socket (No. 1) each is still free, to which, for example, further relays can be connected, in order to switch a warning-flasher unit at the level crossing or lighting within the model town on and off. Additional signals (coupled with the point setting) could be connected to relay No. 1. On the computer itself, we have used up all inputs and outputs, which is why additional supplementary elements are necessary for further computer functions.

BUSCH will develop additional memory modules especially for model-railway enthusiasts, so that for a further expansion the four inputs and outputs now available can be multiplied. Interested model-railway enthusiasts, please note the announcements in the new BUSCH model-railway catalogue, which will be available from late summer 1982. You will be amazed at what can still be „got out“ of the Microtronic computer system.

Parts list: Additional components
for model-railway control

Taking into account the electronic modules contained in the 2090 pack, the following individual parts are also needed for building the model-railway control:

4modules, resistor 470 OhmNo. 20684
7modules, resistor 1 k OhmNo. 20685
2modules, resistor 4.7 K OhmNo. 20687
7modules, NPN transistorsNo. 20611
1plug-in board (for modules)No. 20782
1bag of cable pieces in various
lengths
No. 20785
1bag of 48 yellow plastic plugsNo. 20795

You can order these parts from your Microtronic specialist dealer or directly from us (against prepayment of the amount to our postal giro account). Please use the enclosed order form, in which you will find all the necessary details. If necessary, request a new order form from us free of charge.

The remaining necessary parts:

4IR light barriersNo. 5962
4special relaysNo. 5964

should be in stock in the model-railway departments of good specialist toy shops.

Can the Microtronic computer system
do even more?

It is impossible to give an example for every application in this instruction book. The book would never come to an end, because the possible uses of such a microcomputer cannot be surveyed.

Therefore the most exciting part of working with the Microtronic computer system now begins:

We consider which tasks the computer can take over. We put our considerations into the order that can be carried out by the computer, and we develop the programs required for this. For many applications, modified program parts from the instruction books can be used. With intensive work, however, we will discover yet infinite programming possibilities. It is up to us to make use of these possibilities. We will find that our microcomputer not only provides a serious and satisfying leisure activity, but that it can also be used for many practical applications. For this, BUSCH will over time bring further supplements onto the market, whereby the Microtronic system is adapted to the current state of the art.

Microtronic Programming Contest
Conditions of participation for the
BUSCH Microtronic Program Contest

The purpose of the Microtronic computer system is to master the possibilities of microcomputer technology and to arrive at ever new ideas and programs.

In order to coordinate the exchange of experience, it is planned to hold a contest under the motto:

„The most interesting program suggestions
for the Microtronic computer system“

Submissions are possible at any time. The program suggestions awarded a prize by BUSCH will be published in future Microtronic program books. Every program that comes to publication is rewarded by payment of a prize of DM 100.–.

Eligible to participate are all users of a Microtronic computer system, with the exception of employees of the company BUSCH GmbH.

The program suggestions to be submitted must be new, i.e. they should not represent modified variations of already published programs, and they should fall within the scope of the following 3 categories:

1. Program suggestions which can be carried out with the Microtronic computer system without additional accessories.

For the functioning of these programs, only the Microtronic computer and the supplementary parts contained in the 2090 box may be used.

2. Program suggestions using additional BUSCH Electronic components.

For these program functions, all the individual parts of the BUSCH Electronic Studios, BUSCH switching relays and the supplementary elements coming further onto the market from BUSCH may be used.

3. Program suggestions using generally purchasable components.

For these program functions, general, standard components available everywhere may be included. The purchase price (general retail price) of the additionally necessary parts should not exceed the amount of DM 80.–.

The programs submitted for a contest entry should be laid out in the manner of the Microtronic program listings.

A short functional description is required, necessary program explanations, and for larger programs a program flow chart.

If additional electronic components are needed, the inclusion of a circuit and construction plan is necessary.

Please address your program suggestions to:

BUSCH GmbH & Co. KG
Microtronic Contest Department
P.O. Box 1360
6806 Viernheim/W-Germany

Concept and logic:
The electronic experimentation system from
In collaboration with the electronics magazine
Modern industrial components. . .
From the simple resistor through capacitors, diodes, photocells, transistors, loudspeakers, etc. up to the IC and microprocessor.
. . . mounted on BUSCH electronic modules
Ready to install and function-tested. Understandable for everyone thanks to component labelling and circuit diagram.
Perfect experimentation technique . . .
For building the circuit, place the modules on the plug-in board and wire them with absolutely reliable contact using the protected BUSCH lead-clamping technique.
Compact-Studio
2060
Basic set
from 10 – 12 years
Expandable with the Electronic Studios 2061, 2070, 2090.
Start experimenting immediately without prior knowledge! The inexpensive starter pack for those who want to try it out first and expand it further later.

A detailed instruction book with over 120 illustrations and circuit diagrams shows, understandably for everyone, the construction and function of 40 interesting experiments and device circuits.
Device circuits: From the simple electric circuit to the basic light-organ circuit. Among others: rain-warning system, voltage tester, alarm systems, dimmer circuit, automatic time and delay circuits, flashing-light circuits, electronic two-tone horn, siren wailing, tone generators, acoustic step detector, capacitive proximity detector, remote-controlled electronic relay, AF sound amplifier, Morse-code generator, electronic mini-organ.
Contents: The pack contains everything necessary to begin, such as: mini loudspeaker box, electronic modules with transistors, potentiometer, capacitors, resistors, push-buttons, light bulb, battery holder, plug-in board, cable, stripped cable pieces in various lengths, clamp plugs, etc. (approx. 100 individual parts).
Supplementary pack
Power supply
2059
Suitable for all Electronic Studios.
For everyone who experiments for longer or uses assembled device circuits (e.g. clock radios) in continuous operation, the purchase of the special power supply 2059 is recommended. The plug-in module of the power supply is used within the circuits in the same way as the otherwise usual battery module. The device saves batteries and always ensures the correctly dosed voltage.

The power supply 2059 is a compact, double-insulated safety transformer. The integrated electronic stabilization ensures uniform voltage output with hum filtering (important for radio experiments).

Input (primary) 220 V AC.
Output (secondary) 9 V DC, maximum 200 mA.
Short-circuit-proof, tested according to VDE guidelines.
Studio-Center
2070
Basic set
from 12 – 14 years
Expandable with the Electronic Studios 2060, 2072, 2075 and 2090.

The large Studio-Center 2070 is the centrepiece of the BUSCH Electronic Studio series. It offers all-round experimentation possibilities in all areas of modern electronics. By building circuits in the studio housing, over 130 realistically functioning devices are created. A comprehensive instruction book with approx. 370 illustrations, construction plans understandable for everyone, and professional circuit-diagram representations. An excellent thing, also for those who do not only want to experiment.
Device circuits e.g.: medium-wave radios with push-pull output stage, long-wave (LW) receiver, short-wave (SW) radio, VHF/FM broadcast receiver, 1-channel light organ, acceleration and phon measuring devices, cable and magnetic-field detectors, highly sensitive telephone monitoring circuit and bugging device, transmitter experiments, electronic piano and Hawaiian guitar, automatic telephone dial, rhythm device, car alarm system, reaction-time meter, digital counter, electronic dice, hearing-ability tester, acoustically remote-controlled switch, shot detector, reaction-time test device, electronic roulette, metal detector, automatic warning-flasher unit, light barrier with acoustic continuous alarm, electronic „nerve saw“ and much more. In addition, all the device circuits listed for 2060 and 2065 are possible.
Contents: Electronic Studio-Center with smoked-glass-coloured cover hood and instrument board with built-in loudspeaker, potentiometer, variable capacitor, slide switch, universal measuring instrument and standard phono socket. In addition, a rich selection of electronic modules with transistors, radio IC (integrated circuit), diode and light-emitting diode, electrolytic and disc capacitors, photoresistor, ferrite antennas, choke coil, potentiometer, resistors, push-buttons, earphone, light bulb, wires, cable, cable pieces and clamp plugs.
Supplementary pack
2079
Plug-in modules for self-assembly.
Possibilities of endless further experimentation: attach any electronic components to the modules without soldering.

Contents: 10 modules and 45 clamp plugs. For the easy self-assembly of 2-, 3- or 6-pin components such as resistors, capacitors, transistors, thyristors, coils, transformers, switching relays, etc.
Supplementary pack
2089
IC sockets for self-assembly.
Once initial IC experience has been gained through the experiments with the Electronic Studios 2072 and 2075 and above all with the microcomputer 2090, these self-assemblable IC modules open up endless expansion possibilities.

Contents: 2 modules for plugging in any ICs up to 16 connection pins, plus 40 clamp plugs. Detailed instructions with references to the most common IC types, application examples with circuit and construction plans.
Supplementary pack
IC amplifier technology
2072
from 12 years
Ideal as a supplement to the Electronic Studios 2065, 2070 and 2090.
This add-on box „IC amplifier technology“ brings power and the hi-fi super sound!

Device circuits: The detailed instruction book with over 50 illustrations and construction plans shows 30 sound-generating extension circuits for broadcast receivers with hi-fi sound, phono amplifier with power output stage, electronic organ, spinet and Hawaiian guitar, rhythm device, intercom systems, hi-fi mono amplifier with treble and bass control, hi-fi stereo amplifier, telephone amplifier, vibrato organ with light control, reverb effects, electronic interval-signal generator, sound transmission by light, etc. A genuine 2-channel hi-fi stereo amplifier is possible by using 2 × 2072.

Contents: On a special module with an integrated board, a high-quality AF power amplifier is built, consisting of an amplifier IC, several electrolytic capacitors, disc capacitors, resistors and a trimmer potentiometer for tuning. With the connection socket also included, playback to large external loudspeakers (hi-fi boxes) is also possible.
Digital-Technik
2075
Basic set
from 14 years
Expandable with the Electronic Studios 2070 and 2090.
The „Digital-Technik“ studio explains the fundamentals of calculator and computer technology. An independent experimentation kit and at the same time a supplementary kit.

The core is an IC counter module with a 7-segment illuminated-digit display and an integrated circuit with over 350 transistor functions. This IC (a so-called 4-bit counter-latch-decoder) contains, besides a counter, a memory and a decoder for driving the illuminated display.

Digital electronics is conquering ever more fields of application. The best-known examples of this new technology are computers and pocket calculators. However, digital technology is used just as much in consumer electronics – in televisions and large receivers – as in digital clocks or for the program control of washing machines. The latest technical marvel, the microprocessor (see 2090), likewise works according to the basic rules of digital technology.
Device circuits: The detailed instruction book with over 100 illustrations and circuit diagrams brings 30 highly interesting experiments, such as the principle of the digital clock, programmable counter, electronic roulette with illuminated display, memory circuit, digital memory, electronic calculator, digital stopwatch, opto-electronic adder, frequency meter, principle of the synthesizer, opto-acoustic counter, digital-to-analog converter, digital voltmeter, electronic music box, etc.

The Digital-Technik studio is at the same time a recommendable preliminary stage to the Microtronic computer system 2090.

Contents: Over 60 individual parts, including a high-quality IC counter module with illuminated display, IC gate module, as well as resistors, electrolytic capacitors, capacitors, light-emitting diode, push-buttons, battery holder, cable and clamp plugs.
Low-current
special relay 5964
This relay can be driven by a minimal control current (8–16 V, 50 mA) of the Electronic Studio circuits or by the computer 2090, and switches (in conjunction with, for example, a railway transformer) up to 8 A at 16 V. Ideal for experiments with light-, sound- and time-dependent circuits with the model railway. Also usable in conjunction with the BUSCH IR light barrier / timer 5961 (see the BUSCH model-railway accessories catalogue).
Mains-power switching
unit 2087
for all Electronic Studios and the computer 2090.

The switching unit is controlled by the circuits built with the Electronic Studios using the experimentation low voltage (6–9 V), and triggers, via a relay, switching operations in the lighting mains (220 V, max. 1000 watts). For example, switching radios, tape recorders, warning systems, fan heaters, etc. on and off. The high-current side is completely encapsulated and separated from the low-current side, and can therefore be operated absolutely safely even by laypeople and children. Tested according to VDE regulations. Detailed instructions with wiring examples.
Perfect for further experimenting . . .
BUSCH Electronic Studios are the ideal supplement to the Microtronic computer system. For example the Studio-Center 2070 with approx. 130 interesting experiments and device circuits across the entire field of modern electronics.
In collaboration with
the electronics magazine