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 have to invoice you for any costs incurred.
Components used in life-support devices or systems must be expressly authorized for such purpose!
Critical components
written approval of the Semiconductor Group of Siemens AG.
1 A critical component is a component used in a life-support device or system whose failure can reasonably be expected to cause the
failure of that life-support device or system, or to affect its safety or effectiveness of that device or system.
2 Life support devices or systems are intended (a) to be implanted in the human body, or (b) to support and/or maintain and sustain hu-
man 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 systems2 with the express
8-Bit CMOS Microcontroller C504
Advance Information
• Fully compatible to standard 8051 microcontroller
• Up to 40 MHz operating frequency
• 16 K×8 ROM (C504-2R only, optional ROM protection)
• 256×8 RAM
• 256×8 XRAM
• Four 8-bit ports, (2 ports with mixed analog/digital I/O capability)
• Three 16-bit timers/counters (timer 2 with up/down counter feature)
• Capture/compare unit for PWM signal generation and signal capturing
- 3-channel, 16-bit capture/compare unit
- 1-channel, 10-bit compare unit
• Compare unit
• USART
• 10-bit A/D Converter with 8 multiplexed inputs
• Twelve interrupt sources with two priority levels
• On-chip emulation support logic (Enhanced Hooks Technology
TM
)
• Programmable 15-bit Watchdog Timer
• Oscillator Watchdog
• Fast Power On Reset
• Power Saving Modes
• M-QFP-44 package
• Temperature ranges: SAB-C504T
SAF-C504TA : – 40 to 85°C
SAH-C504TA : – 40 to 110°C (max. operating frequency.: TBD)
SAK-C504TA : – 40 to 125°C (max. operating frequency.: 12 MHz)
: 0 to 70°C
A
Semiconductor Group305.96
C504
The C504 with its capture compare unit (CCU) especially provides a functionality, which allows to
use the microcontroller in motor control applications. Further, the C504 is functionally upward
compatible with the SAB 80C52/C501 microcontroller and can replace it in existing applications.
The C504-2R contains a non-volatile 16K×8 read-only program memory, a volatile on-chip 512×8
read/write data memory, four 8-bit wide ports, three 16-bit timers/counters, a 16-bit capture/
compare unit with compare timer, a 10-bit compare timer, a twelve source, two priority level interrupt
structure, a serial port, versatile fail save mechanisms, on-chip emulation support logic, and a
genuine 10-bit A/D converter. The C504-L is identical to the C504-2R, except that it lacks the
program memory on chip. Therefore, the term C504 refers to all versions within this data sheet
unless otherwise noted.
Ordering Information
TypeOrdering CodePackageDescription
(8-Bit CMOS microcontroller)
SAB-C504-LMQ67120-C1048P-MQFP-44 for external memory (12 MHz)
SAB-C504-L24MQ67120-C1049P-MQFP-44 for external memory (24 MHz)
SAB-C504-L40MQ67120-C1050P-MQFP-44 for external memory (40 MHz)
SAB-C504-2RMQ67120-DXXXXP-MQFP-44 with mask-programmable ROM (12 MHz)
SAB-C504-2R24MQ67120-DXXXXP-MQFP-44 with mask-programmable ROM (24 MHz)
SAB-C504-2R40MQ67120-DXXXXP-MQFP-44 with mask-programmable ROM (40 MHz)
Note: Versions for extended temperature ranges – 40 ˚C to 110 ˚C (SAH-C504) and – 40 ˚C to
125 ˚C (SAK-C504) are available on request.
The ordering number of ROM types (DXXXX extensions) is defined after program release
(verification) of the customer.
Semiconductor Group4
C504
Figure 1
Logic Symbol
Semiconductor Group5
C504
Figure 2
Pin Configuration (top view)
Semiconductor Group6
Table 1
Pin Definitions and Functions
C504
SymbolPin Number
(P-MQFP-44)
P1.0-P1.740-44,
1-3
40
41
42
43
44
1
2
3
I/O
Function
*)
I/OPort 1
is an 8-bit bidirectional port. Port pins can be used for
digital input/output. P1.0 - P1.3 can also be used as analog
inputs of the A/D-converter. As secondary digital functions,
port 1 contains the timer 2 pins and the capture/compare
inputs/outputs. Port 1 pins are assigned to be used as
analog inputs via the register P1ANA.
The functions are assigned to the pins of port 1 as follows:
P1.0 / AN0 / T2Analog input channel 0 /
P1.1 / AN1 / T2EXAnalog input channel 1 /
P1.2 / AN2 / CC0Analog input channel 2 /
P1.3 / AN3 / COUT0Analog input channel 3 /
P1.4 / CC1Input/output of capture/compare
P1.5 / COUT1Output of capture/compare
P1.6 / CC2Input/output of capture/compare
P1.7 / COUT2Output of capture/compare
input to counter 2
capture/reload trigger of timer 2 /
up-down count
input/output of capture/compare
channel 0
output of capture/compare
channel 0
channel 1
channel 1
channel 2
channel 2
RESET4IRESET
A high level on this pin for one machine cycle while the
oscillator is running resets the device. An internal diffused
resistor to VSS permits power-on reset using only an
external capacitor to VCC.
*)I = Input
O = Output
Semiconductor Group7
Table 1
Pin Definitions and Functions (cont’d)
C504
SymbolPin Number
(P-MQFP-44)
P3.0-P3.75, 7-13
5
7
8
9
10
11
12
13
I/O
Function
*)
I/OPort 3
is an 8-bit bidirectional port. P3.0 (R×D) and P3.1 (T×D)
operate as defined for the C501. P3.2 to P3.7 contain the
external interrupt inputs, timer inputs, input and as an
additional optinal function four of the analog inputs of the
A/D-converter. Port 3 pins are assigned to be used as
analog inputs via the bits of SFR P3ANA.
P3.6/WR can be assigned as a third interrupt input. The
functions are assigned to the pins of port 3 as follows:
P3.0 / RxDReceiver data input (asynch.) or data
P3.6 / WR / INT2WR control output; latches the data
P3.7 / RDRD control output; enables the
input/output (synch.) of serial
interface
clock output (synch.) of serial
interface
interrupt 0 input / timer 0 gate control
input
interrupt 1 input / timer 1 gate control
input
counter input
counter input
byte from port 0 into the external data
memory /
external interrupt 2 input
external data memory
CTRAP6ICCU Trap Input
With CTRAP = low the compare outputs of the CAPCOM
unit are switched to the logic level as defined in the COINI
register (if they are enabled by the bits in SFR TRCON).
CTRAP is an input pin with an internal pullup resistor. For
power saving reasons, the signal source which drives the
CTRAP input should be at high or floating level during
power-down mode.
*)I = Input
O = Output
Semiconductor Group8
Table 1
Pin Definitions and Functions (cont’d)
C504
SymbolPin Number
(P-MQFP-44)
I/O
*)
Function
XTAL214–XTAL2
Output of the inverting oscillator amplifier.
XTAL115–XTAL1
Input to the inverting oscillator amplifier and input to the
internal clock generator circuits.
To drive the device from an external clock source, XTAL1
should be driven, while XTAL2 is left unconnected. There
are no requirements on the duty cycle of the external clock
signal, since the input to the internal clocking circuitry is
divided down by a divide-by-two flip-flop. Minimum and
maximum high and low times as well as rise/fall times
specified in the AC characteristics must be observed.
P2.0-P2.718-25I/OPort 2
is a bidirectional I/O port with internal pullup resistors. Port
2 pins that have 1s written to them are pulled high by the
internal pullup resistors, and in that state can be used as
inputs. As inputs, port 2 pins being externally pulled low
will source current (
of the internal pullup resistors. 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.
I
, in the DC characteris-tics) because
IL
PSEN26OThe Program Store Enable
output is a control signal that enables the external program
memory to the bus during external fetch operations. It is
activated every six oscillator periodes except during
external data memory accesses. Remains high during
internal program execution.
ALE27OThe Address Latch Enable
output is used for latching the low-byte of the address into
external memory during normal operation. It is activated
every six oscillator periodes except during an external data
memory access. When instructions are executed from
internal ROM (
EA=1) the ALE generation can be disabled
by bit EALE in SFR SYSCON.
*)I = Input
O = Output
Semiconductor Group9
Table 1
Pin Definitions and Functions (cont’d)
C504
SymbolPin Number
(P-MQFP-44)
I/O
*)
Function
COUT328O10-Bit compare channel output
This pin is used for the output signal of the 10-bit compare
timer 2 unit. COUT3 can be disabled and set to a high or
low state.
EA29IExternal Access Enable
When held at high level, instructions are fetched from the
internal ROM (C504-2R only) when the PC is less than
4000H.When held at low level, the C504 fetches all
instructions from external program memory.
For the C504-L this pin must be tied low.
P0.0-P0.737-30I/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 application it
uses strong internal pullup resistors when issuing 1 s.
Port 0 also outputs the code bytes during program
verification in the C504-2R. External pullup resistors are
required during program (ROM) verification.
V
AREF
V
AGND
V
SS
V
CC
*)I = Input
O = Output
38–Reference voltage for the A/D converter.
39–Reference ground for the A/D converter.
16–Ground (0V)
17–Power Supply (+5V)
Semiconductor Group10
C504
Functional Description
The C504 basic architecture is fully compatible to the standard 8051 microcontroller family. While
maintaining all architectural and operational characteristics of the SAB 80C52 / C501, the C504
incorporates some enhancements such as on-chip XRAM, A/D converter, fail save mechanisms,
and a versatile capture/compare unit.
Figure 3 shows a block diagram of the C504.
Figure 3
Block Diagram of the C504
Semiconductor Group11
C504
CPU
The C504 is efficient both as a controller and as an arithmetic processor. It has extensive facilities
for binary and BCD arithmetic and excels in its bit-handling capabilities. Efficient use of program
memory results from an instruction set consisting of 44 % one-byte, 41 % two-byte, and 15 % threebyte instructions. With a 12 MHz crystal, 58 % of the instructions are executed in 1.0µs (24 MHz:
500 ns, 40 MHz : 300 ns).
Special Function Register PSW (Address D0H)Reset Value : 00
Bit No.MSBLSB
D7
H
BitFunction
CYCarry Flag
ACAuxiliary Carry Flag
F0General Purpose Flag
RS1
RS0
CYAC
D6
H
Used by arithmetic instruction.
Used by instructions which execute BCD operations.
Register Bank select control bits
These bits are used to select one of the four register banks.
RS1RS0Function
H
D5
F0
H
D4
RS1RS0OVF1PD0
H
D3
H
D2
H
D1
H
D0
H
PSW
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
OVOverflow Flag
Used by arithmetic instruction.
F1General Purpose Flag
PParity Flag
Set/cleared by hardware after each instruction to indicate an odd/even
number of "one" bits in the accumulator, i.e. even parity.
Semiconductor Group12
H
H
H
H
Memory Organization
The C504 CPU manipulates operands in the following four address spaces:
– up to 64 Kbyte of external program memory
– up to 64 Kbyte of external data memory
– 256 bytes of internal data memory
– 256 bytes of internal XRAM data memory
– a 128 byte special function register area
Figure 4 illustrates the memory address spaces of the C504.
C504
Figure 4
C504 Memory Map
The XRAM in the C504 is a memory area that is logically located at the upper end of the external
memory space, but is integrated on the chip. Because the XRAM is used in the same way as
external data memory the same instruction types (MOVX instructions) must be used for accessing
the XRAM. The XRAM can be enabled and disabled by the XMAP bit in the SYSCON register.
ROM Protection
The C504-2R ROM version allows to protect the content of the internal ROM against read out by
non authorized people. The type of ROM protection (protected or unprotected) is fixed with the
ROM mask. Therefore, the customer of a C504-2R ROM version has to define whether ROM
protection has to be selected or not.
Semiconductor Group13
C504
Special Function Registers
All registers, except the program counter and the four general purpose register banks, reside in the
special function register area.
The 63 special function register (SFR) include pointers and registers that provide an interface
between the CPU and the other on-chip peripherals. There are also 128 directly addressable bits
within the SFR area.
The SFRs of the C504 are listed in table 2 and table 3. In table 2 they are organized in groups
which refer to the functional blocks of the C504. Table 3 illustrates the contents of the SFRs in
numeric order of their addresses.
Semiconductor Group14
C504
Table 2
Special Function Registers - Functional Blocks
BlockSymbolNameAddressContents after
Reset
CPUACC
B
DPH
DPL
PSW
SP
SYSCON
Interrupt
System
IEN0
IEN1
CCIE
IP0
IP1
ITCON
PortsP0
P1
P1ANA
P2
P3
P3ANA
A/DConverter
ADCON0
ADCON1
ADDATH
ADDATL
P1ANA
P3ANA
Serial
Channels
PCON
SBUF
SCON
Timer 0/
Timer 1
TCON
TH0
TH1
TL0
TL1
TMOD
1) Bit-addressable special function registers
2) This special function register is listed repeatedly since some bits of it also belong to other functional blocks.
3) X means that the value is undefined and the location is reserved
4) SFR is located in the mapped SFR area. For accessing this SFR, bit RMAP in SFR SYSCON must be set.
Accumulator
B-Register
Data Pointer, High Byte
Data Pointer, Low Byte
Program Status Word Register
Stack Pointer
System Control Register