Product specification
Supersedes data of 1998 Aug 14
IC25 Data Handbook
1999 Apr 07
Philips SemiconductorsProduct specification
XA 16-bit microcontroller family
32K/512 OTP/ROM/ROMless, watchdog, 2 UARTs
FAMILY DESCRIPTION
The Philips Semiconductors XA (eXtended Architecture) family of
16-bit single-chip microcontrollers is powerful enough to easily
handle the requirements of high performance embedded
applications, yet inexpensive enough to compete in the market for
high-volume, low-cost applications.
The XA family provides an upward compatibility path for 80C51
users who need higher performance and 64k or more of program
memory. Existing 80C51 code can also easily be translated to run
on XA microcontrollers.
The performance of the XA architecture supports the
comprehensive bit-oriented operations of the 80C51 while
incorporating support for multi-tasking operating systems and
high-level languages such as C. The speed of the XA architecture,
at 10 to 100 times that of the 80C51, gives designers an easy path
to truly high performance embedded control.
The XA architecture supports:
•Upward compatibility with the 80C51 architecture
•16-bit fully static CPU with a 24-bit program and data address
range
•Eight 16-bit CPU registers each capable of performing all
arithmetic and logic operations as well as acting as memory
pointers. Operations may also be performed directly to memory.
•Both 8-bit and 16-bit CPU registers, each capable of performing
all arithmetic and logic operations.
•An enhanced instruction set that includes bit intensive logic
operations and fast signed or unsigned 16 × 16 multiply and
32 / 16 divide
XA-G3
•Instruction set tailored for high level language support
•Multi-tasking and real-time executives that include up to 32
vectored interrupts, 16 software traps, segmented data memory,
and banked registers to support context switching
•Low power operation, which is intrinsic to the XA architecture,
includes power-down and idle modes.
More detailed information on the core is available in the XA User
Guide.
SPECIFIC FEATURES OF THE XA-G3
•20-bit address range, 1 megabyte each program and data space.
(Note that the XA architecture supports up to 24 bit addresses.)
•2.7V to 5.5V operation
•32K bytes on-chip EPROM/ROM program memory =
XA-G37/XA-G33
•512 bytes of on-chip data RAM
•Three counter/timers with enhanced features
(equivalent to 80C51 T0, T1, and T2)
•Watchdog timer
•Two enhanced UARTs
•Four 8-bit I/O ports with 4 programmable output configurations
P0.0 – P0.743–3637–30I/OPort 0: Port 0 is an 8-bit I/O port with a user-configurable output type. Port 0 latches have 1s
P1.0 – P1.72–940–44,
P2.0 – P2.724–3118–25I/OPort 2: Port 2 is an 8-bit I/O port with a user-configurable output type. Port 2 latches have 1s
P3.0 – P3.711,
RST104IReset: A low on this pin resets the microcontroller, causing I/O ports and peripherals to take on
ALE/PROG3327I/OAddress Latch Enable/Program Pulse: A high output on the ALE pin signals external circuitry to
1, 2216IGround: 0V reference.
23, 4417IPower Supply: This is the power supply voltage for normal, idle, and power down operation.
written to them and are configured in the quasi-bidirectional mode during reset. The operation of
port 0 pins as inputs and outputs depends upon the port configuration selected. Each port pin is
configured independently. Refer to the section on I/O port configuration and the DC Electrical
Characteristics for details.
When the external program/data bus is used, Port 0 becomes the multiplexed low data/instruction
byte and address lines 4 through 11.
1–3
240OA0/WRH:Address bit 0 of the external address bus when the external data bus is
341OA1:Address bit 1 of the external address bus.
442OA2:Address bit 2 of the external address bus.
543OA3:Address bit 3 of the external address bus.
644IRxD1 (P1.4):Receiver input for serial port 1.
71OTxD1 (P1.5):Transmitter output for serial port 1.
115IRxD0 (P3.0):Receiver input for serial port 0.
137OTxD0 (P3.1):Transmitter output for serial port 0.
148IINT0 (P3.2):External interrupt 0 input.
159IINT1 (P3.3):External interrupt 1 input.
1610I/OT0 (P3.4):Timer 0 external input, or timer 0 overflow output.
1711I/OT1/BUSW (P3.5):Timer 1 external input, or timer 1 overflow output. The value on this pin is
1812OWRL (P3.6):External data memory low byte write strobe.
1913ORD (P3.7):External data memory read strobe.
I/OPort 1: Port 1 is an 8-bit I/O port with a user-configurable output type. Port 1 latches have 1s
written to them and are configured in the quasi-bidirectional mode during reset. The operation of
port 1 pins as inputs and outputs depends upon the port configuration selected. Each port pin is
configured independently. Refer to the section on I/O port configuration and the DC Electrical
Characteristics for details.
Port 1 also provides special functions as described below.
configured for an 8 bit width. When the external data bus is configured for a 16
bit width, this pin becomes the high byte write strobe.
written to them and are configured in the quasi-bidirectional mode during reset. The operation of
port 2 pins as inputs and outputs depends upon the port configuration selected. Each port pin is
configured independently. Refer to the section on I/O port configuration and the DC Electrical
Characteristics for details.
When the external program/data bus is used in 16-bit mode, Port 2 becomes the multiplexed high
data/instruction byte and address lines 12 through 19. When the external program/data bus is used in
8-bit mode, the number of address lines that appear on port 2 is user programmable.
I/OPort 3: Port 3 is an 8-bit I/O port with a user configurable output type. Port 3 latches have 1s
written to them and are configured in the quasi-bidirectional mode during reset. the operation of
port 3 pins as inputs and outputs depends upon the port configuration selected. Each port pin is
configured independently. Refer to the section on I/O port configuration and the DC Electrical
Characteristics for details.
Port 3 also provides various special functions as described below.
latched as the external reset input is released and defines the default
external data bus width (BUSW). 0 = 8-bit bus and 1 = 16-bit bus.
their default states, and the processor to begin execution at the address contained in the reset
vector. Refer to the section on Reset for details.
latch the address portion of the multiplexed address/data bus. A pulse on ALE occurs only when it
is needed in order to process a bus cycle.
1999 Apr 07
5
Philips SemiconductorsProduct specification
SFR
NAME
DESCRIPTION
SFR
XA 16-bit microcontroller family
XA-G3
32K/512 OTP/ROM/ROMless, watchdog, 2 UARTs
MNEMONICNAME AND FUNCTIONTYPE
MNEMONICNAME AND FUNCTIONTYPE
PSEN3226OProgram Store Enable: The read strobe for external program memory. When the microcontroller
EA/WAIT/
V
PP
XTAL12115ICrystal 1: Input to the inverting amplifier used in the oscillator circuit and input to the internal clock
XTAL22014OCrystal 2: Output from the oscillator amplifier.
SPECIAL FUNCTION REGISTERS
PIN. NO.
LQFPPLCC
accesses external program memory, PSEN
is only active when external code accesses are performed.
3529IExternal Access/Wait: The EA input determines whether the internal program memory of the
microcontroller is used for code execution. The value on the EA pin is latched as the external reset
input is released and applies during later execution. When latched as a 0, external program
memory is used exclusively, when latched as a 1, internal program memory will be used up to its
limit, and external program memory used above that point. After reset is released, this pin takes on
the function of bus Wait input. If Wait is asserted high during any external bus access, that cycle
will be extended until Wait is released. During EPROM programming, this pin is also the
programming supply voltage input.
generator circuits.
BIT FUNCTIONS AND ADDRESSES
ADDRESS
MSBLSB
is driven low in order to enable memory devices. PSEN
TMODTimer 0 and 1 mode control45CGATEC/TM1M0GATEC/TM1M000
TSTAT*Timer 0 and 1 extended status411—————T1OE—T0OE00
WDCON*
WDLWatchdog timer reload45F00
WFEED1
WFEED2
NOTES:
* SFRs are bit addressable.
1. At reset, the BCR register is loaded with the binary value 0000 0a11, where “a” is the value on the BUSW pin. This defaults the address bus
size to 20 bits since the XA-G3 has only 20 address lines.
2. SFR is loaded from the reset vector.
3. All bits except F1, F0, and P are loaded from the reset vector. Those bits are all 0.
4. Unimplemented bits in SFRs are X (unknown) at all times. Ones should not be written to these bits since they may be used for other
purposes in future XA derivatives. The reset value shown for these bits is 0.
5. Port configurations default to quasi-bidirectional when the XA begins execution from internal code memory after reset, based on the
condition found on the EA pin. Thus all PnCFGA registers will contain FF and PnCFGB registers will contain 00. When the XA begins
execution using external code memory, the default configuration for pins that are associated with the external bus will be push-pull. The
PnCFGA and PnCFGB register contents will reflect this difference.
6. The WDCON reset value is E6 for a Watchdog reset, E4 for all other reset causes.
7. The XA-G3 implements an 8-bit SFR bus, as stated in Chapter 8 of the
write 16 bits to an SFR will actually write only the lower 8 bits. Sixteen bit SFR reads will return undefined data in the upper byte.
DESCRIPTION
DESCRIPTION
high byte
low byte
Watchdog control register41FPRE2PRE1PRE0——
Watchdog feed 145Dx
Watchdog feed 245Ex
SFR
ADDRESS
ADDRESS
357356355354353352351350
2C72C62C52C42C32C22C12C0
2CF2CE2CD2CC2CB2CA2C92C8
45B00
45A00
287286285284283282281280
28F28E28D28C28B28A289288
2FF2FE2FD2FC2FB2FA2F92F8
BIT FUNCTIONS AND ADDRESSES
EXEN2
XA User Guide
. All SFR accesses must be 8-bit operations. Attempts to
TR2C/T2
WDRUN WDTOF
CP/RL2
RESET
RESET
VALUE
VALUE
LSBMSB
00
—
Note 6
1999 Apr 07
8
Philips SemiconductorsProduct specification
XA 16-bit microcontroller family
32K/512 OTP/ROM/ROMless, watchdog, 2 UARTs
XA-G3 TIMER/COUNTERS
The XA has two standard 16-bit enhanced Timer/Counters: Timer 0
and Timer 1. Additionally, it has a third 16-bit Up/Down
timer/counter, T2. A central timing generator in the XA core provides
the time-base for all XA Timers and Counters. The timer/event
counters can perform the following functions:
– Measure time intervals and pulse duration
– Count external events
– Generate interrupt requests
– Generate PWM or timed output waveforms
All of the timer/counters (Timer 0, Timer 1 and Timer 2) can be
independently programmed to operate either as timers or event
counters via the C/T bit in the TnCON register. All timers count up
unless otherwise stated. These timers may be dynamically read
during program execution.
The base clock rate of all of the timers is user programmable. This
applies to timers T0, T1, and T2 when running in timer mode (as
opposed to counter mode), and the watchdog timer. The clock
driving the timers is called TCLK and is determined by the setting of
two bits (PT1, PT0) in the System Configuration Register (SCR).
The frequency of TCLK may be selected to be the oscillator input
divided by 4 (Osc/4), the oscillator input divided by 16 (Osc/16), or
the oscillator input divided by 64 (Osc/64). This gives a range of
possibilities for the XA timer functions, including baud rate
XA-G3
generation, Timer 2 capture. Note that this single rate setting applies
to all of the timers.
When timers T0, T1, or T2 are used in the counter mode, the
register will increment whenever a falling edge (high to low
transition) is detected on the external input pin corresponding to the
timer clock. These inputs are sampled once every 2 oscillator
cycles, so it can take as many as 4 oscillator cycles to detect a
transition. Thus the maximum count rate that can be supported is
Osc/4. The duty cycle of the timer clock inputs is not important, but
any high or low state on the timer clock input pins must be present
for 2 oscillator cycles before it is guaranteed to be “seen” by the
timer logic.
Timer 0 and Timer 1
The “Timer” or “Counter” function is selected by control bits C/T in
the special function register TMOD. These two Timer/Counters have
four operating modes, which are selected by bit-pairs (M1, M0) in
the TMOD register. T imer modes 1, 2, and 3 in XA are kept identical
to the 80C51 timer modes for code compatibility. Only the mode 0 is
replaced in the XA by a more powerful 16-bit auto-reload mode. This
will give the XA timers a much larger range when used as time
bases.
The recommended M1, M0 settings for the different modes are
shown in Figure 2.
SCR Address:440
Not Bit Addressable
Reset Value: 00H
PT1PT0OPERATING
00Osc/4
01Osc/16
10Osc/64
11Reserved
CMCompatibility Mode allows the XA to execute most translated 80C51 code on the XA. The
PZPage Zero mode forces all program and data addresses to 16-bits only. This saves stack space
TMOD Address:45C
Not Bit Addressable
Reset Value: 00H
GATEGating control when set. Timer/Counter “n” is enabled only while “INTn” pin is high and
C/TTimer or Counter Selector cleared for Timer operation (input from internal system clock.)
XA register file must copy the 80C51 mapping to data memory and mimic the 80C51 indirect
addressing scheme.
and speeds up execution but limits memory access to 64k.
Figure 1. System Configuration Register (SCR)
GATEC/TM1
TIMER 1TIMER 0
“TRn” control bit is set. When cleared Timer “n” is enabled whenever “TRn” control bit is set.
Set for Counter operation (input from “Tn” input pin).
Figure 2. Timer/Counter Mode Control (TMOD) Register
—PT1PT0CMPZ
M0GATEC/T
M1M0
LSBMSB
LSBMSB
SU00589
SU00605
1999 Apr 07
9
Philips SemiconductorsProduct specification
XA 16-bit microcontroller family
32K/512 OTP/ROM/ROMless, watchdog, 2 UARTs
New Enhanced Mode 0
For timers T0 or T1 the 13-bit count mode on the 80C51 (current
Mode 0) has been replaced in the XA with a 16-bit auto-reload
mode. Four additional 8-bit data registers (two per timer: RTHn and
RTLn) are created to hold the auto-reload values. In this mode, the
TH overflow will set the TF flag in the TCON register and cause both
the TL and TH counters to be loaded from the RTL and RTH
registers respectively.
These new SFRs will also be used to hold the TL reload data in the
8-bit auto-reload mode (Mode 2) instead of TH.
The overflow rate for Timer 0 or Timer 1 in Mode 0 may be
calculated as follows:
where N = the TCLK prescaler value: 4 (default), 16, or 64.
Mode 1
Mode 1 is the 16-bit non-auto reload mode.
Mode 2
Mode 2 configures the Timer register as an 8-bit Counter (TLn) with
automatic reload. Overflow from TLn not only sets TFn, but also
reloads TLn with the contents of RTLn, which is preset by software.
The reload leaves THn unchanged.
XA-G3
Mode 2 operation is the same for Timer/Counter 0.
The overflow rate for Timer 0 or Timer 1 in Mode 2 may be
Timer 1 in Mode 3 simply holds its count. The effect is the same as
setting TR1 = 0.
Timer 0 in Mode 3 establishes TL0 and TH0 as two separate
counters. TL0 uses the Timer 0 control bits: C/T, GA TE, TR0, INT0,
and TF0. TH0 is locked into a timer function and takes over the use
of TR1 and TF1 from Timer 1. Thus, TH0 now controls the “Timer 1”
interrupt.
Mode 3 is provided for applications requiring an extra 8-bit timer.
When Timer 0 is in Mode 3, Timer 1 can be turned on and of f by
switching it out of and into its own Mode 3, or can still be used by
the serial port as a baud rate generator, or in fact, in any application
not requiring an interrupt.
TCON Address:410
Bit Addressable
Reset Value: 00H
BITSYMBOLFUNCTION
TCON.7TF1Timer 1 overflow flag. Set by hardware on Timer/Counter overflow.
This flag will not be set if T1OE (TSTAT.2) is set.
Cleared by hardware when processor vectors to interrupt routine, or by clearing the bit in software.
TCON.6TR1Timer 1 Run control bit. Set/cleared by software to turn Timer/Counter 1 on/off.
TCON.5TF0Timer 0 overflow flag. Set by hardware on Timer/Counter overflow.
This flag will not be set if T0OE (TSTAT.0) is set.
Cleared by hardware when processor vectors to interrupt routine, or by clearing the bit in software.
TCON.4TR0Timer 0 Run control bit. Set/cleared by software to turn Timer/Counter 0 on/off.
TCON.3IE1Interrupt 1 Edge flag. Set by hardware when external interrupt edge detected.
Cleared when interrupt processed.
TCON.2IT1Interrupt 1 type control bit. Set/cleared by software to specify falling edge/low level triggered
external interrupts.
TCON.1IE0Interrupt 0 Edge flag. Set by hardware when external interrupt edge detected.
Cleared when interrupt processed.
TCON.0IT0Interrupt 0 Type control bit. Set/cleared by software to specify falling edge/low level
triggered external interrupts.
Figure 3. Timer/Counter Control (TCON) Register
IE0IT1IE1TR0TF0TR1TF1
LSBMSB
IT0
SU00604C
1999 Apr 07
10
Philips SemiconductorsProduct specification
XA 16-bit microcontroller family
32K/512 OTP/ROM/ROMless, watchdog, 2 UARTs
T2CON Address:418
Bit Addressable
Reset Value: 00H
BITSYMBOL FUNCTION
T2CON.7 TF2Timer 2 overflow flag. Set by hardware on Timer/Counter overflow. Must be cleared by software.
TF2 will not be set when RCLK0, RCLK1, TCLK0, TCLK1 or T2OE=1.
T2CON.6 EXF2Timer 2 external flag is set when a capture or reload occurs due to a negative transition on T2EX (and
EXEN2 is set). This flag will cause a Timer 2 interrupt when this interrupt is enabled. EXF2 is cleared by
software.
T2CON.5 RCLK0Receive Clock Flag.
T2CON.4 TCLK0Transmit Clock Flag. RCLK0 and TCLK0 are used to select Timer 2 overflow rate as a clock source for
UART0 instead of Timer T1.
T2CON.3 EXEN2 Timer 2 external enable bit allows a capture or reload to occur due to a negative transition on T2EX.
T2CON.2 TR2Start=1/Stop=0 control for Timer 2.
T2CON.1 C/T2Timer or counter select.
If CP/RL2 & EXEN2=1 captures will occur on negative transitions of T2EX.
If CP/RL2=0, EXEN2=1 auto reloads occur with either Timer 2 overflows or negative transitions at T2EX.
If RCLK or TCLK=1 the timer is set to auto reload on Timer 2 overflow, this bit has no effect.
Figure 4. Timer/Counter 2 Control (T2CON) Register
C/T2TR2EXEN2TCLK0RCLK0EXF2TF2
LSBMSB
CP/RL2
XA-G3
SU00606A
New Timer-Overflow Toggle Output
In the XA, the timer module now has two outputs, which toggle on
overflow from the individual timers. The same device pins that are
used for the T0 and T1 count inputs are also used for the new
overflow outputs. An SFR bit (TnOE in the TSTAT register) is
associated with each counter and indicates whether Port-SFR data
or the overflow signal is output to the pin. These outputs could be
used in applications for generating variable duty cycle PWM outputs
(changing the auto-reload register values). Also variable frequency
(Osc/8 to Osc/8,388,608) outputs could be achieved by adjusting
the prescaler along with the auto-reload register values. With a
30.0MHz oscillator, this range would be 3.58Hz to 3.75MHz.
Timer T2
Timer 2 in the XA is a 16-bit Timer/Counter which can operate as
either a timer or as an event counter. This is selected by C/T2 in the
special function register T2CON. Upon timer T2 overflow/underflow,
the TF2 flag is set, which may be used to generate an interrupt. It
can be operated in one of three operating modes: auto-reload (up or
down counting), capture, or as the baud rate generator (for either or
both UARTs via SFRs T2MOD and T2CON). These modes are
shown in Table 1.
Capture Mode
In the capture mode there are two options which are selected by bit
EXEN2 in T2CON. If EXEN2 = 0, then timer 2 is a 16-bit timer or
counter, which upon overflowing sets bit TF2, the timer 2 overflow
bit. This will cause an interrupt when the timer 2 interrupt is enabled.
If EXEN2 = 1, then Timer 2 still does the above, but with the added
feature that a 1-to-0 transition at external input T2EX causes the
current value in the Timer 2 registers, TL2 and TH2, to be captured
into registers RCAP2L and RCAP2H, respectively. In addition, the
transition at T2EX causes bit EXF2 in T2CON to be set. This will
cause an interrupt in the same fashion as TF2 when the Timer 2
interrupt is enabled. The capture mode is illustrated in Figure 7.
Auto-Reload Mode (Up or Down Counter)
In the auto-reload mode, the timer registers are loaded with the
16-bit value in T2CAPH and T2CAPL when the count overflows.
T2CAPH and T2CAPL are initialized by software. If the EXEN2 bit in
T2CON is set, the timer registers will also be reloaded and the EXF2
flag set when a 1-to-0 transition occurs at input T2EX. The
auto-reload mode is shown in Figure 8.
In this mode, Timer 2 can be configured to count up or down. This is
done by setting or clearing the bit DCEN (Down Counter Enable) in
the T2MOD special function register (see Table 1). The T2EX pin
then controls the count direction. When T2EX is high, the count is in
the up direction, when T2EX is low, the count is in the down
direction.
Figure 8 shows Timer 2, which will count up automatically, since
DCEN = 0. In this mode there are two options selected by bit
EXEN2 in the T2CON register. If EXEN2 = 0, then Timer 2 counts
up to FFFFH and sets the TF2 (Overflow Flag) bit upon overflow.
This causes the Timer 2 registers to be reloaded with the 16-bit
value in T2CAPL and T2CAPH, whose values are preset by
software. If EXEN2 = 1, a 16-bit reload can be triggered either by an
overflow or by a 1-to-0 transition at input T2EX. This transition also
sets the EXF2 bit. If enabled, either TF2 or EXF2 bit can generate
the Timer 2 interrupt.
In Figure 9, the DCEN = 1; this enables the Timer 2 to count up or
down. In this mode, the logic level of T2EX pin controls the direction
of count. When a logic ‘1’ is applied at pin T2EX, the Timer 2 will
count up. The Timer 2 will overflow at FFFFH and set the TF2 flag,
which can then generate an interrupt if enabled. This timer overflow,
also causes the 16-bit value in T2CAPL and T2CAPH to be
reloaded into the timer registers TL2 and TH2, respectively.
A logic ‘0’ at pin T2EX causes Timer 2 to count down. When
counting down, the timer value is compared to the 16-bit value
contained in T2CAPH and T2CAPL. When the value is equal, the
1999 Apr 07
11
Loading...
+ 25 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.