SM59R16A5/SM59R09A5/SM59R05A5
8-Bit Micro-controller
64KB/36KB/20KB with ISP Flash
& 2KB RAM embedded
FOSVOS TEL: 021-58998693
Description..........................................................................................................................................................................3
Features..............................................................................................................................................................................3
Pin Configuration ................................................................................................................................................................4
Block Diagram.....................................................................................................................................................................8
Pin Description....................................................................................................................................................................9
Special Function Register (SFR) ......................................................................................................................................11
Function Description.........................................................................................................................................................15
1.
General Features .....................................................................................................................................................15
1.1.
1.2.
1.3.
1.4.
Embedded Flash.........................................................................................................................................15
IO Pads .......................................................................................................................................................15
2T/1T Selection...........................................................................................................................................15
RESET ........................................................................................................................................................16
1.4.1.
Hardware RESET function.............................................................................................................16
Software RESET function ..............................................................................................................16
Time Access Key register (TAKEY)................................................................................................16
Software Reset register (SWRES).................................................................................................16
Example of software reset .............................................................................................................17
1.4.2.
1.4.3.
1.4.4.
1.4.5.
1.5.
Clocks .........................................................................................................................................................17
2.
3.
Instruction Set ..........................................................................................................................................................18
Memory Structure.....................................................................................................................................................22
3.1.
3.2.
Program Memory ........................................................................................................................................22
Data Memory...............................................................................................................................................24
3.2.1.
3.2.2.
3.2.3.
Data memory - lower 128 byte (00h to 7Fh) ..................................................................................24
Data memory - higher 128 byte (80h to FFh) ................................................................................25
Data memory - Expanded 2048 bytes ($0000 to $07FF) ..............................................................25
4.
CPU Engine .............................................................................................................................................................26
4.1.
4.2.
4.3.
4.4.
4.5.
4.6.
4.7.
4.8.
Accumulator ................................................................................................................................................26
B Register ...................................................................................................................................................26
Program Status Word..................................................................................................................................27
Stack Pointer...............................................................................................................................................27
Data Pointer ................................................................................................................................................27
Data Pointer 1 .............................................................................................................................................28
Internal RAM control register ......................................................................................................................28
Interface control register .............................................................................................................................28
5.
6.
GPIO ........................................................................................................................................................................30
Multiplication Division Unit (MDU)............................................................................................................................32
6.1.
6.2.
Operating registers of the MDU ..................................................................................................................32
Operation of the MDU .................................................................................................................................33
6.2.1.
6.2.2.
6.2.3.
First phase: loading the MDx registers, x = 0~5: ...........................................................................33
Second phase: executing calculation. ...........................................................................................33
Third phase: reading the result from the MDx registers. ...............................................................34
6.3.
6.4.
Normalizing .................................................................................................................................................34
Shifting ........................................................................................................................................................34
7.
8.
Timer 0 and Timer 1.................................................................................................................................................35
7.1.
7.2.
Timer/counter mode control register (TMOD).............................................................................................35
Timer/counter control register (TCON) .......................................................................................................36
Timer 2 and Capture/Compare Unit.........................................................................................................................37
8.1.
Timer 2 function...........................................................................................................................................39
8.1.1.
Timer mode....................................................................................................................................39
Event counter mode.......................................................................................................................39
Gated timer mode ..........................................................................................................................39
Reload of Timer 2...........................................................................................................................39
8.1.2.
8.1.3.
8.1.4.
8.2.
8.3.
Compare function........................................................................................................................................39
8.2.1.
8.2.2.
Compare Mode 0 ...........................................................................................................................40
Compare Mode 1 ...........................................................................................................................40
Capture function..........................................................................................................................................41
8.3.1. Capture Mode 0 .............................................................................................................................41
Specifications subject to change without notice contact your sales representatives for the most recent information.
ISSFD-M047 Ver.G SM59R16A5 01/2014
1