English
Language : 

45111 Datasheet, PDF (87/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
10 SX Special Features and Coding Tips
10 SX Special Features and Coding Tips
10.1 Introduction
The SX chip offers many configurable features. This chapter explains how to use many of these features,
offers coding tips and demonstrates most topics with sample code. All examples are written for the
SX20/28 chips and may need modification for SX48/52 chips.
10.2 Port Configuration and Usage
There are many configuration options for each of the ports on the SX chip as shown in Table 19 – Port
Configuration Options, below. The following sections explain how to use the various port
configuration options.
Table 19 - Port Configuration Options
Type
Port A Port B Port C* Port D* Port E*
Input/Output
X
X
X
X
X
Pull-Ups
X
X
X
X
X
CMOS/TTL
X
X
X
X
X
Schmitt-Trigger
X
X
X
X
Edge-Interrupts
X
Comparator
Three Pins
* Port C not available on SX20, Port D and E only available on SX48/52 devices.
To set these functions, a special form of the MOV instruction, called the port configuration instruction,
is used to modify the port configuration registers. The syntax of this instruction is:
MOV
!port, src
By default, the port configuration instruction writes to the port direction registers, called the tristate
registers. To write to other registers, the MODE register must be preset with a specific value. Table 20 –
MODE Register Settings lists these values. See chapter 15.4.1 – MODE Register for more information.
SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc. • Page 87