Technical Manual
Technical Manual
Technical Manual
This is the technical manual for the CB2 microcomputer. It describes the more technical things related to
this computer. However, this manual describes the initial version built by Joerg Wolfram (called AVR
ChipBasic2). Since the firmware of the CB2 micro is identical to Joerg's computer, all of the things
mentioned here apply to the CB2 micro, but the CB2 micro hardware is different, so don't rely on the
information on this page on it. This manual should be used only as a reference by more skilled people
that want to learn more or experiment further with the CB2 micro.
Here is what Joerg writes:
2 Important Notice
Binary programs, libraries and drivers must use the current API and contain the new flag structure in the
header, otherwise the system may be affected so much that it may need to be re-flashed!
3 Story
It started with the idea of using a TV set to test and debug a formula parser, as it was possible to display
several values clearly and simultaneously.
At some point in August 2006, the idea then came to integrate a BASIC interpreter with TV output into the
chip. To keep it simple I limited myself to a TINY-BASIC dialect. And so, one thing came after the other,
color output, a menu, an integrated editor and other functions. Initially, only one program in the EEPROM
memory of the ATMega16 could be accommodated, the Mega32 was already used the flash.
According to the versions for the ATMega16 and ATMega32 microcontrollers, the version for the
ATMega644 represents the logical further development with the same hardware base. Even this program
is still subject to change with later versions, with one or more features added or removed. Where
possible, the compatibility with existing programs will be maintained.
4 Features
As an input device an ordinary PS2 computer keyboard is used, as an output device, a TV with Scart
input (color) or composite video BAS input (grayscale) or various PAL/NTSC-compatible TFT displays
with RGB control.
4.1 Hardware
30x23 characters with a maximum of 16 foreground and background colors and pseudographics
in standard mode
PAL/NTSC and Sync signals adjustable via jumper
8 video modes, 4 of which are full graphics, 2 custom characters and a user mode
1-channel audio output (notes in 2 tones, noise) with envelope and volume adjustment
I2C connector for optional data EEPROM, up to 8 LM75 temperature sensors or other I2C
devices
4.2 BASIC
Tiny-Basic programming language with extensions
Own error handling with ONERR, periodic subroutine call with ONSYNC ...
95 program lines with a maximum of 32 usable characters, fullscreen editor, 8 programs in the
internal flash
4.3 SYSTEM
Own file system on ATMEL Dataflash
Loader program for remote control via the serial interface
Chip8 programs can also run, as well as 8080 programs (experimental). For Chip8 programs, note that
you cannot download any Chip8 program from the internet and run it directly on the microcomputer, as it
has to be first converted into a special format for the micro to be able to run. Such a conversion program
is supplied inside the TOOLS folder, but the Chip8 programs available for download in this page, have
been already converted, so just load them to run them.
To run Chip8 programs, firstly the Chip8 emulator has to be loaded into position P2 on the microcomputer
screen and the library XMEM IRAM2 must be loaded into position P8. Run the Chip8 emulator and while
the emulator is running, press F3 to load any Chip8 program from the DFLASH into it. The Chip8
emulator can only load programs from the DFLASH, so if you do not have a DFLASH installed, you
cannot use this option.
6 Changelog
26.3.2017 Version 1.51
Bugfix: CTEXT often copied too many characters into the array
New command: TLEN, determines the length of texts
Bugfix: The starting point at PIE has been set to the top left of the origin
Bugfix: The test program for the tilemode was faulty (wrong library calls)
Extended API
Bugfix: When the EEPROM is deleted, a default configuration will be written at the first start
XOR operator ^
For the PWM drivers, BUSY and STROBE can be used as I/O
Monitor from all video modes out, but with limited functionality
extended ADC setting over the parameter range 0x100 ... 0x1ff
Extended API
Bugfix: Baud rates for second serial interface were too low by a factor of 2
Bugfix: In some cases the channel number was output instead of variable value during output
redirection
Bugfix: SPI() and Clone did not work properly because of problems with include file
Bugfix: Documentation contained some wrong pictures
Cursor positions are saved in the EEPROM when leaving the editor
Only one keyboard layout table, but changeable
Support of the second serial interface of the ATMega644P (EBAUD, ESPUT, ESGET)
Bugfix: In some cases the wrong line was displayed for errors
GOSUB with two parameters becomes CALL, because of flexible parameter lists
GOSUB and CALL can have up to 5 parameters
Added two more API functions for copying characters into the user character set
API functions for using BASIC routines
Programs can also be stored untoken (program name starts with underscore)
PLAY now has fourth parameters to control the number of sequencer cycles
2 bug fixes in the area, which can not be updated by the bootlaoder
Revised documentation
REPEAT-UNTIL grinding
EMIT and YEMIT have been discontinued (can be realized via PRINT)
Revised documentation
New video modem (128x64 monochrome) compatible with the AVR handheld computer
For 16-bit write accesses to the array, 2x the LOW byte was written
Intro Screen
Revised documentation
A few bugfixes
Clear and Copy for programs
SIN() and COS() now only work with whole degrees as arguments
A few bugfixes
New sprite routines
AVR-ChipBasic2: Hardware
1 Minimal hardware
connection signal
1 Video blue
2 Video red
3 Video green
4 VSYNC
5 HSYNC / CSYNC
6 + 5V
7 Audio
8 Video BAS
9 Clock Sync
casing GND (0V)
2 Video adapters for the universal connection
The 8-bit register (eg HCT374) will be wired to work as an 8 bit shift register with tristate output.
As long as CS=HIGH, CS0...CS7 are high-impedance and are pulled to HIGH via the pull-ups.
SPI data output during CS=HIGH will end up in the "shift register" U1.
If now CS goes LOW, the outputs of the register serve as CS0 to CS7 and select the desired
device
The output CS0 is reserved for the data flash, the output CS1 for the clone program. The remaining 6
outputs can be used for own purposes. For the selection there is the command SPISEL and the
corresponding API functions.
AVR-ChipBasic2: Internals
This mode is a text mode with a fixed character set of 256 characters. Each character can be
assigned separately foreground and background color. There are 23 lines of 30 characters, this is
simply because the project was partly developed with a 37 cm TV set with a fairly large margin.
The image memory contains one after the other:
The pixel resolution is 168x116 pixels, whereby for each 8x8 (at the bottom only 4x8) pixels
foreground and background color can be adjusted.
The pixel resolution is 120x76 pixels, each pixel can accept one of 4 colors that can be adjusted
via the palette.
The pixel resolution is 84x58 pixels, each pixel can have one of 16 colors that can be adjusted
via the palette.
The pixel bytes are organized from left to right as well as from top to bottom. Each byte is divided into 2 4-
bit nibbles pointing to one of the 16 palette entries. The pallet entry then determines the color.
1.6 video mode 4
This mode is a text mode with variable character set of 128 characters. Each character can be
assigned separately foreground and background color. When switching to video mode, the lower
128 characters are copied from the fixed character set to the variable character set. The image
memory contains one after the other:
The pixel resolution is 128x64 pixels, each pixel can assume one of 2 colors that can be set via
the palette. This mode is mainly used to emulate graphics LCD with the appropriate resolution.
The pixel bytes are organized from left to right as well as from top to bottom. Within the byte, bit 0
corresponds to the left-most pixel. For each pixel, there is just one bit pointing to one of the first two
palette entries. The pallet entry then determines the color.
1.8 video mode 6
This mode is a variable character text mode of 64 characters. Each pixel in each character can be
assigned one of the 8 colors. When switching to video mode, the lower characters are copied
from the fixed character set to the variable character set. The image memory contains one after
the other:
In the character set, the 30 bytes of each character lie directly behind each other. Each pixel is
represented by three bits, within the byte bits 1 ... 3 correspond to the right and bits 5 ... 7 to the left pixel.
Three bytes result in a character line of 6 pixels, one character consists of 10 of these character lines.
1.9 Video Mode 7
Video mode 7 has been removed in the current version. Instead, a separate driver can be installed on
program slot 8. For video drivers, the ID range 0xc0 to 0xdf is reserved in the HIGH byte. If no such ID
exists, a VMODE 7 only causes a constant error. For binary programs, however, care must be taken to
ensure that a suitable driver is installed.
.include "M644Pdef.inc"
.include "api.inc"
.org 0x4000
start: .db "TestprogrammN",0xec,0xff,0xff
.db "+--+"
.db "ABCD"
.db "+--+"
.org 0x4010
lese: call api_getvram ;setzt Y auf den Anfang des Bildspeichers
ldi XL,LOW(daten-start) ;Bestimmung des Offsets
ldi XH,HIGH(daten-start)
call api_dataptr ;setzt Z auf die Adresse von "daten:"
call api_orom ;ROM-Text ab (Z) ausgeben
ret
daten: .db "Mein Text",0
At the beginning there must be 12 bytes of program name and an "N" (0x4E) followed by 3 bytes for
different flags and library / driver number. This is followed by 12 bytes for the program icon. The actual
program starts with an offset of 32 bytes (16 words). Instead of calling the API functions via CALL or JMP
, it is more convenient to use the macros. However, they do not work correctly with all assemblers (only
tested with AVRA):
.include "M644Pdef.inc"
.include "api_macros.inc"
.org 0x4000
start: .db "TestprogrammN",0xec,0xff,0xff
.db "+--+"
.db "ABCD"
.db "+--+"
.org 0x4010
lese: api_getvram ;setzt Y auf den Anfang des Bildspeichers
ldi XL,LOW(daten-start) ;Bestimmung des Offsets
ldi XH,HIGH(daten-start)
api_dataptr ;setzt Z auf die Adresse von "daten:"
api_orom ;ROM-Text ab (Z) ausgeben
ret
daten: .db "Mein Text",0
But the code generated with the assembler is ultimately the same.
The ICON foreground color can theoretically use any of the 16 values, but for clarity and consistency
within the system, the following mapping should be maintained when developing new programs:
Byte 14 contains another 8 flags. These stand for various extensions. If a program or a library offers one
or more extensions, the corresponding bit is set to 0. At system startup and when a program is loaded or
unloaded, the flag bytes of all programs are read in and the program is stored in a table with the last
occurrence. This table can then be used to call the functions. If there is no corresponding extension in
memory, the corresponding byte = 0xff, otherwise it corresponds to the high address in words of the last
program with active flag. If, for example, there are video drivers on program locations 4 and 6, table entry
0 contains the value 0x66 for the start address of program position 6. The API function api_getprg sets
the Y register at the beginning of the table. If the content of the program memory (program 1-8) is
modified from a binary program, the function api_extdisable should be called first. This blocks the
external functions that are called cyclically (video output, sound, frame) to prevent program calls to invalid
routines from being executed. Then, the table must be refreshed with a call to api_extsearch .
The assignment of the bits is shown in the following table, the bit number corresponds to the offset at the
same time as the beginning of the table:
bit function
7 Not occupied
6 Program contains a font
Byte 15 contains the library number. For programs that do not provide a library function, this should be set
to 0xff. The BASIC command LFIND can then be used to determine whether the library you are looking
for is in memory.
0x22 0x44 2 Jump to Envelope Routine (at the end of the frame)
Number of transferred
12 BYTE
parameters
The parameter values are only valid if the T flag is cleared (numerical parameters), but the return value
can be used in both cases.
5. Creation of any file which, together with the binary file from the previous step, is exactly 3072
bytes long
To avoid having to do this manually each time, there is a small build script that does a lot of the work. It is
called with build-bin name , where name stands for the ASM file (without .asm).
After completion, there should be a file name.bin in the directory, which can then be transferred to the
AVR computer via XModem.
Function name Name of the API function, also corresponds to the macro call
Call without macro Calling the function when working without macros
In addition to the specified registers, registers R0 and R1 and error register R24 are partially overwritten
by the API functions.
3.2 Backing up and restoring registers
parameter ---
register R0, R1
function Description gets the registers X, Y and Z from the stack and executes a RET
parameter ---
register X, Y, Z
function Description saves the registers X, Y and Z as well as R20-R23 on the stack
parameter ---
register R0, R1
parameter ---
All calculation functions (except the square root) refer to signed 16-bit numbers. The X-register
forms a kind of "accumulator", as a second operand the register pair R16 / R17 is used. R24 is
either 0 (no error) after the operation or contains an error code. The error codes correspond to
those in the BASIC program.
offset parameter
0 Y0
2 Y1
4 X0
6 X
8th X1
The assignment table consists of 8 values. These are assigned to 8 possible functionalities. If at
least one program / driver / library offers the functionality, the HIGH address is the
corresponding memory cell. The address refers to 16-bit values, so the value can be used directly
in the ZH register for jumps and subprogram calls. If a functionality is not offered, the value 0 is
in the corresponding memory cell
The BASIC buffer area consists of two buffers a 40 bytes. The first area is the text buffer, which
contains eg the text entered at INPUT. It also serves as a source buffer for the api_token and
api_untoken routines.
The second area is the code buffer for the BASIC. On the one hand, the BASIC lines are
interpreted from this memory area, on the other hand it serves as a code buffer for the api_token
and api_untoken routines.
3.6 Keyboard
function name api_waitkey
Call without macro call api_waitkey
function Description waits for a keystroke (except SHIFT, CTRL, ALT)
parameter ---
return values R20 = Keycode of the pressed key
register ---
For the output functions, R25 determines the mode, the values are explained in more
detail in the PRINT command. Similarly, the channel set determines where to go.
3.9 communication
function name api_putpar
Call without macro call api_putpar
function Description Outputs a character via the parallel interface
parameter R20 = characters
return values ---
register ---
3.10 Audio
function name api_note
Call without macro call api_note
function Description Plays a note at the current volume
parameter XL = note value, according to the BASIC command note
return values ---
register ---
The functions for the internal EEPROM only work with the memory cells 0 ... 2047, if the
address (Y-register) is outside this range, the error register (R24) is set to 34. Since the memory
cells are used from 2040 for system settings, they should not be overwritten if possible.
Before each write, the EEPROM cell is read, if the setpoint and actual state already match, the
write process is aborted.
The I2C bus can only be used as master via the API functions.
This function is used to prepare the file selector box and set the necessary internal variables. If an
error occurs then the return address is removed from the stack and jumped back to the address of
the previous call after displaying an appropriate alert box. For this reason it makes sense, for
example, to load load and memory functions together with the file selector box calls in their own
subroutine. In the case of errors, this is then simply left and jumped back to the higher-level
program.
If the file selection is aborted by pressing the ESC key, the file type returned in R20 is 0xed.
function name api_fs_fsel_nb
Call without macro call api_fs_fsel_nb
calls the Fileselectorbox without screen backup (only in video
function Description
mode 0)
parameter the header is null terminated after the call
return values R23 = file number, R20 = file type
register ---
If the file selection is aborted by pressing the ESC key, the file type returned in R20 is 0xed.
3.15 Direct Access to the Dataflash
The token table always contains the token value first, followed by the token text, which is filled
with dots. Finally, an entry should only consist of points, which then intercepts invalid words.
The function can also be called several times in succession, as a separator the space and the
comma can be used.
In the following example, the length of an entry would be 6 bytes (1 byte token value and 5 bytes
of text):
tokentab:
.db 0x01,"LOAD."
.db 0x02,"ADD .."
.db 0x03,"SUB .."
.db 0x00,"....."
The following functions are used to use program routines of video mode 0 in their own drivers.
These functions can use both the internal array and external memory. If the corresponding array
cell can not be addressed, error 18 (OUT OF ARRAY) is returned in the error register.
AVR-ChipBasic2 - libraries
1.1 General
This library extends the BASIC computer with fixed-point calculations. Fixed-point means that the
positions before and after the comma are fixed. With this library, the number of digits can be set via the
initialization command. Internally, a representation is selected that combines 2 digits each (value range
0 ... 99) in one byte. Thus, before and after decimal places are adjustable only in 2-steps.
1 initialization
8 Addition V3 = V1 + V2
9 Subtracking V3 = V1 - V2
10 Multiplication V3 = V1 * V2
11 Division V3 = V1 / V2
16 Copy variable
17 Variable / 2
18 Variable * 2
19 Start script in the array memory
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
return value 0
parameter meaning
Parameter 3 ---
parameter meaning
Parameter 3 ---
return value 0
parameter meaning
Parameter 3 ---
return value 0
parameter meaning
Parameter 1 variable number
Parameter 2 ---
Parameter 3 ---
parameter meaning
return value 0
parameter meaning
Parameter 3 ---
return value 0
parameter meaning
Parameter 3 ---
return value 0
parameter meaning
return value 0
return value 0
parameter meaning
return value 0
parameter meaning
return value 0
parameter meaning
Parameter 3 ---
return value 0
The 8 constants have 15 valid decimal places and are defined as follows:
0 0
1 1
2 PI
3 e (Euler number)
4 ln (2)
5 ln (10)
6 SQRT (2)
7 SQRT (3)
parameter meaning
Parameter 3 ---
return value 0
parameter meaning
Parameter 3 ---
return value 0
1.2.16 Function 15: Comparison of two variables
Variable 1 is compared with variable 2. If variable 1 is greater than variable 2, then the return value is 1, if variable
1 is smaller than variable 2, the result is 2 and if both variables are equal, 0 is returned.
parameter meaning
Parameter 3 ---
parameter meaning
Parameter 3 ---
return value 0
parameter meaning
Parameter 1 Variable number of variable 1
Parameter 3 ---
return value 0
parameter meaning
Parameter 3 ---
return value 0
parameter meaning
For loops, etc., four 8-bit counter variables are available. Each command consists of 2 bytes, which are
still divided into nibbles. An x indicates that the value of the corresponding nibble is not evaluated.
Nevertheless, it makes sense to set these nibbles to 0. For loops, etc., there are four 8-bit counter
variables available. When starting a script, the first three are pre-assigned the LOW bytes of parameters 1
... 3, Countervariable 4 is set to 0. Due to the system, only parameters that have been specified have a
defined value. With a CALL 7,19,17 only parameter 1 is set to 17, parameters 2 and 3 are undefined.
code meaning
1 0 WV W=V
1 1 WV W = ABS (V)
1 2 WV W = -V
1 3 WV W = INT (V)
1 4 WV W = FRAC (V)
1 5 WV W=V*2
1 6 WV W=V/2
4 UWV W=U+V
5 UWV W=U-V
6 UWV W=U*V
7 UWV W=U/V
2.1 General
This library extends the BASIC computer with measuring routines for resistors, diodes, capacitors and
inductors in different measuring ranges. The following measuring ranges are achieved with the circuit
below:
4 PA.3 from LOW to HIGH, time measurement to U (PA.0)> Uref (resolution 300ns)
5 PA.3 from LOW to HIGH, time measurement to U (PA.0)> Uref (resolution 500ns)
6 PA.2 from LOW to HIGH, time measurement to U (PA.0)> Uref (resolution 300ns)
7 PA.2 from LOW to HIGH, time measurement to U (PA.0)> Uref (resolution 64us)
8 PA.1 from LOW to HIGH, time measurement to U (PA.0) <Uref (resolution 300ns)
9 PA.1 from LOW to HIGH, time measurement to U (PA.0) <Uref (resolution 500ns)
10 PA.2 from LOW to HIGH, time measurement to U (PA.0) <Uref (resolution 500ns)
11 PA.3 from LOW to HIGH, time measurement to U (PA.0) <Uref (resolution 300ns)
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
return value 0
The pins PA.0, PA.2 and PA.3 are switched as input without pullup, PA.1 as output with HIGH
level
Measure voltage at pin PA.1 with AVCC as reference 32 times and total the values
Measure voltage at pin PA.0 with AVCC as reference 32 times and total the values
The return value is the measured value of PA.0, the measured value of PA.1 is stored in the array cell 1024.
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
2.3.5 Function 4: PA.3 from LOW to HIGH, time measurement to U (PA.0)> Uref
(resolution 300ns)
Pin PA.0 is connected to the analog comparator, the reference voltage is the internal bandgap reference
source with approx. 1.1 volts. Pin PA.3 is switched from 0 to 1 and the time is measured until the voltage
at PA.0 is greater than the voltage of the reference voltage source. The time resolution is 300ns, the
maximum measuring range is 60 microseconds. 16 measurements are taken every 20ms and the values
are added up. The maximum value returned is thus 3200. The procedure is as follows:
The pins PA.0, PA.1 and PA.2 are switched as input without pullup, PA.3 as output with LOW
level
Set PA.3 to HIGH and set the time until the voltage at PA.0> Uref.
Stop the measurement after 60 microseconds and set PA.3 to LOW level
Repeat 15 times
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
return value 16 x measured value (in 300 nanosecond steps)
2.3.6 Function 5: PA.3 from LOW to HIGH, time measurement to U (PA.0)> Uref
(resolution 500ns)
This function corresponds to function 4, but with a different time resolution and a larger measuring range.
The time resolution is 500ns, the maximum measuring range is 6.4 milliseconds. 16 measurements are
taken every 20ms and the values are added up. Finally, the result is divided by 8. The maximum returned
value is therefore 25600. The process is as follows:
The pins PA.0, PA.1 and PA.2 are switched as input without pullup, PA.3 as output with LOW
level
Set PA.3 to HIGH and set the time until the voltage at PA.0> Uref.
After 6.4 milliseconds, stop the measurement and set PA.3 to LOW level
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
2.3.7 Function 6: PA.2 from LOW to HIGH, time measurement to U (PA.0)> Uref
(resolution 500ns)
This function corresponds to function 5, but the LOW-HIGH transition takes place at pin PA.2.
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
2.3.8 Function 7: PA.2 from LOW to HIGH, time measurement to U (PA.0)> Uref
(resolution 64us)
This function corresponds to function 5, the LOW-HIGH transition takes place at pin PA.2. The temporal
resolution is 64us (line frequency), the maximum measuring range is 262 milliseconds. Two
measurements are taken at intervals of 20 ms and the values are added up. The maximum returned value
is therefore 8192. The process is as follows:
The pins PA.0, PA.1 and PA.3 are switched as input without pullup, PA.2 as output with LOW
level
Set PA.2 to HIGH and set the time until the voltage at PA.0> Uref.
After 262 milliseconds, stop the measurement and set PA.3 to LOW level
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
The pins PA.0, PA.2 and PA.3 are switched as input without pullup, PA.1 as output with LOW
level
PA.1 switch to HIGH and wait 300ns
After 60 microseconds, stop the measurement and set PA.1 to LOW level
Repeat 15 times
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
2.3.10 Function 9: PA.1 from LOW to HIGH, time measurement to U (PA.0) <Uref
(resolution 500ns)
This function corresponds to function 4, but with a different time resolution and a larger measuring range.
The time resolution is 500ns, the maximum measuring range is 6.4 milliseconds. 16 measurements are
taken every 20ms and the values are added up. Finally, the result is divided by 8. The maximum returned
value is thus 25600. The procedure is the following:
The pins PA.0, PA.2 and PA.3 are switched as input without pullup, PA.1 as output with LOW
level
PA.1 switch to HIGH and wait 300ns
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
2.3.11 Function 10: PA.2 from LOW to HIGH, time measurement to U (PA.0) <Uref
(resolution 500ns)
This function corresponds to function 9, but the LOW-HIGH transition takes place at pin PA.2.
2.3.12 Function 11: PA.3 from LOW to HIGH, time measurement to U (PA.0) <Uref
(resolution 500ns)
This function corresponds to function 9, but the LOW-HIGH transition takes place at pin PA.3.
Type of
measuring range
measurement
The scaling factors are stored in lines 9 to 13. These were determined empirically with reference
components, but depend to a large extent on manufacturing tolerances in the components used (including
controllers). The following table gives an assignment over the scaling values to the measuring ranges, for
the calibration a component should be taken, which lies approximately in the middle of the measuring
range by value. The specified measuring ranges are to be regarded as approximate values only:
PROGRAM:Mess4
01 E=30:F=31:LFIND V,160
02 IF V=0 GOTO ~L+2
03 VM 7:COLOR 1,5:E=8:F=9
04 LFIND L,18:IF L>0 GOTO ~L+2
05 ? "Keine Messlib ";:END
06 GOSUB 89
07 ? "CB2 KOMPO-Meter":WAIT 20
08 'Korrektur-Faktoren
09 DATA 1026,3320,12000,2150
10 DATA 1029,5000
11 DATA 1030,740,96,7660,6
12 DATA 1034,2190,0,1043,0
13 DATA 1038,6710,8300
14 OUT $47E,15:'disable INPUT
15 GOSUB 25:GOSUB 80:'R
16 IF T=0 GOTO ~L-1
17 GOSUB 41:GOSUB 80:'D
18 IF T=0 GOTO ~L-1
19 GOSUB 48:GOSUB 80:'C
20 IF T=0 GOTO ~L-1
21 GOSUB 70:GOSUB 80:'L
22 IF T=0 GOTO ~L-1
23 GOTO ~L-8
24 'R Messung
25 CALL L,3
26 X=~R:N=AR(1024)-X:Y=AR(1026)
27 IF X>31000 GOTO ~L+4
28 IF X<200 GOTO ~L+4
29 X=X/10:SCALE R,0,Y,0,X,N:CLS
30 ? "(R) ";!$1D;R;" K";%F:RET
31 CLS :? "(R) > 1 M";%F:RET
32 CALL L,2
33 X=~R:N=AR(1024)-X:Y=AR(1027)
34 IF X<200 GOTO ~L+3
35 X=X/10:SCALE R,0,Y,0,X,N:CLS
36 ? "(R) ";!$0D;R;" ";%F:RET
37 CALL L,1
38 X=~R:N=AR(1024)-X:Y=AR(1028)
39 SCALE R,0,Y,0,X,N:CLS
40 ? "(R) ";!$1D;R;" ";%F:RET
41 'D-Messung
42 CALL L,2:Y=AR(1029)
43 X=~R:IF X>32000 GOTO ~L+3
44 SCALE R,0,Y,0,X,32767:CLS
45 ? "(D) ";!$3D;R;" V":RET
46 CLS :? "(D) > 4.88 V":RET
47 'C-Messung
48 CALL L,4
49 Y=AR(1030):O=AR(1031)
50 X=~R:IF X>3199 GOTO ~L+3
51 SCALE R,0,Y,0,X-O,32000:CLS
52 ? "(C) ";!$1D;R;" nF":RET
53 CALL L,5
54 Y=AR(1032):O=AR(1033)
55 X=~R:IF X>25000 GOTO ~L+3
56 SCALE R,0,Y,0,X-O,25600:CLS
57 ? "(C) ";!$1D;R;" nF":RET
58 CALL L,6
59 Y=AR(1034):O=AR(1035)
60 X=~R:IF X>25000 GOTO ~L+3
61 SCALE R,0,Y,0,X-O,25600:CLS
62 ? "(C) ";!$2D;R;" ";%E;"F"
63 CALL L,7
64 Y=AR(1036):O=AR(1037)
65 X=~R:IF X>4090 GOTO ~L+3
66 SCALE R,0,Y,0,X-O,4096:CLS
67 ? "(C) ";!$0D;R;" ";%E;"F":RET
68 CLS :? "(C) OVERFLOW ":RET
69 'L-Messung
70 ? @0,0;:CALL L,8:Y=AR(1038)
71 X=~R:IF X>3199 GOTO ~L+3
72 SCALE R,0,Y,0,X,3200:CLS
73 ? "(L) ";!$0D;R;" ";%E;"H":RET
74 ? @0,0;:CALL L,9:Y=AR(1039)
75 X=~R:IF X>25599 GOTO ~L+3
76 SCALE R,0,Y,0,X,25600:CLS
77 ? "(L) ";!$1D;R;" mH":RET
78 CLS :? "(L) OVERFLOW ":RET
79 'Test auf Tastendruck
80 I=0:T=0
81 'IF IN($807)=0 GOTO ~L-2
82 IF KEY(0)>0 GOTO ~L+3
83 IF IN($807)=0 GOTO ~L+2
84 RETURN
85 SYNC 1:I=I+1:IF I<50 GOTO ~L-3
86 T=1
87 RETURN
88 'my and omega symbols
89 DA 100,0,0,9,9,9,14,8,16
90 DA 108,0,0,14,17,17,10,27,0
91 FOR I=0 TO 15:J=I+100
92 OUT $A00+I,AR(J):NEXT
93 RETURN
#
3.1 General
This demo library shows how to extend the scope of the BASIC computer. For this the following
commands are implemented:
3.2 Function overview
command function
_SETSEC n sets the seconds value to parameter n, while the limits are monitored.
_SETMIN n sets the minute value to the parameter n, while the limits are monitored.
_SETHOUR n sets the hour value to the parameter n, while the limits are monitored.
_SETDAY n sets the day value to the parameter n, while the limits are monitored.
_SETMONTH n sets the monthly value to the parameter n, while the limits are monitored.
_SETYEAR n sets the year value to the parameter n (0..99)
_GETSEC V reads the second value into variable V
_GETMIN V reads the minute value into variable V
_GETHOUR V reads the hour value into variable V
_GETDAY V reads the day value into variable V
_GETMONTH V reads the month value into variable V
_GETYEAR V reads the year value into variable V
All commands have only one dummy function, but a connection to a specific RTC (eg via I2C) should not
be a problem.
1.1.1 General
This mode allows the display of text and pseudo-graphics with a resolution of 24 lines of 40 characters each.
However, the representation is only monochrome (green on black) possible, the output pins for the red and blue
color channel are switched to high impedance. One line in screen memory consists of 45 bytes. First, there are 5
bytes, each of which is responsible for inverting one of the following characters. This is followed by 40 character
bytes, bit 7 of the characters is ignored. The characters are defined with 8 pixels horizontally and 10 pixels
vertically, the character set with a total of 128 characters is in the RAM and can also be changed. Since the character
set has no longer fit into the driver due to the memory requirement, it must be loaded to program location 7. A
matching character set is charset10.bin . The image memory is divided as follows:
The character set in the RAM is constructed line by line, first 128 bytes for the first line, then 128 bytes for
the second line and so on up to 128 bytes for the tenth and thus last line. The character set on program
location 7, which serves as the source, has a similar structure, except that here a line has 256 bytes. This
also means that the driver uses only the lower 128 characters of the character set.
1.1.2 Functions
The current driver has no additional functions installed, the control is via the "normal" BASIC output
commands. To activate the driver, you only need to switch to the USER video mode using VMODE 7 .
The character set of program location 7 is then copied to the RAM. With COLOR 0 , the characters are
output inverted, COLOR 1 returns to non-inverted mode.
It is also possible to use 16 (0x00 ... 0x0f) user-defined characters. For this the I / O area is reserved from
0xa00 to 0xaff. In each case 16 consecutive bytes are responsible for one character, only the first 10
bytes are used. Within the bytes, bits 7 ... 0 are used, with bit 7 corresponding to the leftmost pixel.
Alternatively, VPOKE can also be written directly into the screen memory , but there is no linear
relationship between the character bytes and the address as in the OUT command, which already
performs the conversion of the addresses.
1.2.1 General
This mode allows the display of text and pseudo-graphics with a resolution of 24 lines of 50 characters each.
However, the representation is only monochrome (green on black) possible, the output pins for the red and blue
color channel are switched to high impedance. One line in screen memory consists of 50 bytes. The associated
character set with 6 pixels horizontally and 10 pixels vertically must be loaded on program slot 7. It contains 256
characters where the characters from 128 correspond to those from 0 ... 127 but are displayed inverted. A matching
character set is charset_50z.bin . The image memory is divided as follows:
The character set in the Flash is constructed line by line, first 256 bytes for the first line, then 256 bytes
for the second line and so on up to 256 bytes for the tenth and thus last line. The character set must be in
program position 7, the start address is permanently coded in the driver.
1.2.2 Functions
The current driver has no additional functions installed, the control is via the "normal" BASIC output
commands. To activate the driver, you only need to switch to the USER video mode using VMODE 7 .
With COLOR 0 , the characters are output inverted, COLOR 1 returns to non-inverted mode.
1.3.1 General
This mode allows the display of text and pseudographics with a resolution of 24 lines of 60 characters each.
However, the representation is only monochrome (green on black) possible, the output pins for the red and blue
color channel are switched to high impedance. One line in screen memory consists of 50 bytes. The associated
character set with 6 pixels horizontally and 10 pixels vertically must be loaded on program slot 7. It contains 256
characters where the characters from 128 correspond to those from 0 ... 127 but are displayed inverted. A matching
character set is charset_60z.bin . The image memory is divided as follows:
The character set in the Flash is constructed line by line, first 256 bytes for the first line, then 256 bytes
for the second line and so on up to 256 bytes for the tenth and thus last line. The character set must be in
program position 7, the start address is permanently coded in the driver. The last pixel of each character
is repeated 2 times, thus, for example, the pseudographics are applied unbalanced. {Functions The
current driver has no additional functions built in, the control is carried out via the "normal" BASIC output
commands. To activate the driver, you only need to switch to the USER video mode using VMODE 7 .
With COLOR 0 , the characters are output inverted, COLOR 1 returns to non-inverted mode.
1.4.1 General
The tile-and-sprite driver is primarily intended for programming games. There is a tilemap that repeats in both the X
and Y directions. From this map a window of 16 tiles horizontal and 13 tiles vertical is visible, the position of this
window can be moved over the entire area pixel by pixel. Each of the 1024 tile positions contains an index on one of
the 49 tiles. Each of these tiles ("tiles") consists of 8 x 8 pixels, each of which can have one of 16 displayable colors.
In addition to extensive Tile manipulation options, there are also software sprites, which themselves consist of one
tile and can move pixel-wise throughout the tilemap. At the top and bottom of the screen, there is still one line of
text that behaves like the first two lines in mode 0.
0 39 40 system
The Tilemap has a size of 32 times 32 tiles and repeats in both X and Y direction.
Each of the 49 tiles of 8 x 8 pixels is represented by 32 bytes, with 4 bits each for one pixel.
offset meaning
0 New Y coordinate
1 New X coordinate
2 Old Y coordinate
3 Old X coordinate
4 Sprite Tile
6 Transparency Color
7 visible (0/1)
9 Kollisionsflag
11 vertical increment
22 Copy Tile
24 Rotate 2 tiles
25 Initialize sprites
26 Define sprite
27 Position sprite
28 Enable sprite
29 Disable sprite
36 ---
37 ---
parameter meaning
Parameter 2 ---
Parameter 3 ---
return value 0
1.4.6 Function 10: Set Tile Map with a Tile Bitmap
This function sets the specified tile in the entire tile area if the corresponding bit in the array is set to "1".
The bitmap area in the array is 128 bytes and is organized as follows:
parameter meaning
Parameter 3 ---
return value 0
1.4.7 Function 11: Fill Tile Map Area with Constant Tile Index
This function sets the specified tile area to the specified tile. Start and end positions result from 32 * line + column .
There are no restrictions in either X or Y directions because the tile map repeats almost infinitely.
parameter meaning
return value 0
return value 0
parameter meaning
Parameter 3 ---
parameter meaning
return value 0
parameter meaning
return value 0
parameter meaning
return value 0
1.4.13 Function 17: Draw Pattern from Character Set in Tile
With this function characters from the character set can be used as patterns for tiles. Since the tiles have a size of
8x8 pixels, but the character set is one of 6x10 pixels, one pixel row is cut off at the top and bottom and one empty
pixel row is added to the right and left. The first parameter is the tile to be filled. The second parameter specifies the
character from the system character set that determines the pattern. The third parameter is again a byte for defining
the character color, with only the pixels in the tile being set with the set color having a "1" in the pattern. All other
pixels remain unchanged.
parameter meaning
return value 0
parameter meaning
Parameter 2 ---
Parameter 3 ---
return value 0
1.4.15 Function 19: Mirror Tile Vertically
The specified tile will be mirrored vertically. What was above above is down afterwards and vice versa.
parameter meaning
Parameter 2 ---
Parameter 3 ---
return value 0
parameter meaning
Parameter 2 ---
Parameter 3 ---
return value 0
parameter meaning
Parameter 1 Tile number (0 ... 48)
Parameter 2 ---
Parameter 3 ---
return value 0
parameter meaning
Parameter 3 ---
return value 0
parameter meaning
return value 0
1.4.20 Function 24: Rotate tiles
This function rotates the content of two tiles. The two tiles are meant to be next to each other or on top of each other,
which is postponed at one end, reappears at the other end. The first parameter specifies the tile that is up or to the
left in the imaginary union, the second parameter specifies the tile that is below or to the right in the imaginary
union.
parameter meaning
return value 0
Parameter 3 direction
Parameter 3 ---
parameter meaning
return value 0
parameter meaning
Parameter 1 Sprite number (0 ... 7)
return value 0
parameter meaning
Parameter 2 ---
Parameter 3 ---
return value 0
parameter meaning
Parameter 3 ---
return value 0
parameter meaning
Parameter 2 Y position
Parameter 3 X position
return value 0
parameter meaning
Parameter 2 ---
Parameter 3 ---
return value 0
1.4.28 Function 32: Draw all sprites sequentially
Draws all enabled sprites in ascending order.
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
return value 0
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
return value 0
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
return value 0
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
return value 0
1.5.1 General
This mode could be called a "vector mode" or "differential mode". It corresponds to video mode 7 in earlier
versions. At the top and bottom of the screen there is a line of text that behave in the same way as the first two lines
in mode 0. But then the similarity already stops. Then there are 105 byte pointers followed by 105 line definitions a
24 bytes. Each of the pointers indicates which of the 105 row definitions is relevant to the current row. Thus, all
lines can have their own definition or all lines have the same definition. Values greater than 104 should not be set,
because then the behavior is not defined.
The image memory is divided as follows:
start address end address bytes function
0 59 60 2 lines characters
1.5.2 Functions
To activate the driver, you only need to switch to the USER video mode using VMODE 7 . The two text lines at
the top and bottom of the screen are controlled via the "normal" BASIC output commands. The line at the top
corresponds to the text line 0 and the one at the bottom of the text line 1.
Further functions are available via CALL :
24 ---
25 ---
26 ---
27 ---
parameter meaning
Parameter 1 ---
Parameter 2 ---
Parameter 3 ---
return value 0
parameter meaning
Parameter 3 value
return value 0
parameter meaning
return value 0
parameter meaning
return value 0
1.5.7 Function 20: Fill row pointer with array values
Copies the values of the array cells from parameter 3 into the row pointers from parameter 1 , the number is in
parameter 2. The values are automatically limited to the valid range, as well as an overflow from 104 to 0 at the
addresses and one from 767 to 0 at the array cells instead.
parameter meaning
return value 0
parameter meaning
return value 0
1.5.9 Function 22: Fill Lines with Constant Array Values
Copies the values of the array cells from parameter 3 into the lines from parameter 1 , the number is in parameter
2. The same 24 bytes are copied per line. There is an overflow from 104 to 0 in the rows and one from 767 to 0 in
the array cells.
parameter meaning
return value 0
parameter meaning
return value 0
2.1.1 General
These drivers can be used to control various single-line and multi-line text LCDs. The data lines D4 ... D7
are used, the data lines D0 ... D3 can be freely used via the I / O address range from 0x800 or the IN and
ADC functions.
The actual output is done with PRINT or direct writing into the video RAM in the address range from
0x0000. A cyclic update function ensures that all characters are transmitted to the LCD.
It is also possible to use the custom characters. For this the I / O range from 0xa00 to 0xa40 is reserved.
For each 8 consecutive bytes are responsible for a character. Within the bytes, bits 4 ... 0 are used, with
bit 4 corresponding to the leftmost pixel. These characters are usefully used in the range of 8 ... 15, the
range of 0 ... 7 is also possible, but in some cases a 0x00 in the string leads to the abort of the output.
Parallel to the LCD, the contents of the display will also be displayed on the TV output, the display should
match that of the LCD, and characters larger than 128 may differ in character sets. The foreground and
background colors can be easily set via the COLOR command, whereby the setting is immediately
applied to the entire (TV) display.
2.1.2 Hardware
The display is connected to the parallel port, but also the + 5V must be led out with it. The lines Strobe,
Busy and the data lines D4 ... D7 are used.
Buttons, etc. can still be connected to the data lines D4 ... D7. These must switch the signals over approx.
1Kohm to ground. The status of the four data lines can be queried using IN ($ 804) ... IN ($ 807) .
driver driver code display Display works Display does not work
2.1.4 Functions
The current driver has no additional functions installed, the control is via the "normal" BASIC output
commands. To activate the driver, you only need to switch to USER video mode using VMODE 7 . When
switching to another video mode, the display remains on the LCD. However, there should be a small
break between the last write and the change of the video mode (0.1s), so that the data can be safely
updated on the LCD. There is no need to connect an LCD to test the driver.
2.2 DUAL graphic LCD driver 128x64 PIXEL (library code 0xA8)
2.2.1 General
With this driver, various KS0107 / 0108 based or compatible graphics displays with 128x64 pixels can be
controlled. The output is parallel to the TV output, functionally, the video mode is the same as the built-in
mode 5. For the control of the entire parallel port is used, in addition a 4-bit wide latch (H transparent) or
register (both edges possible) is necessary , Furthermore, 7 keys can be connected. There are two
versions of the driver, which differ in the polarity of the chip-select signals. The version with the extension
_ncs is suitable for displays with LOW-active chip-select signals, with the suffix _pcs correspondingly for
displays with HIGH-active chip-select signals. A cyclic update function ensures that the screen content is
transferred to the LCD approx. 12 times per second. The foreground and background colors are
permanently assigned with blue and cyan and can not be changed.
2.2.2 Hardware
The display is connected to the parallel port, but also the + 5V must be led out with it. The data lines are
led directly to the display, the control lines I / D, CS1 and CS2 and the driver signal for the additional keys
are buffered via a 4-bit latch / register. The purpose of this is the BUSY signal, which is used as output.
The E-signal is supplied by the STROBE output, the R / W line is grounded, it is only written to the
display.
2.2.3 Output functions
The current driver has no additional functions installed, the control is via the "normal" BASIC output
commands. To activate the driver, you only need to switch to USER video mode using VMODE 7 . When
switching to another video mode, the display remains on the LCD. However, there should be a small
break between the last write and the change of the video mode (0.1s), so that the data can be safely
updated on the LCD. There is no need to connect an LCD to test the driver.
right 1 0xE3
up 2 0xE4
down 3 0xE5
enter 4 0xEA
esc 5 0xED
F5 6 0xF5
ATTENTION! Once one of the buttons is pressed, a connected PS2 keyboard will not work properly.
2.3 DUAL graphic LCD driver 24x40 characters (library code 0xA9)
2.3.1 General
This mode allows the display of text and pseudo-graphics with a resolution of 24 lines of 40 characters each.
However, the representation is only monochrome (green on black) possible, the output pins for the red and blue
color channel are switched to high impedance. Optionally, the display contents can be output to a graphic display
connected to the parallel port. Monochrome displays without their own controller with 320x240 pixels are
supported. The display can only be done one way, TV out or display, simultaneous display is not possible. The
respective non-active display is then turned off, the LCD, there is a control pin with which the LCD voltage can be
turned off and should. One line in screen memory consists of 45 bytes. First, there are 5 bytes, each of which is
responsible for inverting one of the following characters. This is followed by 40 character bytes, bit 7 of the
characters is ignored. The characters are defined with 8 pixels horizontally and 10 pixels vertically, the character set
with a total of 128 characters is in the RAM and can also be changed. Since the character set has no longer fit into
the driver due to the memory requirement, it must be loaded to program location 7. A matching character set is
charset10.bin . The image memory is divided as follows:
The character set in the RAM is structured line by line, first 128 bytes for the first line, then 128 bytes for
the second line and so on up to 128 bytes for the tenth and thus last line. The character set on program
location 7, which serves as the source, has a similar structure, except that here a line has 256 bytes. This
also means that the driver uses only the lower 128 characters of the character set.
2.3.2 Hardware
The parallel port is used to connect the display. The data signals D0 ... D3 (at the port pins of the same
name), CP at pin D7, LOAD at pin D6 and FLM / FRAME at pin D5 are available. A switching signal
(LOW active) is also available at the BUSY pin, with which the display voltages VEE and VO should be
switched. Otherwise, damage to the display may occur, both at the moment of switching on until the video
mode 7 is switched on and when changing to another video mode.
2.3.3 Functions
The current driver has no additional functions installed, the control is via the "normal" BASIC output
commands. To activate the driver, you only need to switch to the USER video mode using VMODE 7 .
The character set of program location 7 is then copied to the RAM. With COLOR 0 , the characters are
output inverted, COLOR 1 returns to non-inverted mode.
It is also possible to use 16 (0x00 ... 0x0f) user-defined characters. For this the I / O area is reserved from
0xa00 to 0xaff. In each case 16 consecutive bytes are responsible for one character, only the first 10
bytes are used. Within the bytes, bits 7 ... 0 are used, with bit 7 corresponding to the leftmost pixel.
Alternatively, VPOKE can also be written directly into the screen memory , but there is no linear
relationship between the character bytes and the address as in the OUT command, which already
performs the conversion of the addresses. With the command OUT $ 900,1 the display can be switched
to the connected LCD, with OUT $ 900,0will switch back to TV output. By default, the video mode starts
with TV display.
3.1.1 General
This driver provides 4 pulse width modulated outputs. These have a resolution of 8 bits and a frequency
of about 61 Hz. In addition, there is a video video to 0 as far as possible compatible display, however, of
each line only the erten 24 characters are visible.
3.1.2 Hardware
The 4 PWM channels are connected to the data bits D4 ... D7, the data bits D0 ... D3 can be set via the
address ranges 0x800 ... 0x803 (data) and 0x810 ... 0x813 (data direction) as well as via the IN ( ) and
ADC () functions freely.
3.1.3 Functions
The current driver has no additional functions installed, the control is via the "normal" BASIC output
commands. To activate the driver, you only need to switch to USER video mode using VMODE 7 . When
activating and exiting the video mode, all PWM channels are set to 0.
The individual channels are controlled by means of OUT commands to the addresses 0x900 ... 0x903, a
read back is possible via the IN () function. The following table shows an overview of the usable I / O
addresses:
3.2.2 Hardware
The 8 PWM channels are connected to the data bits D0 ... D7.
3.2.3 Functions
The current driver has no additional functions installed, the control is via the "normal" BASIC output commands. To
activate the driver, you only need to switch to USER video mode using VMODE 7 . When activating and exiting
the video mode, all PWM channels are set to 0.
The individual channels are controlled by means of OUT commands to the addresses 0x900 ... 0x907, data can be
read back via IN (). The following table shows an overview of the usable I / O addresses:
3.3.1 General
This driver provides 2 pulse width modulated outputs. These have a resolution of 8 bits and a frequency
of about 61 Hz. In addition, there are two pulse outputs with which periodic pulses can be generated in
the range of 0 ... 2.24 milliseconds. The repetition frequency corresponds to the vertical synchronizing
frequency, ie approx. 50Hz for PAL and 60Hz for NTSC. In addition, there is a video mode 0 as far as
possible compatible display, however, only the first 20 lines are displayed of which only 28 characters are
visible.
3.3.2 Hardware
The 2 PWM channels are applied to the lines D6 and D7, the two pulse channels on the data lines D4 and
D5. The data lines D0 ... D3 as well as BUSY and STROBE can be set via the address ranges 0x800 ...
0x809 (data) and 0x810 ... 0x819 (data direction) as well as via the IN () and ADC () functions (the latter
only D0 .. .D3) use freely.
3.3.3 Functions
The current driver has no additional functions installed, the control is via the "normal" BASIC output commands. To
activate the driver, you only need to switch to the USER video mode using VMODE 7 . When activating and
exiting the video mode, all PWM channels are set to 0.
The individual channels are controlled by means of OUT commands to the addresses 0x900 ... 0x903, the set values
can also be read back via IN (). The following table shows an overview of the usable I / O addresses:
4.2 Memory driver for 64K external RAM (library code 0xF1)
This driver allows the use of the XRAM64 memory module as described in the extensions. Pages 0 ... 255
can be used, with only 32K RAM pages 0 ... 127.
4.3 Memory driver for 12K internal RAM (library code 0xF2)
This driver uses the free 12K of internal memory when using an ATMega1284P. Pages 0 to 48 are
available.
AVR-ChipBasic2 programs
1 Program overview
In the current version the following programs are included with the system:
SETKBD -DE-
SETKBD -US-
Serial Load
CBTerm mini
Clone644
Bench
chip-8
2 keyboard configuration
By means of these programs it is possible to install alternative keyboard assignments. The currently set
layout is displayed in the lower part of the main menu. After the start of the corresponding program, the
display in the main menu changes and the new keyboard layout is effective immediately.
----------------------------
ChipBasic2 Serial Loader
----------------------------
S = Show Status
U = Upload (XMODEM)
T = Text Upload (ASCII)
A = Set Autostart
C = Config Hardware
Q = Quit
----------------------------
Status
----------------------------
P1: SerialLoader LOADER
P2: BASIC
P3: BASIC
P4: BASIC (A)
P5: BASIC
P6: BASIC
P7: BASIC
P8: BASIC
Space returns to main menu
Press any key!
----------------------------
XModem Upload
----------------------------
P1: SerialLoader LOADER
P2: BASIC
P3: BASIC
P4: BASIC (A)
P5: BASIC
P6: BASIC
P7: BASIC
P8: BASIC
Space returns to main menu
Select Program (1..8) :
The upload is started by selecting one of the programs (buttons 1 ... 8 ), with the space bar you get back
to the main menu. If the loader has been selected, there is still a security prompt, because you can lock
yourself out by overwriting the loader itself.
The actual upload starts after 10 seconds, so that enough time is available on the terminal program to
start the upload there as well. When all data have been transferred, the upload menu is displayed again.
Only if the loader has been overwritten will the system be restarted.
----------------------------
Text Upload
----------------------------
P1: SerialLoader LOADER
P2: BASIC
P3: BASIC
P4: BASIC (A)
P5: BASIC
P6: BASIC
P7: BASIC
P8: BASIC
Space returns to main menu
Select Program (1..8) :
The upload is started by selecting one of the programs (buttons 1 ... 8 ), with the space bar you get back
to the main menu. The loader can not be overwritten in this way, if you select this for overwriting, an error
message is displayed.
Since the image memory is used as a text buffer, a colorful "letter clutter" will appear on the screen (if
connected) of the ChipBasic2 system. This is normal.
3.4 Autostart
The A button can be used to set the autostart function. Autostart is programmable for programs 1 to 7, it can not be
turned off. The autostart function can not be set to a loader.
----------------------------
Autostart
----------------------------
P1: SerialLoader LOADER
P2: BASIC
P3: BASIC
P4: BASIC (A)
P5: BASIC
P6: BASIC
P7: BASIC
P8: BASIC
Space returns to main menu
Select Autostart (1..7) :2
Autostart is now set to program 2.
----------------------------
ChipBasic2 Configuration
----------------------------
(1) Serial speed: 2400 Bps
(2) I2C speed : 400 kHz
(3) SPI speed : 5 MHz
(4) EEPROM addr : 0
(5) Line end : only LF
(6) Serial I/O : simple
(7) Serial Input: PD3
(8) Store
Space returns to main menu
Select Parameter (1..8) :
3.6 Quit
With the key Q , the loader is stopped and the autostart function is executed.
----------------------------
Serial Loader Quit
----------------------------
Leave program
Clone system
5.1.1 Exit (ESC)
After a query whether to exit the program, the system returns to the main menu.
VCC 2 VCC 2
MOSI 1 MOSI 1
MISO 9 MISO 9
SCK 7 SCK 7
SS 3 RESET 5
6 system benchmark
With Benchmark you can determine the effective clock frequency in MHz for all 8 video modes. Effective
clock frequency means at which clock frequency the microcontroller would be just as fast if he does not
have to do any video output etc. When the display appears, the program can be stopped by pressing any
key.
The displayed results are measured in NTSC mode (without mode 7 driver). For PAL, the results are
slightly better because the total number of lines is higher for the same number of visible lines.
Since the Chip8 interpreter is much faster than the original, a delay can be set. It corresponds to the
number of image lines that are being serviced before each command and is stored with the program.
Values between 6 and 20 are meaningful.