MicroBee write-protected memory
ETI Australia, March 1984, page 56
So you've written your 32K 'Adventure' program and you're impressing all your friends with the graphics and the witty text - but they're not impressed at how long it takes to load the goldang program from tape! Then again, loading those short, useful utilities from tape takes a frustrating few minutes when you're hot to get on with the job. This project fixes that -- transfer those tape programs to EPROM and load them with the ROM Reader.
Paul Leonardi
THIS PROJECT enables your favourite games or utilities to be loaded into your Microbee very quickly and cheaply. At the moment, if you want to change prograins in the Microbee, you must either wait agonising minutes for an 8K program to load from cassette, or if you want it faster, a disk drive and associated software is needed (rather expensive for most of us). The ETI-673 MultiPROM board described in the November 1982 issue is another approach but is limited to a number of programs and the program must be written for a certain area of memory.
The ROM Reader was designed to enable you to read a program previously written for tape storage and then transferred to EPROM. The project plugs into the 15-pin D-socket on the Microbee's rear apron and requires no external power. The program you wish to read into memory must have previously been put into a 2716, 2732 or a 2764 EPROM. If the ET1-668 Microbee EPROM blower is available, you can quite easily do this by reading the program from tape and copying to EPROM with a few small modifications to the code. This way, a library of EPROMs can be kept, similarly to your library of tapes.
A machine code support program is necessary to read the information into memory quickly. A USR (XXXX) call from BASIC is all that is necessary to read in and execute the program as the first seven locations of the EPROM contain the type and load address information.
The design is very simple, as you can see from the circuit diagram. However, I've pulled a few tricks. The Microbee's parallel I/O port has only eight signal lines. To read eight data lines from the EPROM, select cach address location in turn and do whatever else is necessary, I have arranged the Microbee I/O lines to be a 4-in/4-out set, multiplexing the eight EPROM data lines onto the four Microbee input lines set up. Naturally, some driving software is needed.
The program which enables the EPROM to be read can be ORGed to reside in RAM and thus needs to be loaded from cassette to occasionally or reside in the NETWORK EPROM socket.
The software initially sets up the PIO for 4-in and 4-out lines. It then resets the address generator, sets A12 low and selects the least significant nibble (half a byte, four bits). The first location in the EPROM describes the EPROM type: 4 for a 2732 (4K), 8 for a 2764 (8K). If the data is zero then a 2716 is assumed. All is connected to Vpp and this must be high to read a 2716, so the address generator is clocked 2048 times to set A11 high. If a 2 is the first data in the EPROM then the next step is carried out, else an error message is displayed.
The 4040 is clocked to address the EPROM's next location, the data read by setting and resetting the MUX select linc (pin 1) — this byte is the most significant byte of the address to where the program is to be loaded. The next location contains the least significant byte of the load address. The following two locations specify the number of bytes to be transferred and the next two contain the program start address, The actual program resides after the initial seven bytes.
Assembling the project is quite easy. First, pins 6, 7 and 9 of the DB10P need to be cut off and discarded so that the socket can be mounted to the pc board. The way tracks had to run on the board made this necessary. Carefully check the PCB to see that all holes are correctly drilled and that there are no breaks in the tracks or hairline 'bridges', particularly where tracks or pads are closely spaced. See that you can screw the DB15 plug to the board without straining the pins. Don't mount it just yet, though.
The six links need to be inserted and soldered in place first. Don't forget the one beneath the EPROM socket. While two IC Sockets were used on the prototype shown in the photograph, they aren't essential. If you're using them, put them on next, otherwise, mount the EPROM socket. You have three alternatives here: the expensive way, the less expensive way and the cheap way. The expensive way is to buy a 28-pin zero insertion force socket. It's elegant, handy to use and saves your valuable EPROMs from harm. But they cost $15-$20. The less expensive way is to use a low insertion force socket. They're easy to use, the EPROM) slip in and out comfortably, reducing the risk of damaged pins, and they cost under $10. The cheap way is just to use an ordinary IC socket and take care. Use a good quality IC socket if you must go for the cheap option.
Fit the DB15 plug next, bolt it to the board before soldering the pins to avoid putting strain on the soldered joints.
Assemble the ICs to the board last of all, taking care with their orientation. The 4040 is a CMOS type, so only handle it by the ends of the package, using your thumb and forefinger, and avoid touching the pins. Better still, use a static-safe IC insertion tool. If you're soldering it in, solder pins 8 and 16 first - in that order. Use a soldering iron with a grounded tip.
Plug the unit into the Port A socket of the Microbee. Insert a pre-programmed EPROM. If the driver software resides in the NETWORK socket, a simple MEM command from the BASIC command level will read in and execute the program, else a USR (XXXX) to where you have assembled the program will be needed. Swift and happy ROM reading to you!
Resistors..............nil! Capacitors.............nil! Semiconductors 1C1....................74LS257 1C2....................4040B Miscellaneous ET1-678 pc board; 28-pin ZIF socket or 28-pin low insertion pressure socket; DA15P right-angle pc mount 15-pin plug; tinned copper wire for links Price estimate: $23-$30
To enable only eight I/O lines to read eight data lines from the EPROM$, resent the address generator, clock the address generator and select A12 on 2764's, the port I/O A lines are arranged to be four in and four out.
The eight data lines are multiplexed by IC1, a 74LS257, on the four input lines to the Microbee (D0-03) and one output line (D4) is used to select the higher or lower nibble (4 bits) when reading.
Two output lines reset and clock the 12-bit ripple counter IC2, a 5050, used as an address generator. The last output is used to address A12 as the address generator only goes to A11.
The driver software which enables the data to be read into the Microboe is described in the software section. Power is derived from the Microbee, via pin 1 of the DB15 connector.
2, 4 OR 8 2 FOR A 2716, 4 FOR A 2732, 8 FOR A 2764 AABB = HEX LOAD ADDRESS CCDD = NO. OF BYTES IN PROGRAM EEFF = AUTO START ADDRESS = 8021 FOR RETURN TO BASIC PROGRAM CODE
;*************************************** ; EPROM READING PROG. ; BY P.J. LEONARDI ; **************************************** BSEL EQU 010H ; MUX SELECT BIT BRESET EQU 020H ; 4040 RESET BIT BCLOCK EQU 040H ; 4040 CLOCK BIT BAD12 EQU 080H ; ADD. A12 BIT ; **************************************** ORG 0E000H ; E000 FOR NETWORK SPACE ; **************************************** ; MAIN PROGRAM STARTS HERE ; **************************************** MEM: JP START ; TO PREVENT Option not fitted ERROR START: CALL INIT ; INITIALIZE PIO AND 4040 CALL TYPE ; DETERMINE EPROM TYPE CALL INFO ; GET DESTINATION, LENGTH, START ADDR. PUSH DE ; SAVE START ADDR, ON STACK DE, 4096-7 LD DE,4096-7 ; FIRST 7 LOCATIONS DATA CALL TRANS ; TRANSFER CONTENTS TO MEMORY HL POP HL ; GET START ADDR, FROM STACK JP (HL) ; JUMP TO START ADDR. ;***************************** ; INITIALIZE ;*************************** INIT: LD A,0FFH OUT (1),A ; SELECT PIO MODE 3 LD A,0FH OUT (1),A ; SELECT MS NIBBLE AS OUTPUT ; AND LS NIBBLE AS INPUT LD A,BRESET OUT (0),A ; RESET THE 4040 COUNTER XOR A ; CLEAR A OUT (0),A ; CLEAR THE RESET LINE RET ; INITIALIZE COMPLETE ;************************************** ; EPROM TYPE DETERMINATION ;************************************** TYPE: CALL GET1 ; GET DATA FROM EPROM (1 BYTE) CP 0 ; IS DATA=0 CALL Z,A2716 ; YES, ASSUME A 2716 EPROM CP 2 ; IS DATA=2 RET Z ; EPROM=2716 I.E. VALID CP 4 ; IS DATA=4 RET Z ; EPROM=2732 CP 8 ; IS DATA=8 RET Z ; EPROM-2764 LD HL,0B774H ; ADDRESS OF "SYNTAX" MESS. CALL 0A256H ; PRINT ERROR MESSAGE AND GOTO BASIC
;*************************************** ; PROGRAM INFORMATION ;*************************************** INFO: CALL GET1 ; GET EPROM DATA AND CLOCK 4040 LD H,A CALL GET1 LD L,A ; HL=LOAD ADDRESS OF PROGRAMME CALL GET1 LD B,A CALL GET1 LD C,A ; BC=LENGTH OF PROGRAMME CALL GET1 LD D,A CALL GET1 LD E,A ; DE=PROGRAMME START ADRESS RET ; INFORMATION COMPLETE ;*************************************** ; TRANSFER DATA TO MEMORY ;*************************************** TRANS: CALL GET1 ; GET DATA FROM EPROM AND CLOCK 4040 LD (HL),A ; PUT DATA INTO LOAD ADDRESS POINTER DEC BC ; DECREMENT LENGTH TO GO COUNTER DEC DE ; DECREMENT A12 OFF COUNTER INC HL ; INCREMENT LOAD ADDRESS POINTER LD A,D OR E ; IS DE=0000 JR Z,MA12 ; YES SET A12 HIGH CONT: LD A,B ; IS BC=0000 I.E. PROGRAMME TRX COMPLETE JR NZ,TRANS ; NO SO DO IT AGAIN SAM RET ; PROGRAMME TRANSFER COMPLETE MA12: LD A,BAD12 ; A12 BIT OUT (0),A ; SET A12 HIGH ON EPROM JR CONT ; CONTINUE WITH TRANSFER ;************************************ ; GET 1 BYTE OF DATA FROM EPROM ; AND CLOCK THE ADDRESS GENERATOR ;*************************************** GET1: PUSH BC ; SAVE BC ON STACK IN A,(0) ; LOOK FOR A12 STATUS AND BAD12 ; RETAIN A12, LOSE MUX SELECT AND CLOCk OUT (0),A ; SELECT LS NIBBLE IN A,(0) ; READ IT AND 0FH ; MASK OUTPUTS LD B,A ; SAVE IN BREG IN A,(0) ; RETAIN A12 OR BSEL ; GET SELECT HIGH OUT (0),A ; SELECT MS NIBBLE IN A,(0) ; READ IT SLA A SLA A SLA A SLA A ; PUT MS NIBBLE IN MS NIBBLE OF A ADD A,B ; ADD MS NIBBLE TO LS NIBBLE LD B,A ; SAVE DATA IN BREG IN A,(0) ; RETAIN A12 OR BCLOCK ; SET CLOCK BIT HIGH OUT (0), A ; CLOCK THE ADDRESS GENERATOR AND BAD12 ; RETAIN A12, CLEAR OTHER OUTPUTS OUT (0), A ; RESET CLOCK BIT LD A,B ; A REG = DATA NEEDED POP BC ; GET BC REG BACK RET ; DATA IN A REG AND 4040 CLOCKED ;********************************** ; 2716 EPROM SPECIAL TREATMENT ;********************************** A2716: LD BC,07FFH ; 2047 CYCLES A21: CALL GET1 ; CLOCK 4040 DEC BC ; DECREMENT COUNTER LD A,B ; OR C ; IS BC=0? JR NZ,A21 ; NO DO IT AGAIN CALL GET1 RET ; A11 OF 4040 IS NOW HIGH ; TO ENABLE EPROM COMPATABILITY ; A11 ON 2716-VPP AND MUST ; BE HIGH TO READ IT END
Thinking of upgrading your ’Bee to colour? Here, Mike Hennessy reviews what he went through with the colour conversion of his Bee and explains the software additions, their use, advantages and disadvantages.
Mike Hennessy
COLOUR CONVERSION of the Microbee gives you the new colour BASIC, version 5.22e, Wordbee and terminal communications. The conversion will he performed by Applied Technology. Microbee owners may he asking themselves if the change is worth it. Well, this is one answer.
I will assume that the main interest is in the the selected colour is used as colour enhancement of the 'Bee; Wordbee and terminal communications deserve separate articles by themselves.
Physically, the conversion consists of fitting the new RGB colour module to the underside of the main hoard. The colour signals are brought out in a 15-pin socket, fixed to the new module and positioned beneath the serial port. A slot is cut into the case to accommodate the new socket. The connections between the main board and the RGB module are extensive, some changes are made to the main board, and in some cases the core board is also replaced.
To sum up, Applied Technology insist on doing the work, this is not a case of simply plugging in extra ICs.
How long does it take Applied Technology to do the work? Well, with the unit under review it was handed in at their Gosford plant about 11.00 a.m. on one day and I picked up at 9.00 a.m. at their showroom at Waitara on the next! That is what is called service.
With Microbee Colour BASIC you have at your disposal three now commands; COLOURB, COLOUR, COLOURM. Let's have a look at what they do and how they're used.
COLOURB. This command. "COLOURB n” selects any one for eight background colours, where n = 0 to 7.
The background colours are as follows:
COLOUR DECIMAL CODE BLACK 0 RED 1 GREE 2 YELLOW 3 BLUE 4 MAGENTA 5 CYAN 6 WHITE 7
If you follow the command with a CLS the screen clears to the selected background colour. If CLS is not used and COLOURB is followed by a PRINT instruction, then the selected coulour is used as background for that print. It is therefore possible to develop in your displays, combinations of the eight background colours on the screen.
COLOUR. The command "COLOUR N" selects the foreground colour used for any PRINT, PLOT or the SET instruction. However when used with PLOT or SET one disadvantage is that the colour information is set for the character block used, you cannot set alternative pixels in the same block to different colours. This was a distinct disadvantage when using the HIRES graphics.
Although 32 foreground colours are specified as "describable", the first eight colours are the same as for the background colours, after that the colours are variations of combinations of background and foreground colours for a total of 255.
In addition, just to confuse you, when using the foreground colours, the codes for RED und BLUE and YELLOW and CYAN are reversed to that given for the background colours.
For those who argue about how to spell the word ... COLOUR or COLOR are accepted without error in Microworld Colour Basic; COLOR, of course', uses one less byte of memory.
The other graphics commands that can be used in conjunction with COLOUR are underline and INVERSE.
The use of UNDERLINE simply under-lines the print, to the VDU, in foreground colour.
INVERSE reverses the current foreground and background colours when used before a print instruction.
COLOURM. As an instruction, "COLOURM n" is designed to give you a half-amplitude colour signal with the colour being selected by using the same code as for the background colour.
COLOURM 4 immediately sets the background to a half-intensity BLUE. There is no need to implement CLS to obtain a background change, as you would do if using COLOURB.
As the normal RGB and half-amplitude RGB signals can be mixed, it is therefore possible to develop 64 background colours by combining COLOURB and COLOURM commands.
If you wish to use POKE instructions to change any of the colours, then this can be readily done by placing the required decimal code at these memory addresses:
POKE 156,1 foreground colour POKE 157,01 background colour POKE 158,11 half intensity background colour.
On the 15-pin socket from the RGB module you will find the RGB colour signals, the half-mode R/2, G/2, B/2 signals, positive and negative synchronising pulses, ground and a surprise +5 volts on pin 9 of the socket. The latter has been added by Applied Technology, as a modification to the RGB module. In my case the pin connections supplied for the module had this signal as ground, it was found by accident and could have been disastrous for the Bee if connected to ground as the pin diagram would have you believe.
Fortunately, this 1.5 V is required for the RGB interlace board that is not supplied with the conversion. The interface board does two things, firstly, a means of mixing the RGB and half intensity RGB signals, secondly, it is a buffer between the 'Bee' and your TV set and provides you with a means to preset the levels of the signals to the set.
The Microbee Engineering Notebook suggests in one possible alternative for the interface, an open-collector inverter on page 12. My solution was to use the 74LS04 inverter with a diode to isolate the outputs where they combine, as shown in the diagram. An oscilloscope will be required to set up the half-intensity RGB signals so that they are 50% of the RGB signals. The need to build this interface board is the worst aspect of the colour conversion. It should be supplied with the conversion and fitted inside the 'Bee, I think.
It should also be noted that the RGB-plus sync signal is not compatible with the normal TV. An RGB monitor is required, although most family colour TVs can be modified successfully.
Two short programs are listed to assist in testing and demonstrating the colour capability of the Microbee. The first displays a standard set of colour bars to assist in aligning the RGB monitor. The second is a kaleidoscope using all of the colour commands. Both arc self explanatory and useful as a demonstration of what the Bee can do.
Below. The RGB interface card plugs in below the serial port. This board is not supplied with the conversion, you build it yourself.
The new Microbee Colour BASIC is upwards compatible from earlier versions. Programs such as Chess, Invaders, Robot Man all run but without the enhancement of colour change from the default green foreground on black, unless of course you change these before the program is run. I would assume that the popular programs would be rewritten for colour and that users could obtain replacements, for a nominal fee, by returning the old tapes. (That'd be a good idea . . . Ed.).
The worst deficiency as a result of this conversion is that you are still stuck with 128 PCG characters. As a result, your high resolution capabilities are very restricted, you are unable to utilize the full screen display potential that is there. Personally, I feel that the loss of some program RAM space in order to increase the number of PCG characters would be well worth it in terms of utilizing the latent graphics potential.
Next, there are no graphics commands to fill circles or triangles, or any shape for that matter, with colour. The inability to address alternative individual pixels, within the same character block, for colour change will make the development of these routines very interesting.
The enhancement to the VDU presentation by using colour on the Microbee can only be described as spectacular. The conversion puts the Microbee in the same league as more expensive personal computers using high resolution colour graphics, in my opinion. The inclusion of Wordbee and the terminal communications in the conversion is an added bonus for users, and makes up for the lack of an RGB interface card for the TV.
Program number one for the Microbee .. Colour Bars. 00100 REM .. Microbee Colour Bars .. 00110 LORES : PCG 00120 FOR N = 0 TO 14 00130 FOR C = 0 TO 7 00140 COLOR C : PRINT "????????"; 00150 NEXT C 00160 NEXT N 00170 A1$ = KEY : IF A1$ = "" THEN 170 00180 HIRES : CURS 0 > Program number two for the Microbee .. Kaleidoscope. 00100 REM .. Kaleidoscope .. for Microbee OS 5.22e 00110 REM .. Mike Hennessy . . Jan '84. 00120 PCG : LORES 00130 FOR K= 1 TO 10 00140 B = INT (RND*7) : COLORB B : REM background color 00150 CLS 00160 FOR J= 1 TO 10 00170 FOR N=1 TO 100 00180 X=INT (RND*959) 00190 Y=INT (RND*63)+129 00200 C=INT (RND*31) : COLOR C : REM foreground color 00210 CURS X : PRINT CHR (Y) 00220 NEXT N 00230 M=INT (RND*7) : C0L0RM M : REM Half mode color 00240 NEXT J 00250 NEXT K 00260 GOTO 130 >
ETI Australia, March 1984, page 102
Paul Leonardi, Canley Vale NSW
After having inadvertently written over my source code or BASIC program with an untried program, I decided to put a copy of the program in a switch-selectable write-protected area of RAM, and then run the program.
So then if things went haywire and the source code was written over, the copy in the write-protected memory could be copied hack, corrected and tried again.
To protect a 6116 the WRX line must be disconnected (pin 21) and the PWRX line connected to it. Be careful when disconnecting one line that you don't disconnect other 0116s as the WXR line is often linked from one to the next.
In the Microbee the first and last 2K blocks (6116s) should not be protected; the first is used for a BASIC-EDASM scratch pad and the last for BASIC strings and variable storage (16K and 32K versions of the Microbee).
I suggest protecting the fifth, sixth and seventh RAM chips on the 16K version, and the ninth to the fifteenth on the 32K version. (2000-37FF for 16K, 4000-77FF for 32K).
Care must be exercised with a cold start if the protected memory is selected, as the top-of-memory pointer will be lower than expected.