MERTEC COMPACT COMPANION MANUAL



The Compact Companion is an interface unit which fits onto the Acorn BBC Master Compact Computer keyboard, in order to provide these additional facilities for the machine : user port, 2 MHz bus and analogue to digital conversion.

MENU OPTIONS
CLI COMMANDS
LOW LEVEL
EXAMPLE PROGRAM
FITTING INSTRUCTIONS

Complete Companion Collection



(1) MENU OPTIONS

The menu is obtained by typing *CMENU.

General Comments :

The eight menu options directly control the setting or resetting of bits in the configuration byte. The remaining two allow the user to exit the menu accepting, or ignoring, any changes that have been made.

HARDWARE :

This option will allow the user to almost completely disable the Companion system.

PRESENT : The Companion will operate normally.

ABSENT : The Companion will not sign on, initialize the hardware, or respond to any commands or help requests. It will, howerer, handle certain interrupts, which may occur. To cancel this command a [CTRL] [BREAK] will be needed. If this option is made the default, then a *FX 162,32 command must be issued before the [CTRL] [BREAK].

SOFTWARE :

This option will allow the user to disable most of the functions of the Companion system.

SELECT : The Companion will operate normally.

DE-SELECT : The Companion will not sign on, or initialize the hardware. It will however, respond to all * commands and help requests. To cancel this command a [CTRL] [BREAK] will be needed. If this option is made the default, then CMENU may be used to change it before the [CTRL] [BREAK].

N.B. After any [BREAK], or power-on, the hardware, and some crucial software hooks, will NOT be initialized if either the hardware or software disables are active. This means that a [BREAK], or [CTRL] [BREAK], must occur before the re-enabling can be completed.

N.B. This does not preclude using software de-selection and selection freely if the disables were not active during the last [BREAK] or power-on.

ANALOGUE :

This option will allow the user to disable the additional analogue to digital conversion facilities offered by the Companion.

INACTIVE : The analogue port is disabled, speeding up operation of the machine somewhat, and reducing software conflicts.

ACTIVE : The analogue port is active, converting the number of channels specified by *FX 16 in the usual way. If *FX 16,0 is issued, then the interrupt overhead is removed by the analogue port remains active, and could be re-enabled by issuing *FX 16,n (where n = 1, 2, 3, 4).

FIRE BUTTONS :

This option will allow the user to disable the fire button facilities provided by the Companion.

ACTIVE : The reading of the two fire buttons will take place every 1/100th of a second.

INACTIVE : The reading of the fire buttons is disabled, speeding up the operation of the machine, and reducing software conflict.

N.B. Care should be excercised when disabling the fire buttons as they are necessary for the function of some light-pens.

INTERRUPTS :

This option, in conjuction with the following one, will allow the user full control of the state of the user port interrupts.

MODIFY : The Companion will modify the interrupt state every [BREAK], or power-on. The modification that occurs will be controlled by the option detailed below (INT STATE).

IGNORE : The Companion will ignore the state of the interrupts, and will not modify it.

N.B. Care should be excercised when disabling the user port interrupts as they are necessary for the functioning of a Mouse connected to the user port.

INT STATE :

This option, in conjuction with the preceeding one, will allow the user full control of the state of the user port interrupts.

DISABLE : If the preceeding option is set to modify, the Companion will disable the interrupt at every [BREAK], or power-on.

ENABLE : If the preceeding option is set to modify, the Companion will enable the interrupt at every [BREAK], or power-on.

N.B. The BBC 'B' and Master machines will disable the user port interrupt by default. The Master Compact will enable them.

2 MHz BUS :

This option will allow the user to control the operation of the 2 MHz bus.

ACTIVE : Any accesses are not affected, and the 2 MHz bus remains dormant.

INACTIVE : 1 MHz bus accesses are not affected, and the 2 MHz bus remains dormant.

N.B. The 2MHz bus connector is pin compatible with the 1MHz bus connector available on both the standard BBC 'B' and Master computers, but it operates at twice the speed. Thus not all 1MHz peripherals will work, or work reliably.

MOUSE :

This option will allow the user to control the operation of a mouse connected to the user port.

INACTIVE : The Companion mouse control software is inactive, but the mouse may be used with external operating software e.g., AMX or PMFS.

ACTIVE : The Companion mouse software is inactive. The movements of the mouse are translated into cursor key codes, and the buttons generate the code [CR], "K", [ESC] respectively from left to right. These codes may be read by selecting the RS 423 serial port as the input port. This allows the user's program to differentiate between mouse and keyboard generated codes if necessary.

N.B. For any mouse connected to the user port to function, the user port interrupts must be enabled. This may be done by the external controlling software, or by using the Companion facilities.

ABORT :

This option allows the user to exit the menu system ignoring any changes that have been made.

EXIT :

This option allows the user to exit the menu system SAVING ANY CHANGES THAT HAVE BEEN MADE. The user will be prompted regarding whether the changes should be made the default or not and should answer accordingly. The default settings are the ones that the computer returns to after [CTRL] [BREAK] or a power up. To return to the initially defined defaults the command *FX 162,32 is issued, followed by a [CTRL] [BREAK].

N.B. In order to maximize the life of the default setting ROM in the Compact, the Companion will not re-set the machine even if the default request is made if none of the eight options has actually been changed.



(2) C.L.I Commands

The Companion software implements three CLI commands.

*CMENU
*CSETUP
*CSTATUS


In addition it will respond to *HELP requests. Informantion can be obtained in this way on the three CLI commands e.g.
*HELP CSETUP

This will give help on the CSETUP command.

All of these commands may be addreviated in the usual manner. The minimum acceptable abbreviation will depend on any other software in the machine i.e., the minimum abbreviation should be long enough to ensure that the correct command is executed. If command name conflicts do occur, then is should be noted that any of the above three commands may be preceeded by an additional "C", which may help to reduce the problem e.g., *CCMENU.

CMENU :

This command invokes a menu driven configuration program to allow the user to setup the current and default configuration of the Companion.

CSETUP :

This command allows the configuartion of the Companion to be changed. It is designed for the use within a program (where appropriate), or when the byte describing a desired setup is known. The byte may be entered in any of Binary, Decimal, or Hexadecimal number bases. To make the configuration the default the number should be followed by a "D".

N.B. The number to use is best discovered by setting up the desired configuration using the CMENU command and then using CSTATUS to show the value of the configuration byte.

CSTATUS :

This command allows the current configuration of the Companion to be displayed. Both the current and the default configurations are displayed in all three number bases.

N.B. The relationships between the configuration options and the bits of the configuration byte are as follows :

Bit 7 - HARDWARE
Bit 6 - SOFTWARE
Bit 5 - ANALOGUE
Bit 4 - FIRE BUTTONS
Bit 3 - INTERRUPTS
Nit 2 - INTERRUPT STATE
Bit 1 - 2 MHz BUS
Bit 0 - MOUSE



(3) LOW LEVEL

The Companion software does not make use af any user memory, other than when executing the CMENU command. This command makes use of non-screen ram in the area &7E00-&7E0F. This area should be safe, except for extremely large BASIC programs which would probably not have enough BASIC stack space to work correctly anyway.

The software does, however, make use of the extended vector associated with USER vector 3 (IND3V). This extended vector and the OSBYTE vector (BYTEV) are used to enable OSBYTE calls to be intercepted when the ADC is in use.

The OSBYTE calls that are intercepted are :

OSBYTE 16 To set maximum number of ADC channels
OSBYTE 17 To force an ADC conversion
OSBYTE 128 i.e. ADVAL(n) where n=1..4

The software also makes use of the ROM polling semaphore to enable ROM polling at centisecond intervals. Thus care should be taken if any additional ROMS use this facility e.g. PMFS, or if *FX22 or *FX23 is used in a user written program. The ROM polling is used to sample the fire buttons, and also to re-trigger the ADC if it is shut off by a *FX 16 command.

Interrupts are intercepted as "Unrecognized Interrupt" ROM service call 5, which occurs after indirecting via IRQ1V but before IRQ2V. Interrupts are used for signaling an ADC "End of conversion", and for handling the Mouse.



(4) EXAMPLE MOUSE PROGRAM

10 *FX 2,1
20 REPEAT
30 K%=GET
40 IF K%=13 THEN PROCleft_button
50 IF K%=ASC("K") THEN PROCmiddle_button
60 IF K%=27 THEN PROCright_button
70 IF K%=136 THEN PROCleft
80 IF k%=137 THEN PROCright
90 IF K%=138 THEN PROCdown
100 IF K%=139 THEN PROCup
110 UNTIL FALSE
...
...
1000 *FX 2,0
1010 END

Line 10 selects the serial port for input.
Line 30 reads the recieved character.
Lines 30..100 select various procedures, depending on the character recieved.
Line 1000 selects the keyboard for input.



FITTING

The only tools you will need for fitting is a medium size screwdriver. Ensure that the keyboard to be fitted with the Companion IS NOT CONNECTED TO THE COMPUTER POWERSUPPLY. Proceed as follows :

a) Turn the keyboard over and place it upside down on your knee. The printed circuit board (PCB) extension (the only which has the 25 straight silver lines on it) should now be on your right if you are right handed and to your left otherwise.

b) Offer the Companion up to the PCB extensions, as illustrated in the assembly diagram opposite. Be careful to align the gold contacts in the edge connector with the silver tracks in the PCB.

c) Hold keyboard with one hand and firmly press the connector and Companion onto the PCB extension with the other hand until the black mounting angle is firmly located onto the keyboard.

d) Now locate the two 6mm dia. screws provided, into the black angle fixing holes. Hold the white connecting cable away from the screws to prevent trapping it under the screw head and tightly fix the screws into position with a good screwdriver (not to small in order to get a good purchase on the screw).

e)Finaly insert the plug on to the end of the white cable into the port at the back of the keyboard marked JOYSTICK/MOUSE.

f) Re-connect the keyboard to the Compact base unit and the system is ready for use.

NOTE : If the computer does not power-up correctly re-check the alignment of the gold edge connector contacts with the PCB tracks and if they need to be re-aligned slightly loosen the fixing screws and press the Companion in the desired direction for alignment then re-tighten the screws.

REMEMBER - NEVER ASSEMBLE OR DISASSEMBLE THE COMPANION TO THE KEYBOARD WITH THE COMPUTER CONNECTED TO THE ELECTRICITY SUPPLY.


(C) 1987 MERTEC

MERTEC
33-36 Singleton Street
Swansea SA1 3QN
Tel 0792-467980
Fax 0792-467398

Original text from instruction leaflet, typed and converted to HTML format by zjost 2001.