Down-Line Loading On Hero Robot
Down-Line Loading On Hero Robot
Research Online
Department of Computing Science Working Paper
Series
1984
Recommended Citation
Fulcher, John, Down-line loading on hero robot, Department of Computing Science, University of Wollongong, Working Paper 84-13,
1984, 39p.
http://ro.uow.edu.au/compsciwp/9
ABSTRACT
-2TABLE OF CONTENTS
1.
Background
2.
Introduction
3.
4.
5.
6.
Additional Facilities
6.1
Up-line Save
6.2
7.
Acknowledgements
8.
References
LIST OF FIGURES
Fig.la
Fig.lb
Fig.2
Fig.3
ACIA Registers
APPENDICES
Appendix 1
Appendix 2
Appendix 3
Appenidx 4
-31. Background
During July 1983, the Department purchased an ET-l8 Educational Robot from Heath
Center in San Francisco, U.S.A.. The robot came in kit form, and was subsequently assembled in
August of 1983. Several minor problems manifested themselves both during assembly and after,
these being documented in some detail in Appendix I.
The main problems arose from Hero's power supply circuitry; two of the four 6V rechargeable batteries have been replaced to date (the Institute Sector, who purchased a Hero robot at the
same time, experienced even more difficulty, when the 6V battery mounted in Hero's head leaked
its contents!). A serious design flaw became apparent during our investigations into these power
supply problems, namely:- if the batteries discharge to below their 'la-voltage' setting, then the
lower their charge becomes, the higher their rate of discharge (i.e. this inbuilt 'downward spiralling' effect acts as a 'self- destruct mechanism'!). A local modification, whereby Hero switches
itself into 'SLEEP' mode upon detection of a 'la-voltage' condition, has been added to overcome
this problem.
Another problem was encountered with the Arm stepper motor; phases had to be swapped
in order to make it work.
Other major design oversights include the possibility of driving Hero's arm below ground
level when pointing vertically downwards (item 28 in Appendix 1), and the lack of touch sensors,
so that Hero wi! continue to (attempt to) drive through obstacles which have not been detected
with its Sonar sense circuitry (ultrasonic ranging only being good for large, flat surfaces such as
walls etc.).
Such design oversights are unusual in Heath products, as are the numerous minor errors in
printed circuit boards, component values and documentation encountered with Hero (see Appendix 1). It appears as though Heath were too intent on rushing into the marketplace with a
'personal/hobby robot' - the latest growth area - to such an extent that their characterisitic
thoroughness and attention to detail were compromised to some extent.
2. Introduction
As mentioned earlier, Hero is powered by four 6V sealed rechargeable batteries. Two of
these constitute the motor drive power supply, the other two the logic circuit power supply. Hero
can be run either from these batteries or by using the battery charger.
Hero's drive motor is a permanent-magnet D.C. type. A shaft encoder disk and associated
sensor are fitted to the main drive wheel, and together provide an indication of the wheel's position. All other motors are stepper motors (viz. steering, head, arllL...pivot, arm_extend,
wrist_pivot, wrist--..J'otate, gripper).
The single-board microcomputer controlling Hero comprises a Motorola 6808 c.p.u. (6800
+ internal clock generator/driver - or alternatively a 6802 without the 128 bytes of internal
RAM), 8Kx8-bit Monitor ROM (MCM68764) and 2Kx8-bit User RAM (2 x 6116).
A separate I/O board is used to interface the c.p.u. to Hero's motors, sensors and other
I/O devices. Hero's sensors comprise a timer/counter, light-dependant resistor, sound transducer
(loudspeaker), motion detector (ultrasonic transmitter/receiver) and ultrasonic ranging device.
The other I/O devices comprise a hexadecimal keypad, 7-segment display, voice synthesizer, lowbattery indicators, 'abort' button, 'sleep' switch and cassette interface.
Hero powers up in 'Executive' or 'Robot Language Interpreter' mode (although it can be
run in the faster 'Machine code' mode if so desired). The teaching pendant can be used in either
'manual' (key-4) or 'learn' (key-7) mode; in 'learn' mode, Hero will remember the various movements and is capable of repeating them at some later stage.
3. The need for Down-line Loading
At the time of writing, the Department's Microcomputer Laboratory consisted of several
Heathkit ET-3400 Microprocessor Trainers. These trainers are based on the (8-bit) Motorola
M6800 c.p.u. (moves are currently underway to upgrade the Microcomputer Laboratory to support the (16/32-bit) Motorola MC68000 for 1985). The ET-3400 trainers have been extended via
a motherboard/backplane to allow various experimental cards to be inserted for different experiments. One such experimental card - a 'Master Card' - contains a System Utility in EPROM
form. Included in this Utility are a transparent link to the host Unix operating system, and a
-4down-line load facility fron Unix to the ET-3400. Hence programs can be developed under Unix,
assemled using the 'mac' general-purpose cross- assembler, and then down-line loaded to the ET3400 trainers.
As it stands, the only facility for saving programs developed on Hero is via the audio
cassette interface. A decision was made to enhance the usability of Hero, by providing a similar
down-line load facility from Unix as exists on the ET-3400 trainers.
4. Implementation of Down-line Loading -Hardware
Hero's c.p.u. board comes fitted with a spare 24-pin socket (U417), which can support 2K,
4K or 8Kx8-bit ROM's. Since Hero's c.p.u. (6808) is compatible with the ET-3400 trainers (6800),
and moreover since the ET-3400 Expansion Utility resides in a 2716 2Kx8-bit EPROM, it was
decided to simply use this same Utility (with appropriate modifications) on Hero. (In order to
strap U417 to support 2716, jumpers J7 and J9 need to be connected).
In order to send data to (from) Unix, a parallel-to-serial (serial-to-parallel) conversion has
to take place, and moreover such serial data has to be buffered to produce RS232c-compatible
signals. This was achieved on the ET-3400 trainers using Motorola M6850 Asynchronous Communication Interface Adaptors (ACIA's) and MC1488/9 drivers/receivers. MC1488/9
drivers/receivers were again chosen for Hero, whereas Synertek SY6551 ACINs were preferred
over the M6850's used on the ET-3400 trainers. (SY6551 ACIA's had proved more versatile in a
Cambridge Ring Terminal Multiplexer application - in fact Synertek tout the SY6551 as an
enhanced version of the M6850 viz. on-chip programmable baud-rate generator, additional (command) register etc.).
Figure la shows the components added to Hero in order to provide Down-line Loading the additional components are shown in bold face. lO-way connector pins are provided on Hero's
c.p.u. board to facilitate expansion of the existing system, viz.:
P406 - I : decoded $4000-5FFF address range
- 2 : decoded $6000-7FFF address range
- 3 to 10 : address bits A7 to AD
N07 - I : *RESET
- 2: *R/W (which needs to be inverted back to R/*WI)
- 3 to 10 : data bits D7 to DO
N08 - I : decoded $8000-9FFF address range
- 2 : decoded $AOOD-BFFF address range
- 3 to 10 : address bits Al5 to A8
Ribbon-wire is run from these three connectors to the Down-line Loader Wire-wrap Board as
shown in Figure lb.
There are two signals which don't appear on these lO-way connectors, namely 02(E) and
*IRQ. Individual wires had to be run from the appropriate 6808 c.p.u. pins (37 and 4 respectively) to the connectors on the Down-line Loading Wire-wrap Board.
The MCl488 line driver requires a -12V supply, and this is derived from the + 12V supply
rail using a Signetics NE555-based positive-to-negative voltage converter (actual measured opencircuit voltage was more like -11 V, which is still plenty to drive RS232c signals over the distances
involved in this application ).
Figure lb also gives the crystal oscillator circuit used to drive both ACIA's. Also shown in
Figure lb is the layout for the Down-line Loader Wire-wrap Board.
25-pin RS232c connectors are connected to the Down-line Loader Wire-wrap Board via 16pin d.i.p.-header sockets (in order to make them compatible with the ET-3400 expansion board).
These 25-pin D-type connectors (female from Unix; male to the terminal) are mounted on either
side of Hero's rear control panel. A floating laboratory 'curly cord' connects directly from its
wall-mounting socket to the female 'Unix' D-type connector, and a female-to-male extension
cable from the rear of a laboratory terminal to the male 'terminal' D-type connector.
-5-
-6-
5- - - - - - - - - . :6:::..jf
VNAr:-
---no
CHIP SELL
00 75
dL{)S~l~j:
I I-~
170
A15 25,...2
(from U414C
lJ
s.Af!1
,.....
72 1
'JO
4~"
/2716]
R0t1#2
Pf!08
164
-'18
lr4' -$8COO-9Fff
m18~-+- _ _-t--t-'"=-~:_:tA_OOO_-8_FF:_F-+++++++++++-++-+-+-+-+-+-+-",~
~ U402I.1;f-----++--t+l-----+++++++++-+-+-+--H-+-+-H~~~
,-' LS244t-7------+-+---t<>t-----+-+++++-+-+-f--,I--+--+-+-++++++,.....
A8
~----+-+-_te+---_+_++++_I_+_++_I_+--+-+-+-+-+-+-+~~
~----++-_+_t----+++++++++-e---++-+++-+-+--+---
i-"'-----+-t----:-::-i4+----++-+-+-+-++-++---+-+-+-+-+-+-+-+---
--'
10
1llf4l.2J
~
1 ..... Z4000-
A7 16".-2
'--~$5FFF ---.---+-+-+-+-+-+-t-+----t-+--1f-H~H--...
1'7.18;.--
U401
U404
~_--+--+++++-_---+-+-+-++-++_+_+
I-';!'--
:--'
..-" 15244~-------t-<~---1--+--+-+------+-t--1r+++-+-':--rl
116808
'---':
AO ---'
10 "-
1l1f4lJ
P406
IRt1r4_ _7
....-++-
11
.--:.7~O'+_7+_L-S-O-4-__.._++--++++++++_++
3_
7 --------1'-t-i-+------+-t----~++--_t_+_+_t_+_+-+-+_++
(J!)2) E r-
DO F=;3.:;.,3_ - - t.....
4-/------t--t-i-+-t---------+-t----++-+-+-+----t--+-+-t-f-t-f-H'
D7
?t
.17
A-1
~ - ~4
-#:l AW7"""'fu:.
RE~;~ U424A
1!4
'RES 02 RSO DO
D7 2
SY6551-A
[unix}
~_--J40
98
tfSR
cSld-
177 9
"""'-/ .......,.,
XTAL
CSOF-
'V7
12 10
14 ~8.?)~ ~ 4
"", 918
I
l1i ~/k IRQ RS1 DO
D7 2
I
__ ~
S Y6551 .. a CSOF-----' I
1
[tty]
[51 3
J
tJSR ITS 1JITJ RxO TxD
__
16-pin D.I.R
HEADERS
.
11
I~
77
,tf
10
-c::::::;7
~ ~0177l72
6
:~~~ 1~'-t(~(",.-t"l/ ~[1488 lH. /~/" ~~
2
11Q 12
17 9
""" ...........
(i.f1489
13 I
'70
L?'-- I r - - - - - - - - - '
~
2 16 5 3
2 16 5 3
I
fROM
UNIX
-I
\2 3
I
J
TO
720jTERMINAL
TX RX ~DTR
(male)
fii,
Vee (12V)
O'5mSec
V~( '1:~lJl
1K
7
"---'1
33K
:ES
DISCH O/P~3
f= 1-49/(RA+2RB)[
= 2-22 kHz
lN4148
100uf
-;+ \---..---<t---1C
NE555
6
""'---'1 THR
2
CON
"'-""-iTRJG {j
O01uF
1
1N4148
100uF
O.OluF
(ref. p.729 Signetics Analog Data Manual)
1-8432 HHz
01------.
to X TAU input of
5Y6551'5 (viz. pin-6)
74L S04
150pF
100
--en-
1K 33K
0 nOn nDo-m
10K~1N4148 V~
510
-e=J- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - oOV to P405-.
ILS04)
----- SY6551-A
I XTAL I
c:::l
150PF
SY6551-8
( tty)
(unix)
~ 11488 )
- - - - - - - - - -
1555J
Riw IRQ
$4000
t-r--.-rTt-r-I""'lI+TTT'rh~r7l
~'
to P406
to P407
ET-3400 EXPANSION:
0000
USER R.A.M.
(197 bytes)
00C4
00[5 59 byfes reserved
for MONITOR
OOFF
0100 (optional) USER
01FF R.A.M. (256 bytes)
8000 PI.A.
8003
8080 PI.A.
8083
8100 PI.A.
A-I.e.d.'s
keyboard
rows/column 5
8200 MUSIC
8207
8280 MUSIC
A - tur fie aP
2000
timer - A
timer - B
tx/rx dafa
KEYBOARD
(2Kbyte) ADO/TIONAL
2800
)
3FFF ( at $2000
4000 TRANSPARENT
LINK
A.CI.A.
5FFF ADDRESS1NG
6000
7FFF
8000
9FFF
AOOO
BFFF
[000
[003 KEYBOARD
[110
DISPLAY
[200
[220
C2AO
[300
[FFF
in
I}
}
}
decoded on.
P406
P406
P408
P408
11 0 pori,
DOOO
DFFF
fOOD
(8K)
MONITOR
R.O.H.
DI SPLAY
pin - 18 --7'-J 2
(R.O.H. # 1 )
(not useable)
(FOOO)
pin-20~) 12
(redundant conditions)
(due to 2716 strapping)
(not useable)
C1FF
pin-18 -?-) 7
pin-21-."",.J9
L1NKI UTILITY
B -turtle i/p
[000
[003
rOOF
[110
[170
jUffiRers:
A music
B -bar code
8287
AOOO
(re5erv~d for)
0000
MONITOR
003F
0040 USER R.A.M. # 1
(6116)
07FF
0800 USER R.A.M.1I2
(6116)
OEEO
(reserved
fof')
OEFD
MONI
TOR
OFFF
B-'7:-seg.
8180 PI.A.
8403
HERO fET-18l:
----------
pin -21 ~J t.
(ItK)
---------(FBOO) (2K)
FFFF
pin - 20---J6
ACIA
REG. IRS)
SELEC T SELEC
A15
I 1 01
13
12
11
10
t
8
01 0
TERMUX
SY6551:
A1
AO
$81,.01 .
Tx I Rx Data
$8402:
$8403:
TxlRx Data
AUA SELECT
A 15
14
13
12
11
10
....-----A----7
6
RS1
AC lA-A
unix
ACIA-a
tty
RSO
A1
A0
write reiJ{j
TxlRxDat d
0
o
0
1
0
o
resetls tatus
commilnd
control
A1
(strappable)
14
13
12
11
10
($4000-5FFF decoded)
(
)
on P406-1
bit-?
IRQ
REGISTER
6
5
4
bit- 0
parity Rx fram.
TxD RxD
error olrun error CTslDCD empty fu (f
CONTROL
blt-7 6
REGISTER
5
4
0
0
AU A - A
unix
AUA-S
unix
ilY
4000
4001
4004
4005
Data reg.
Status reg.
4002
4006
CommiJnd reg.
4003
4007
Control reg.
STA TUS
bit-?
6
tty
bit- 0
IRQ DSR
CONTROL
bit-7
6
0
bit- 0
COMMAND
bit-7
6
REGISTER
5
4
3
2
o
norm; Tx in is. disa~ IRO DrR
parity check
I/echo) RTS low' disab ready
APPENDIX
November 3, 1983
MRJaiN FOICHER
THE UNIVERSITY OF
V\O~G
r;I:'.!
.,I
'
Lt.=on Cray
Service Supervisor
LC:ta
Heathkit'
"
(;'7
P. O. Box 1144
Wollongong N.S.W. 2500
Australia
Telephone (042) 297311
Telex 29022
Cable Uniofwol
In Reply Please Quote:
JF:seb
Dear Sir,
In July of this year,' this University purchased two ET-18 "Hero"
Robot kits from the Heathkit shop, Redwood City, California, complete
with arm and voice options.
I thought you might appreciate some feedback on d~fficulties/
problems we encountered during the course of assembling these Robots.
Documentation we received as part of the above kit consisted of
the following.
(i)
(ii)
(iii)
(iv)
(v)
(vi)
(vii)
As you can see from the above, we did not receive revisions for the
Assembly Manual, and this might explain some of the difficulties encountered, towit:
1
2.
Over illld above these minor errors, two of these single-sided P.C.B's
should really be re-designed to incorporate "add-on" components onboard, rather than soldered to the foil side of the boards as at
present, namely C6l6, D601 and D602 on the Sense Circuit Board
and D707-11, D7l6-9 on the Arm Drive Circuit Board.
3.
4.
5.
6.
7.
8.
9.
10.
p.13l Assembly Manual - the 8.32 setscrew pin does not belong in pack
#14; it is used in assembling the Robot's head and therefore should
by rieJhts appear in Pack #15.
11.
13.
14.
P.196 Assembly Manual - why install both 8-32 x 1/4" allen head setscrews, when on the next page one has to be replaced by a 8-32 set
screw pin (the one left over from Pack #14)7
15.
16.
P.222 Assembly Manual - it was found that both R202 and R225 had to
be adjusted to their full extent in order to achieve 5.2V, let alone
the desired 5.6V; perhaps consideration should be given to altering
the values of R201 and 1<224 from lK, in order to provide some
proper adjustment in the above two controlsI'
17.
18.
1.9.
reset"
. .... /3
20.
P.229 Assembly Manual - it would be a good idea to adjust the sonar 'I'X
for maximum input on the sonar RX before running this sonar test
proqram, ~ la p.48 of technical manua:l(Lhis would avoid unnecessary
"troubleshootintJ" of a sonar system which is in fact fully functional!).
21.
22.
23.
p.B Voice Manual - Why secure the speaker baffle with masking tape
or a staple (its adhesive backed, after all)?
24.
P.2 Voice Dictionary - it might be helpful to add two notes here, viz.
(i) 20FE is "J2..0t an address which this speak program jWllPS to/waits at
after completing its speech, but rather 20FE is a 'Ei800-assembly
instxuction (branch relative - to itself, vi21 an infinite loop).
In order to link speech routines to other program routines, have
to replace this by 7E (AD DR) - viz Jwnp extended to the next
:t"outine.
(il) 'fhe Hex codes shown for the phonemes (& words) in this
dictionary are at the lowest of the four pitches possible; to
change individual phonemes to higher pitches, simply add 4~, 8.0
or C.0 to t_he basic hex code indicated.
25.
26.
P.G) 'l'f~chnical Manual - check for +SV at P201-11 should be +lV, surely"?
(see p. 223 of aSf:;embly manual).
27.
'1'he vertical mark on the side of the 'reaching Pendant rotary switch
0
knob is 180 out of phase from where it is intended to be.
28.
'I'he fact that the Arm can extend below grolUld level when pointing
vertically down would appear to be a design oversight.
29.
30.
Apart from the odd nut and washer, all components listed in the
Assembly Manual were supplied with both Robot Kits - the only
exception to this being the 12 and 15 hole connector
(JIO, J 9)
in one of the ki ts i they didn' t match t,he pendant and charger
plugs.
. .... /4
31.
blew
I trust the above COllunents prove helpful in any future changes you
might make to E'l'-18 Robot Hardware and/or documentation.
Yours faithfully,
John Fulcher.
/B/sys/usr/john/robots/herodl1.s Page 1
APPENDIX
,.*********************************************************************
;NOTE: Hero DOWN-LINE-LOADING/UP-LINE-SAVE is simply mjm's 68001ib.s
;Heathkit ET3400 expansion monitor, with minor modifications to run
ion ETl8 Hero Robot.(changes are indicated by a '*' in comment field).
;
John Fulcher 3.5.84
,.*********************************************************************
;This file contains the downline loader/transparent link and lots
;of nice 10 routines to make life easier.
;AII the routines are referenced through a three byte entry in a jump
;table at the beginning of the library. This jump table should remain
;inviolate although the actual routine may be changed or shuffled.
;
Michael Milway 22.11.83
,.*********************************************************************
;equates
;(note: herodll uses 6551 ACIA's rather than 6850 used on ET3400)
,
controlu
equ
contralt
equ
statusu
equ
statust
equ
equ
datau
equ
datat
monitor
equ
commandu
equ
commandt
equ
rxrdy
equ
txrdy
equ
;
;variable storage
Ox4003
Ox4007
Ox4001
Ox4005
Ox4000
Ox4004
Oxf37e
Ox4002
Ox4006
Ox08
OxlO
tempI
equ
addr
egu
coun t.
egu
addrconv
equ
;
;6800 I/O library
seg
org
jumptable
.transp
jmp
.unixinit
jmp
termini t
jmp
.putline
jmp
.getline
jmp
. ~lIr4
jmp
.wr2
jmp
,putchar
jmp
.getchar
jmp
jmp
.putc
.getc
jmp
jmp
.putu
jmp
.getu
jmp
.getword
jmp
.getbyte
jmp
.getaddr
OxlOO
OxlO2
OxI04
OxlO6
;used
;used
;used
;used
1
Ox2000
transp
unixinit
terminit
putline
getline
wr4
wr2
put char
getchar
putc
getc
putu
getu
get~"ord
getbyte
getaddr
by
by
by
by
;transparent link
;initialise unix ACIA
;initialise terminal ACIA
;send line to terminal
;get line from termninal
;send 16 bit hex number to terminal
;send 8 bit hex number to terminal
;send character to terminal
;get character from terminal
;send raw character to terminal
;get raw character from terminal
;send raw character to unix
;get raw character from unix
;get 16 bit word from unix
;get 8 bit byte from unix
;get modulo 16 bit address from
.tohex
.toascii
tolower
.ishex
.ls16
.wait
jmp
jmp
jmp
jmp
jmp
jmp
IB/sys/usr/john/robots/herodll.s Page 2
tohex
toascii
tolower
ishex
ls16
wait
;input buffer
;convert ascii character to hex
;convert hex digit to ascii
;convert upper to lower case character
;check to see if hex digit
;shift 16 bit reg AlB 4 bits left
;time waste loop
;The routines
,.********************
;transparent link
;downline loader
;upline save
;branch to user program
,.********************
DLE
CRTLA
;equates
equ
Ox10
equ
OxOl
,
,.********************
,
;initialisation
transp
dc
Ox83
jsr
jsr
.unixinit
.terminit
,.********************
,
;transparent link
reentry
;reentry point from load and save
testu
Ida
and
beq
jsr
c.mp
beq
jsr
a,statusu
a, flOx08 '
testt
.getu
a, flDLE
command
.pute
Ida
and
beq
jsr
cmp
beq
jsr
a,statust
a, flOx08
again
.getc
a, flCRTLA
exit
.putu
jmp
testu
testt
again
/B/sys/usr/john/robots/herodll.s Page 3
exit
Idx
jsr
jmp
Ilmesgbgn
.putline
monitor
,
,.********************
; command
command
jsr
.getu
and
cmp
beq
cmp
beq
cmp
beq
;insert
jmp
a,IIOx7f
a,II'B'
branch
a,II'L'
load
a,II'S'
save
;upline save
branches to other routines here
reentry
;not a valid command
,.********************
;branch under unix control
branch
jsr
swi
.getword
jmp
O(x)
,.********************
;downline load
load
jsr
stx
jsr
stx
.getword
addr
.getword
count
jsr
Idx
sta
inx
stx
Idx
dex
stx
bne
jmp
;return
.getbyte
addr
a,O(x)
Iaad2
reenrty1
addr
count
;one less to go
count
load2
;i count not zero get next byte
reentry
to transparent link
/B/sys/usr/john/robots/herodll.s Page 4
,.********************
;
;upline save
jsr
stx
jsr
stx
.getword
addr
.getword
count
ldx
Ida
and
ror
ror
ror
ror
add
addr
a,O(x)
a, tlOxiO
a
a
a
a
a, {,lOx20
jsr
jsr
Ida
and
add
jsr
jsr
inx
stx
ldx
dex
stx
bne
jmp
.putu
.getu
a,O(x)
a, tlOxOf
save
;get byte count
savel
;high order nibble
a,IIOx20
.putu
.getu
addr
count
count
savel
reentry
;more to send?
mesgbgn
de
"\r\nHERO MONITOR.\O"
;unixinit
intialise unix ACIA
; inputs:
none
;outputs:
none
;calls:
nothing
;destroys:
A
;*NOTE: 6551 ACIA used rather than 6850, as on the
;* Heathkit ET3400 expansion
unixinit
Ida
sta
a,statusu
Ida
sta
a,commandu
Ida
sta
rts
a,110xOO
a,1I0xOb
a,110x18
a,controlu
;********************
/B/sys/usr/john/robots/herodll.s Page 5
a,IIOxOO
a,statust
a,IIOxOb
a,commandt
Ida
sta
rts
a,IIOx18
a,eontrolt
,
,.*******************
,
;getline - get a line of text from terminal
;inputs:
X = start of buffer
X = end of string
;outputs:
getchar, putchar
;ealls:
;destroys:
A
getline
stx
tempI
jsr
cmp
bne
.getchar
a,-It'@'
getlin.3
kill?
ldx
Ida
jsr
bra
tempI
a,fI'\n'
.putehar
getlin.l
cmp
bne
Ida
jsr
Ida
jsr
dex
cpx
bpI
Idx
bra
a,lt'\b'
getlin.5
,
a, -It'
.putehar
a,1r\b'
.putehar
erase?
getlin.l
get next input char
getlin.3
tempI
getlin.l
tempI
getlin.l
getlin.5
sta
inx
cmp
bne
elr
rts
a,O(x)
a,-II'\n'
getlin.1
O(x)
x points to buffer
bump pointer
end?
no loop for more
nul at end of str
/B/sys/usr/john/robots/herodll.s Page 6
,.*******************
,
; putline - send string, null terminated, to the terminal
X = addresss of string
;inputs:
none
;outputs:
putchar
;calls:
A,X
;destroys:
putline
Ida
bne
rts
a,O(x)
putl.l
putl.I
lnx
jsr
bra
bump ptr
.putchar
put line
,.*******************
;getchar - get a character from the terminal
;inputs:
none
;outputs:
A = character
putchar, getc
;calls:
A
;destroys:
getchar
getch.O
jsr
cmp
bne
Ida
jsr
.getc
a,II'\r'
getch.O
a,II'\n'
.putchar
no!
echo
rts
,.*******************
putch.O
psh
jsr
pul
cmp
bne
Ida
jsr
Ida
rts
a
.pute
a
a,II'\n'
putch.O
a,II'\r'
.pute
a,II'\n'
,.*******************
;getc - get raw character from terminal
;inputs:
none
;outputs:
A = character
;calls:
nothing
save character
write it
fetch
NL?
no
echo CR as well
was NL
/B/sys/usr/john/robots/herodll.s Page 7
;destroys:
gete
Ida
and
beq
Ida
and
rts
a,statust
get status
a,llrxrdy
getc
a,datat
a,IIOx7f
,.*******************
save
Ida
and
beq
pul
sta
rts
a,statust
a,/ltxrdy
putc.1
a
a,datat
status
putc.1
not ready - wait
get data
write
,.*******************
addr
addr+1
addrconv
Ida
jsr
beq
inc
Ida
Ida
jsr
sta
sta
Ida
inx
jsr
ora
sta
bra
a,O(x)
.ishex
getadr.r
addrconv
a,addr
b,addr+1
.ls16
a.addr
b.addr+1
a.O(x)
get character
is hex digit?
no
mark conversion made
.tohex
a,addr+l
a,addr+l
getadr.1
convert char
or in new digit
Ida
a,addrconv
address converted?
save area
getadr.1
getadr.r
/B/sys/usr/john/robots/herodll.s Page 8
rts
,.*******************
;wr4 - write four digit hex number
;inputs:
X = number
;outputs:
none
wr2
;calls:
nothing
;destroys:
wr4
psh
stx
Ida
jsr
Ida
jsr
pul
rts
a
tempI
a, tempI
.wr2
a,templ+l
.wr2
a
save a
store for later
get hi byte
get 10 byte
restore
,.*******************
a
a
a
a
a
.toascii
.putchar
a
a,tlOxf
.toascii
.putchar
convert to ascii
restore
,
,.*******************
,
,
; tolower - convert upper case character to lower case
;inputs:
A = character
;outputs:
A = character
;calls:
nothing
;destroys:
A
tolower
tolwr.O
cmp
bls
cmp
bhi
add
rts
a,II'A'-I
tolwr.O
no
a,II'Z'
tolwr.O
a,It'a'-'A'
;*******************
no
yes
/B/sys/usr/john/robots/herodll.s Page 9
a,119
toase.1
add
a,II'A'-lO
a,rO'
just digit
toase.2
toase.l
letter
toasc.2
rts
,
,.*******************
,
tohex
tohex.l
sub
add
a,II'a'
a, III 0
letter
tohex.2
rts
,
,.*******************
,
;ishex - check if hex digit
A = digit
jinputs:
;outputs
A = 0 if false
;A = 1 if true
tolower
;calls:
A
;destroys:
is hex digit?
ishex
.tolower
jsr
cmp
bls
cmp
bis
cmp
bis
cmp
bis
ishex.no
a,II'9'
ishex.yes
a,II'a'-l
ishex.no
a,II''
ishex.yes
Ida
bra
a,IIO
ishex.l
a,II'O'-l
ishex.no
/B/sys/usr/john/robots/herodII.s Page 10
ishex.yes
ishex .1
rts
,
,.*******************
;ls16 - shift 16 bit number in A/B 4 bits left
;inputs:
A high order byte
B low order byte
;outputs:
A = high order byte
B low order byte
;calls:
nothing
;destroys:
nothing
ls16
asl
rol
as1
rol
asl
rol
asl
rol
rts
b
a
b
a
b
a
b
a
,.*******************
wai t
,.********************
;getu - get char from unix
;inputs:
none
;outputs:
A = char
;calls:
nothing
;destroys:
A, flags
getu
Ida
a, Ilrxrdy
bit
beq
Ida
and
rts
a,statusu
getul
a,datau
getu1
a,flOx7f
,
;********************
;putu - send char to unix
IB/sys/usr/john/robots/herodll.s Page 11
;inputs:
;outputs:
;calls:
;destroys:
A = char
none
nothing
nothing
putu
psh
Ida
a
a,lltxrdy
bit
beq
pul
sta
rts
a,statusu
putu1
putu1
a,datau
;sendchar
,
,.********************
;getword - get a 16 bit word from unix
none
;inputs:
X = 16 bit word
;outputs:
byte
;calls:
A,B,X,flags,templ
;destroys:
getword
jsr
sta
jsr
sta
ldx
rts
.getbyte
a,templ+l
.getbyte
a, tempI
tempI
,.
,.********************
.getu
a,IIOxOf
a
a
a
a
;save in B
.getu
a,1I0xOf
leader
)c
,yt e
lord
Ic
Ic
pre
8
APPENDIX
a: 16
a:8
a:8
a
b
lefmt
.i
laC
OxOO
"ET-IS HERO ROBOT"
.iterals
rgs
xpr(x)
expr
xpr
xpr,expr
xpr,expr,expr,expr,expr.expr,expr
,expr(x)
,expr(x)
,flexpr
,Itexpr
,expr
,expr
{
{
{
{
{
{
{
{
{
{
{
{
{
ObOOl0
ObOOl0
ObOOl0
ObOOl0
ObOOl0
ObOOl0
ObOOl0
ObOOl0
ObOOl0
ObOOl0
ObOOl0
ObOOl0
ObOOl0
0
0
0
0
0
a
a
a
a
0
0
0
0
2 1
4 2
3 0
11 4
12 5
6 0
9 a
5 a
8 a
7 2
10 2
0 0
1 0
ormats
0:8
0:8a:8
0:8a:16
0:8pa:8
0:8a:8b:8
o:8a:8b:8c:8d:8e:Bf:8g:8
)codes
'.ass 13
1m o Ox02
an o Ox03
1m o Ox04
,p o OxOS
,b o OxOD
a OxOO
t
b o Oxoo
p o OxOO
o Ox21
0
x o Ox3a
d o Ox41
d o Ox42
o Ox45
r
:l o Ox4b
o Ox4e
~
i o Ox51
I o Ox52
I o Ox55
o OxSb
o OxSe
o OxOO
l
o OxOO
o OxOO
o OxOO
OxOO
OxOO
a OxOO
a OxOO
D OxOO
0 OxOO
0 Oxoo
o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re
bYte
8
2
a
word
de
de
APPENDIX
.-.-_._-~---.-
a:16
a:8
a:8
jefmt
OxOO
"ET-IB HERO ROBOT"
Li
nac
literals
I>
)(
Yo
args
expr(x)
Itexpr
expr
expr,expr
expr,expr,expr,expr,expr.expr,expr
il,expr(x)
b,expr(x)
il,lfexpr
b,ltexpr
'l,expr
J,expr
1
)
{ ObOOIO
{
{
{
{
{
{
{
{
{
{
{
{
ObOOIO
abOOIO
ObOOIO
OboaIO
ObOOIO
OboaIO
ObOOIO
ObOOl0
ObOOIO
ObOOIO
ObOOIO
ObOOIO
2 I
0 4 2
0 3 0
a 11 4
0 12 5
0 6 0
a9 a
a 5a
0 8 0
0 7 2
0 10 2
0 0 0
a I 0
Formats
0:8
0:8a:8
o:8a:16
0:8pa:8
o:8a:8b:8
o:8a:8b:8e:8d:8e:8f:8g:8
L
l
l
)peodes
:lass 13
ldm
Han
lam
ISP
)bb
)8 t
)ab
)SP
:ro
:tx
~ Id
~sd
~ur
~md
~ds
tid
isci
[md
lur
ids
:cn
:wn
ex
wx
o Ox05
o OxOO
o OxOO
o OxOO
o Oxoo
o Ox21
o Ox3a
o
o
o
o
o
a
o Ox42
o Ox45
o Ox4b
o Ox4e
o
o
o
o
a
a
o Ox41 o
o Ox5l
o Ox52 o
o Ox55 o
0 OxSb o
0 OxSe o
0 OxOO o
0 OxOO o
0 OxOO o
0 OxOO o
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
2 OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
2 OxOO
2 OxOO
2 OxOO
2
2
2
2
2
2
0
0
0
0
0
3
3
0
0
OxOO
OxOO
OxOO
OxOD
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
0 OxOO 2
0 OxOO 2
0 OxOO 2
o OxOO 2
o OxOO 2
o OxOO 2
3 OxOO 2
3 OxOO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xOO
2 OxOO
2
3
2
2
2
2
2 OxOO
3 OxOO
2 OxOO
2 OxOO
2 OxOO
2 OxOO
2 OxOO
2 Oxb2 1
2 Oxb4 1
2 OxbS 1
2 Oxb6 1
2 Oxb7 1
2 Oxb8 1
2 Oxb9 1
2 Oxba 1
2 Oxbb 1
2 OxOO 2
2 OxOO 3
2 OxOO 2
2 OxOO 2
2 OxOO 2
2 OxOO 2
2 OxOO 2
Oxe2
Oxe4
OxeS
Oxe6
OxOO
Oxe8
Oxe9
Oxca
Oxeb
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
Oxe2
Oxe4
OxeS
Oxe6
Oxe7
Oxe8
Oxe9
Oxea
Oxeb
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
Oxf2
Oxf4
OxfS
Oxf6
Oxf7
Oxf8
Oxf9
Oxfa
Oxfb
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
OxOO
4 OxOO 5 OxOO
4 OxOO 5 OxOO
4 OxOO S OxOO
4 OxOO 5 OxOO
4 OxOO 5 OxOO
4 OxOO 5 OxOO
4 OxOO 5 OxOO
4 OxOO 5 OxOO
4 OxOO S OxOO
4 OxOO 5 OxOO
4 OxOO 5 OxOO
4 OxOO 5 OxOO
4 OxOO 5 OxOO
4 OxOO 5 Oxoo
4 OxOO 5 OxOO
4 OxOO 5 OxOO
1. Powering Up
The Heathkit ET-18 'HERO 1.0' Robot is powered by four 6V rechargeable dry cell batteries, two of which power the motor drive circuitry, and two the electronics. Hero can be run
using either batteries only or by using the battery charger (plugged into the appropriate socket in
its rear panel), however it is imperative to always ensure:
*(i)*
Hero is NEVER moved from point to point with the battery charger still connected
(although its head and arm can be safely moved without any danger of dragging the
power supply around after it!), and
*(ii)*
The battery charger is NEVER left connected to Hero and switched OFF (this provides a
discharge path whereby Hero's batteries will run down completely if left long enough).
i.e. the battery charger's red 'power' I.e.d. should ALWAYS be on when connected to
Hero. (The charger's white 'charge' I.e.d. mayor may not be on, depending on how
much current is being drawn by Hero's batteries viz. how charged/discharged they are).
After you've finished, you SHOULD ALWAYS PLUG THE BATTERY CHARGER IN
AND SWITCH ON, so that Hero has a chance to charge up before the next user comes
along.
When power is applied to Hero, or the RESET key is pressed, it comes up with 'HERO 1.0'
displayed on its 7-segment I.e.d. displays, and says 'READY' (and after IO seconds the display
changes to a moving '-' prompt, in order to conserve power).
2. Executive Moue
Hero powers up in 'Executive' or 'Robot Language Interpreter' mode; further key presses
will change the mode of operation, as follows:
1 - Program mode
3 - Utility mode
4 - Manual mode
7 - Learn mode
A - Repeat mode
Hero can be made to move around, using the teaching pendant, in either 'Manual' or 'Learn'
mode.
3. Utilities (key 3)
[ref. p.l7 ET-18 Robot User's Guide]
A total of 8 utilities are provided, namely:
31 - Initialize
32 - Home (to initial position)
33 - Download to cassette
34 - Uploading from cassette
35 - Set time-of-day
36 - Set date
-2-
37 - Display time-of-day
38 - Display date
4. Moving Hero around
Before attempting to move Hero around, it is necessary to initialize it (otherwise the Hex
digits on the display and the postions of the various stepper motors bear no relation to each
other). Thus the very first act after powering up should ALWAYS be to INITIALIZE Hero (31).
Once Hero has been initialized, it is only necessary to use 32 (or the HOME command) on subsequent occasions (provided Hero has not been powered down in the meantime).
Make sure the TEACHING PENDANT is plugged into the appropriate socket in its rear
panel before you attempt to move Hero around! The FUNCTION switch selects either 'ARM' or
'BODY' movements, and the ROTARY switch selects which particular movement, namely (clockwise from left to right):
ARM:
(i)
(ii)
head/extend/arm_pivat
(neutral)
wrist_pivot/wrisLJotate/gripper
BODY:
fast_reverse/medium_reverse/slow_reverse
(neutral)
slow_forward/medium_forward/fast_forward
None of these movements will be activated unless the TRIGGER switch is held in. Moreover, in
order to execute head/arm movements or to STEER Hero left or right, the MOTION switch
ALSO needs to be switched to its LEFT or RIGHT position. In order to CENTRE Hero's steering wheel, simply hold the TRIGGER switch in without operating,the (left/right) motion switch.
NOTE:
(i)
Hero does not posess touch sensors, only sonar, and as such is prone to running into
table legs etc. (i.e. small, non-flat surfaces), and will CONTINUE to try to drive
through such obstacles! It is up to the operator to ensure that this does not happen (the
RESET and/or ABORT keys are handy as a last resort!).
(ii)
If Hero is to be used to trace out a particular path REPEATEDLY, it must be oriented
at EXACTLY THE SAME starting point each time (otherwise small errors will accumulate into large ones and it could start running into walls etc. where it wasn't beforehandl).
5. Learn Mode
The techniques just mentioned for moving Hero around can be done in either MANUAL
(4) or LEARN (7) mode. In MANUAL mode, the 7-segment l.e.d. displays will indicate both
motor number and position as that particular motor is activated. In LEARN mode, you will need
to provide two memory addresses (start an,d finish), indicating what portion of memory you are
allocating for storage of movements. Hero's 7-seg. display will then show:
7.F .xxxx
(where xxxx = start address + 8 bytes)
The display will be updated each time the trigger switch is RELEASED, indicating what memory
location has now been reached. (Note that in order to conserve memory, only release the trigger
when you want to CHANGE to a DIFFERENT function. i.e. presses and releases of the trigger
switch will consume memory locations - even if you are driving the SAME motor).
If you've made a mistake with the last movement, you can press 'B'(ackup) and Hero will
automatically reverse the movement you've just made, pause (and keep on backing up through
previous movements) until you press the 'F'(orward) key. If you want to SAVE these backup
movements as part of your sequence, then press '7'(reverse-the-instruction) rather than 'B' - an
'r' will now appear where 'F' was displayed previously as you step back through the movement(s)
(and pressing the 'F'-key will set up Hero ready to move forward again).
Pressing keys in the following order will now run the program you've just stored:
-3-
RESET
A(uto) D(o) xxxx (starting address)
(Note that Hero will home to the position it had PRIOR to entering 'learn' mode BEFORE it
begins executing the sequence of movements you've just programmed in).
[ref. p.23 ET-18 Robot User's Guide]
6. Saving Programs
There are two facilities for saving/loading programs to and from Hero, the first involves
using an audio cassette recorder and the second an RS-232C Unix link.
(i)
CASSETTE [ref. p.19 ET-18 Robot User's Guide]:
For STORING A PROGRAM ON CASSETTE,
connect the RCA plug end of the AUDIO CONNECTOR to the 'out' socket
on Hero's rear panel and the 3mm audio plug end to the cassette recorder's
'microphone' input.
Fr'.
Press '33', display will show'
Enter the starting address of your program, display will show'
La'.
Enter the last address of your program.
On successfully up-line saving your program on cassette, Hero will automatically return to 'Executive' mode (viz. 'Ready').
For LOADING A PROGRAM FROM CASSETTE,
connect the same AUDIO CONNECTOR, this time from the 'in' socket on
Hero's rear panel to the cassette player's 'earphone' jack.
Turn the volume control up full. Press' 34' (note that you don't need to
specify a starting address for down-line loading, as this was stored automatically in the up-line save header).
The'.' segment in '3.4' on the display will flash during the down-line load, and
Hero will automatically return to 'Executive' mode following a successful load
(or alternatively display 'ErrOr' if the load was unsuccessful).
(ii)
UNIX:
For UP-LINE SAVING A PROGRAM to Unix,
Press A( uto) D(0) 2000
(transparent link program)
(cf. AOoo on ET3400 trainers)
Login to Unix
type:
($)dll -s -y[segno.]/[start]/[end]
(AND/OR)
-y[segno.]/[start]/ + [length] ...etc
(note: addr in Hex ;length in Decimal)
For DOWN-LINE LOADING A PROGRAM from Unix,
Press A D 2000 (transparent link)
Login
type:
($) dll -1 filename
control-A --> 'HERO MONITOR' on v.d.u.
and 'READY' on Hero.
AD xxxx will then run your program on Hero.
(xxxx =: starting address)
alternatively, type:
-4-
7. Programming Hero
7.1. Introduction
Small programs can be entered via Hero's hexadecimal keypad; larger-scale programs are
better developed under Unix then down-line loaded to Hero. Programs developed under Unix
must be assembled using the 'mac' cross- assembler prior to down-line loading. The appropriate
command is:
($) 'mac -I hero file.s'
In 'Executive' or 'Robot Interpreter' mode, Hero will respond not only to M6800 machinecode instructions, but also to special (Robot Language) commands. Hero will run much slower in
'Robot Interpreter' mode than in 'Machine-code' mode, since each command is interpreted prior
to execution.
For entering programs via the HEXADECIMAL KEYPAD, pressing 'A'(uto or repeat -->
_ _ _~Ad. ) runs Hero in 'Robot Interpreter' mode, while pressing '1' runs Hero in 'Machinecode' mode.
(Note that while programs will run much faster in 'Machine-language' mode, you will not be able
to use any of the special 'Robot Language' commands developed for Hero).
[ref. p.25 ET-18 Robot User's Guide]
NOTE: 'op code' Ox83 will be interpreted by Hero as a directive to change from 'Robot
Interpreter' mode to 'Machine-language' mode, and a Ox3F ('swi' instruction) will convert back
from 'Machine-language' mode to 'Robot Interpreter' mode. Moreover, 'op code' Ox3A (return
to exec) command stops current program execution and returns Hero to 'Executive' (READY)
mode).
[ref. p.23 & 29 ET-18 Robot Technical Manual]
7.2. Robot Interpreter Commands
A complete list of INTERPRETER COMMANDS is given on p.24 of ET-18 Robot Technical Manual; these are repeated here for convenience, together with the mnemonics recognised by
'mac' (note that Hero's Robot Interpreter utilizes unused M6800 op. codes. i.e. 'mac' has been
modified to accept these additional mnemonics at compilation time):
-5-
HEX
Ox02
Ox03
Ox04
OxOS
OxiC 00
OxlD 00
OxlE 00
OxlF 00
Ox21
Ox3A
Ox41
Ox42
Ox45
Ox4B
Ox4E
Ox51
Ox52
Ox55
Ox5B
Ox5E
Ox61 00
Ox62 00
Ox71 MM MM
Ox72 MM MM
Ox83
Ox87 XX XX
Ox8F XX XX
OxBf MM MM
OxC3 SS XX
OxE300
OxF3 MM MM
OxD3 SS XX
OxCC SS XX
OxEC 00
OxFC MM MM
OxDC SS XX
OxFD **
MNEMONIC
adm
asm
aam
asp
bbb
bst
bab
bsp
zro
rtx
eld
csd
eur
emd
eds
dId
dsd
dmd
dur
dds
sen
swn
sex
swx
cml
sip
pau
jws
mwa
mwa
mwa
mwr
mea
mea
mea
mer
mam
INTERPRETED COMMAND
Abort Drive Motor
Abort Steering Motor
Abort Arm Motor
Abort SPeech
Branch if Base Busy
Branch if STeering busy
Branch if Arm Busy
Branch if SPeech busy
Zero
Return To eXecutive
Enable Light Detector
Enable Sound Detector
Enable Ultrasonic Ranging
Enable Motion Detector
Enable DiSplay
Disable Light Detector
Disable Sound Detector
Disable Motion Detector
Disable Ultrasonic Ranging
Disable DiSplay
Speak, Continue (iNdex)
Speak, Wait (iNdex)
Speak, Continue (eXtended)
Speak, Wait (eXtended)
Change to Machine Language
SLeeP (immediate)
PAUse (immediate)
Jump When Speaking (extended)
motor Move Wait Absolute (immediate)
motor Move Wait Absolute (index)
motor Move Wait Absolute (extended)
motor Move Wait Relative (immediate)
motor Move Continue Absolute (immediate)
motor Move Continue Absolute (index)
motor Move Continue Absolute (extended)
motor Move Continue Relative (immediate)
Move All Motors absolute (immediate)
XX = distance,position,time etc.
S5 = select motor, speed, direction
MM = memory address
00 = relative offset
** = SEVEN motor position bytes, in order:
extend, shoulder, rotate, pivot, gripper, head, steering
The following reserved labels are recognized by 'mac':
legend:
LABEL
extend
gripper
trigg
user3
inch
ADDR
0000
0004
002A
0036
F777
LABEL
shoulder
head
expbd
redis
ihb
outch
ADDR
0001
0005
002D
F64E
F796
F7C8
LABEL
rotate
steering
userl
clrdis
outbyt
outstr
ADDR
0002
0006
0030
F65B
F7AD
F7E5
LABEL
pivot
motndet
user2
dsplay
outhex
ADDR
0003
0027
0033
F6F9
F7B5
-6-
MOTOR
Extend
Shoulder
Rotate
Pivot
Gripper
Head
Steering
RANGE
(full in)oo to 98(fu11 out)
(lowered)OO to 86(raised)
(CCW)OO to 93(CW)
(up)OO to A5(down)
(closed)oo to 75(open)
(CCW)OO to C2(CW)
(left_turn)OO to 93(right_turn)
START ADDRESS
OxF777
OxF7C8
OxF7BS
OxF7AD
OxF65B
OxF7E5
OxF6F9
OxF796
OxF64E
BRIEF DESCRIPTION
inputs key presses from keyboard
outputs (ACCA) to 7-segment display
outputs (ACCA) to 7-segment display
outputs 2 numbers to display
blanks all 7-segment displays
outputs character string to display
outputs 1,2 or 3 bytes to dispIay
monitors keyboard for 2 keystrokes
resets
REGISTER
Acca.xx
Pc.xxxx
cc-- > 100100
KEY
(key 2)
(key 4)
(key 6)
REGISTER
Accb.xx
In.xxxx
8p.xxxx
USER DEFINED KEYS: In 'Executive' mode, the F,C & 9 keys can be used as SPECIALFUNCTION keys, with the c.p.u. jumping to the location specified in the following R.A.M. locations (& arriving in 'Robot Interpreter' mode):
-7-
KEY
(F)
(C)
(9)
FUNCTION
user-l
user-2
user-3
ADDR LOCATIONS
OxOO30,1,2
OxOO33,4,5
OxOO36,7,8
CONTENTS
7E xx xx
7E xx xx
7E xx xx
FUNCTION
Motion Detect
Trigger
Experimental Board *IRQ
ADDRESS LOCATIONS
0027,8,9
002A,B,C
002D,C,D
Hero can sense TIME, LIGHT, SOUND, MOTION around it, and DISTANCE
away from a large flat surface (such as a wall).
TIME
[ref. p.20,39 ET-18 Robot User's Guide for setting/using date and/or time-ofdaYILIGHT
Hero can sense 256 different light intensities with its light- dependant resistor
(mounted behind the hole in the orange panel on the side of its head).
[ref. pAO E1'-18 Robot User's Guide]
SOUND
Hero can sense 256 discrete sound intensities with its loudspeaker transducer
(mounted on the same side of its head, at one end of the orange panel).
[ref. pAl E1'-18 Robot User's Guide]
Hero can sense motion with its ultrasonic transmitter/receiver transducer pair
MOTION
(mounted behind the orange panel on the side of its head).
[ref. pA2 E1'-18 Robot User's Guide]
RANGING Ultrasonic Ranging -- Hero can sense distance away from a wall, or other
large flat object, with its sonar transmitter/receiver transducer pair (mounted
behind the blue foam at the front of its head).
[ref. pA3 E1'-18 Robot User's Guide]
(NOTE: Hero CANNOT sense small thin objects such as table legs however, and
since it is not fitted with feedback sensors it will attempt to drive straight through
such obstacles!)
It is STRONGLY RECOMMENDED that you peruse the sample programs given in the above
sections of the ET-18 Robot User's Guide, PRIOR to attempting to use these sensors in your
own program.
[ref. p.57 ET-18 Robot Technical Manual for a 'Sonar Test Program' e.g.]
I/O PORT ADDRESSES
The following addressing scheme is used for (I/O) sensor ports:
-8-
ADDRESS
OxC200
OxC220
OxC240
OxC260
OxC280
OxC2AO
OxC2EO
OxC300
OxC003
OxCIIO
IN
interrupts
sonar timer
sense
tape_in/motor_limits
remote
experimental board
--
OUT
clear interrupt latches
experimental board
speech
steering/pivot,rotate
extend,head,gripper ,shoulder
main drive
main power on-off/tape_out
time clock
clock data
keyboard
--
--
display
I
I
(phonemes)
I
I
03
(pause)
Phonemes are given in the ET-18 Robot Voice Dictionary. It is easiest if you try to find a similar sounding word first in the 750-word vocabulary provided , and then modify accordingly
(with the aid of the alphabetical listing of phonemes on p.81/2) than it is to 'start from
scratch' with every new word (although of course you will have to with some).
Once you've developed the speech to a state where the phonemes are reasonably
correct, you can make it more realistic by addil1g inflections, as follows:
Hero's speech synthesizer has four PITCH outputs, the lowest being the hex code
given in the voice dictionary, and the others as follows:
highest
I
I
lowest
base
base
base
base
+ OxCO
+ Ox80
+ Ox40
hex. code
Some standard phrases are stored in R.O.M., and the starting addresses of these are given on
p.77/8 of the ET-18 Rohot Voice Dictionary.
WARNING: For speech programs, any subsequent routines must start at the NEXT address,
whereas for movement programs (entered using the teaching pendant in 'Learn' mode) subsequent routines must start at the address indicated on the display (PC) and NOT the following
address. This is important in linking together speech and movement programs.
e.g.
-9-
10. It is STRONGLY RECOMMENDED that you drive Hero around manually with the teaching pendant, in order to become familiar with its capabilities BEFORE you attempt to program
it.