SX20AC/SX28AC
Configurable Communications Controllers with EE/Flash Program Memory,
In-System Programming Capability and On-Chip Debug
1.0
1.1.
PRODUCT OVERVIEW
Introduction
the SX architecture is flash-based and therefore
reprogrammable. On-chip functions include a general-
purpose 8-bit timer with prescaler, an analog comparator,
a brown-out detector, a watchdog timer, a power-save
mode with multi-source wakeup capability, an internal
R/C oscillator, user-selectable clock modes, and high-
current outputs. These features enable the SX to be used
as a general-purpose, high-speed microcontroller in a
variety of applications.
The Parallax SX family of configurable communications
controllers is fabricated in an advanced CMOS process
technology. The advanced process, combined with a
RISC-like architecture, allows high-speed computation,
flexible I/O control, and efficient data manipulation.
Throughput is enhanced by operating the device at
frequencies up to 75 MHz and by optimizing the
instruction set to include mostly single-cycle instructions.
The deterministic architecture of the SX provides reliable
performance for time-critical applications. In addition,
Figure 1-1: Block Diagram
Parallax and the Parallax logo are trademarks of Parallax, Inc.
SX is a trademark of Ubicom Inc, used with permission.
© Parallax Inc.
I C is a trademark of Philips Corporation. All other trademarks
are the property of their respective holders.
Rev 1.6 11/20/2006
2
Page 1 of 51
Parallax SX20AC/SX28AC
www.parallax.com
Table of Contents
1.0
1.1.
1.2.
1.3.
1.4.
1.4.1.
Product Overview......................................................... 1
Introduction ................................................................................1
Key Features..............................................................................3
Architecture................................................................................4
Programming Benefits in Assembly and High-Level Languages 4
Parallax SX/B Basic Compiler ...............................................................4
10.2.
10.3.
Watchdog Timer ...................................................................... 26
The Prescaler .......................................................................... 26
11.0
12.0
13.0
14.0
15.0
15.1.
15.2.
15.3.
15.4.
15.5.
15.6.
15.7.
15.8.
15.9.
15.10.
15.10.1.
15.10.2.
15.10.3.
15.10.4.
Comparator .................................................................27
Reset ............................................................................28
Brown-Out Detector ...................................................29
Register States upon Different Reset Operations ...30
Instruction Set ............................................................31
Instruction Set Features........................................................... 31
Instruction Execution ............................................................... 31
Addressing Modes ................................................................... 31
RAM Addressing...................................................................... 32
The Bank Instruction................................................................ 32
Bit Manipulation ....................................................................... 32
Input/Output Operation ............................................................ 32
Increment/Decrement .............................................................. 32
Loop Counting and Data Pointing Testing................................ 32
Branch and Loop Call Instructions ........................................... 32
Jump Operation .................................................................................. 33
Page Jump Operation......................................................................... 33
Call Operation..................................................................................... 33
Page Call Operation ........................................................................... 33
1.5.
1.6.
1.7.
1.8.
Programming and Debugging Support .......................................4
Applications................................................................................4
Support ......................................................................................4
Part Numbering..........................................................................5
2.0
2.1.
2.2.
2.3.
Connection Diagrams .................................................. 6
Pin Assignments ........................................................................6
Pin Descriptions .........................................................................6
Typical Connection Diagrams ....................................................7
3.0
3.1.
3.1.1.
Port Descriptions ......................................................... 9
Reading and Writing the Ports ...................................................9
Read-Modify-Write Considerations......................................................11
3.2.
3.2.1.
3.2.2.
3.2.3.
Port Configuration ....................................................................11
MODE Register ...................................................................................11
Port Configuration Registers ...............................................................11
Port Configuration Upon Reset............................................................12
4.0
4.1.
4.2.
4.3.
Special-Function Registers ....................................... 13
PC Register (02h) ....................................................................13
STATUS Register (03h) ...........................................................13
OPTION Register.....................................................................14
15.11.
15.12.
15.12.1.
15.12.2.
Return Instructions................................................................... 33
Subroutine Operation............................................................... 33
Push Operation................................................................................... 33
Pop Operation .................................................................................... 34
5.0
5.1.
5.2.
5.3.
Device Configuration Registers................................ 15
FUSE Word (Read/Program at FFFh in Main Memory Map) ....15
FUSEX Word (Read/Program via Programming Command) ....16
DEVICE Word (Hard-Wired Read-Only)...................................16
15.13.
15.14.
15.15.
15.16.
Comparison and Conditional Branch Instructions .................... 34
Logical Instruction.................................................................... 34
Shift and Rotate Instructions.................................................... 34
Complement and SWAP.......................................................... 34
6.0
6.1.
6.1.1.
6.1.2.
Memory Organization ................................................ 17
Program Memory .....................................................................17
Program Counter.................................................................................17
Subroutine Stack .................................................................................17
16.0
16.1.
Native SX Instruction Set Summary Tables .............35
Equivalent Assembler Mnemonics ........................................... 39
17.0
17.1.
17.2.
17.3.
17.4.
17.5.
Electrical Characteristics...........................................40
Absolute Maximum Ratings ..................................................... 40
DC Characteristics................................................................... 41
AC Characteristics ................................................................... 42
Comparator DC and AC Specifications.................................... 42
Typical Performance Characteristics (25°C) ............................ 43
6.2.
6.2.1.
Data Memory ...........................................................................17
File Select Register (04h)....................................................................17
7.0
7.1.
7.2.
Power Down Mode ..................................................... 19
Multi-Input Wakeup ..................................................................19
Port B MIWU/Interrupt Configuration........................................20
8.0
9.0
9.1.
9.2.
9.3.
9.4.
Interrupt Support........................................................ 21
Oscillator Circuits ...................................................... 23
XT, LP or HS modes ................................................................23
75 MHz Operation....................................................................25
External RC Mode....................................................................25
Internal RC Mode.....................................................................25
18.0
18.1.
18.2.
18.3.
Package Dimensions..................................................46
SX20AC/SS ............................................................................. 46
SX28AC/SS ............................................................................. 47
SX28AC/DP............................................................................. 48
19.0
19.1.
19.2.
19.3.
19.4.
Manufacturing Information ........................................49
Reflow Peak Temperature ....................................................... 49
MSL3 Compliance ................................................................... 49
Green/RoHS Compliance ........................................................ 49
Stress Testing Data Summary ................................................. 49
10.0
10.1.
Real Time Clock (RTCC)/Watchdog Timer............... 26
RTCC.......................................................................................26
© Parallax Inc.
Page 2 of 51
Rev 1.6 11/20/2006
Parallax SX20AC/SX28AC
www.parallax.com
1.2.
Key Features
Hardware Peripheral Features
75 MIPS Performance
•
SX20AC/SX28AC: DC - 75 MHz
•
SX20AC/SX28AC: as low as 13.3 ns instruction
cycle, 39.9 ns internal interrupt response
•
1 instruction per clock for most instructions (skips
require 2 clocks, branches require 3 clocks, IREAD
requires 4)
EE/FLASH Program Memory and SRAM Data Memory
•
Access time of < 13.3 ns provides single cycle
access
•
EE/Flash rated for > 10,000 rewrite cycles
•
2048 Words EE/Flash program memory
•
136x8 bits SRAM data memory
CPU Features
•
One 8-bit Real Time Clock/Counter (RTCC) with
programmable 8-bit prescaler
•
Watchdog Timer (shares the RTCC prescaler)
•
Analog comparator
•
Brown-out detector
•
Multi-Input Wakeup logic on 8 pins
•
Internal RC oscillator with configurable rate from
31.25 kHz to 4 MHz
•
Power-On-Reset
Packages
•
20-pin SSOP, 28-pin DIP/SSOP
Programming and Debugging Support
•
Compact, RISC-like instruction set
•
All non-branch instructions are single cycle
•
Eight-level push/pop hardware stack for subroutine
operation
•
Fast table lookup capability through run-time
readable code (IREAD instruction)
•
Totally predictable program execution rate for
precise real-time applications
Fast and Deterministic Interrupt
•
On-chip in-system serial programming support via
the oscillator pins
•
On-chip in-system debugging support logic
•
Real-time emulation, full program debug, and
integrated development environment offered by the
Parallax SX-Key
®
programming device
•
The language options available: Parallax Assembly;
Parallax SX/B (BASIC); and CCS SX/C (C)
Software Support
•
Jitter-free 3-cycle internal interrupt response
•
Hardware context save/restore of key resources such
as PC, W, STATUS, and FSR within the 3-cycle
interrupt response time
•
External wakeup/interrupt capability on Port B
(8 pins)
Flexible I/O
•
Native assembly instruction set
•
Expanded assembly instruction set available in the
SASM assembler of the Parallax SX-Key IDE
•
Parallax SX/B compiler (BASIC)
•
Several “C” compliers available from third-party
vendors
•
•
•
•
•
•
•
All port pins individually programmable as I/O
Inputs are TTL or CMOS level selectable
All pins have selectable internal pull-ups
Selectable Schmitt Trigger inputs on Ports B and C
All output pins capable of sourcing/sinking 30 mA
Port A outputs have symmetrical drive
Analog comparator support on Port B (RB0 OUT,
RB1 IN-, RB2 IN+)
•
Selectable I/O operation synchronous to the
oscillator clock
© Parallax Inc.
Page 3 of 51
Rev 1.6 11/20/2006
Parallax SX20AC/SX28AC
www.parallax.com
1.3.
Architecture
•
Synchronous serial communication for I
2
C, 1-Wire,
SPI
•
Asynchronous serial communication with SERIN
and SEROUT
•
Table data storage and retrieval with LOOKUP,
LOOKDOWN
•
I/O pin control with HIGH, LOW, TOGGLE,
REVERSE
•
Timing and delay with PAUSE, SLEEP
•
PULSIN and PULSOUT
•
Resistor/capacitor A/D with RCTIME
•
RANDOM for pseudo-random number generation
•
Non-volatile EEPROM memory access with DATA,
READ
•
Low-current SLEEP command
The complete SX/B command reference and examples are
installed with the SX-Key IDE.
The SX devices use a modified Harvard architecture. This
architecture uses two separate memories with separate
address buses, one for the program and one for data, while
allowing transfer of data from program memory to
SRAM. This ability allows accessing data tables from
program memory. The advantage of this architecture is
that instruction fetch and memory transfers can be
overlapped with a multi-stage pipeline, which means the
next instruction can be fetched from program memory
while the current instruction is being executed using data
from the data memory.
This RISC-like architecture and memory design is based
on technology that makes it very fast, deterministic, jitter
free, and totally reprogrammable.
The SX family implements a four-stage pipeline (fetch,
decode, execute, and write back), which results in
execution of one instruction per clock cycle. For example,
at the maximum operating frequency of 75 MHz,
instructions are executed at the rate of one per 13.3 ns
clock cycle.
1.5.
Programming and Debugging
Support
The SX devices are supported by Parallax’s programming
and debugging tools. The Parallax SX-Blitz is a
programming tool. The SX-Key supports programming
and source-level debugging. On-chip in-system debug
capabilities allow the Parallax tool to be an all-in-one
integrated development environment with editor, macro
assembler, debugger, and programmer. Unobtrusive in-
system programming is provided through the OSC pins.
Visit www.parallax.com for the SX-Key development
tools, the IDE and support forum information.
The in-system programming specification is available to
other 3rd party tool vendors upon request.
1.4.
Programming Benefits in Assembly
and High-Level Languages
The SX’s high speed enables a “software system on a
chip” approach. Programming in assembly language
provides a particularly high-level of access to the interrupt
service routine, the stack and registers to take the highest
advantage of the SX’s deterministic timing. The primary
technical resources for programming the SX in assembly
language include the following:
•
The SX20AC/SX28AC datasheet
•
SX-Key Development System User’s Manual
by
Parallax, Inc.
•
Programming the SX Microcontroller – A Complete
Guide
by Guenther Daubach
Customers with a high-level programming language
background may prefer the use of a C or BASIC
compiler.
1.4.1. Parallax SX/B Basic Compiler
Parallax's SX/B is a free BASIC language compiler for
the SX microcontroller (SX20, SX28, and SX48). The
compiler speeds the programming of the SX
microcontrollers by providing a simple, yet robust high-
level language familiar to Parallax customers. SX/B
includes the following features and commands:
•
ASM directive to support in-line assembly language
•
Program structure commands including BRANCH,
DO..LOOP, GOTO, GOSUB, IF..THEN..ELSE
•
Numeric formatters
•
WORD variable support
•
Frequency generation with FREQOUT
1.6.
Applications
The SX may be used as a solution for process controllers,
electronic appliances/tools, security/monitoring systems,
sound and signal generation, GPS interface, robotic
control, motor control, sensor interfacing and personal
communication devices. Applications such as interactive
toys, magnetic-stripe readers, infrared decoders, and other
timing-sensitive projects are also common with the SX.
Examples of customer applications may be seen on the
Parallax web site.
1.7.
Support
Parallax and our distributors provide all support for the
SX microcontroller. Support is available free of charge
via phone (888) 512-1024 in the U.S. Also be sure to
participate in the SX discussion forum at
http://forums.parallax.com/forums/. The on-line SX
support community is actively involved in customer
support 24 hours a day.
© Parallax Inc.
Page 4 of 51
Rev 1.6 11/20/2006
Parallax SX20AC/SX28AC
www.parallax.com
1.8.
Part Numbering
Table 1-1: Part Numbering
Device Part#
SX20AC/SS
SX20AC/SS-G
SX28AC/DP
SX28AC/DP-G
SX28AC/SS
SX28AC/SS-G
Pins
20
I/O
12
EE/Flash
(Words)
2K
RAM
(Bytes)
137
Voltage
Range (V)
3.0
–
5.5
Operating Temp @
3.0
–
5.5 V, 50 MHz*
-40 °C to +85 °C
Operating Temp @
4.5
–
5.5 V, 75 MHz*
0 °C to +70 °C
28
20
2K
136
3.0
–
5.5
-40 °C to +85 °C
0 °C to +70 °C
28
20
2K
136
3.0
–
5.5
-40 °C to +85 °C
0 °C to +70 °C
* Ratings are preliminary
Figure 1-2
Part Number Reference Guide
© Parallax Inc.
Page 5 of 51
Rev 1.6 11/20/2006