⬆️ ⬇️

We program a microwave or controller 40 years ago

Hi, I recently accidentally fell into the hands of such a piece of iron:

image



Well, a piece of iron and a piece of iron, I thought ... There is a PBE035 microcontroller on the board, an IO m5l8243p extender, an IR12 between RF5 and the controller, and there is somewhere else LN1 on the side dangles. I immediately liked the good rare ROM on 2KB RF5 in the socket in gold. I think I'll take it off, and the rest boldly in the scrap, more, the whole board is covered with varnish for the most unbeatable .. And then all the same it became interesting, but what is it all about?



It turned out that this is a control board from the Soviet microwave type Electronics 23 (aka BUVI-2 aka Fairy aka Dnepryanka). On the Internet, even the device scheme was quickly found: http://www.elremont.ru/small_rbt/bt_rem32.php Now that it became clear what it is, one hand confidently reached for the trash, and the other inadvertently hammered in Google “035” and ... And I became interested and carefully looked at the fee. Once there is a controller, it means you can write programs for it. There is also a kind of screen directly on the board (4 digits) where you can display all sorts of swear words (BABA, SISI, well, you understand). There is also a piezo element here, which means you can squeak. Everything else you can connect 4x4 keyboard. This is just some kind of devboard, I was delighted!



As already mentioned, the PBE035 controller is installed on the board. In Russia, it is better known by the name of KR1816BE35, but in general, this is the great and terrible Intel 8035 MSC-48 series. The first copies began to be produced in 1976, that is, about 40 years ago. The controller does not have its own memory for programs, so it communicates on the external bus with the ROM, from which it reads the instructions for execution. But there are 64 bytes of RAM, of which about 32 bytes can be used as you like, and the rest are for registers and the stack. There is a timer, there is an interrupt from the timer, there is an external interrupt, there is a system of priorities. In short, the normal old-school controller, not like bold PICs. What the Bolsheviks had been waiting for so long. Immediately I wanted to code something under it.

')

But first they had to solve one difficulty, namely, to connect the board. As can be seen from the diagram, the power supply for the digital part requires just + 5V, while for the indicator powering it is necessary 2.5V and 30V of alternating voltage.



By the way about the indicator - it's a lamp! Yes, a warm lamp radio tube, and not some kind of pop-up LEDs. And like a lamp, it has a cathode anode and a grid. This type of indicator is called fluorescent vacuum indicator. After thinking a bit about the circuit, I saw that 30V breaks go to the diode bridge, which means they straighten up. And even 2.5V also go to the diodes and then to the grid, which means they, too, straighten. So you can try to connect the board to a constant voltage. Instead of 30V, I filed 12V, instead of 2.5V, I filed 3.3V from a standard ATX format power supply. To do this, solder the wiring to the board. It turned out like this:







But having turned on the board, I was at first disappointed. Some segments on the display did not glow. At first, I thought that 12 volts was not enough, but then after carefully examining the board, I found it was not in two places near the indicator. Rang, disappeared. The board started up, numbers appeared on the screen to set the time and select the program mode. So, I wanted to throw it out, but in the end I fixed it. It's time to fry.



I used the free cross-platform assembler Asm48 . Cool, that there is a version for MacOS, apparently the authors are not deprived of a sense of humor, at least I appreciated. Well, it means downloading the assembler, everything is simple there: ASM48 <filename.asm> The first thing I did was “blink the LED”, but instead of the LED I was jerking the leg of the speaker (piezoelectric element) in an endless loop with a delay. Speaker is connected to port 1, high bit:

jmp main nop nop nop nop nop nop main: mov r6,#0 ;   r6 - 0  80h forever: mov a,r6 ;     ALU xrl a,#080h ; a = a xor 80h outl p1,a ;    1 mov r6,a ;    r6 call onesec ;   jmp forever ;   ;---PROCEDURES ;;;;;;;; delay100: mov r1,#84 loopex: mov r2,#236 loopin: djnz r2,loopin djnz r1,loopex mov r3,#4 loopad: djnz r3,loopad ret ;;;;;;;; onesec: mov r4,#10 loop_d: call delay100 djnz r4,loop_d ret 




Having compiled the program and stitched it on the programmer in ROM 2716, I launch the board and hear periodic clicks at intervals of about a second. Works! Now I had to deal with the screen. The scheme shows that the “mask” of the ABCDEFG symbol is connected to port 1. Moreover, the signal is inverted, that is, when 1 - the wand does not light, when 0 - it is lit. In order to set the mask of the letter “H”, see the picture:



We begin to bypass the letter from G to A, since here the order of the bits is reversed: G is shaded, it means 1; F is shaded, it means 1; E is shaded, it means 1; D is not painted over, it means 0 and so on. The result is: 1110110b. We remember that the signals are inverted, so you need to invert the mask itself: not 1110110b = 0001001b. Or 9h. Sending this number to port 1 we will set a mask for the letter. Harder to choose a character. Here is applied dynamic display. In short, the essence comes down to the fact that we constantly have to set a mask, light the first character, set a mask, light the second character, and so on. For the resolution of the luminescence of the symbol, the second port is responsible, which is extended to 4-four four-bit ports with the help of the m5l8243p microcircuit. To access these ports, use the MOVD command, while the ports themselves are numbered P4, P5, P6, P7. P4 according to the authors is responsible for scanning the keyboard, but P5 just sets one of four characters to display.

image

At first I tried to make a dynamic indication in the main program loop, but then I used a timer for this. And in the main cycle of the program, the indicator buffer changes, displaying at intervals of 1 second the inscriptions “HELO” and “2014”

Source Code
 ;DATA .equ disp_buf, 030h ; 4 bytes buffer ;;; reset vector .org 0 dis i ; disable interrupts jmp main ;;; external interrupt vector--trap .org 3 jmp $ ; nop ;;; timer interrupt vector .org 7 sel rb1 mov a,#0d5h mov t,a mov a,#00FH orld p5,a mov a,disp_buf-1 add a,r5 mov r0,a mov a,@r0 outl p1,a mov a,r4 movd p5,a rl a mov r4,a djnz r5,exit_tmr mov r4,#0feh mov r5,4 exit_tmr: sel rb0 mov a,#0d8h mov t,a ; strt t retr ;MAIN main: ;initialize dis tcnti ; turn off counter mov r1,#0 mov r5,#0 call copy_buf sel rb1 ; timer variables mov r4,#0feh ; 1110h - CT position mov r5,4 ; R5 = buf offset sel rb0 mov a,#0e5h mov t,a strt t en tcnti mov a,#0ffh movd p6,a main_loop: call onesec mov a,r5 xrl a,#4 mov r5,a mov r1,a call copy_buf jmp main_loop msg_table: .db #0c0h ;O .db #0c7h ;L .db #086h ;E .db #089h ;H .db #099h ;4 .db #0f9h ;1 .db #0c0h ;0 .db #0a4h ;2 ;;;;;;;; delay100: mov r6,#84 loopex: mov r2,#236 loopin: djnz r2,loopin djnz r6,loopex mov r6,#4 loopad: djnz r6,loopad ret ;;;;;;;; onesec: mov r3,#10 loop_d: call delay100 djnz r3,loop_d ret ;;;;;;;; ;copy from msg_table to display buffer 4 bytes ; R1 = msg_table offset ;;;;;;;; copy_buf: mov r0,disp_buf mov r2,4 copy_lp: mov a,r1 add a,#msg_table movp a,@a mov @r0,a inc r0 inc r1 djnz r2,copy_lp ret 




A short video demonstration of the device:



An inquisitive habrauser probably noticed a bug at the end of the video when, instead of HELO, not exactly what was needed was highlighted. I noticed him too, yes. And all because when the main program is sending the display buffer, I forgot to stop the timer. Before call copy_buf you need to do DIS TCNTI and after EN TCNTI. So that!



Now it only remains to play on the device "a Christmas tree was born in the forest" and I will consider the mission successfully completed. All good!



Literary:


1) MCS-48 AND UPI-41 ASSEMBLER LANGUAGE MANUAL 1976

2) Volume 2 of the Shakhnov Reference Book (Microprocessors and integrated circuit microprocessor sets)

3) Stashin V.V. and others. - Designing digital devices on single-chip microcontrollers

4) Signs Synthesizing Indicators: A Handbook / Ed. V.P. Balashov

5) Bystrov Yu.A. One hundred charts with indicators

Source: https://habr.com/ru/post/214355/



All Articles