sh6636 SinoWealth Micro-Electronics Corp. Ltd, sh6636 Datasheet - Page 3

no-image

sh6636

Manufacturer Part Number
sh6636
Description
Mask 4-bit Microcontroller With Remote Control Carrier Synthesizer
Manufacturer
SinoWealth Micro-Electronics Corp. Ltd
Datasheet
Functional Description
1. CPU
The CPU core contains the following function blocks:
Program Counter, ALU, Carry Flag, Accumulator, Table
Branch Register (TBR), Data Pointer (INX, DPH, DPM and
DPL), and Stack.
(a) PC (Program Counter)
The PC is used for ROM addressing consisting of 12-bits:
Page Register (PC11), and Ripple Carry Counter (PC10,
PC9, PC8, PC7, PC6, PC5, PC4, PC3, PC2, PC1, PC0).
The program counter normally increases by one (+1) with
every execution of an instruction except in the following
cases:
(1) When executing a jump instruction (such as JMP, BA0,
(2) When executing a subroutine call instruction (CALL);
(3) When an interrupt occurs;
(4) When the chip is in the INITIAL RESET mode.
The program counter is loaded with data corresponding to
each instruction. The unconditional jump instruction (JMP)
can be set at 1-bit page register for higher than 2K.
The program counter can only address a 4K program ROM.
To address a 24K program ROM, the bank switch must be
used (Refer to the ROM description).
(b) ALU and CY (Carry Flag)
The ALU performs arithmetic and logic operations. The ALU
provides the following functions:
Binary addition/subtraction (ADC, SBC, ADD, SUB, ADI,
SBI)
2. RAM
Built-in RAM consists of general-purpose data memory and
a system register.
(a) RAM Addressing
Data memory and system register can be accessed in one
instruction by direct addressing.
The following is the memory allocation map:
$000 - $01F: System register and I/O.
$020 - $07F: Data memory (96 X 4 bits).
BAC);
3
Decimal adjustments for addition/subtraction (DAA, DAS)
Logic operations (AND, EOR, OR, ANDIM, EORIM, ORIM)
Decisions (BA0, BA1, BA2, BA3, BAZ, BC)
Logic Shift (SHR)
The Carry Flag (CY) holds the ALU overflow that the
arithmetic operation generates. During an interrupt service
or call instruction, the carry flag is pushed into the stack and
recovered from the stack by the RTNI instruction. It is
unaffected by the RTNW instruction.
(c) Accumulator
The accumulator is a 4-bit register holding the results of the
arithmetic logic unit. In conjunction with the ALU, data is
transferred between the accumulator and system register, or
data memory can be performed.
(d) Stack
The stack is a group of registers used to save the contents of
CY & PC (11-0) sequentially with each subroutine call or
interrupt. It is organized into 13 bits X 4 levels. The MSB is
saved for CY. 4 levels are the maximum allowed for
subroutine calls and interrupts.
The contents of the stack are returned sequentially to the PC
with the return instructions (RTNI/RTNW). The stack is
operated on a first-in, last-out basis. This 4-level nesting
includes both subroutine calls and interrupts requests. Note
that program execution may enter an abnormal state if the
number of calls and interrupt requests exceeds 4, where
upon then the bottom of stack will be shifted out.
(b) Data memory
Data memory is organized as 96 X 4 bits ($020 - $07F).
Because of its static nature, the RAM can keep data after the
CPU enters STOP or HALT.
(c) Data Pointer
The Data Pointer can indirectly address data memory.
Pointer address is located in register DPM (3-bits) and DPL
(4-bits). The addressing range can have 128 locations.
Pseudo index address (INX) is used to read or write Data
memory, then RAM address bit9-bit0 comes from DPH, DPM
and DPL.
SH6636

Related parts for sh6636