sh66l16a SinoWealth Micro-Electronics Corp. Ltd, sh66l16a Datasheet - Page 5

no-image

sh66l16a

Manufacturer Part Number
sh66l16a
Description
16k 4-bit Low Power Micro-controller With Lcd Driver
Manufacturer
SinoWealth Micro-Electronics Corp. Ltd
Datasheet
Functional Description
1. CPU
The CPU contains the following functional blocks:
Program Counter (PC), Arithmetic Logic Unit (ALU), Carry
Flag (CY), Accumulator, Table Branch Register, Data
Pointer (INX, DPH, DPM, and DPL) and Stacks.
1.1. PC
The PC is used for ROM addressing consisting of 12-bit:
Page Register (PC11), and Ripple Carry Counter (PC10,
PC9, PC8, PC7, PC6, PC5, PC4, PC3, PC2, PC1, PC0).
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 address only 4K program ROM.
(Refer to the ROM description).
1.2. ALU and CY
The ALU performs arithmetic and logic operations. The ALU
provides the following functions:
Binary addition/subtraction (ADC, ADCM, ADD, ADDM,
SBC, SBCM, SUB, SUBM, ADI, ADIM, SBI, SBIM)
Decimal adjustments for addition/subtraction (DAA, DAS)
Logic operations (AND, ANDM, EOR, EORM, OR, ORM,
ANDIM, EORIM, ORIM)
Decisions (BA0, BA1, BA2, BA3, BAZ, BNZ, BC, BNC)
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.
1.3. Accumulator (AC)
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.
2. RAM
Built-in RAM contains general-purpose data memory and system register. Because of its static nature, the RAM can keep data
after the CPU entering STOP or HALT.
2.1. RAM Addressing
Data memory and system register can be accessed in one instruction by direct addressing. The following is the memory
allocation map:
System register: $000 - $01F
Data memory: $020 - $2FF, $370 - $3FF & $420 - $7FF (1872 X 4 bits, divided into 16 banks)
LCD RAM space: $300 - $36F (112 X 4 bits)
RAM Bank Table: (RAMB: System Register $14 bit3)
Where, B: RAM bank bit use in instructions.
RAMB=0, B=0
RAMB=1, B=0
$020 - $07F
$420 - $47F
Bank 0
Bank 8
RAMB=0, B=1
RAMB=1, B=1
$080 - $0FF
$480 - $4FF
Bank 1
Bank 9
RAMB=0, B=2
RAMB=1, B=2
$100 - $17F
$500 - $57F
Bank 10
Bank 2
RAMB=0, B=3
RAMB=1, B=3
$180 - $1FF
$580 - $5FF
Bank 11
Bank 3
5
RAMB=0, B=4
RAMB=1, B=4
$200 - $27F
$600 - $67F
1.4 Table Branch Register (TBR)
Table Data can be stored in program memory and can be
referenced by using Table Branch (TJMP) and Return
Constant (RTNW) instructions. The TBR and AC are placed
by an offset address in program ROM. TJMP instruction
branch into address ((PC11 - PC8) X (2
address is determined by RTNW to return look-up value into
(TBR, AC). ROM code Bit7-Bit4 is placed into TBR and
Bit3-Bit0 into AC.
1.5. Data Pointer
The Data Pointer can indirectly address data memory.
Pointer address is located in register DPH (3-bit), DPM
(3-bit)
000H--3FFH. Pseudo index address (INX) is used to read or
write Data memory, then RAM address Bit9 - Bit0 which
comes from DPH, DPM and DPL.
1.6. 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. The MSB is saved for CY and it is organized into 13
bits X 4 levels. The stack is operated on a first-in, last-out
basis and returned sequentially to the PC by the return
instructions (RTNI/RTNW).
Note:
The stack nesting includes both subroutine calls and
interrupts requests. The maximum allowed for subroutine
calls and interrupts are 4 levels. If the number of calls and
interrupt requests exceeds 4, then the bottom of stack will be
shifted out, that program execution may enter an abnormal
state.
Bank 12
Bank 4
and
RAMB=0, B=5
RAMB=1, B=5
DPL
$280 - $2FF
$680 - $6FF
Bank 13
Bank 5
(4-bit).
RAMB=0, B=6
RAMB=1, B=6
The
$300 - $37F
$700 - $77F
Bank 14
Bank 6
addressing
8
) + (TBR, AC)). The
SH66L16A
RAMB=0, B=7
RAMB=1, B=7
$380 - $3FF
$780 - $7FF
Bank 15
Bank 7
range
is

Related parts for sh66l16a