G-Tek 2010B User manual

Model 2010B Intel 8052AH Basic SBC
Operator’s Manual
Copyright 1986, 1988
GTEK, Inc. All Rights Reserved,
Worldwide
Second Printing
April 1, 1988
Part # 01–000–282
Please see section on installation before using

Chapter 1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . .1
1.1 Hardware Overview . . . . . . . . . . . . . . . . . . .1
1.2 Hardware Specifications . . . . . . . . . . . . . . . .1
1.3 Software Overview . . . . . . . . . . . . . . . . . . .2
1.4 Software Specifications . . . . . . . . . . . . . . . .2
1.5 Firmware Overview . . . . . . . . . . . . . . . . . . .3
1.6 Firmware Specifications . . . . . . . . . . . . . . . .3
Chapter 2
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . .5
2.1 Unpacking . . . . . . . . . . . . . . . . . . . . . . .5
2.2 Installation . . . . . . . . . . . . . . . . . . . . . . .5
2.2.1Quick Start . . . . . . . . . . . . . . . . . . . .5
2.2.2Normal Installation . . . . . . . . . . . . . . . .6
Chapter 3
New Commands and Additions . . . . . . . . . . . . . . . . .9
3.1 New Commands . . . . . . . . . . . . . . . . . . . .9
3.1.1AUTOEXn . . . . . . . . . . . . . . . . . . . .9
3.1.2DIR . . . . . . . . . . . . . . . . . . . . . . . 10
3.1.3EGETn . . . . . . . . . . . . . . . . . . . . . 10
3.1.4EPUTn . . . . . . . . . . . . . . . . . . . . . 11
3.1.5 ERASEn . . . . . . . . . . . . . . . . . . . . 11
3.1.6INn . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.7LOADn . . . . . . . . . . . . . . . . . . . . . 12
3.1.8OUTn . . . . . . . . . . . . . . . . . . . . . . 13
3.1.9SAVEn . . . . . . . . . . . . . . . . . . . . . 13
3.1.ATKO . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 Differences In V1.1 Intel Basic Commands . . . . . 14
3.2.1 Differences Caused by Ram Refresh . . . . . 14
3.2.2 New Values for Basic Constants . . . . . . . . 14
3.2.3Sign on message . . . . . . . . . . . . . . . . 14
3.2.4 EE/Eprom Code Memory . . . . . . . . . . . 14
3.2.5 Unusable Intel Basic V1.1 Commands . . . . 15
3.2.6 Intel V1.1 Basic Commands Used Differently . 15
Table of Contents
Page i

Chapter 4
Communications Software . . . . . . . . . . . . . . . . . . 19
4.1 B51 Installation . . . . . . . . . . . . . . . . . . . . 19
4.2 Using B51 . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Using Mke.bat . . . . . . . . . . . . . . . . . . . . 21
Chapter 5
2010B RS–232 Interface . . . . . . . . . . . . . . . . . . . 23
Appendix A
2010B Board Connector Pinouts . . . . . . . . . . . . . . . 25
Expansion Bus 34 Pin Connector On 2010 Board . . . . 25
40 Pin Connector On 2010 Board . . . . . . . . . . . . 26
Appendix B
Jumpers Used on the 2010B Board . . . . . . . . . . . . . 31
Appendix C
Example Basic Program
Table of Contents
Page ii

Chapter 1
Introduction
1.1 Hardware Overview
The GTEKModel 2010 single board computer is intended to be the
best single board computer to use for control applications ever made.
The 2010 has 40 programmable I/O lines. Each I/O line may be
programmed foreitherinputor outputwithoutregardto itspositionon
the connector. Eight ofthose40are PORT1of the processor.The other
32 are on 2 Z80 PIO chips.
In addition to those 40 I/O lines, are lines to be used to expand the
functions of the 2010 board. AD0-AD7, ALE, RD, WR, PSEN, A8- A15,
ROM, CMM, VDD, P1.5, P1.6, P1.7, Vcc, Vdd, DTR and GROUND are
brought to a 34 pin expansion bus (see appendix A). This makes
expansiontomorememoryorboards,likeaD/AA/Dconverterormore
I/O, easily attached. With proper design, the board could just piggy
back on top of the 2010.
The 2010 has a built in 5volt regulated power supply. It needsto be
connected to a single ended power supply capable of at least 9 volts
at 500 milliamps to be adequately powered. If you attach expansion
boards to it, you must usean adequate power supply. The RS-232 uses
a MAX-232 chip to obtain the + — 12 volts for the RS-232 supply.
With the proper power supply, you can supply approximately an
other 250 to 500 milliamps to peripherals. You must provide for
adequatecooling ofthe regulator,however.Theregulator iscapable of
delivering up to 1amp provided proper heat sinking is provided.
1.2 Hardware Specifications
PHYSICAL SIZE:
3.55 x 6.90 x .6 inches
90.17 x 175.26 x 15.24 mm
WEIGHT: 6 ounces (170 grams)
Chapter1 Model 2010B
Page 1

POWER REQUIREMENTS:
9 Volts AT 500 milliamps
Direct I/O Lines Programmable as Input or Output:
40
Indirect I/O Lines Through Expansion Bus:
C000-FFFFH, and 0000-7FFFH if the EEprom is not used.
PROCESSORS:
8031 at 11 MHz (standard)
(Optional) 8751, 8751H, 87C51 at 11 MHz
8032 at 11 MHz
8052AH BASIC
(Also see your processor specification sheet)
1.3 Software Overview
Much of the software for the 2010 is strictly communications
software. That is, you could use other programs to communicate with
the 2010, but our software will recognize upload, download and other
commands and handle them accordingly.
Most of thecommands are handled by the2010directly, rather than
on your computer. This allows it to run in the same way on virtually any
computer or terminal.
The software used to handle communications is called B51.COM.
A program called PINSTALL is provided to install it for the Baud Rate
or COM port you are using. The software used to handle
upload/download from the BASIC option is called B51.COM. Use B51
to save/load your basic programs either in an ASCII format for imme-
diate use with an EEprom, or in a tokenized format so that you can
dedicate the controller with a BASIC program in an Eprom.
1.4 Software Specifications
Although the 2010 is capable of communicating at Baud Rates of
from 300 to 57,600 Baud, B51 communicates at 9600 Baud. Com-
mands areavailable to saveor load an ASCII BASIC program, and save
a tokenized BASIC program to execute from a burned Eprom.
Model 2010B Chapter1
Page 2

1.5 Firmware Overview
Much of the versatility of the model 2010 board comes from being
able to refresh ram through an interrupt service routine every 2 mil-
liseconds.Thebuiltinmonitorfirmwaretakescareofthisinconjunction
with the PAL. You arenot awareof this going on except that you cannot
make exclusive use of the timer taking care of this function.
Much of thefirmwaremonitor istied into thePAL functionality. This
means that if you write code to go into the Eprom or EEprom, then you
must also includethemonitor code. Ifyoudon’t you may losefunction
of the ram refresh and of course all of the built- in commands and
RS-232 communications. When using the B51 program to save
tokenized basic to beput intoan Eprom,youshould usetheMKE.BAT
program to put the monitor and other things into the correct location
in the Eprom.
1.6 Firmware Specifications
The firmware included with the 8052AH BASIC chip takes care of
the Ram Refresh and new commands added to 8052AH BASIC. Refer
to the memory map. Locations 0-1FFFH in code memory are reserved
for 8052AH BASIC. 2000H Through 7FFFH is reserved for BASIC and
the firmware monitor. When using a 2864 or 2764 (8K memory device),
it is inserted at locations 2000H through 3FFFH. When using a 16K
device, it is inserted at 2000H through 5FFFH. When using a 32K
device, it is inserted at 2000H through 7FFFH. Note that you lose 8K to
the 8052AH BASIC monitor rom.
—Notes—
Chapter1 Model 2010B
Page 3

—Notes—
Model 2010B Chapter1
Page 4

Chapter 2
Getting Started
2.1 Unpacking
When unpacking the model 2010 board, be sure to watch for items
such as jumpers, disks, cables, and instructions and/or errata sheets
whileyouareunpacking.Many phonecallshavebeenmadeinthepast,
because in the haste of unpacking and getting to the main board,
material that was thought to be packing material was protecting a disk
or instruction manuals. These materials should be plainly marked as
"instructions"or "disk", but some people don’t take the time to read it
and discard it. If you think you are missing anything from your order,
please be sure to go back through the packing material to make sure
that it was not acci dentally discarded.
2.2 Installation
The 2010 board (depending on the options ordered) generally
comesset up to plug in and run. Yours should be set up with the Basic
monitor on a 2864. Jumpers will beset for this installationwith no other
option jumpers.
2.2.1 Quick Start
To begin communicating immediately with the board follow these
instructions:
1—Plug in RS–232 cable to computer and 2010 board. (or make
cable from instructions in appendix D).
2—Plug wall transformer into board.
3—Plug wall transformer into 120 Volt outlet.
4—Run B51 (B51 is an optional program) communications pro-
gram.
5—Issue commands.
Remember that if you don’t have theB51communicationsprogram
that you will have to set the communications parameters first on your
computer to communicate with the board. The 2010 is set up to be a
Chapter2 Model 2010B
Page 5

DCE device. This means that on an IBM PC or ATtype computer (that
has a DTE port) the cable will run straight through.
2.2.2 Normal Installation
After unpacking the 2010, set it up for your use. Normally, it will
already be installed to use with the 8052AH BASIC. However, you may
install the board in this manner:
1—If you didn’t get a cable from us, make an RS-232 cable like this:
a) The cable required is a straight through cable. Pin 2 on the
computer hooks to pin 2 on the 2010. Hook up pins 1, 2, 3, 4, 5, 6,
7, and 20. 8052AH BASIC does not require hardwarehandshaking,
so you could just use pins 2, 3 and 7 for a cable.
b) The computer end of the cable will require a female connector,
while the 2010 end requires a male connector.
2- Hook the RS–232 cable to the 2010 and the computer.
3- Check the jumpers for operation. A normal first time operation
willalready havethejumpersinthecorrect location,howevercheck
the jumpers as follows:
JB5
—1 is /EA of the processor pulled high by a 2K RP (for internal
program memory).
—2 is Ground (for external program memory access)
Default: leave thisjumper open for usewith 8052AHBASIC. Ground
it to use the 8052AH as an 8032.
JB6
—1 is Vcc. (used for 2764/27128 /pgm pin.)
—2 is pin 27 of the program memory socket (common).
—3 is A14 of the Address Bus
—4 is /WRfrom the processor
Default: 4–2for 2864. Hook 1–2for 2764,27128. Hook 4–2for 28256
to allow /WR to program EEprom. Hook 3–2 for 27256, 27512 to
allow A14 on pin 27 (A14).
Model 2010B Chapter2
Page 6

JB7
—1 is Vcc. (used for 2764/27128/27256 Vpp pin.)
—2 is pin 1 of the program memory socket (common)
—3 is A15 of the Address Bus
—4 is A14 of the Address Bus
Default: 4–2for2864.Hook 1–2for Vcc to Vpp of 2764,27128,27256.
Hook 4–2 for 28256 to allow A14 onto pin 1 (A14). Hook 3–2 for 27512
to allow A15 onto pin 1 (A15).
Memory (Usable size) JB5 JB6 JB7 Type:
2764/A 8K Eprom 1–2 2–1 2–1 ML
2764/A 8K Eprom none 2–1 2–1 BASIC
2864 8K EEprom 1–2 2–4 2–1 ML
2864 8K EEprom none 2–4 2–1 BASIC
27128/A 16K Eprom 1–2 2–1 2–1 ML
27128/A 16K Eprom none 2–1 2–1 BASIC
27256 32K Eprom 1–2 2–3 2–1 ML
27256 24K Eprom none 2–3 2–1 BASIC
28256 32K EEprom 1–2 2–4 2–4 ML
28256 24K EEprom none 2–4 2–4 BASIC
27512 32K Eprom 1–2 2–3 2–3 ML
27512 24K Eprom none 2–3 2–3 BASIC
JB5 controls external access of program code fetches. If it is
jumpered /EA is grounded,forcing theprocessor to fetch codeexter-
nally from the Eprom. If you have a 8751 or 87C51 you should leave
pin1and2ofJB5open(none)tofetchcodeinternallyfromtheEprom.
JB6 controls where pin 27 of the program memory socket (Eprom
or EEprom) connects. Pin 27 connects to pin 2 of the jumper block. If
pin 2 is jumpered to pin 1 (Vcc) then that pin is held at Vcc for a 2764.
To pin 3willconnect line A14 to pin 27for a27256. To pin 4will connect
/WR to pin 27 for for /WE for 8K EEproms, Xicor X2864A for example.
JB7controlswherepin1oftheprogrammemorysocket(Epromor
EEprom) connects. Pin 1 of the program memory socket connectsto
pin 2 of the jumper block. If pin 2 is jumpered to pin 1 (Vcc) then that
pin is held at Vcc for a 2764. To pin 3 will connect line A15 to pin 1 for
27512. To pin 4 will connect line A14 to pin 1 for a Xicor X28256 for
example.
Chapter2 Model 2010B
Page 7

4—If you are using the Wall Transformer, plug it into the miniature
phone jack just to the side of the DB-25 connector. If you are using
another external power supply, the be sure that you don’t exceed 9
Volts input. If you do, make sure that the extra power dissipation from
the 7805 is taken care of. A12volt power supply may require additional
heat sinking or forced air cooling of the heat sink of the 7805 regulator.
On the Miniature phone jack connector the tip is + and the ring is
—. There is a diode in series with the line going to the regulator to
prevent reverse current flow, so if the board does not operate, check
for power reversal.
If you are supplying a regulated + 5 volts from an external power
supply, unsolder and remove the 7805 regulator from the board. Hook
the + 5 volts to either the expansion connector or the hole where the
output pin ofthe7805was, and theground to either theexpansion plug
or the middle leg hole of the 7805.
—Notes—
Model 2010B Chapter2
Page 8

Chapter 3
NewCommands and Additions
3.1 NEWCOMMANDS
All these commands can be executed either from an executing
basic program or from the immediate mode. Some commands are
better executed from the immediate mode, such as for the baud rate.
In the programs shown below, a command that you are to type in
from the command prompter is shown in bold. A "enter" is shown as
< cr> . A> REM issimply a comment that does not haveto betyped.
3.1.1 AUTOEXn
Special command to perform an automatic command on boot up.
AUTOEX0
Causes an auto baud–rate seek on power up. You must
strike a space bar to lock onto the baud rate. (default)
AUTOEX1
Saves the current baud rate. No space will have to be
struck before any execution begins.
AUTOEX2
When executed will cause 8052AH BASIC to boot to the
READY prompter instead of loading and executing program 0.
(default)
AUTOEX3
When executed will cause 8052AH BASIC to load and
execute program number 0, if there is one saved by that name. If
there isn’t one, then it will return to the READYprompt.
AUTOEX4
When executed will cause 8052AH BASIC to use our
SLOW EEprom program routine to be used for certain types of
EEproms that program slowly when using the SAVE and ERASE
commands.
AUTOEX5
When executed will cause 8052AH BASIC to use our
FAST EEprom program routine to be used with certain types of
EEproms that can be programmed fast. (default)
Once any of the above commands are used, they become per-
manent in the EEprom.To changethem, simply issue theopposite
command. Eg. if you have used AUTOEX1, to change it use
AUTOEX0.
Chapter3 Model 2010B
Page 9

EXAMPLES: Program in PROGRAM 0 that you want to execute on
power up with no user intervention:
>AUTOEX1
> REM Store current Baud Rate: Else your program
> REM won’t execute without striking a space bar
> REM Really necessary if you don’t have a
> REM terminal hooked to the 2010!!!
>AUTOEX3
> REM Tell 8052AH Basic to Execute program 0 on
> REM power up.
3.1.2 DIR
When the
DIR
command is used, a list of the programs available
stored on theEEprom,along with the sizeisprinted to the console.
EXAMPLES:
>DIR< cr>
4 size 389
2 size 185
0 size 1084
1 size 988
>_
Note: The order in which you saved the programs is how they will
appear on screen. There may be up to 254 files if you had room for
them on the EEprom.
3.1.3 EGETn
EGET
Is a command that PUSHes an 8052AH BASIC 6 byte floating
point numberfromstorageintheEEpromonto theargumentstack.
You can retrieve up to 32 numbers in this fashion (0-31). The
numbers are stored in EEprom (or Eprom) from 2740H through
27FFH (192 bytes). You can create a file externally on disk to be
stored on the Eprom so that you can EGETn those numbers after
power has been offor for re-boots.
Model 2010B Chapter3
Page 10

EXAMPLES of EGET:
>PUSH 32: EPUT 0 : EGET 0: POP A: ? A< cr>
32
READY
>_
3.1.4 EPUTn
EPUTn
Is a command that POPs an 8052AH BASIC 6 byte floating
point number from the argument stack and programs the EEprom
in the storage area (2740H- 27FFH). The number may then be
obtained by an EGETn and a POPcommand.
EXAMPLES:
>PUSH 123.45678: EPUT0: EGET0: POP A: ? A< cr>
123.45678
READY
>_
> REM now that number is in permanent
> REM storage (until it’s changed)
> REM in the EEprom at location 0 of the EGETs.
3.1.5 ERASEn
ERASEn
isa command that will ERASEa program from the EEprom
program storage area. It is the opposite of SAVEn. The 2010 will
remove the program by rewriting the entire EEprom program
storageareaso that thereareno gaps after theprogram is removed
from storage. The range of n is 0–254 (0–FEh).
Examples:
>DIR< cr>
4 size 389
2 size 185
0 size 1084
1 size 988
READY
>erase0< cr>
READY
>dir< cr>
4 size 389
Chapter3 Model 2010B
Page 11

2 size 185
1 size 988
3.1.6 INn
INn
isa command that will input 8 bits of dataand PUSH it onto the
argument stack from the 4 ports on the Z80-PIO’s. The valid num-
bers for the ports are 4, 5, 6 and 7. U4 Port A is what we call port 4,
U4 Port B is what we call port 5, U3 Port A is port 6 and U3 port B
is port 7. (See Appendix A for pinout)
Examples:
>IN4: POPA: ? A: IN4,5,6,7: POP A,B,C,D< cr>
255
READY
>PRINT A,B,C,D< cr>
255 255 255 255
READY
>_
3.1.7 LOADn
LOADn
is a command that will cause file number n to be loaded to
current Ram memory. A NEW is automatically done before the
LOAD, so fileswill not "merge"inmemory.The rangeof nis 0to 254.
If LOADn isexecuted onaprogram line,anotherprogram isLOADed
and run. You could chain programs together like this. All variables
are lost during this process, but you can use
EPUTn, EGETn, LD@
and ST@
commands to save your variables.
Examples:
>LOAD9< cr>
READY
> REM Loads file 9 from EEprom to Ram.
>RUN: REM Run it.
Model 2010B Chapter3
Page 12

3.1.8 OUTn
OUTn
isa command that will output 8bits of data (to port numbers
4, 5, 6, or 7) to the Z80-PIO’s, that was POPped from the argument
stack.
Examples:
>C= 29: PUSH 22,25,32,C: OUT 4,5,6,7< cr>
> REM Port 4 pins contain data 29, Port 5 pins contain data 32
> REM Port 6 pins contain data 25, Port 7 pins contain data 22.
>IN 4,5,6,7: POP PORT7,PORT6,PORT5,PORT4< cr>
READY
>PRINT PORT4,PORT5,PORT6,PORT7< cr>
29 32 25 22
READY
> REM PORT4 etc in the above line are just variables we used.
> REM Remember that PORT1 is a Basic Keyword!
3.1.9 SAVEn
SAVEn
is a command that will save the program that is currently in
Ram to the EEprom in file number n. The range of n can be from
0–254. If there is currently a program residing in that file number,
thenan error messagewill beissued.Ifthereisnot enough memory
to save that file, then an error message will be issued.
Example:
>SAVE3< cr>
3.1.A TKO
TKO
is a command that will cause each byte of the program in
memory to be output to the console in an ASCII-HEX form. One
binary byte becomes 2 ASCII bytes. This command is used by the
program B51 to capture the program in Tokenized form to be put
on an Eprom using an external Eprom Programmer such as the
GTEK model 9000. This command should not be issued from the
console. It should be used from the "Enter Command Line" com-
mand within B51.
Example:
>^F
Chapter3 Model 2010B
Page 13

Enter Command Line —> filename [TKO< cr>
3.2 Differences In V1.1 Intel Basic Commands
3.2.1 Differences Caused by Ram Refresh
Ram refresh is handled in a top priority mode every 2 milliseconds
during the
TIMER1
interrupt. This will cause all calculations for the
BAUD, PWM
, every command that uses
TIMER1
, to be 79 machine
cycles longer. See the specific commands affected for differences.
3.2.2 Values for Basic Constants
MTOP = E000H
XTAL = 11,000,000 Hz.
TCON = 118
T2CON = 52
TMOD = 16
3.2.3 Sign on message:
GTEK, INC.
Model 2010 Basic 51
Version 1.1 b
>_
3.2.4 EE/Eprom Code Memory from 2000H through:
2864 EEprom through 3FFFH (8K).
2764 Eprom through 3FFFH (8K).
27128 Eprom through 5FFFH (16K).
27256 Eprom through 7FFFH (24K).
28256 EEprom through 7FFFH (24K).
In relation to the above, SAVE and ERASEwill not work with Eprom
for code memory. LOAD will load the program from Eprom to ram
to run.
Model 2010B Chapter3
Page 14

3.2.5 Unusable Intel Basic V1.1 Commands
These commands are still there, but use of them may cause you
problems because Eprom [EEprom] is at 2000H instead of 8000H.
RAM
—Hardware dependent. Use
LOAD
to load program into Ram
to
LIST
, etc., instead.
ROM
—Hardware dependent. Use
LOAD
to load program into Ram
to
LIST
, etc., instead.
XFER
—Hardware dependent. Use the
LOAD
command.
PROG,PROG1,PROG2,PROG3, PROG4,PROG5,PROG6,FPROG,
FPROG2, FPROG3, FPROG4, FPROG5, FPROG6—
Hardware de-
pendent. Use SAVE and ERASE instead.
UI0, UI1, UO0, UO1
—Do not use, hardware dependent.
RROM
—Hardware dependent. Use
LOAD
and
RUN
.
PGM
—Hardware dependent. Do not use.
3.2.6 Intel V1.1 Basic Commands Used Differently
a) The
BAUD
command must be modified. Use the following for-
mulae to calculate the Baud Rate for
List#
and
Print#
:
79 is number of machine cycles for refresh. 12/XTAL is period for 1
machine cycle= about 1.090909 uS. ABN is Actual Baud Number.
BRis the baud rate of the device to be output to:
or
ABN = 1 / ((1/baud) - (79*(12/XTAL))
Use the 2010 to calculate it for you:
>10 BR= 1200: REM FOR 1200 BAUD DEVICE<cr>
>20 ABN= 1/((1/BR)-(79*(12/XTAL)): ? ABN< cr>
>RUN< cr>
ABN= 1
1
BR 79 x 12
XTAL
()
—
Chapter3 Model 2010B
Page 15

1338
READY
>BAUD 1338< cr> : REM LIST DEVICE TO 1200 BAUD
You should not use baud rates lower than 600 Baud, because since
thesametimerfor RamRefresh isused for baud raterunning at300
baud (about 3.3 milliseconds), that is longer than the time between
refresh cycles. The ram could probably withstand the rate, but a
marginal Ram chip might not make it much longer than the 2
millisecond rate specified for that chip. See Page 28 in the
Intel
8052AH BASIC
manual. The
Intel 8052AH Basic manual
is an
optional purchase.
b) Do not use
CALL (0-127)
unless you are using an Eprom greater
than 8K and have provided the proper vectors. use
Call [integer]
instead. Page 29 of
8052AH BASIC
manual.
c) The
PWM
statement (Page 62 of
8052AH BASIC
manual) will run
differently, due to the Ram Refresh having higher priority. The
minimum valid number usable for the number of clock cycles the
wavewillremainhighorlowisstill25,butsinceaRamRefreshCycle
will occur for every transition, you must figure that there are ap-
proximately 79 additional machine cycles added to the number of
machine cycles you use for the
PWM
statement.
PWM 100,100,1000
would generate 1000 cycles of a square wave
that has a period of (100mc + 79mc)* 2 * 1.0909us = 390uS on
P1.2 (2560 HZ). It is not possible to obtain the same frequency as
on page 62 because the number that you would use for mc would
be Machine Cycles = (217us/(2*1.0909us)) - 79 = 20, which is too
low to use in thePWM statement since 25is the minimum. Referring
to the program on page 173, use the one following instead:
10 PRINT"1= FREQUENCY FOR PWM"
11 PRINT"2= RELOAD FOR FREQUENCY"
12 PRINT"3= QUIT -",
14 INPUT A
20 IF A= 1 THEN GOSUB 30 : A= 0
22 IF A= 2 THEN GOSUB 110 : A= 0
23 IF A= 3 THEN END
24 GOTO 10
30 T= 12/XTAL
Model 2010B Chapter3
Page 16

40 C= 79
50 INPUT "ENTER RELOAD OR 0 TO RETURN - ",B
60 IF B= 0 THEN RETURN
70 A= 1/((B+ C)*T*2)
80 PRINT "FREQUENCY IS",
90PRINTUSING(#####.###),A: PRINT
100 GOTO 50
110 T= 12/XTAL
120 C= 79
130 INPUT "ENTER FREQ. OR 0 TO RETURN - ",A
140 IF A= 0 THEN RETURN
150 B= ((1/A)-(C*T*2))/(T*2)
155 PRINT "RELOAD VALUE IS ",
156 D= INT(B): D= B-INT(B): IF D.5 THEN 160
157 B= B+ 1
160 PRINT USING(####),B: PRINT
170 GOTO 130
Thelowest reloadvalueyoumayuseis25(asperthe
8052AHBASIC
manual). The largest you should attempt to use is 835 due to the
Ram Refresh Rate.
d)
PCON, RCAP2, T2CON, TCON, TMOD
Probably should not be
used at all, or with extreme caution. If you modify or assign any
variables to these registers, you might damage the Ram Refresh
ISR and / or the Serial Communications.
e)
TIMER0 (RTC- CLOCK1), TIMER1 (Ram, PWM, LIST#), TIMER2
(Serial Baud Rate Generation), Probably should not be used at all
or with extreme caution. If you modify or assign any variables to
these registers, you may damage the Ram Refresh ISR and/or the
Serial Communications.
—Notes—
Chapter3 Model 2010B
Page 17
Table of contents
Other G-Tek Motherboard manuals