Duty cycle for XTAL2 corrected
RESET : correction in text “for the duration of two machine cycles“
Correction in text : XRAM is internal
1st paragraph: sentence “Bit Swap is ...” added;
Table 3-2: Text in right column corrected
Figure 3-7; corrected and improved
Last paragraph og 4.4.2 : last sentence deleted
Correction in figure 6-4 and text : “Delay = 1 state“
Correction in text 2nd paragraph : “consists of three ...“
Abbreviations below table 6-10 added
Name of bit T1P2 corrected to T2P0
Formula for mode 1,3 baud rate corrected; last sentence added
Formula for mode A,B baud rate corrected
Several references in the text corrected from IRCON to IRCON0
Description of ICR and ICS added
V
modified
IL2
Improved and extended ICC specification
V
min. changed from 5V - 15% to 5V - 5%
CC
AC characteristics : 16 MHz clock oscillator duty cycle (DC) for
external clock changed to 0.45 to 0.55
Improved index; bold page numbers for main definition reference
Edition 10.97
Published by Siemens AG,
Bereich Halbleiter, MarketingKommunikation, Balanstraße 73,
81541 München
As far as patents or other rights of third parties are concerned, liability is only assumed for components, not for
applications, processes and circuits implemented within components or assemblies.
The information describes the type of component and shall not be considered as assured characteristics.
Terms of delivery and rights to change design reserved.
For questions on technology, delivery and prices please contact the Semiconductor Group Offices in Germany or
the Siemens Companies and Representatives worldwide (see address list).
Due to technical requirements components may contain dangerous substances. For information on the types in
question please contact your nearest Siemens Office, Semiconductor Group.
Siemens AG is an approved CECC manufacturer.
Packing
Please use the recycling operators known to you. We can also help you – get in touch with your nearest sales
office. By agreement we will take packing material back, if it is sorted. You must bear the costs of transport.
For packing material that is returned to us unsorted or which we are not obliged to accept, we shall haveto invoice
you for any costs incurred.
Components used in life-support devices or systems must be expressly authorized for such purpose!
Critical components
systems
1 A critical component is a component used in a life-support device or system whose failure can reasonably be
2 Life support devices or systems are intended (a) to be implanted in the human body, or (b) to support and/or
2
with the express written approval of the Semiconductor Group of Siemens AG.
expected to cause the failure of that life-support device or system, or to affect its safety or effectiveness of that
device or system.
maintain and sustain human life. If they fail, it is reasonable to assume that the health of the user may be endangered.
1
of the Semiconductor Group of Siemens AG, may only be used in life-support devices or
The C509-L is a high-end microcontroller in the Siemens SAB-C500 8-bit microcontroller family. lt
is based on the well-known industry standard 8051 architecture; a great number of enhancements
and new peripheral features extend its capabilities to meet the extensive requirements of new
applications. Further, the C509-L is a superset of the Siemens SAB 80C517/80C517A 8-bit
microcontroller thus offering an easy upgrade path for SAB 80C517/80C517A users.
The high performance of the C509-L microcontroller is achieved by the C500-Core with a maximum
operating frequency of 16 MHz internal (and external) CPU clock. While maintaining all the features
of the SAB 80C517A, the C509-L is expanded by one I/O port, in its compare/capture capabilities,
by A/D converter functions, by additional 1 KByte of on-chip RAM (now 3 KByte XRAM) and by an
additional user-selectable CMOS port structure. The C509-L is mounted in a P-MQFP-100-2
package.
Figure 1-1 shows the different functional units of the C509-L and figure 1-2 shows the simplified
logic symbol of the C509-L.
C509
Watchdog
Oscillator
Watchdog
8-Bit UART
HW/SW
Power
Down
Modes
On-Chip Emulation Support Module
MDU
8-Bit USART
T 2
Comp.
Timer 1
Port 9Port 8
I/OI/OI/OI/O
RAM
256 x 8
T 0
T 1
10-Bit ADC
analog/
digit.
input
CPU
C500-Core
(8-Dataptr)
Port 7
analog/
digit.
input
Boot ROM 512 x 8
XRAM
3 K x 8
CCU
Port 6
Comp.
Timer 1
Port 5
Port 4
Port 4
Port 4
Port 4
Port 4
I/O
I/O
I/O
I/O
I/O
Improved functionality in
comparison to the SAB 80C517A.
MCB02493
Figure 1-1
C509-L Functional Units
Semiconductor Group1-11997-10-01
Introduction
C509-L
Listed below is a summary of the main features of the C509-L:
l
Full upward compatibility with SAB 80C517/80C517A
l
256 byte on-chip RAM
l
3K byte of on-chip XRAM
l
256 directly addressable bits
l
375 ns instruction cycle at 16-MHz oscillator frequency
l
64 of 111 instructions are executed in one instruction cycle
l
External program and data memory expandable up to 64 Kbyte each
l
On-chip emulation support logic (Enhanced Hooks Technology
Ten I/O ports
– Eight bidirectional 8-bit I/O ports with selectable port structure
quasi-bidirectional port structure (8051 compatible)
bidirectional port structure with CMOS voltage levels
– One 8-bit and one 7-bit input port for analog and digital input signals
l
Two full-duplex serial interfaces with own baud rate generators
l
Four priority level interrupt systems, 19 interrupt vectors
l
Three power saving modes
– Slow-down mode
– Idle mode
– Power-down mode
l
Siemens high-performance ACMOS technology
l
M-QFP-100 rectangular quad flat package
l
Temperature Ranges :SAB-C509-L
SAF-C509-L
= 0 to 70 ° C
T
A
= -40 to 85 ° C
T
A
TM
)
Semiconductor Group1-21997-10-01
Introduction
C509-L
Figure 1-2
C509-L Logic Symbol
Semiconductor Group1-31997-10-01
Introduction
1.1Pin Configuration
This section describes the pin configuration of the C509-L in the P-MQFP-100-2 package.
C509-L
Figure 1-3
C509-L Pin Configuration (P-MQFP-100-2, top view)
Semiconductor Group1-41997-10-01
1.2Pin Definitions and Functions
This section describes all external signals of the C509-L with its function.
Table 1-1
Pin Definitions and Functions
SymbolPin NumberI/O*)Function
Introduction
C509-L
P1.0 - P1.79-6, 1,
100-98
9
8
7
6
1
100
99
98
I/O
Port 1
is an 8-bit bidirectional I/O port with internal pullup
resistors. Port 1 pins that have 1's written to them are
pulled high by the internal pullup resistors, and in that
state can be used as inputs. As inputs, port 1 pins being
externally pulled low will source current ( I
, in the DC
IL
characteristics) because of the internal pullup resistors.
Port 1 can also be switched into a bidirectional mode, in
which CMOS levels are provided. In this bidirectional
mode, each port 1 pin can be programmed individually
as input or output.
Port 1 also contains the interrupt, timer, clock, capture
and compare pins that are used by various options. The
output latch corresponding to a secondary function must
be programmed to a one (1) for that function to operate
(except when used for the compare functions).
The secondary functions are assigned to the pins of
port 1 as follows :
P1.0INT3
is an 8-bit bidirectional I/O port with internal pullup resistors. Port 9 pins that have 1's written to them are pulled
high by the internal pullup resistors, and in that state can
be used as inputs. As inputs, port 9 pins being externally
pulled low will source current ( I
, in the DC characteri-
IL
stics) because of the internal pullup resistors.
Port 9 can also be switched into a bidirectional mode, in
which CMOS levels are provided. In this bidirectional
mode, each port 1 pin can be programmed individually
as input or output.
Port 9 also serves alternate compare functions. The output latch corresponding to a secondary function must be
programmed to a one (1) for that function to operate.
The secondary functions are assigned to the pins of
port 9 as follows :
P9.0-P9.7 CC10-CC17Compare/capture channel 0-7
output/input
XTAL2
is the input to the inverting oscillator amplifier and input
to the internal clock generator circuits.
When supplying the C509-L with an external clock
source, XTAL2 should be driven, while XTAL1 is left
unconnected. A duty cycle of 0.45 to 0.55 of the clock
signal is required. Minimum and maximum high and low
times as well as rise/fall times specified in the AC
characteristics must be observed.
XTAL113–
XTAL1
Output of the inverting oscillator amplifier. This pin is
used for the oscillator operation with crystal or ceramic
resonartor
*) I = Input
O = Output
Semiconductor Group1-61997-10-01
Table 1-1
Pin Definitions and Functions (cont’d)
SymbolPin NumberI/O*)Function
Introduction
C509-L
P2.0 – P2.714-21I/O
PSEN
/ RDF22O
Port 2
is a 8-bit I/O port. Port 2 emits the high-order address
byte during fetches from external program memory and
during accesses to external data memory that use 16-bit
addresses (MOVX @DPTR). In this application it uses
strong internal pullup resistors when issuing 1s. During
accesses to external data memory that use 8-bit
addresses (MOVX @Ri), port 2 issues the contents of the
P2 special function register.
P2.0 - P2.7A8 - A15Address lines 8 - 15
Program Store Enable / Read FLASH
The PSEN
external program memory to the bus during external
code fetch operations. It is activated every third
oscillator period. PSEN is not activated during external
data memory accesses caused by MOVX instructions.
PSEN is not activated when instructions are executed
from the internal Boot ROM or from the XRAM.
In external programming mode RDF becomes active
when executing external data memory read (MOVX)
instructions.
output is a control signal that enables the
ALE23O
EA
PRGEN25IExternal Flash-EPROM Program Enable
*) I = Input
O = Output
24IExternal Access Enable
Address Latch Enable
This output is used for latching the low byte of the
address into external memory during normal operation.
It is activated every third oscillator period except during
an external data memory access caused by MOVX
instructions.
The status of this pin is latched at the end of a reset.
When held at low level, the C509-L fetches all
instructions from the external program memory. For the
C509-L this pin must be tied low.
A low level at this pin disables the programming of an
external Flash-EPROM. To enable the programming of
an external Flash-EPROM, the pin PRGEN must be held
at high level and bit PRGEN1 in SFR SYSCON1 has to
be set. There is no internal pullup resistor connected to
this pin.
Semiconductor Group1-71997-10-01
Table 1-1
Pin Definitions and Functions (cont’d)
SymbolPin NumberI/O*)Function
Introduction
C509-L
P0.0 – P0.726, 27,
30-35
I/OPort 0
is an 8-bit open-drain bidirectional I/O port. Port 0 pins
that have 1s written to them float, and in that state can be
used as high-impendance inputs. Port 0 is also the
multiplexed low-order address and data bus during
accesses to external program or data memory. In this
operating mode it uses strong internal pullup resistors
when issuing 1 s.
P0.0 - P0.7AD0-AD7Address/data lines 0 - 7
HWPD
36IHardware Power Down
A low level on this pin for the duration of one machine
cycle while the oscillator is running resets the C509-L.
A low level for a longer period will force the part to power
down mode with the pins floating. There is no internal
pullup resistor connected to this pin.
P5.0 - P5.744-37I/OPort 5
is an 8-bit bidirectional I/O port with internal pullup
resistors. Port 5 pins that have 1's written to them are
pulled high by the internal pullup resistors, and in that
state can be used as inputs. As inputs, port 5 pins being
externally pulled low will source current (I
characteristics) because of the internal pullup resistors.
Port 5 can also be switched into a bidirectional mode, in
which CMOS levels are provided. In this bidirectional
mode, each port 5 pin can be programmed individually
as input or output.
Port 5 also serves as alternate function for “Concurrent
Compare” and "Set/Reset compare” functions. The
output latch corresponding to a secondary function must
be programmed to a one (1) for that function to operate.
The secondary functions are assigned to the pins of port
5 as follows :
P5.0 - P5.7CCM0-CCM7Concurrent Compare
, in the DC
IL
or Set/Reset lines 0 - 7
*) I = Input
O = Output
Semiconductor Group1-81997-10-01
Table 1-1
Pin Definitions and Functions (cont’d)
SymbolPin NumberI/O*)Function
OWE45IOscillator Watchdog Enable
A high level on this pin enables the oscillator watchdog.
When left unconnected, this pin is pulled high by a weak
internal pullup resistor. The logic level at OWE should
not be changed during normal operation. When held at
low level the oscillator watchdog function is turned off.
During hardware power down the pullup resistor is
switched off.
Introduction
C509-L
P6.0 - P6.746-50,
54-56
46
47
48
49
I/OPort 6
is an 8-bit bidirectional I/O port with internal pullup
resistors. Port 6 pins that have 1's written to them are
pulled high by the internal pullup resistors, and in that
state can be used as inputs. As inputs, port 6 pins being
externally pulled low will source current (I
characteristics) because of the internal pullup resistors.
Port 6 can also be switched into a bidirectional mode, in
which CMOS levels are provided. In this bidirectional
mode, each port 6 pin can be programmed individually
as input or output.
Port 6 also contains the external A/D converter control
pin, the receive and transmission lines for the serial
port 1, and the write-FLASH control signal. The output
latch corresponding to a secondary function must be
programmed to a one (1) for that function to operate.
The secondary functions are assigned to the pins of
port 6 as follows :
P6.0ADST
P6.1R×D1Receiver data input of serial interface 1
P6.2T×D1Transmitter data output of serial
P6.3WRFThe WRF (write Flash) signal is active
, in the DC
IL
External A/D converter start pin
interface 1
when the programming mode is
selected. In this mode WRF becomes
active when executing external data
memory write (MOVX) instructions.
*) I = Input
O = Output
Semiconductor Group1-91997-10-01
Table 1-1
Pin Definitions and Functions (cont’d)
SymbolPin NumberI/O*)Function
Introduction
C509-L
P8.0 - P8.657-60,
51-53
RO
61OReset Output
P4.0 – P4.764-66,
68-72
IPort 8
is a 7-bit unidirectional input port. Port pins can be used
for digital input if voltage levels meet the specified input
high/low voltages, and for the higher 7-bit of the
multiplexed analog inputs of the A/D converter
simultaneously.
P8.0 - P8.6AIN8 - AIN14Analog input 8 - 14
This pin outputs the internally synchronized reset
request signal. This signal may be generated by an
external hardware reset, a watchdog timer reset or an
oscillator watchdog reset. The RO output is active low.
I/OPort 4
is an 8-bit bidirectional I/O port with internal pull-up
resistors. Port 4 pins that have 1’s written to them are
pulled high by the internal pull-up resistors, and in that
state can be used as inputs. As inputs, port 4 pins being
externally pulled low will source current (I
characteristics) because of the internal pull-up resistors.
Port 4 also erves as alternate compare functions. The
output latch corresponding to a secondary functionmust
be programmed to a one (1) for that function to operate.
The secondary functions are assigned to the pins of port
4 as follows :
P4.0 - P4.7CM0 - CM7Compare channel 0 - 7
A low level on this pin allows the software to enter the
power down mode, idle and slow down mode. If the low
level is also seen during reset, the watchdog timer
function is off on default.
Usage of the software controlled power saving modes is
blocked, when this pin is held on high level. A high level
during reset performs an automatic start of the watchdog
timer immediately after reset.
When left unconnected this pin is pulled high by a weak
internal pullup resistor. During hardware power down the
pullup resistor is switched off.
*) I = Input
O = Output
Semiconductor Group1-101997-10-01
Table 1-1
Pin Definitions and Functions (cont’d)
SymbolPin NumberI/O*)Function
RESET73IRESET
A low level on this pin for the duration of two machine
cycles while the oscillator is running resets the C509-L.
A small internal pullup resistor permits power-on reset
using only a capacitor connected to VSS.
Introduction
C509-L
V
V
AREF
AGND
78–Reference voltage for the A/D converter
79–Reference ground for the A/D converter
P7.0 - P7.787-80IPort 7
Port 7 is an 8-bit unidirectional input port. Port pins can
be used for digital input if voltage levels meet the
specified input high/low voltages, and for the lower 8-bit
of the multiplexed analog inputs of the A/D converter
simultaneously.
P7.0 - P7.7AIN0 - AIN7Analog input 0 - 7
*) I = Input
O = Output
Semiconductor Group1-111997-10-01
Table 1-1
Pin Definitions and Functions (cont’d)
SymbolPin NumberI/O*)Function
Introduction
C509-L
P3.0 – P3.790-97
90
91
92
93
94
95
96
97
I/OPort 3
is an 8-bit bidirectional I/O port with internal pullup
resistors. Port 3 pins that have 1's written to them are
pulled high by the internal pullup resistors, and in that
state can be used as inputs. As inputs, port 3 pins being
externally pulled low will source current (I
characteristics) because of the internal pullup resistors.
Port 3 also contains two external interrupt inputs, the
timer 0/1 inputs, the serial port 0 receive/transmit line
and the external memory strobe pins. The output latch
corresponding to a secondary function must be
programmed to a one (1) for that function to operate.
The secondary functions are assigned to the port pins of
port 3 as follows
P3.0R×D0Receiver data input (asynchronous) or
data input/output (synchronous) of serial
interface 0
or clock output (synchronous) of the
serial interface 0
The write control signal latches the data
byte from port 0 into the external data
memory
external data memory to port 0
PSENX PSENX (external program store enable)
enables the external code memory
when the external / internal XRAM
mode or external / internal programming
mode is selected.
V
SS
V
CC
*) I = Input
O = Output
10, 28, 62, 88–Circuit ground potential
11, 29, 63, 89–Supply terminal for all operating modes
Semiconductor Group1-121997-10-01
Fundamental Structure
C509-L
2Fundamental Structure
The C509-L is the high-end 8051-compatible microcontroller of the C500 microcontroller family with
a significantly increased performance of CPU and peripheral units. It includes the complete
SAB 80C517A functionality, providing 100% upward compatibility. This means that all existing
80517A programs or user’s program libraries can be used further on without restriction and may be
easily extended to the C509-L.
Some of the various on-chip peripherals of the C509-L support the 8-bit core in case of stringent
real-time requirements. The 32-bit/16-bit arithmetic unit, the improved 4-level interrupt structure and
eight 16-bit datapointers are meant to give such a CPU support. But strict compatibility to the 8051
architecture is a principle of the C509-L design.
Furthermore, the C509-L contains eight 8-bit I/O ports and fifteen general input lines. The second
serial channel is compatible to the 8051-UART and provided with an independent and freely
programmable baud rate generator. An 10-bit resolution A/D-converter with built-in self calibration
has been integrated to allow analog signal processing. The C509-L further includes a powerful
compare/capture unit with two 16-bit compare timers for all kinds of digital signal processing. The
controller has been completed with well considered provisions for “fail-safe” reaction in critical
applications and offers all CMOS features like low power consumption as well as an idle, powerdown and slow-down mode.
Figure 2-1 shows the block diagram of the C509-L.
Semiconductor Group2-11997-10-01
Fundamental Structure
C509-L
Figure 2-1
Block Diagram of the C509-L
Semiconductor Group2-21997-10-01
Fundamental Structure
C509-L
2.1CPU
The CPU is designed to operate on bits and bytes. The instructions, which consist of up to 3 bytes,
are performed in one, two or four machine cycles. One machine cycle requires six oscillator cycles
(this number of oscillator cycles differs from other members of the C500 microcontroller family). The
instruction set has extensive facilities for data transfer, logic and arithmetic instructions. The
Boolean processor has its own full-featured and bit-based instructions within the instruction set. The
C509-L uses five addressing modes: direct access, immediate, register, register indirect access,
and for accessing the external data or program memory portions a base register plus index-register
indirect addressing.Efficient use of program memory results from an instruction set consisting of
44 % one-byte, 41 % two-byte, and 15 % three-byte instructions. With a 16 MHz clock, 58 % of the
instructions execute in 375 ns.
The CPU (Central Processing Unit) of the C509-L consists of the instruction decoder, the arithmetic
section and the program control section. Each program instruction is decoded by the instruction
decoder. This unit generates the internal signals controlling the functions of the individual units
within the CPU. They have an effect on the source and destination of data transfers, and control the
ALU processing.
The arithmetic section of the processor performs extensive data manipulation and is comprised of
the arithmetic/logic unit (ALU), an A register, B register and PSW register.
The ALU accepts 8-bit data words from one or two sources and generates an 8-bit result under the
control of the instruction decoder. The ALU performs the arithmetic operations add, substract,
multiply, divide, increment, decrement, BDC-decimal-add-adjust and compare, and the logic
operations AND, OR, Exclusive OR, complement and rotate (right, left or swap nibble (left four)).
Also included is a Boolean processor performing the bit operations as set, clear, completement,
jump-if-not-set, jump-if-set-and-clear and move to/from carry. Between any addressable bit (or its
complement) and the carry flag, it can perform the bit operations of logical AND or logical OR with
the result returned to the carry flag.
The program control section controls the sequence in which the instructions stored in program
memory are executed. The 16-bit program counter (PC) holds the address of the next instruction to
be executed. The conditional branch logic enables internal and external events to the processor to
cause a change in the program execution sequence.
Accumulator
ACC is the symbol for the accumulator register. The mnemonics for accumulator-specific
instructions, however, refer to the accumulator simply as A.
Program Status Word
The Program Status Word (PSW) contains several status bits that reflect the current state of the
CPU.
Semiconductor Group2-31997-10-01
Fundamental Structure
C509-L
Special Function Register PSW (Address D0H) Reset Value : 00
Bit No.D7
D0
H
MSB
H
D6
H
D5
H
D4
CYACF0RS1
H
D3
H
D2
H
RS0OVF1P
D1
H
LSB
D0
H
PSW
BitFunction
CYCarry Flag
Used by arithmetic instructions.
ACAuxiliary Carry Flag
Used by instructions which execute BCD operations)
F0General Purpose Flag
RS1
RS0
Register Bank select control bits
These bits are used to select one of the four register banks.
RS1RS0Function
H
00Bank 0 selected, data address 00H-07
01Bank 1 selected, data address 08H-0F
10Bank 2 selected, data address 10H-17
11Bank 3 selected, data address 18H-1F
H
H
H
H
OVOverflow Flag
F1General Purpose Flag
Used by arithmetic instructions.
PParity Flag
Set/cleared by hardware after each instruction cycle to indicate an odd/even
number of “one” bits in the accumulator, i.e. even parity.
B Register
The B register is used by 8-bit multiply and divide instructions and serves as both source and
destination. For other instructions it can be treated as another scratch pad register.
Stack Pointer
The stack pointer (SP) register is 8 bits wide. It is incremented before data is stored during PUSH
and CALL executions and decremented after data is popped during a POP and RET (RETI)
execution, i.e. it always points to the last valid stack byte. While the stack may reside anywhere in
the on-chip RAM, the stack pointer is initialized to 07H after a reset. This causes the stack to begin
a location = 08H above register bank zero. The SP can be read or written under software control.
Semiconductor Group2-41997-10-01
Fundamental Structure
C509-L
2.2CPU Timing
A machine cycle consists of 6 states (6 oscillator periods). Each state is divided into a phase 1 half,
during OSC is high, and a phase 2 half, during which OSC is low. Thus, a machine cycle consists
of 6 oscillator periods, numbered S1P1 (state 1, phase 1) through S6P2 (state 6, phase 2). Each
state lasts for one oscillator period. Typically, arithmetic and logical operations take place during
phase 1 and internal register-to-register transfers take place during phase 2.
The diagrams in figure 2-2 show the fetch/execute timing related to the internal states and phases.
Since these internal clock signals are not user-accessible, the XTAL1 oscillator signals and the ALE
(address latch enable) signal are shown for external reference. ALE is normally activated twice
during each machine cycle: once during S1P2 and S2P1, and again during S4P2 and S5P1.
Executing of a one-cycle instruction begins at S1P2, when the op-code is latched into the instruction
register. If it is a two-byte instruction, the second reading takes place during S4 of the same
machine cycle. If it is a one-byte instruction, there is still a fetch at S4, but the byte read (which would
be the next op-code) is ignored (discarded fetch), and the program counter is not incremented. In
any case, execution is completed at the end of S6P2.
Figures 2-2a) and b) show the timing of a 1-byte, 1-cycle instruction and for a 2-byte, 1-cycle
instruction.
Most C509-L instructions are executed in one cycle. MUL (multiply) and DIV (divide) are the only
instructions that take more than two cycles to complete; they take four cycles. Normally two code
bytes are fetched from the program memory during every machine cycle. The only exception to this
is when a MOVX instruction is executed. MOVX is a one-byte, 2-cycle instruction that accesses
external data memory. During a MOVX, the two fetches in the second cycle are skipped while the
external data memory is being addressed and strobed. Figure 2-2 c) and d) show the timing for a
normal 1-byte, 2-cycle instruction and for a MOVX instruction.
Semiconductor Group2-51997-10-01
Fundamental Structure
C509-L
Figure 2-2
Fetch and Execute Sequences
Semiconductor Group2-61997-10-01
Memory Organization
3Memory Organization
The C509-L CPU manipulates data and operands in the following five address spaces:
– up to 64 Kbyte of external program memory
– up to 64 Kbyte of external data memory
– 512 byte of internal Boot ROM (program memory)
– 256 bytes of internal data memory
– 3 Kbyte of internal XRAM data memory
– a 128 byte special function register area
Figure 3-1 illustrates the memory address spaces of the C509-L.
C509-L
Figure 3-1
C509-L Memory Map
The internal XRAM data memory overlaps with the external data memory in the address range from
F400H to FFFFH. In this address range, either external or internal data RAM can be used. If the
internal XRAM has been enabled, it only can be disabled by an active RESET or HWPD signal.
The internal Boot ROM also overlaps with the external code memory in the address range from
0000H to 01FFH. Depending on the selected operating mode (chipmode), either external code
memory or the internal Boot ROM is accessed in this address range.
Semiconductor Group3-11997-10-01
Memory Organization
C509-L
3.1Program Memory, “Code Space”
Besides the internal Boot ROM, the C509-L has no internal program memory (ROM). In normal
mode the program memory of the C509-L is located externally and can be expanded up to 64 Kbyte.
In the normal mode the C509-L fetches all instructions from the external program memory.
Therefore, the pin EA of the C509-L must be always tied to low level.
The Boot ROM includes a bootstrap loader program for the bootstrap mode of the C509-L. The
software routines of the bootstrap loader program allow the easy and quick programming or loading
of the internal XRAM (F400H to FFFFH) via the serial interface while the MCU is in-circuit. This
allows to transfer custom routines to the XRAM, which will program an external 64 KByte FLASH
memory. The routines of the bootstrap loader program may be executed or even can be blocked to
prevent unauthorized persons from reading out or writing to the external FLASH memory.
Therefore, the bootstrap loader checks an external FLASH memory for existing custom software
and executes it. The bootstrap loader program is described in detail in chapter 10.
3.2Data Memory, “Data Space”
The data memory address space consists of an internal and an external memory space. The
internal data memory is divided into three physically separate and distinct blocks: the lower 128
bytes of RAM, the upper 128 bytes of RAM, and the 128 byte special function register (SFR) area.
While the upper 128 bytes of data memory and the SFR area share the same address locations,
they are accessed through different addressing modes. The lower 128 bytes of data memory can
be accessed through direct or register indirect addressing; the upper 128 bytes of RAM can be
accessed through register indirect addressing; the special function registers are accessible through
direct addressing. Four 8-register banks, each bank consisting of eight 8-bit multi-purpose registers,
occupy locations 0 through 1FH in the lower RAM area. The next 16 bytes, locations 20H through
2FH, contain 128 directly addressable bit locations. The stack can be located anywhere in the
internal data memory address space, and the stack depth can be expanded up to 256 bytes.
The external data memory can be expanded up to 64 Kbytes and can be accessed by instructions
that use a 16-bit or an 8-bit address. The internal XRAM is also located in the external data memory
area and must be accessed by external data memory instructions (MOVX). The XRAM can also
serve as code memory in the XRAM mode and in the FLASH programming mode. In these modes
program code which has been prior loaded via the bootstrap loader program, is executed in the
XRAM.
3.3General Purpose Registers
The lower 32 locations of the internal RAM are assigned to four banks with eight general purpose
registers (GPRs) each. Only one of these banks may be enabled at a time. Two bits in the program
status word, RS0 (PSW.3) and RS1 (PSW.4), select the active register bank (see description of the
PSW in chapter 2). This allows fast context switching, which is useful when entering subroutines
or interrupt service routines.
The 8 general purpose registers of the selected register bank may be accessed by register
addressing. With register addressing the instruction op code indicates which register is to be used.
For indirect addressing R0 and R1 are used as pointer or index register to address internal or
external memory (e.g. MOV @R0).
Semiconductor Group3-21997-10-01
Memory Organization
C509-L
Reset initializes the stack pointer to location 07H and increments it once to start from location 08
H
which is also the first register (R0) of register bank 1. Thus, if one is going to use more than one
register bank, the SP should be initialized to a different location of the RAM which is not used for
data storage.
3.4Program and Data Memory Organization
The C509-L can operate in four different operating modes (chipmodes) with different program and
data memory organizations:
Table 3-1 describes the program and data memory areas which are available in the different
chipmodes of the C509-L. It also shows the control bits of SFR SYSCON1, which are used for the
software selection of the chipmodes.
Table 3-1
Overview of Program and Data Memory Organization
Operating Mode
(Chipmode)
Program MemoryData MemorySYSCON1 Bits
Ext.Int.Ext.Int.PRGEN1SWAP
Normal Mode0000
FFFF
H
H
XRAM Mode0200H -
F3FF
H
Bootstrap Mode0200H -
F3FF
H
Programming Mode0200H -
FFFF
H
-
–
0000H 01FFH =
Boot ROM;
F400
H
-
FFFFH =
(XRAM)
0000H 01FFH =
Boot ROM
0000H 01FFH =
Boot ROM;
F400
H
-
FFFFH =
XRAM
0000H F3FF
H
0000
FFFF
H
H
-
(read only)
0000H F3FF
H
0000
FFFF
H
H
-
(read and
write)
F400
H
FFFF
H
(XRAM)
–
F400
H
FFFF
H
(XRAM)
–
-
00
01
-
10
11
Semiconductor Group3-31997-10-01
Memory Organization
C509-L
3.4.1 Interface of External FLASH/ROM/EPROM and External SRAM Memory
The external FLASH/ROM/EPROM memory and the external SRAM memory can be used in the
chipmodes either as code memory or as data memory. The basic memory configuration is shown
in figure 3-2.
The following alternate function pins control the read/write accesses for code/data memories:
PSEN / RDFRead control signal for the FLASH/ROM/EPROM memory
P6.3 / WRFWrite control signal for the FLASH/ROM/EPROM memory
P3.6 / WRWrite control signal for the SRAM memory
P3.7 / RD / PSENXRead control signal for the SRAM memory
Figure 3-2
Interface of External FLASH/ROM/EPROM and External SRAM Memory
Semiconductor Group3-41997-10-01
Memory Organization
C509-L
3.4.2 Normal Mode Configuration
The Normal Mode is the standard 8051 compatible operating mode of the C509-L. In this mode 64K
byte external code memory and 61K byte external SRAM as well as 3K byte internal data memory
(XRAM) are provided. If the XRAM is disabled (default after reset), totally 64K byte external data
memory are available. The Boot ROM is disabled. The external program memory is controlled by
the PSEN/RDF signal. Read and write accesses to the external data memory are controlled by the
RD and WR pins of port 3.
The Normal Mode is entered by keeping the pin PRGEN at a logic low during the rising edge of the
external RESET or HWPD signal. The locations of the code- and data-memory in Normal Mode are
shown in figure 3-4.
Figure 3-3
Locations of Code- and Data Memory in Normal Mode
Semiconductor Group3-51997-10-01
Loading...
+ 260 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.