AD9S12DP512BM Quick Ref

advertisement
Adapt9S12DP512 Module with memory-resident BASIC
Run/Load Switch
(for AutoRun feature)
26
1
25
C16
W2
J6
R14
CAN0
W20
W5
U7
Mode Select
1 PAD0 0
C6
www.technologicalarts.com
Adapt9S12D
TM
R20
1 PAD1 0
(C)2005 TECHNOLOGICAL ARTS
R19
C5
R5
U8
REV 1a W14
W15
1
25
50
26
CAN1
R1
R11
W21
BDM Connector
(advanced users only)
J5
R3
R4
C7
JB3
PP7
W6
XIRQ*
W9
W10
JB4
1
U6
W8 C11
J4 RS232
1
R8
R13
W19
D1
9-pin female RS232
(UART 0)
MODA and MODB
Jumpers both at 0
(Single-chip Mode)
SW1
BDM IN
U4
Y1
RESET
R15
W12
C3
W7
C10
16 MHz crystal
C8
C9
W17
W18
9S12DP512
C2
C1
C12
JB1
MODA 0
MODB
0
R7
W16
R17
R18
N/C
TX
G
RX
C4
JB2
U3
J1 PWR
J2
C17 C14
U1
PWR
D2
R16
R9
W13
4-pin RS232 interface
(UART 1)
W3 TERM
C19
+
C13
R6
W11
H2
R2
U2
Run
SW2
W1
RS485
low-dropout
5V regulator
(rear-mounted)
Reset button
R10
Load
U5 W4
R12
TB1
50
C15
DC In
(6 to 12V, nominal)
H2 - Secondary I/O
J7
H1
H1 - Primary I/O
Heartbeat LED (on PP7)
CONNECTOR PIN ASSIGNMENTS
H1
H2
PIN
SIGNAL NAME
PIN
SIGNAL NAME
PIN
SIGNAL NAME
PIN
SIGNAL NAME
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
PS4
PS5
PS6
PS7
PS1/TXD0
PT7
PT6
PT5
PT4
PT3
PT2
PT1
PT0
PP7
PP6
PP5
PP4
PP3
PP2
PP1
PP0
PAD00
PAD01
PAD02
PAD03
50
49
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
GROUND
GROUND
PS0/RXD0
+5VDC
PE1/IRQ*
PE0/XIRQ*
RESET*
PE7
PH0
PH1
PH2
PH3
PH4
PH5
PH6
PH7
PS2/RXD1
PE4
PS3/TXD1
VRL
VRH
PAD04
PAD05
PAD06
PAD07
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
PA7
PA6
PA5
PA4
PA3
PA2
PA1
PA0
PB7
PB6
PB5
PB4
PB3
PB2
PB1
PB0
PE2
PE4
PE3
PE1
PJ1
PAD08
PAD09
PAD10
PAD11
50
49
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
VCC (+5VDC)
GROUND
PE7
PK7
PK5
PK4
PK3
PK2
PK1
PK0
PJ0
PJ7
PJ6
PM7
PM6
PM5/SCK
PM4/MOSI
PM3/SS*
PM2/MISO
PM1
PM0
PAD12
PAD13
PAD14
PAD15
QSPI pins
NOTES: * indicates active low signal
Standard Connector Options (use NC for “no connector”)
Component Side
Component Side
Component Side
Component Side
Component Side
Component Side
Component Side
Component Side
Component Side
Component Side
Component Side
FM
FM1
0.3”
SB
Order Code:
RA
RA1
FRA
FRA1
M
M1
F1
F
Module with soBASIC in Flash: AD9S12DP512BM0-‰-‰
(NOTE: When ordering modules, fill in -‰-‰ with desired connector option codes for H1 and H2, as shown above)
www.technologicalarts.com • sales@technologicalarts.com • phone: +1(416) 963-8996 • fax: +1(416) 963-9179
©2009 Technological Arts
Specifications subject to change without notice
AD9S12DP512BMDAT1b
SoBASIC Language - Quick Reference
Commands
auto <line>
clear [flash]
clone [run]
cls
cont [<line>]
delete [<line>][-][<line>]
dir
edit <line>
help [<topic>]
list [<line>][-][<line>]
load <name>
memory
new
profile [<line>][-][<line>]
purge <name>
renumber [<line>]
reset
run [<line>]
save [<name>]
undo
uptime
----------------------
Modes
analog [<millivolts>]
autorun [on|off]
echo [on|off]
indent [on|off]
nodeid [<nodeid>|none]
numbers [on|off]
pins [<assign> [<pinname>|none]]
prompt [on|off]
servo [<Hz>]
sleep [on|off]
step [on|off]
trace [on|off]
watchsmart [on|off]
do
[(break|continue) [n]]
until <expression>
gosub <subname> [<expression>, ...]
sub <subname> [<param>, ...]
[return]
Endsub
automatically number program lines
clear ram [and flash] variables
clone flash to slave MCU [and run]
clear terminal screen
continue program from stop
delete program lines or <subname>
list saved programs
edit program line
online help
list program lines or <subname>
load saved program
print memory usage
erase code ram and flash memories
like list, but display profile info
purge saved program
renumber program lines (and save)
reset the MCU!
run program
save code ram to flash memory
undo code changes since last save
print time since last reset
--------------
Device Statements
timers:
configure timer <n> for <n> (s|ms|us)
on timer <n> do <statement>
-- on timer execute statement
off timer <n>
-- disable timer interrupt
mask timer <n>
-- mask/hold timer interrupt
unmask timer <n>
-- unmask timer interrupt
uarts:
configure uart <n> for <n> baud <n> data (even|odd|no) parity [loopback]
on uart <n> (input|output) do <statement> -- on uart execute statement
off uart <n> (input|output)
-- disable uart interrupt
mask uart <n> (input|output)
-- mask/hold uart interrupt
unmask uart <n> (input|output)
-- unmask uart interrupt
set/display analog voltage scale
autorun (on reset) mode
terminal echo mode
listing indent mode
set/display Zigflea nodeid
listing line numbers mode
set/display soBASIC pin assignments
terminal prompt mode
set/display servo Hz (on reset)
debugger sleep mode
debugger single-step mode
debugger trace mode
low-overhead watchpoint mode
Pin assignments:
Heartbeat safemode* qspi_cs*
Statements
<line> <statement>
assert <expression>
data <n> [, ...]
dim <variable>[[n]] [as ...] [, ...]
end
label <label>
let <variable> = <expression> [, ...]
print ("string"|<expression>) [, ...]
qspi <variable> [, ...]
read <variable> [, ...]
rem <remark>
restore [<label>]
sleep <expression> (s|ms|us)
stop
---------------
enter program line into code ram
break if expression is false
read-only data
dimension variables
end program
read/data label
assign variable
print strings/expressions
perform qspi I/O by reference
read read-only data into variables
remark
restore read-only data pointer
delay program execution
insert breakpoint in code
Block Statements
if <expression> then
[elseif <expression> then]
[else]
endif
for <variable> = <expression> to <expression> [step <expression>]
[(break|continue) [n]]
next
while <expression> do
[(break|continue) [n]]
endwhile
Pins
pin names:
0
1
------- ------pad00
pad01
pad08
pad09
pa0
pa1
pb0
pb1
pe0
pe1
ph0
ph1
pj0
pj1
pk0
pk1
pm0
pm1
pp0
pp1
ps0
ps1
pt0
pt1
watchpoints:
on <expression> do <statement>
off <expression>
mask <expression>
unmask <expression>
-----
on expr execute statement
disable expr watchpoint
mask/hold expr watchpoint
unmask expr watchpoint
Expressions
the following operators are supported as in C,
in order of decreasing precedence:
<n>
-- decimal constant
0x<n>
-- hexadecimal constant
<variable>
-- simple variable
<variable>[<expression>]
-- array variable element
(
)
-- grouping
!
~
-- logical not, bitwise not
*
/
%
-- times, divide, mod
+
-- plus, minus
>> <<
-- shift right, left
<= < >= >
-- inequalities
== !=
-- equal, not equal
|
^
&
-- bitwise or, xor, and
|| ^^ &&
-- logical or, xor, and
Variables
all variables must be dimensioned!
variables dimensioned in a sub are local to that sub
simple variables are passed to sub params by reference
array variable indices start at 0; v[0] is the same as v
ram variables:
dim <var>[[n]]
dim <var>[[n]] as (byte|short)
absolute variables:
dim <var>[[n]] [as (byte|short)] at address <addr>
flash parameter variables:
dim <varflash>[[n]] as flash
pin alias variables:
dim <varpin> as pin <pinname> for (digital|analog|servo|frequency|uart) \
(input|output) \
[debounced] [inverted] [open_drain]
system variables:
nodeid
msecs
2
------pad02
pad10
pa2
pb2
pe2
ph2
3
------pad03
pad11
pa3
pb3
pe3
ph3
4
------pad04
pad12
pa4
pb4
pe4
ph4
5
------pad05
pad13
pa5
pb5
pe5
ph5
pk2
pm2
pp2
ps2
pt2
pk3
pm3
pp3
ps3
pt3
pk4
pm4
pp4
ps4
pt4
pk5
pm5
pp5
ps5
pt5
seconds
6
------pad06
pad14
pa6
pb6
pe6
ph6
pj6
pk6
pm6
pp6
ps6
pt6
ticks
7
--------+
pad07
|
pad15
|
pa7
|
pb7
|
pe7
|
ph7
|
pj7
|
pk7
|
pm7
|
pp7
|
ps7
|
pt7
|
ticks_per_msec
PORT
PORT
PORT
PORT
PORT
PORT
PORT
PORT
PORT
PORT
PORT
PORT
(read-only)
AD0
AD1
A
B
E
H
J
K
M
P
S
T
all pins support general purpose digital input
all pins except pad?? and pe[01] support general purpose digital output
pad?? = potential analog input pins (mV)
pp? = potential analog output (PWM) pins (mV)
pp? = potential servo output (PWM) pins (cms)
pt? = potential frequency output pins (Hz)
ps0 (u0), ps2 (u1) = potential uart input pins (received byte)
ps1 (u0), ps3 (u1) = potential uart output pins (transmit byte)
Visit www.soBASICsoEasy.com
for complete details
Download