* * HARDWARE OVERVIEW * *



NOTE: Before use this board it is highly recommended to read the Z8671 Basic/Debug Software Manual to understand how this MCU works together with the provided BASIC/DEBUG environment.


The specs of the RC-Z8BASIC are:

128KB SRAM with battery backup, RS-232 port, serial-USB adapter port, GPIO port, LCD (1602 or 2004) port, User led and key, on-board power supply, ROM emulation mode to enable the "Auto execution at power-up/reset" feature, can be powered from USB or on-board power supply.

Because this board use only a SRAM with a backup battery for data retention, you don't need any legacy EPROM programmer.



It is possible select a ROM emulation mode to use half the SRAM address space as ROM. When the ROM emulation is active it is possible use the "auto execution at power-up/reset" feature of the ROM Basic inside this MCU.

Two different ROM emulation mode are possible. The selection is done with the J7 jumper.

The first time you power on this board (or after changing the SRAM backup battery) you need to do the "INIT PROCEDURE" to set the wanted baud rate (that is stored inside the SRAM).

The RC-Z8BASIC has a RS232 serial port, but there is also a "transparent" serial-USB connector to use a common serial-USB adapter.

It is possible plug a common LCD module (1602 or 2004) into the LCD (J4) connector, but you have to write the low level driver yourself (but I've already written a demo Basic driver for it...). Note that the LCD connector shares some  GPIO of the GPIO (J6) port.

There is also an USER led and a USER key (sharing two GPIO with the J6 GPIO connector too).

You can power the board from the on-board power supply or from USB using a common serial-USB adapter. The selection is made with a jumper (J5). The HW can manage the mixed powering situations when you power the board with the on-board PS (Power Supply) and are using the serial-USB adapter for the serial data link (USB adapter not powered from the host USB while the board is powered, and vice-versa) so you don't need to have care of this detail.


* * SRAM * *

I've used a TC551001 just because is cheap on Ebay. You can use any speed variant (70/85/100ns) or any equivalent 128KB SRAM chip. In the photos I've used another SRAM chip with a speed grade of 120ns without any problem.


* * J5 AND J7 JUMPERS SETTING * *

J5 (PWR SEL) jumper is used to select how to power the board.
To power from an external 9V power supply (using J1 "DC IN" connector) set a jumper using pin 1 and 2.
To power from USB (using J3 "SER-USB" connector) with a serial-USB adapter (like the one in the photo) place a jumper using pin 2 and 3.

J7 (ROM MAP) jumper is used to select the address space used for ROM emulation when SW3 (ROM EMU) is in the ON position.

The default setting for J7 is pin 1 and 2 "jumped". This corresponds to divide the Z8 64K bytes address space used for programs and data in two half. The low half is ROM (from 0x0800 to 0x7FFF) and the high half (from 0x8000 to 0xFFFF) is RAM.

When pin 2 and pin 3 are "jumped" all the Z8 64K bytes address space used for programs and data is configured as ROM if it is enabled the DM signal (see the manual). This mode is only to make "experiments".

Please note that the total 128K bytes address space is managed by the DM signal (pin 29 of the Z8 BASIC/DEBUG MCU) that selects one of the two 64K bytes pages available, while the "normal" Z8 address space used for the program and data is 64K bytes large. The "second" Z8 64K bytes page can be used when it is enabled the DM function (see the manual) and can be accessed using a couple of assembler instructions.



* * INIT PROCEDURE * *

First time you power on the RC-Z8BASIC you need to do the following "Init Procedure". You need to do this procedure also when you change the SRAM backup battery (CR2032) or every time you power on if there isn't any SRAM backup battery installed.

Because after a reset the Z8 BASIC/DEBUG MCU reads the baud rate at the memory location 0xFFFD (see the manual), you need to write permanently the wanted value in that memory location. But there is only a SRAM here and the content is unknown when powered first time, so the trick is disable the SRAM at first forcing a value using the pull-up resistors that corresponds to the 300 baud rate. After that re-enable the SRAM and write the wanted value and reset again to activate it. This value will be stored permanently using the backup battery.

The procedure is the following:

1. Put SW4 (INIT) in the ON position and SW3 (ROM EMU) in the OFF position;

2. Set the J5 jumper (PWR SEL) accordingly to the wanted power source;

3. Connect a terminal emulator @ 300 baud 8N1  using the RS-232 connector (J2) or a serial-USB adapter connected to the SER USB port (J3);

4. Power on the  RC-Z8BASIC (or press the RES key if already powered);

5. At this point you should see a sort of error message (ignore it) and the prompt (:) :




6. Put SW4 (INIT) in the OFF position;

7. At the prompt (:) give the following command to set the serial at 19200 baud after the next reset, writing the corresponding value:
@%FFFD = 1


All done!

Set the terminal emulator at 19200 and reset the RC-Z8BASIC pressing the RES key. After the reset the MCU will read the value corresponding to the 19200 baud rate at location 0xFFFD.


* * SW3 (ROM EMU) SWITCH * *

SW3 (ROM EMU) is used to turn on and off the ROM emulation.

When SW3 is in the OFF position all the 128KB address space sees a RAM, so it is possible to write and read on it.

When SW3 is in the ON position the 128KB address space is divided into two parts accordingly with the J7 jumper. In the address space "assigned" to ROM emulation it is only possible to do a read operation (write operations are disabled).


* * BASIC DEMO EXAMPLES * *

In the Files section there is a zip file (Examples.zip) with a couple of Basic demo programs to see the RC-Z8BASIC in action.

To send the files to the RC-Z8BASIC it is needed a terminal emulator program like Tera Term. Remember to set the speed to 19200, a transmit delay between characters of 1ms and a delay of about 90ms at new line (see the following screenshot):

The UserLedKey.txt is a demo using the User led and key.

The LCD.txt demo program requires a 1602 or 2004 LCD module fitted in the J4 (LCD) connector. To adjust the LCD module contrast you must use the RV1 trimmer. There is also a test point (TP1): with the LCD module inserted you must set the RV1 trimmer to read about 1.1V with a DVM, then you can do a fine tuning while the LCD.txt demo is running.


* * AUTO EXECUTION AT POWER-UP/RESET * *

On power-on/reset, Z8 Basic/Debug sizes RAM memory and checks
for an auto start-up program (see the manual).

Automatic start-up allows a program stored in ROM to be executed on reset without operator intervention. Automatic execution occurs on power-up/reset when the program:

When Z8 sizes the RAM it stores the first available location to store a program in the R8-R9 registers pair.

So when the SW3 switch (ROM EMU) is in the OFF position (all RAM) it stores 0x0800 inside R8-R9, while if SW3 is in the ON position and J7 (ROM MAP) "jumps" pin 2 and 1, it stores 0x8000 inside R8-R9.

So an easy way to store a program starting from 0x1020 is to set SW3 in the OFF position and tweak the R8-R9 registers pair writing  the wanted starting address.

At this point it is possible load the program using a terminal emulator, and then set SW3 to the ON position enabling the ROM emulation, so at the next reset/power-up the program will be automatically executed.


So the procedure to load a program and execute it automatically at power-up/reset is:


1. Check that J7 is in the default setting (pin 1 and 2 jumped) and SW3 is OFF, then press the RES key (just to be sure);


2. Using a terminal emulator give the commands @8=%10 and @9=%20 (optionally re-read both registers with the PRINT command that will show them in 10 base:)




3. Give the command NEW to erase a previous program starting at 0x1020:


4. Load the wanted program using a terminal emulator (using the send file command or as it is called on your emulator);


5. Give the LIST command just for a "visual check";


6. Set SW3 to ON and press the RES key. Your program should start ! (the same when powering on the board).


All done!


* * WHERE TO GET A PCB * *

I've prepared an "easy" link to get a small lot (5 pcs minimum) of PCB. The link is this one.