Part Number Hot Search : 
BR1045 NCV427 MSB32DA TA4100 2SK135 OP770D MSCD022H IRS50
Product Description
Full Text Search
 

To Download SM39R16A2 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 - 1 - table of contents description.................................................................................................................... ........................................3 features....................................................................................................................... ..........................................3 pin configuration.............................................................................................................. ....................................4 28 pin pdip/sop................................................................................................................ ..........................4 24 pin pdip/sop................................................................................................................ ..........................5 20 pin pdip/sop/ssop ........................................................................................................... ....................5 block diagram.................................................................................................................. ....................................6 pin description ................................................................................................................ .....................................7 special function register (sfr) ................................................................................................ ........................10 function description ........................................................................................................... ...............................14 1 general features ............................................................................................................. ..............................14 1.1 embedded flash............................................................................................................. .................14 1.2 io pads.................................................................................................................... ........................14 1.3 instruction timing selection............................................................................................... .............14 1.4 the clock out selection.................................................................................................... .............15 1.5 reset ...................................................................................................................... ......................15 1.5.1 hardware reset function .................................................................................................1 5 1.5.2 software reset function .................................................................................................. 15 1.5.3 reset status ............................................................................................................. ............16 1.5.4 time access key register (takey) ..................................................................................16 1.5.5 software reset register (swres) ......................................................................................16 1.5.6 example of software reset ................................................................................................ ..16 1.6 clocks ..................................................................................................................... ........................17 2 instruction set.............................................................................................................. .................................18 3 memory structure ............................................................................................................. ............................22 3.1 program memory............................................................................................................. ...............22 3.2 data memory ................................................................................................................ ..................24 3.2.1 data memory - lower 128 byte (00h to 7fh) ......................................................................25 3.2.2 data memory - higher 128 byte (80h to ffh).....................................................................25 4 cpu engine ................................................................................................................... ...............................26 4.1 accumulator ................................................................................................................ ...................26 4.2 b register ................................................................................................................. ......................26 4.3 program status word ........................................................................................................ ..............27 4.4 stack pointer .............................................................................................................. .....................27 4.5 data pointer ............................................................................................................... .....................27 4.6 data pointer 1 ............................................................................................................. ....................28 4.7 clock control register ..................................................................................................... ................28 4.8 interface control register........ ................ ................ ................ ................ ............. ............ ................29 5 gpio ......................................................................................................................... ....................................30 6 timer 0 and timer 1 .......................................................................................................... ...........................32 6.1 timer/counter mode control register (tmod) ...............................................................................32 6.2 timer/counter control register (tcon)...................................................................................... ....33 6.3 peripheral frequency control register............... ....................................................................... .......33 6.4 mode 0 (13-bit counter/timer) .. ................ ................ ................ ................ ................ ............ ........34 6.5 mode 1 (16-bit counter/timer) .. ................ ................ ................ ................ ................ ............ ........34 6.6 mode 2 (8-bit auto-reload counter/timer) ................................................................................... ..35
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 - 2 - 6.7 mode 3 (timer 0 acts as two independent 8 bit timers / counters)...............................................35 7 timer 2 and capture compare unit............................................................................................. .................36 7.1 timer 2 function ........................................................................................................... ..................38 7.1.1 timer mode............................................................................................................... ..........38 7.1.2 event counter mode ....................................................................................................... .....38 7.1.3 gated timer mode ......................................................................................................... ......39 7.1.4 reload of timer 2 ........................................................................................................ .......39 7.2 compare function ........................................................................................................... ................39 7.2.1 compare mode 0 ........................................................................................................... .....39 7.2.2 compare mode 1 ........................................................................................................... .....40 7.3 capture function ........................................................................................................... ..................41 7.3.1 capture mode 0 (by hardware)..........................................................................................41 7.3.2 capture mode 1(by software) ............................................................................................41 8 serial interface ............................................................................................................. .................................42 8.1 serial interface ........................................................................................................... .....................43 8.1.1 mode 0 ................................................................................................................... .............43 8.1.2 mode 1 ................................................................................................................... .............43 8.1.3 mode 2 ................................................................................................................... .............44 8.1.4 mode 3 ................................................................................................................... .............44 8.2 multiprocessor communication of serial interface .......................................................................45 8.3 peripheral frequency control register............... ....................................................................... .......45 8.4 baud rate generator........................................................................................................ .................46 8.4.1 serial interface modes 1 and 3........................................................................................... .46 9 watchdog timer............................................................................................................... ..............................47 10 interrupt ................................................................................................................... .....................................50 10.1 priority level structure .................................................................................................. ..................53 11 power management unit ....................................................................................................... .......................55 11.1 idle mode ................................................................................................................. .......................55 11.2 stop mode ................................................................................................................. ......................55 12 pulse width modulation (pwm) ................................................................................................ ..................56 13 iic function................................................................................................................ ...................................58 14 spi function - serial peripheral interface .................................................................................. ..................62 15 kbi ? keyboard interface .................................................................................................... ........................66 16 lvi ? low voltage interrupt................................................................................................. ........................69 17 10-bit analog-to-digital converter (adc) .................................................................................... ..............70 18 in-system programming (internal isp) ........................................................................................ ................73 18.1 isp service program....................................................................................................... .................73 18.2 lock bit (n).............................................................................................................. ......................73 18.3 program the isp service program ........................................................................................... .......74 18.4 initiate isp service program.............................................................................................. .............74 18.5 isp register ? takey, ifcon, ispfah, ispfal , ispfd and ispfc ............. ................ ............75 19 op/comparator ............................................................................................................... ..............................77 operating conditions......... ................ ................ ............. .............. ............. ............. ............. ...............................79 dc characteristics ............................................................................................................. .................................79 opa / comparator characteristics............................................................................................... .......................81
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 3 product list sm39r16/12/08a2w20np, sm39r16/12/08a2w24kp, sm39r16/12/08a2w28kp, sm39r16/12/08a2w20sp, sm39r16/12/08a2w24sp, sm39r16/12/08a2w28sp, sm39r16/12/08a2w20gp description the SM39R16A2 is a 1t (one machine cycle per clock) single-chip 8-bit microcontroller. it has 16k-byte embedded flash for program, and executes all asm51 instructions fully compatible with mcs-51. SM39R16A2 contains 256b on-chip ram, more than 26 gpios (28l package), various serial interfaces and many peripheral functions as described below. it can be programmed via writers. its on-chip ice is convenient for users in verification during development stage. the high performance of SM39R16A2 can achieve complicated manipulation within short time. about one third of the instructions are pure 1t, and the average speed is 8 times of traditional 8051, the fastest one among all the 1t 51-series.its excellent emi and esd characteristics are advantageous for many different applications. ordering information SM39R16A2ihhkl yymmv i: process identifier {w = 2.7v ~ 5.5v} hh: pin count k: package type postfix {as table below } l:pb free identifier {no text is non-pb free ?p? is pb free} yy: year mm: month v: version identifier{ a, b,?} postfix package pin / pad configuration n pdip (300 mil) page 3 s sop (300 mil) page 2,3 k skinny pdip (300 mil) page 2,3 g ssop (150 mil) page 3 contact syncmos : www.syncmos.com.tw 6f, no.10-2 li- hsin 1st road , sbip, hsinchu, taiwan tel: 886-3-567-1820 fax: 886-3-567-1891 features z operating voltage: 2.7v ~ 5.5v z high speed architecture of 1 clock/machine cycle runs up to 25mhz. z 1~8t can be switched on the fly. z instruction-set compatible with mcs-51. z 22.1184mhz internal rc oscillator, with programmable clock divider z 16k/12k/8k bytes on-chip program memory. z 256 bytes ram as standard 8052, z dual 16-bit data pointers (dptr0 & dptr1). z one serial peripheral interfaces in full duplex mode. z additional baud rate generator z three 16-bit timer/counters. (timer 0,1,2) z 26 gpios(28l package) z external interrupt 0,1 with four priority levels z programmable watchdog timer. z one iic interface. (master/slave mode) z one spi interface (master/slave mode) z 2-channel pwm z 4-channel 16-bit pca for compare(pwm) / capture / reload functions z 8-channel 10-bit analog-to-digital converter (adc) z opa/cmp x1 set (2 devices) z isp/iap/icp functions. z isp service program space configurable in n*256 byte (n=0 to 16) size. z eeprom function. z on-chip in-circuit emulator (ice) functions with on-chip debugger (ocd). z keyboard interface (kbi) for four more interrupts. z lvi/lvr (lvr deglitch 500ns) z io pad esd over 4kv. z enhance user code protection. z power management unit for idle and power down modes.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 4 pin configuration 28 pin pdip/sop 3 4 5 6 7 8 9 10 11 12 26 25 24 23 22 21 20 19 18 17 syncmos SM39R16A2 yymmv (28 pin top view) op1out/adc0/spi_clk/kbi0/p0.0 pwm1/mosi/cc2/p1.7 pwm0/miso/cc1/p1.6 rst(default)/p1.5 vss osc_in/xtal1/p3.1 clk_out/xtal2/p3.0 spi_ss/int1/p1.4 oci_sda/iic_sda/int0/p1.3 oci_scl/iic_scl/t0/p1.2 p0.1/kbi1/adc1/op1nin p0.2/kbi2/adc2/op1pin p0.3/kbi3/t2/adc3/op0nin p0.4/adc4/op0pin p0.5/adc5 vdd p0.6/adc6/op0out p0.7/t1/adc7 p1.0/txd p1.1/rxd/t2ex 2 cc3/(rxd*)/p2.1 1 (txd*)/p2.0 28 27 p2.7/(iic_sda*) p2.6/cc0/(iic_scl*) 16 15 p2.5/(spi_clk*) p2.4/(spi_ss*) 13 14 (mosi*)/p2.2 (miso*)/p2.3 notes 1. the pin reset/p1.5 factory default is reset, user must keep this pin at low during power-up. user can configure it to gpio (p1. 5) by a flash programmer. 2. to avoid accidentally entering isp-mode(refer to section 18.4), care must be taken not asserting pulse signal at rxd p1.1/p2.1 during power-up while p2.6 p2.7 p1.6 are set to high. 3. to apply icp function, osi_sda/p1.3 and oci_scl/p1.2 must be set to bi-direction mode if they are configured as gpio in system. 4. have *mark pins can offer the special function to switch, please reference the sfr aux introduction.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 5 24 pin pdip/sop 2 3 4 5 6 7 8 9 10 11 23 22 21 20 19 18 17 16 15 14 syncmos SM39R16A2 yymmv (24 pin top view) op1out/adc0/spi_clk/kbi0/p0.0 pwm1/mosi/cc2/p1.7 pwm0/miso/cc1/p1.6 rst(default)/p1.5 vss osc_in/xtal1/p3.1 clkout/xtal2/p3.0 spi_ss/int1/p1.4 oci_sda/iic_sda/int0/p1.3 oci_scl/iic_scl/t0/p1.2 p0.1/kbi1/adc1/op1nin p0.2/kbi2/adc2/op1pin p0.3/kbi3/t2/adc3/op0nin p0.4/adc4/op0pin p0.5/adc5 vdd p0.6/adc6/op0out p0.7/t1/adc7 p1.0/txd p1.1/rxd/t2ex 1 cc3/p2.1 24 p2.6/cc0 13 p2.5 12 p2.2 20 pin pdip/sop/ssop 1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 syncmos SM39R16A2 yymmv (20 pin top view) op1out/spiclk/kbi0/p0.0 pwm1/mosi/cc2/p1.7 pwm0/miso/cc1/p1.6 rst(default)/p1.5 vss osc_in/xtal1/p3.1 clkout/xtal2/p3.0 spi_ss/int1/p1.4 oci_sda/iic_sda/int0/p1.3 oci_scl/iic_scl/t0/p1.2 p0.1/kbi1/adc1/op1nin p0.2/kbi2/adc2/op1pin p0.3/kbi3/t2/adc3/op0nin p0.4/adc4/op0pin p0.5/adc5 vdd p0.6/adc6/op0out p0.7/t1/adc7 p1.0/txd p1.1/rxd/t2ex
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 6 block diagram
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 7 pin description 28l symbol i/o description 1 p2.0/(txd*) i/o bit 0 of port 2 & serial interface channel transmit data or receive clock in mode 0 can be switch by aux 2 p2.1/(rxd*)/cc3 i/o bit 1 of port 2 & serial interface channel receive/transmit data can be switch by aux & timer 2 compare/capture channel 3 3 p0.0/kbi0/ spi_clk/adc0/ op1out i/o bit 0 of port 0 & kbi interrupt 0 & spi interface clock pin & adc input channel 0 & op1 output 4 p1.7/cc2/mosi/ pwm1 i/o bit 7 of port 1 & timer 2 compare/capture channel 2 & spi interface serial data master output or slave input pin & pwm channel 1 5 p1.6/cc1/miso/ pwm0 i/o bit 6 of port 1 & timer 2 compare/capture channel 1 & spi interface serial data master input or slave output pin & pwm channel 0 6 p1.5/rst i/o bit 5 of port 1 & reset pin(default) 7 vss i power supply 8 p3.1/xtal1/osc_in i/o bit 1 of port 3 & crystal input(default) & oscillator input 9 p3.0/xtal2/clkout i/o bit 0 of port 3 & crystal output(default) & clock output 10 p1.4/int1/spi_ss i/o bit 4 of port 1 & external interrupt 1 & spi interface slave select pin 11 p1.3/int0/ iic_sda/oci_sda i/o bit 3 of port 1 & external interrupt 0 & iic sda pin & on-chip instrumentation command and data i/o pin synchronous to oci_scl in ice and icp functions 12 p1.2/t0/iic_scl/ oci_scl i/o bit 2 of port 1 & timer 0 external input & iic scl pin & on-chip instrumentation clock i/o pin of ice and icp functions 13 p2.2/mosi i/o bit 2 of port 2 & spi interface serial data master output or slave input pin 14 p2.3/miso i/o bit 3 of port 2 & spi interface serial data master input or slave output pin 15 p2.4/(spi_ss*) i/o bit 4 of port 2 & spi interface slave select pin can be switch by aux 16 p2.5/(spi_clk*) i/o bit 5 of port 2 & spi interface clock pin can be switch by aux 17 p1.1/rxd/t2ex i/o bit 1 of port 1 & serial interface channel 0 receive/transmit data & timer 2 capture trigger 18 p1.0/txd i/o bit 0 of port 1 & serial interface channel 0 transmit data or receive clock in mode 0 19 p0.7/t1/adc7 i/o bit 7 of port 0 & timer 1 external input & adc input channel 7 20 p0.6/adc6/ op0out i/o bit 6 of port 0 & adc input channel 6 & op0 output 21 vdd i power supply 22 p0.5/adc5 i/o bit 5 of port 0 & adc input channel 5 23 p0.4/adc4/ op0pin i/o bit 4 of port 0 & adc input channel 4 & op0 positive input 24 p0.3/kbi3/t2/ adc3/op0nin i/o bit 3 of port 0 & kbi interrupt 3 & timer 2 external input clock & adc input channel 3 & op0 negative input 25 p0.2/kbi2/adc2/ op1pin i/o bit 2 of port 0 & kbi interrupt 2 & adc input channel 2 & op1 positive input 26 p0.1/kbi1/adc1/ op1nin i/o bit 1 of port 0 & kbi interrupt 1 & adc input channel 1 & op1 negative input 27 p2.6/cc0/(iic_scl*) i/o bit 6 of port 2 & timer 2 compare/capture channel 0 & iic scl pin can be switch by aux 28 p2.7/(iic_sda*) i/o bit 7 of port 2 & iic sda pin can be switch by aux
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 8 24l symbol i/o description 1 p2.1/cc3 i/o bit 1 of port 2 & timer 2 compare/capture channel 3 2 p0.0/kbi0/ spi_clk/adc0/ op1out i/o bit 0 of port 0 & kbi interrupt 0 & spi interface clock pin & adc input channel 0 & op1 output 3 p1.7/cc2/mosi/ pwm1 i/o bit 7 of port 1 & timer 2 compare/capture channel 2 & spi interface serial data master output or slave input pin & pwm channel 1 4 p1.6/cc1/miso/ pwm0 i/o bit 6 of port 1 & timer 2 compare/capture channel 1 & spi interface serial data master input or slave output pin & pwm channel 0 5 p1.5/rst i/o bit 5 of port 1 & reset pin(default) 6 vss i power supply 7 p3.1/xtal1/osc_in i/o bit 1 of port 3 & crystal input(default) & oscillator input 8 p3.0/xtal2/clkout i/o bit 0 of port 3 & crystal output(default) & clock output 9 p1.4/int1/spi_ss i/o bit 4 of port 1 & external interrupt 1 & spi interface slave select pin 10 p1.3/int0/ iic_sda/oci_sda i/o bit 3 of port 1 & external interrupt 0 & iic sda pin & on-chip instrumentation command and data i/o pin synchronous to oci_scl in ice and icp functions 11 p1.2/t0/iic_scl/ oci_scl i/o bit 2 of port 1 & timer 0 external input & iic scl pin & on-chip instrumentation clock i/o pin of ice and icp functions 12 p2.2 i/o bit 2 of port 2 13 p2.5 i/o bit 5 of port 2 & spi interface clock pin 14 p1.1/rxd/t2ex i/o bit 1 of port 1 & serial interface channel 0 receive/transmit data & timer 2 capture trigger 15 p1.0/txd i/o bit 0 of port 1 & serial interface channel 0 transmit data or receive clock in mode 0 16 p0.7/t1/adc7 i/o bit 7 of port 0 & timer 1 external input & adc input channel 7 17 p0.6/adc6/ op0out i/o bit 6 of port 0 & adc input channel 6 & op0 output 18 vdd i power supply 19 p0.5/adc5 i/o bit 5 of port 0 & adc input channel 5 20 p0.4/adc4/ op0pin i/o bit 4 of port 0 & adc input channel 4 & op0 positive input 21 p0.3/kbi3/t2/ adc3/op0nin i/o bit 3 of port 0 & kbi interrupt 3 & timer 2 external input clock & adc input channel 3 & op0 negative input 22 p0.2/kbi2/adc2/ op1pin i/o bit 2 of port 0 & kbi interrupt 2 & adc input channel 2 & op1 positive input 23 p0.1/kbi1/adc1/ op1nin i/o bit 1 of port 0 & kbi interrupt 1 & adc input channel 1 & op1 negative input 24 p2.6/cc0 i/o bit 6 of port 2 & timer 2 compare/capture channel 0
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 9 20l symbol i/o description 1 p0.0/kbi0/spi_clk/ op1out i/o bit 0 of port 0 & kbi interrupt 0 & spi interface clock pin & op1 output 2 p1.7/cc2/mosi/ pwm1 i/o bit 7 of port 1 & timer 2 compare/capture channel 2 & spi interface serial data master output or slave input pin & pwm channel 1 3 p1.6/cc1/miso/ pwm0 i/o bit 6 of port 1 & timer 2 compare/capture channel 1 & spi interface serial data master input or slave output pin & pwm channel 0 4 p1.5/rst i/o bit 5 of port 1 & reset pin(default) 5 vss i power supply 6 p3.1/xtal1/osc_in i/o bit 1 of port 3 & crystal input(default) & oscillator input 7 p3.0/xtal2/clkout i/o bit 0 of port 3 & crystal output(default) & clock output 8 p1.4/int1/spi_ss i/o bit 4 of port 1 & external interrupt 1 & spi interface slave select pin 9 p1.3/int0/ iic_sda/oci_sda i/o bit 3 of port 1 & external interrupt 0 & iic sda pin & on-chip instrumentation command and data i/o pin synchronous to oci_scl in ice and icp functions 10 p1.2/t0/iic_scl/ oci_scl i/o bit 2 of port 1 & timer 0 external input & iic scl pin & on-chip instrumentation clock i/o pin of ice and icp functions 11 p1.1/rxd/t2ex i/o bit 1 of port 1 & serial interface channel 0 receive/transmit data & timer 2 capture trigger 12 p1.0/txd i/o bit 0 of port 1 & serial interface channel 0 transmit data or receive clock in mode 0 13 p0.7/t1/adc7 i/o bit 7 of port 0 & timer 1 external input & adc input channel 7 14 p0.6/adc6/ op0out i/o bit 6 of port 0 & adc input channel 6 & op0 output 15 vdd i power supply 16 p0.5/adc5 i/o bit 5 of port 0 & adc input channel 5 17 p0.4/adc4/ op0pin i/o bit 4 of port 0 & adc input channel 4 & op0 positive input 18 p0.3/kbi3/t2/ adc3/op0nin i/o bit 3 of port 0 & kbi interrupt 3 & timer 2 external input clock & adc input channel 3 & op0 negative input 19 p0.2/kbi2/adc2/ op1pin i/o bit 2 of port 0 & kbi interrupt 2 & adc input channel 2 & op1 positive input 20 p0.1/kbi1/adc1/ op1nin i/o bit 1 of port 0 & kbi interrupt 1 & adc input channel 1 & op1 negative input
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 10 special function register (sfr) a map of the special function registers is shown as below: hex\bin x000 x001 x010 x011 x100 x101 x110 x111 bin/hex f8 iics iicctl iica1 iica2 iicrwd iicebt cmp0con cmp1con ff f0 b spic1 spic2 spitxd spirxd spis oppin takey f7 e8 ef e0 acc ispfah ispfal ispfd ispfc lvc swres e7 d8 pfcon p3m0 p3m1 df d0 psw ccen2 p0m0 p0m1 p1m0 p1m1 p2m0 p2m1 d7 c8 t2con cccon crcl crch tl2 th2 pwmmdh pwmmdl cf c0 ircon ccen ccl1 cch1 ccl2 cch2 ccl3 cch3 c7 b8 ien1 ip1 srelh pwmd0h pwmd0l pwmd1h pwmd1l bf b0 p3 pwmc wdtc wdtk b7 a8 ien0 ip0 srell adcc1 adcc2 adcdh adcdl adccs af a0 p2 rsts a7 98 scon sbuf ien2 9f 90 p1 aux kbls kbe kbf kbd ircon2 97 88 tcon tmod tl0 tl1 th0 th1 ckcon ifcon 8f 80 p0 sp dpl dph dpl1 dph1 pcon 87 hex\bin x000 x001 x010 x011 x100 x101 x110 x111 bin/hex note: special function registers reset values and description for SM39R16A2 register location reset value description system sp 81h 07h stack pointer acc e0h 00h accumulator psw d0h 00h program status word b f0h 00h b register dpl 82h 00h data pointer 0 low byte dph 83h 00h data pointer 0 high byte dpl1 84h 00h data pointer 1 low byte dph1 85h 00h data pointer 1 high byte aux 91h 00h auxiliary register pcon 87h 00h power control ckcon 8eh 10h clock control register interrupt & priority ircon c0h 00h interrupt request control register ircon2 97h 00h interrupt request control register 2 ien0 a8h 00h interrupt enable register 0 ien1 b8h 00h interrupt enable register 1
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 11 register location reset value description ien2 9ah 00h interrupt enable register 2 ip0 a9h 00h interrupt priority register 0 ip1 b9h 00h interrupt priority register 1 kbi kbls 93h 00h keyboard level selector register kbe 94h 00h keyboard input enable register kbf 95h 00h keyboard interrupt flag register kbd 96h 00h keyboard interface de-bounce control register uart pcon 87h 00h power control aux 91h 00h auxiliary register scon 98h 00h serial port, control register sbuf 99h 00h serial port, data buffer srell aah 00h serial port, reload register, low byte srelh bah 00h serial port, reload register, high byte pfcon d9h 00h peripheral frequency control register adc adcc1 abh 00h adc control 1 register adcc2 ach 00h adc control 2 register adcdh adh 00h adc data high byte adcdl aeh 00h adc data low byte adccs afh 00h adc clock select wdt rsts a1h 00h reset status register wdtc b6h 04h watchdog timer control register wdtk b7h 00h watchdog timer refresh key. takey f7h 00h time access key register pwm pwmc b5h 00h pwm control register pwmd0h bch 00h pwm channel 0 data high byte pwmd0l bdh 00h pwm channel 0 data low byte pwmd1h beh 00h pwm channel 1 data high byte pwmd1l bfh 00h pwm channel 1 data low byte pwmmdh ceh 00h pwm max data register, high byte. pwmmdl cfh ffh pwm max data register, low byte. timer0/timer1 tcon 88h 00h timer/counter control tmod 89h 00h timer mode control tl0 8ah 00h timer 0, low byte tl1 8bh 00h timer 1, low byte th0 8ch 00h timer 0, high byte
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 12 register location reset value description th1 8dh 00h timer 1, high byte pfcon d9h 00h peripheral frequency control register pca(timer2) ccen c1h 00h compare/capture enable register ccl1 c2h 00h compare/capture register 1, low byte cch1 c3h 00h compare/capture register 1, high byte ccl2 c4h 00h compare/capture register 2, low byte cch2 c5h 00h compare/capture register 2, high byte ccl3 c6h 00h compare/capture register 3, low byte cch3 c7h 00h compare/capture register 3, high byte t2con c8h 00h timer 2 control cccon c9h 00h compare/capture control crcl cah 00h compare/reload/capture register, low byte crch cbh 00h compare/reload/capture register, high byte tl2 cch 00h timer 2, low byte th2 cdh 00h timer 2, high byte ccen2 d1h 00h compare/capture enable 2 register gpio p0 80h ffh port 0 p1 90h ffh port 1 p2 a0h ffh port 2 p3 b0h ffh port 3 p0m0 d2h 00h port 0 output mode 0 p0m1 d3h 00h port 0 output mode 1 p1m0 d4h 00h port 1 output mode 0 p1m1 d5h 00h port 1 output mode 1 p2m0 d6h 00h port 2 output mode 0 p2m1 d7h 00h port 2 output mode 1 p3m0 dah 00h port 3 output mode 0 p3m1 dbh 00h port 3 output mode 1 isp/iap/eeprom ifcon 8fh 00h interface control register ispfah e1h ffh isp flash address-high register ispfal e2h ffh isp flash address-low register ispfd e3h ffh isp flash data register ispfc e4h 00h isp flash control register takey f7h 00h time access key register lvi/lvr/softreset rsts a1h 00h reset status register lvc e6h 20h low voltage control register swres e7h 00h software reset register takey f7h 00h time access key register
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 13 register location reset value description spi aux 91h 00h auxiliary register spic1 f1h 08h spi control register 1 spic2 f2h 00h spi control register 2 spitxd f3h 00h spi transmit data buffer spirxd f4h 00h spi receive data buffer spis f5h 40h spi status register iic aux 91h 00h auxiliary register iics f8h 00h iic status register iicctl f9h 04h iic control register iica1 fah a0h iic channel 1 address 1 register iica2 fbh 60h iic channel 1 address 2 register iicrwd fch 00h iic channel 1 read / write data buffer iicebt fdh 00h iic enable bus transaction register opa oppin f6h 00h op/comparator pin select register cmp0con feh 00h comparator 0 control register cmp1con ffh 00h comparator 1 control register
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 14 function description 1 general features SM39R16A2 is an 8-bit micro-controller. all of its functions and the detailed meanings of sfr will be given in the following sections. 1.1 embedded flash the program can be loaded into the embedded 16kb/12kb/8kb flash memory via its writer or in-system programming (isp). the high-quality flash has a 100k-write cycle life suitable for re-programming and data recording as eeprom. 1.2 io pads the SM39R16A2 has four i/o ports: port 0, port 1, port 2 and port 3. ports 0, 1, 2 are 8-bit ports and port 3 is a 2-bit port. these are: quasi-bidirectional (standard 8051 port outputs), push-pull, open drain, and input-only. as description in section 5. all the pads for p0 p1 p2 and p3 are with slew rate to reduce emi. the io pads can withstand 4kv esd in human body mode guaranteeing the SM39R16A2?s quality in high electro-static environments. the reset pin can define as general i/o p1.5 when user use internal reset. the xtal2 and xtal1 can define as p3.0 and p3.1 by writer or isp when user use internal osc as system clock when user use external osc as system clock and input into xtal1 only xtal2 can be defined as p3.0. 1.3 instruction timing selection the conventional 52-series mcus are 12t, i.e., 12 oscillator clocks per machine cycle. SM39R16A2 is a 1t to 8t mcu, i.e., its machine cycle is one-clock to eight-clock. in the other words, it can execute one instruction within one clock to only eight cl ocks. mnemonic: ckcon address: 8eh 7 6 5 4 3 2 1 0 reset - its[2:0] - - clkout[1:0] 10h its: instruction timing select. its [2:0] instruction timing 000 1t mode 001 2t mode (default) 010 3t mode 011 4t mode 100 5t mode 101 6t mode 110 7t mode 111 8t mode the default is in 2t mode, and it can be changed to another instruction timing mode if ckcon [6:4] (at address 8eh) is change a ny time. not every instruction can be executed with one machine cycle. the exact machine cycle number for all the instructions are given in the next section.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 15 1.4 the clock out selection the SM39R16A2 can generator a clock out signal at p3.0 when user use oscillator (xtal1 as clock input) or internal osc as system clock. the ckcon [1:0] (at address 8eh) can change any time. clkout: clock output select. ckcon [1:0] mode. 00 gpio(default) 01 fosc 10 fosc/2 11 fosc/4 it can be used when the system clock is the internal rc oscillator. 1.5 reset 1.5.1 hardware reset function SM39R16A2 provides internal reset circuit inside the internal reset time can set by writer or isp. internal reset time 25ms (default) 200ms 100ms 50ms 16ms 8ms 4ms 1.5.2 software reset function SM39R16A2 provides one software reset mechanism to reset whole chip. to perform a software reset, the firmware must write three specific values 55h, aah and 5ah sequentially to the takey register to enable the software reset register (swres) write attribu te. after swres register obtain the write authority, the firmware can write ffh to the swres register. the hardware will decode a reset signal that ?or? with the other hardware reset. the swres register is self-reset at the end of the software reset procedu re. mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t software reset function rsts reset status register a1h - - - pdrf wdtf swrf lvrf porf 00h takey time access key register f7h takey [7:0] 00h swres software reset register e7h swres [7:0] 00h
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 16 1.5.3 reset status mnemonic: rsts address: a1h 7 6 5 4 3 2 1 0 reset - - - pdrf wdtf swrf lvrf porf 00h pdrf: pad reset flag. when mcu is reset by reset pad, pdrf flag will be set to one by hardware. this flag clear by software. wdtf: watchdog timer reset flag. when mcu is reset by watchdog, wdtf flag will be set to one by hardware. this flag clear by software. swrf: software reset flag. when mcu is reset by software, swrf flag will be set to one by hardware. this flag clear by software. lvrf: low voltage reset flag. when mcu is reset by lvr, lvrf flag will be set to one b y hardware. this flag clear by software. porf: power on reset flag. when mcu is reset by por, porf flag will be set to one by hardware. this flag clear by software. 1.5.4 time access key register (takey) mnemonic: takey address: f7h 7 6 5 4 3 2 1 0 reset takey [7:0] 00h software reset register (swres) is read-only by default; software must write three specific values 55h, aah and 5ah sequentially to the takey register to enable the swres register write attribute. that is: mov takey, #55h mov takey, #0aah mov takey, #5ah 1.5.5 software reset register (swres) mnemonic: swres address: e7h 7 6 5 4 3 2 1 0 reset swres [7:0] 00h swres [7:0]: software reset register bit. these 8-bit is self-reset at the end of the reset procedure. swres [7:0] = ffh, software reset. swres [7:0] = 00h ~ feh, mcu no action. 1.5.6 example of software reset mov takey, #55h mov takey, #0aah mov takey, #5ah ; enable swres write attribute mov swres, #0ffh ; software reset mcu
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 17 1.6 clocks the default clock is the 22.1184mhz internal osc. this clock is used during the initialization stage. the major work of the initialization stage is to determine the clock source used in normal operation. the internal clock sources are from the internal osc with difference frequency division as given in table 1-1 the clock source can set by writer or icp. table 1-1: selection of clock source clock source external crystal (use xtal1 and xtal2 pins ) external crystal (only use xtal1, the xtal2 define as i/o) 22.1184mhz from internal osc 22.1184mhz/2 from internal osc 22.1184mhz/4 from internal osc 22.1184mhz/8 from internal osc 22.1184mhz/16 from internal osc there may be having a little variance in the frequency from the internal osc. the max variance as giving in table 1-2. table 1-2: temperature with variance temperature max variance 25 2%
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 18 2 instruction set all SM39R16A2 instructions are binary code compatible and perform the same functions as they do with the industry standard 8051 . the following tables give a summary of the instruction set cycles of the SM39R16A2 microcontroller core. table 2-1: arithmetic operations mnemonic description code bytes cycles add a,rn add register to accumulator 28-2f 1 1 add a,direct add direct byte to accumulator 25 2 2 add a,@ri add indirect ram to accumulator 26-27 1 2 add a,#data add immediate data to accumulator 24 2 2 addc a,rn add register to accumulator with carry flag 38-3f 1 1 addc a,direct add direct byte to a with carry flag 35 2 2 addc a,@ri add indirect ram to a with carry flag 36-37 1 2 addc a,#data add immediate data to a with carry flag 34 2 2 subb a,rn subtract register from a with borrow 98-9f 1 1 subb a,direct subtract direct byte from a with borrow 95 2 2 subb a,@ri subtract indirect ram from a with borrow 96-97 1 2 subb a,#data subtract immediate data from a with borrow 94 2 2 inc a increment accumulator 04 1 1 inc rn increment register 08-0f 1 2 inc direct increment direct byte 05 2 3 inc @ri increment indirect ram 06-07 1 3 inc dptr increment data pointer a3 1 1 dec a decrement accumulator 14 1 1 dec rn decrement register 18-1f 1 2 dec direct decrement direct byte 15 2 3 dec @ri decrement indirect ram 16-17 1 3 mul ab multiply a and b a4 1 5 div divide a by b 84 1 5 da a decimal adjust accumulator d4 1 1
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 19 table 2-2: logic operations mnemonic description code bytes cycles anl a,rn and register to accumulator 58-5f 1 1 anl a,direct and direct byte to accumulator 55 2 2 anl a,@ri and indirect ram to accumulator 56-57 1 2 anl a,#data and immediate data to accumulator 54 2 2 anl direct,a and accumulator to direct byte 52 2 3 anl direct,#data and immediate data to direct byte 53 3 4 orl a,rn or register to accumulator 48-4f 1 1 orl a,direct or direct byte to accumulator 45 2 2 orl a,@ri or indirect ram to accumulator 46-47 1 2 orl a,#data or immediate data to accumulator 44 2 2 orl direct,a or accumulator to direct byte 42 2 3 orl direct,#data or immediate data to direct byte 43 3 4 xrl a,rn exclusive or register to accumulator 68-6f 1 1 xrl a,direct exclusive or direct byte to accumulator 65 2 2 xrl a,@ri exclusive or indirect ram to accumulator 66-67 1 2 xrl a,#data exclusive or immediate data to accumulator 64 2 2 xrl direct,a exclusive or accumulator to direct byte 62 2 3 xrl direct,#data exclusive or immediate data to direct byte 63 3 4 clr a clear accumulator e4 1 1 cpl a complement accumulator f4 1 1 rl a rotate accumulator left 23 1 1 rlc a rotate accumulator left through carry 33 1 1 rr a rotate accumulator right 03 1 1 rrc a rotate accumulator right through carry 13 1 1 swap a swap nibbles within the accumulator c4 1 1
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 20 table 2-3: data transfer mnemonic description code bytes cycles mov a,rn move register to accumulator e8-ef 1 1 mov a,direct move direct byte to accumulator e5 2 2 mov a,@ri move indirect ram to accumulator e6-e7 1 2 mov a,#data move immediate data to accumulator 74 2 2 mov rn,a move accumulator to register f8-ff 1 2 mov rn,direct move direct byte to register a8-af 2 4 mov rn,#data move immediate data to register 78-7f 2 2 mov direct,a move accumulator to direct byte f5 2 3 mov direct,rn move register to direct byte 88-8f 2 3 mov direct1,direct2 move direct byte to direct byte 85 3 4 mov direct,@ri move indirect ram to direct byte 86-87 2 4 mov direct,#data move immediate data to direct byte 75 3 3 mov @ri,a move accumulator to indirect ram f6-f7 1 3 mov @ri,direct move direct byte to indirect ram a6-a7 2 5 mov @ri,#data move immediate data to indirect ram 76-77 2 3 mov dptr,#data16 load data pointer with a 16-bit constant 90 3 3 movc a,@a+dptr move code byte relative to dptr to accumulator 93 1 3 movc a,@a+pc move code byte relative to pc to accumulator 83 1 3 push direct push direct byte onto stack c0 2 4 pop direct pop direct byte from stack d0 2 3 xch a,rn exchange register with accumulator c8-cf 1 2 xch a,direct exchange direct byte with accumulator c5 2 3 xch a,@ri exchange indirect ram with accumulator c6-c7 1 3 xchd a,@ri exchange low-order nibble indir. ram with a d6-d7 1 3
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 21 table 2-4: program branches mnemonic description code bytes cycles acall addr11 absolute subroutine call xxx11 2 6 lcall addr16 long subroutine call 12 3 6 ret from subroutine 22 1 4 reti from interrupt 32 1 4 ajmp addr11 absolute jump xxx01 2 3 ljmp addr16 long iump 02 3 4 sjmp rel short jump (relative addr.) 80 2 3 jmp @a+dptr jump indirect relative to the dptr 73 1 2 jz rel jump if accumulator is zero 60 2 3 jnz rel jump if accumulator is not zero 70 2 3 jc rel jump if carry flag is set 40 2 3 jnc jump if carry flag is not set 50 2 3 jb bit,rel jump if direct bit is set 20 3 4 jnb bit,rel jump if direct bit is not set 30 3 4 jbc bit,direct rel jump if direct bit is set and clear bit 10 3 4 cjne a,direct rel compare direct byte to a and jump if not equal b5 3 4 cjne a,#data rel compare immediate to a and jump if not equal b4 3 4 cjne rn,#data rel compare immed. to reg. and jump if not equal b8-bf 3 4 cjne @ri,#data rel compare immed. to ind. and jump if not equal b6-b7 3 4 djnz rn,rel decrement register and jump if not zero d8-df 2 3 djnz direct,rel decrement direct byte and jump if not zero d5 3 4 nop no operation 00 1 1 table 2-5: boolean manipulation mnemonic description code bytes cycles clr c clear carry flag c3 1 1 clr bit clear direct bit c2 2 3 setb c set carry flag d3 1 1 setb bit set direct bit d2 2 3 cpl c complement carry flag b3 1 1 cpl bit complement direct bit b2 2 3 anl c,bit and direct bit to carry flag 82 2 2 anl c,/bit and complement of direct bit to carry b0 2 2 orl c,bit or direct bit to carry flag 72 2 2 orl c,/bit or complement of direct bit to carry a0 2 2 mov c,bit move direct bit to carry flag a2 2 2 mov bit,c move carry flag to direct bit 92 2 3
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 22 3 memory structure the SM39R16A2 memory structure follows general 8052 structure. it is 16kb program memory. 3.1 program memory the SM39R16A2 has 16kb on-chip flash memory which can be used as general program memory or eeprom, on which include up to 4k byte specific isp service program memory space. the address range for the 16k byte is $0000 to $3fff. the address rang e for the isp service program is $3000 to $3fff. the isp service program size can be partitioned as n blocks of 256 byte (n=0 to 16). when n=0 means no isp service program space available, total 16k byte memory used as program memory. when n=1 means address $3f00 to $3fff reserved for isp service program. when n=2 means memory address $3e00 to $3fff reserved for isp service program?etc. value n can be set and programmed into SM39R16A2 by the writer or icp. it can be used to record any data as eeprom(if you need modify the data on program memory, please page erase first ). the procedure of this eeprom application function is described in the section 18 on internal isp. 3fff 3f00 3e00 3d00 3c00 3b00 3a00 3900 3800 0000 n=16 n=15 n=14 n=13 n=12 n=11 n=10 n=9 isp service program space, up to 4k 16k program memory space 3700 3600 3500 3400 3300 3200 3100 3000 n=8 n=7 n=6 n=5 n=4 n=3 n=2 fig. 3-1: SM39R16A2 programmable flash
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 23 3fff 3f00 3e00 3d00 3c00 3b00 3a00 3900 3800 0000 n=16 n=15 n=14 n=13 n=12 n=11 n=10 n=9 isp service program space, up to 4k 8k program memory space 3700 3600 3500 3400 3300 3200 3100 3000 n=8 n=7 n=6 n=5 n=4 n=3 n=2 2000 1fff fig. 3-2 : sm39r12a2 programmable flash
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 24 3fff 3f00 3e00 3d00 3c00 3b00 3a00 3900 3800 0000 n=16 n=15 n=14 n=13 n=12 n=11 n=10 n=9 isp service program space, up to 4k 4k program memory space 3700 3600 3500 3400 3300 3200 3100 3000 n=8 n=7 n=6 n=5 n=4 n=3 n=2 1000 0fff fig. 3-3 : sm39r08a2 programmable flash 3.2 data memory the SM39R16A2 has 256bytes on-chip sram; 256 bytes of it are the same as general 8052 internal memory structure higher 128 bytes (accessed by indirect addressing mode only) lower 128 bytes (accessed by direct & indirect addressing mode ) sfr (accessed by direct addressing mode only) 00 7f 80 ff 80 ff fig. 3-4: ram architecture
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 25 3.2.1 data memory - lower 128 byte (00h to 7fh) data memory 00h to ffh is the same as 8052. the address 00h to 7fh can be accessed by direct and indirect addressing modes. address 00h to 1fh is register area. address 20h to 2fh is memory bit area. address 30h to 7fh is for general memory area. 3.2.2 data memory - higher 128 byte (80h to ffh) the address 80h to ffh can be accessed by indirect addressing mode. address 80h to ffh is data area.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 26 4 cpu engine the SM39R16A2 engine is composed of four components: a. control unit b. arithmetic ? logic unit c. memory control unit d. ram and sfr control unit the SM39R16A2 engine allows to fetch instruction from program memory and to execute using ram or sfr. the following chapter describes the main engine register. mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t 8051 core acc accumulator e0h acc.7 acc.6 a cc.5 acc.4 acc.3 acc.2 acc.1 acc.0 00h b b register f0h b.7 b.6 b. 5 b.4 b.3 b.2 b.1 b.0 00h psw program status word d0h cy ac f0 rs[1:0] ov psw.1 p 00h sp stack pointer 81h sp[7:0] 07h dpl data pointer low 0 82h dpl[7:0] 00h dph data pointer high 0 83h dph[7:0] 00h dpl1 data pointer low 0 84h dpl1[7:0] 00h dph1 data pointer high 0 85h dph1[7:0] 00h aux auxiliary register 91h brgs - p2spi p2ur p2iic - - dps 00h ckcon clock control register 8eh - its[2:0] clkout[1:0] 10h ifcon interface control register 8fh - cdpr - - - - - ispe 00h 4.1 accumulator acc is the accumulator register. most instructions use the accumulator to store the operand. mnemonic: acc address: e0h 7 6 5 4 3 2 1 0 reset acc.7 acc.6 acc05 acc.4 acc.3 acc.2 acc.1 acc.0 00h acc[7:0]: the a (or acc) register is the standard 8052 accumulator. 4.2 b register the b register is used during multiply and divide instructions. it can also be used as a scratch pad register to store temporar y data. mnemonic: b address: f0h 7 6 5 4 3 2 1 0 reset b.7 b.6 b.5 b.4 b.3 b.2 b.1 b.0 00h b[7:0]: the b register is the standard 8052 register that serves as a second accumulator.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 27 4.3 program status word mnemonic: psw address: d0h 7 6 5 4 3 2 1 0 reset cy ac f0 rs [1:0] ov f1 p 00h cy: carry flag. ac: auxiliary carry flag for bcd operations. f0: general purpose flag 0 available for user. rs[1:0]: register bank select, used to select working register bank. rs[1:0] bank selected location 00 bank 0 00h ? 07h 01 bank 1 08h ? 0fh 10 bank 2 10h ? 17h 11 bank 3 18h ? 1fh ov: overflow flag. f1: general purpose flag 1 available for user. p: parity flag, affected by hardware to indicate odd/even number of ?one? bits in the accumulator, i.e. even parity. 4.4 stack pointer the stack pointer is a 1-byte register initialized to 07h after reset. this register is incremented before push and call instr uctions, causing the stack to start from location 08h. mnemonic: sp address: 81h 7 6 5 4 3 2 1 0 reset sp [7:0] 07h sp[7:0]: the stack pointer stores the scratchpad ram address where the stack begins. in other words, it always points to the top of the stack. 4.5 data pointer the data pointer (dptr) is 2-bytes wide. the lower part is dpl, and the highest is dph. it can be loaded as a 2-byte register (e.g. mov dptr, #data16) or as two separate registers (e.g. mov dpl,#data8). it is generally used to access the external code or dat a space (e.g. movc a, @a+dptr, @dptr respectively). mnemonic: dpl address: 82h 7 6 5 4 3 2 1 0 reset dpl [7:0] 00h dpl[7:0]: data pointer low 0 mnemonic: dph address: 83h 7 6 5 4 3 2 1 0 reset dph [7:0] 00h dph [7:0]: data pointer high 0
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 28 4.6 data pointer 1 the dual data pointer accelerates the moves of data block. the standard dptr is a 16-bit register that is used to address exter nal memory or peripherals. in the SM39R16A2 core the standard data pointer is called dptr, the second data pointer is called dptr1. the data pointer select bit chooses the active pointer. the data pointer select bit is located in lsb of aux register (dps). the user switches between pointers by toggling the lsb of aux register. all dptr-related instructions use the currently selecte d dptr for any activity. mnemonic: dpl1 address: 84h 7 6 5 4 3 2 1 0 reset dpl1 [7:0] 00h dpl1[7:0]: data pointer low 1 mnemonic: dph1 address: 85h 7 6 5 4 3 2 1 0 reset dph1 [7:0] 00h dph1[7:0]: data pointer high 1 mnemonic: aux address: 91h 7 6 5 4 3 2 1 0 reset brgs - p2spi p2ur p2iic - - dps 00h dps: data pointer select register. dps = 1 is selected dptr1. 4.7 clock control register mnemonic: ckcon address: 8eh 7 6 5 4 3 2 1 0 reset - its[2:0] - - clkout[1:0] 10h its[2:0]: instruction timing select. its [2:0] mode 000 1t mode 001 2t mode (default) 010 3t mode 011 4t mode 100 5t mode 101 6t mode 110 7t mode 111 8t mode clkout[1:0]: clock output select. clkout[1:0] mode 00 gpio(default) 01 fosc 10 fosc/2 11 fosc/4 it can be used when the system clock is the internal rc oscillator.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 29 4.8 interface control register mnemonic: ifcon address: 8fh 7 6 5 4 3 2 1 0 reset - cdpr - - - - - ispe 00h cdpr: code protect (read only) ispe: isp function enable bit ispe = 1, enable isp function ispe = 0, disable isp function
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 30 5 gpio the SM39R16A2 has four i/o ports: port 0, port 1, port 2, and port 3. ports 0, 1, 2 are 8-bit ports and port 3 is a 2-bit port. these are: quasi-bidirectional (standard 8051 port outputs), push-pull, open drain, and input-only. two configuration registers for e ach port select the output type for each port pin. all i/o port pins on the SM39R16A2 may be configured by software to one of four types on a pin-by-pin basis, shown as below: mnemonic description direct bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t i/o port function register p0m0 port 0 output mode 0 d2h p0m0 [7:0] 00h p0m1 port 0 output mode 1 d3h p0m1[7:0] 00h p1m0 port 1 output mode 0 d4h p1m0[7:0] 00h p1m1 port 1 output mode 1 d5h p1m1[7:0] 00h p2m0 port 2 output mode 0 d6h p2m0[7:0] 00h p2m1 port 2 output mode 1 d7h p2m1[7:0] 00h p3m0 port 3 output mode 0 dah p3m0[1:0] 00h p3m1 port 3 output mode 1 dbh p3m1[1:0] 00h pxm1.y pxm0.y port output mode 0 0 quasi-bidirectional (standard 8051 port outputs) (pull-up) 0 1 push-pull 1 0 input only (high-impedance) 1 1 open drain the reset pin can define as general i/o p1.5 when user use internal reset. the xtal2 and xtal1 can define as p3.0 and p3.1 by writer or isp when user use internal osc as system clock when user use external osc as system clock and input into xtal1 only xtal2 can be defined as p3.0. for general-purpose applications, every pin can be assigned to either high or low independently as given below: mnemonic description direct bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reset ports port 3 port 3 b0h - - - - - - p3.1 p3.0 ffh port 2 port 2 a0h p2.7 p2.6 p2.5 p2.4 p2.3 p2.2 p2.1 p2.0 ffh port 1 port 1 90h p1.7 p1.6 p1.5 p1.4 p1.3 p1.2 p1.1 p1.0 ffh port 0 port 0 80h p0.7 p0.6 p0.5 p0.4 p0.3 p0.2 p0.1 p0.0 ffh
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 31 mnemonic: p0 address: 80h 7 6 5 4 3 2 1 0 reset p0.7 p0.6 p0.5 p0.4 p0 .3 p0.2 p0.1 p0.0 ffh p0.7~ 0: port0 [7] ~ port0[0] mnemonic: p1 address: 90h 7 6 5 4 3 2 1 0 reset p1.7 p1.6 p1.5 p1.4 p1 .3 p1.2 p1.1 p1.0 ffh p1.7~ 0: port1 [7] ~ port1 [0] mnemonic: p2 address: a0h 7 6 5 4 3 2 1 0 reset p2.7 p2.6 p2.5 p2.4 p2 .3 p2.2 p2.1 p2.0 ffh p2.7~ 0: port2 [7] ~ port2 [0] mnemonic: p3 address: b0h 7 6 5 4 3 2 1 0 reset - - - - - - p3.1 p3.0 ffh p3.1~ 0: por3 [1] ~ port3 [0]
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 32 6 timer 0 and timer 1 the SM39R16A2 has three 16-bit timer/counter registers: timer 0, timer 1 and timer 2. all can be configured for counter or time r operations. in timer mode, the timer 0 register or timer 1 register is incremented every 1/12/96 machine cycles, which means that it counts up after every 1/12/96 periods of the clk signal. it?s dependent on sfr(pfcon). in counter mode, the register is incremented when the falling edge is observed at the corresponding input pin t0or t1. since it takes 2 machine cycles to recognize a 1-to-0 event, the maximum input count rate is 1/2 of the oscillator frequency. there are no restrictions on the duty cycle, however to ensure proper recognition of 0 or 1 state, an input should be stable for at least 1 machine cycle. four operating modes can be selected for timer 0 and timer 1. two special function registers (tmod and tcon) are used to select the appropriate mode. mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t timer 0 and 1 tl0 timer 0 , low byte 8ah tl0[7:0] 00h th0 timer 0 , high byte 8ch th0[7:0] 00h tl1 timer 1 , low byte 8bh tl1[7:0] 00h th1 timer 1 , high byte 8dh th1[7:0] 00h tmod timer mode control 89h gate c/t m1 m0 gate c/t m1 m0 00h tcon timer/counter control 88h tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 00h pfcon peripheral frequency control register d9h - - srelps[1:0] t1ps[1:0] t0ps[1:0] 00h 6.1 timer/counter mode control register (tmod) mnemonic: tmod address: 89h 7 6 5 4 3 2 1 0 reset gate c/t m1 m0 gate c/t m1 m0 00h timer 1 timer 0 gate: if set, enables external gate control (pin int0 or int1 for counter 0 or 1, respectively). when int0 or int1 is high, and trx bit is set (see tcon register), a counter is incremented every falling edge on t0 or t1 input pin c/t: selects timer or counter operation. when set to 1, a counter operation is performed, when cleared to 0, the corresponding register will function as a timer. m[1:0]: selects mode for timer/counter 0 or timer/counter 1. m1 m0 mode function 0 0 mode0 13-bit counter/timer, with 5 lower bits in tl0 or tl1 register and 8 bits in th0 or th1 register (for timer 0 and timer 1, respectively). the 3 high order bits of tl0 and tl1 are hold at zero. 0 1 mode1 16-bit counter/timer. 1 0 mode2 8 -bit auto-reload counter/timer. the reload value is kept in th0 or th1, while tl0 or tl1 is incremented every machine cycle. when tlx overflows, a value from thx is copied to tlx. 1 1 mode3 if timer 1 m1 and m0 bits are set to 1, timer 1
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 33 stops. if timer 0 m1 and m0 bits are set to 1, timer 0 acts as two independent 8 bit timers / counters. 6.2 timer/counter control register (tcon) mnemonic: tcon address: 88h 7 6 5 4 3 2 1 0 reset tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 00h tf1: timer 1 overflow flag set by hardware when timer 1 overflows. this flag can be cleared by software and is automatically cleared when interrupt is processed. tr1: timer 1 run control bit. if cleared, timer 1 stops. tf0: timer 0 overflow flag set by hardware when timer 0 overflows. this flag can be cleared by software and is automatically cleared when interrupt is processed. tr0: timer 0 run control bit. if cleared, timer 0 stops. ie1: interrupt 1 edge flag. set by hardware, when falling edge on external pin int1 is observed. cleared when interrupt is processed. it1: interrupt 1 type control bit. selects falling edge or low level on input pin to cause interrupt. it1=1, interrupt 1 select falling edge trigger. it1=0, interrupt1 select low level trigger. ie0: interrupt 0 edge flag. set by hardware, when falling edge on external pin int0 is observed. cleared when interrupt is processed. it0: interrupt 0 type control bit. selects falling edge or low level on input pin to cause interrupt. it0=1, interrupt 0 select falling edge trigger. it0=0, interrupt 0 select low level trigger. 6.3 peripheral frequency control register mnemonic: pfcon address: d9h 7 6 5 4 3 2 1 0 reset - - srelps[1:0] t1ps[1:0] t0ps[1:0] 00h t1ps[1:0]: timer1 prescaler select t1ps[1:0] prescaler 00 fosc/12 01 fosc 10 fosc/96 11 reserved t0ps[1:0]: timer0 prescaler select t0ps[1:0] prescaler 00 fosc/12 01 fosc 10 fosc/96 11 reserved
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 34 6.4 mode 0 (13-bit counter/timer) 6.5 mode 1 (16-bit counter/timer) 12 osc t1 pin c/t = 0 c/t = 1 00 01 10 t1ps[1:0] tl1 (5 bits) th1 (8 bits) tf1 gate1 int1 pin not or and tr1 0 1 0 1 et1 ea control if not higher priority interrupt processing jump 001bh d0d1d2d3d4 d5d6d7 d0d1d2d3d4d5d6d7 tf1 tl1 th1 96 12 osc t1 pin c/t = 0 c/t = 1 00 01 10 t1ps[1:0] tl1 (8 bits) th1 (8 bits) tf1 gate1 int1 pin not or and tr1 0 1 0 1 et1 ea control if not higher priority interrupt processing jump 001bh 96 d0d1d2d3d4d5d6d7 tf1 tl1 th1 d0d1d2d3d4d5d6d7
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 35 6.6 mode 2 (8-bit auto -reload counter/timer) 6.7 mode 3 (timer 0 acts as two independent 8 bit timers / counters) t1 pin c/t = 0 c/t = 1 t1ps[1:0] tl1 (8 bits) th1 (8 bits) tf1 gate1 int1 pin not or and tr1 0 1 0 1 et1 ea auto reload 12 osc 00 01 10 96 control if not higher priority interrupt processing jump 001bh
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 36 7 timer 2 and capture compare unit timer 2 is not only a 16-bit timer, also a 4-channel unit with compare, capture and reload functions. it is very similar to th e programmable counter array (pca) in some other mcus except pulse width modulation (pwm). mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t timer 2 and capture compare unit t2con timer 2 control c8h t2ps[2:0] t2r[1:0] - t2i[1:0] 00h cccon compare/capture control c9h cci3 cci2 cci1 cci0 ccf3 ccf2 ccf1 ccf0 00h ccen compare/capture enable register c1h - cocam1[2:0] - cocam0[2:0] 00h ccen2 compare/capture enable 2 register d1h - cocam3[2:0] - cocam2[2:0] 00h tl2 timer 2, low byte cch tl2[7:0] 00h th2 timer 2, high byte cdh th2[7:0] 00h crcl compare/reload/c apture register, low byte cah crcl[7:0] 00h crch compare/reload/c apture register, high byte cbh crch[7:0] 00h ccl1 compare/capture register 1, low byte c2h ccl1[7:0] 00h cch1 compare/capture register 1, high byte c3h cch1[7:0] 00h ccl2 compare/capture register 2, low byte c4h ccl2[7:0] 00h cch2 compare/capture register 2, high byte c5h cch2[7:0] 00h ccl3 compare/capture register 3, low byte c6h ccl3[7:0] 00h cch3 compare/capture register 3, high byte c7h cch3[7:0] 00h mnemonic: t2con address: c8h 7 6 5 4 3 2 1 0 reset t2ps[2:0] t2r[1:0] - t2i[1:0] 00h t2ps[2:0]: prescaler select bit: t2ps = 000 ? timer 2 is clocked with the oscillator frequency. t2ps = 001 ? timer 2 is clocked with 1/2 of the oscillator frequency. t2ps = 010 ? timer 2 is clocked with 1/4 of the oscillator frequency. t2ps = 011 ? timer 2 is clocked with 1/6 of the oscillator frequency. t2ps = 100 ? timer 2 is clocked with 1/8 of the oscillator frequency. t2ps = 101 ? timer 2 is clocked with 1/12 of the oscillator frequency. t2ps = 110 ? timer 2 is clocked with 1/24 of the oscillator frequency. t2r[1:0]: timer 2 reload mode selection t2r[1:0] = 0x ? reload disabled t2r[1:0] = 10 ? mode 0: auto reload t2r[1:0] = 11 ? mode 1: t2ex falling edge reload t2i[1:0]: timer 2 input selection t2i[1:0] = 00 ? timer 2 stop t2i[1:0] = 01 ? input frequency from prescaler (t2ps[2:0])
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 37 t2i[1:0] = 10 ? timer 2 is incremented by external signal at pin t2 t2i[1:0] = 11 ? internal clock input is gated to the timer 2 mnemonic: cccon address: c9h 7 6 5 4 3 2 1 0 reset cci3 cci2 cci1 cci0 ccf3 ccf2 ccf1 ccf0 00h cci3: compare/capture 3 interrupt control bit. ?1? is enable. cci2: compare/capture 2 interrupt control bit. ?1? is enable. cci1: compare/capture 1 interrupt control bit. ?1? is enable. cci0: compare/capture 0 interrupt control bit. ?1? is enable. ccf3: compare/capture 3 flag set by hardware. this flag can be cleared by software. ccf2: compare/capture 2 flag set by hardware. this flag can be cleared by software. ccf1: compare/capture 1 flag set by hardware. this flag can be cleared by software. ccf0: compare/capture 0 flag set by hardware. this flag can be cleared by software. compare/capture interrupt share t2 interrupt vector. mnemonic: ccen address: c1h 7 6 5 4 3 2 1 0 reset - cocam1[2:0] - cocam0[2:0] 00h cocam1[2:0] 000: compare/capture disable 001: compare enable but no output on pin 010: compare mode 0 011: compare mode 1 100: capture on rising edge at pin cc1 101: capture on falling edge at pin cc1 110: capture on both rising and falling edge at pin cc1 111: capture on write operation into register cc1 cocam0[2:0] 000: compare/capture disable 001: compare enable but no output on pin 010: compare mode 0 011: compare mode 1 100: capture on rising edge at pin cc0 101: capture on falling edge at pin cc0 110: capture on both rising and falling edge at pin cc0 111: capture on write operation into register cc0 mnemonic: ccen2 address: d1h 7 6 5 4 3 2 1 0 reset - cocam3[2:0] - cocam2[2:0] 00h cocam3[2:0] 000: compare/capture disable 001: compare enable but no output on pin 010: compare mode 0 011: compare mode 1 100: capture on rising edge at pin cc3 101: capture on falling edge at pin cc3 110: capture on both rising and falling edge at pin cc3 111: capture on write operation into register cc3 cocam2[2:0] 000: compare/capture disable 001: compare enable but no output on pin
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 38 010: compare mode 0 011: compare mode 1 100: capture on rising edge at pin cc2 101: capture on falling edge at pin cc2 110: capture on both rising and falling edge at pin cc2 111: capture on write operation into register cc2 7.1 timer 2 function timer 2 can operate as timer, event counter, or gated timer as explained later. 7.1.1 timer mode in this mode timer 2 can by incremented in various frequency that depending on the prescaler. the prescaler is selected by bit t2ps[2:0] in register t2con. fig. 7-1: timer mode and reload mode function 7.1.2 event counter mode in this mode, the timer is incremented when external signal t2 change value from 1 to 0. the t2 input is sampled in every cycl e. timer 2 is incremented in the cycle following the one in which the transition was detected. fig. 7-2: event counter mode function
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 39 7.1.3 gated timer mode in this mode, the internal clock which incremented timer 2 is gated by external signal t2. fig. 7-3: gated timer mode function 7.1.4 reload of timer 2 reload (16-bit reload from the crc register) can be executed in the following two modes: mode 0: reload signal is generate by a timer 2 overflows - auto reload mode 1: reload signal is generate by a negative transition at the corresponding input pin t2ex. 7.2 compare function in the four independent comparators, the value stored in any compare/capture register is compared with the contents of the time r register. the compare modes 0 and 1 are selected by bits c0camx . in both compare modes, the results of comparison arrives at port 1 within the same machine cycle in which the internal compare signal is activated. 7.2.1 compare mode 0 i n mode 0, when the value in timer 2 equals the value of the compare register, the output signal changes from low to high. it go es back to a low level on timer overflow. in this mode, writing to the port will have no effect, because the input line from the internal bus and the write-to-latch line are disconnected. the following figure illustrates the function of compare mode 0. fig. 7-4: compare mode 0 function
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 40 7.2.2 compare mode 1 in compare mode 1, the transition of the output signal can be determined by software. a timer 2 overflow causes no output chan ge. in this mode, both transitions of a signal can be controlled. fig. 7-5 shows a functional diagram of a register/port configura tion in compare mode 1. in compare mode 1, the value is written first to the ?shadow register?, when compare signal is active, this val ue is transferred to the output register. fig. 7-2: compare mode 1 function fig. 7-5: compare mode 1 function
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 41 7.3 capture function actual timer/counter contents can be saved into registers ccx or crc upon an external event (mode 0) or a software write operat ion (mode 1). 7.3.1 capture mode 0 (by hardware) in mode 0, value capture of timer 2 is executed when: (a) rising edge on input cc0-cc3 (b) falling edge on input cc0-cc3 (c) both rising and falling edge on input cc0-cc3 the contents of timer 2 will be latched into the appropriate capture register. fig. 7-6: capture mode 0 function 7.3.2 capture mode 1(by software) in mode 1, value capture of timer 2 is caused by writing any value into the low-order byte of the dedicated capture register. t he value written to the capture register is irrelevant to this function. the contents of timer 2 will be latched into the appropri ate capture register. fig. 7-7: capture mode 1 function
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 42 8 serial interface the serial buffer consists of two separate registers, a transmit buffer and a receive buffer. writing data to the special function register sbuf sets this data in serial output buffer and starts the transmission. reading from the sbuf reads data from the serial receive buffer. the serial port can simultaneously transmit and receive data. it can also b uffer 1 byte at receive, which prevents the receive data from being lost if the cpu reads the first byte before transmission of the sec ond byte is completed. mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t serial interface 0 and 1 pcon power control 87h smod - - - - - stop idle 00h aux auxiliary register 91h brgs - p2spi p2ur p2iic - - dps 00h scon serial port control register 98h sm0 sm1 sm2 ren tb8 rb8 ti ri 00h srell serial port reload register low byte aah srel. 7 srel. 6 srel. 5 srel. 4 srel. 3 srel. 2 srel. 1 srel. 0 00h srelh serial port reload register high byte bah - - - - - - srel. 9 srel. 8 00h sbuf serial port data buffer 99h sbuf[7:0] 00h pfcon peripheral frequency control register d9h - - srelps[1:0] t1ps[1:0] t0ps[1:0] 00h mnemonic: aux address: 91h 7 6 5 4 3 2 1 0 reset brgs p2spi p2ur p2iic - - dps 00h brgs: baud rate generator. brgs = 0 - baud rate generator from timer 1. brgs = 1 - baud rate generator by srel. p2ur: p2ur = 0 ? serial interface function on p1. p2ur = 1 ? serial interface function on p2. mnemonic: scon address: 98h 7 6 5 4 3 2 1 0 reset sm0 sm1 sm2 ren tb8 rb8 ti ri 00h sm0,sm1: serial port 0 mode selection. sm0 sm1 mode 0 0 0 0 1 1 1 0 2 1 1 3 the 4 modes in uart, mode 0 ~ 3, are explained later. sm2: enables multiprocessor communication feature ren: if set, enables serial reception. cleared by software to disable reception. tb8: the 9 th transmitted data bit in modes 2 and 3. set or cleared by the cpu depending on the function it performs such as parity check, multiprocessor communication etc. rb8: in modes 2 and 3, it is the 9 th data bit received. in mode 1, if sm2 is 0, rb8 is the stop bit. in mode 0, this bit is not used. must be cleared by software. ti: transmit interrupt flag, set by hardware after completion of a serial transfer. must be cleared by software.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 43 ri: receive interrupt flag, set by hardware after completion of a serial reception. must be cleared by software. 8.1 serial interface the serial interface can operate in the following 4 modes: sm0 sm1 mode description board rate 0 0 0 shift register fosc/12 0 1 1 8-bit uart variable 1 0 2 9-bit uart fosc/32 or fosc/64 1 1 3 9-bit uart variable here fosc is the crystal or oscillator frequency. 8.1.1 mode 0 pin rxd serves as input and output. txd outputs the shift clock. 8 bits are transmitted with lsb first. the baud rate is fixed at 1/12 of the crystal frequency. reception is initialized in mode 0 by setting the flags in scon as follows: ri = 0 and ren = 1. in other modes, a start bit when ren = 1 starts receiving serial data. fig. 8-1: transmit mode 0 fig. 8-2: receive mode 0 8.1.2 mode 1 pin rxd serves as input, and txd serves as serial output. no external shift clock is used, 10 bits are transmitted: a start bit (always 0), 8 data bits (lsb first), and a stop bit (always 1). on receive, a start bit synchronizes the transmission , 8 data bits are available by reading sbuf, and stop bit sets the flag rb8 in the special function register scon. in mode 1 either internal baud rate generator or timer 1 can be use to specify baud rate.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 44 fig. 8-3: transmit mode 1 fig. 8-4: receive mode 1 8.1.3 mode 2 this mode is similar to mode 1, with two differences. the baud rate is fixed at 1/32 (smod=1) or 1/64(smod=0) of oscillator frequency and 11 bits are transmitted or received: a start bit (0), 8 data bits (lsb first), a programmable 9 th bit, and a stop bit (1). the 9 th bit can be used to control the parity of the serial interface: at transmission, bit tb8 in scon is output as the 9 th bit, and at receive, the 9 th bit affects rb8 in special function register scon. 8.1.4 mode 3 the only difference between mode 2 and mode 3 is that in mode 3 either internal baud rate generator or timer 1 can be use to specify baud rate. fig. 8-5: transmit modes 2 and 3 fig. 8-6: receive modes 2 and 3
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 45 8.2 multiprocessor communication of serial interface the feature of receiving 9 bits in modes 2 and 3 of serial interface can be used for multiprocessor communication. in this case, the slave processors have bit sm2 in scon set to 1. when the master processor outputs slave?s address, it sets the 9 th bit to 1, causing a serial port receive interrupt in all the slaves. the slave processors compare the received byte with their network address. if there is a match, the addressed slave will clear sm2 and receive the rest of the message, while other slaves will leave sm2 bit unaffected and ignore this message. after addressing the slave, the host will output the rest of the message with the 9 th bit set to 0, so no serial port receive interrupt will be generated in unselected slaves. 8.3 peripheral frequency control register mnemonic: pfcon address: d9h 7 6 5 4 3 2 1 0 reset - - srelps[1:0] t1ps[1:0] t0ps[1:0] 00h srelps[1:0]: srel prescaler select srelps[1:0] prescaler 00 fosc/64 01 fosc /32 10 fosc /16 11 fosc /8 t1ps[1:0]: timer1 prescaler select t1ps[1:0] prescaler 00 fosc/12 01 fosc 10 fosc/96 11 reserved
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 46 8.4 baud rate generator 8.4.1 serial interface modes 1 and 3 8.4.1.1 when brgs = 0 (in special function register aux). 8.4.1.1.1 t1ps[1:0] is 00 () th1 256 12 32 f 2 rate baud osc smod ? = 8.4.1.1.2 t1ps[1:0] is 01 () th1 256 32 f 2 rate baud osc smod ? = 8.4.1.1.3 t1ps[1:0] is 10 () th1 256 96 32 f 2 rate baud osc smod ? = 8.4.1.2 when brgs = 1 (in special function register aux). 8.4.1.2.1 srelps[1:0] is 00 () srel 2 64 f 2 rate baud 10 osc smod ? = 8.4.1.2.2 srelps[1:0] is 01 () srel 2 32 f 2 rate baud 10 osc smod ? = 8.4.1.2.3 srelps[1:0] is 10 () srel 2 16 f 2 rate baud 10 osc smod ? = 8.4.1.2.4 srelps[1:0] is 11 () srel 2 8 f 2 rate baud 10 osc smod ? =
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 47 9 watchdog timer the watch dog timer (wdt) is an 8-bit free-running counter that generate reset signal if the counter overflows. the wdt is usef ul for systems which are susceptible to noise, power glitches, or electronics discharge which causing software dead loop or runawa y. the wdt function can help user software recover from abnormal software condition. the wdt is different from timer0, timer1 and timer2 of general 8052. to prevent a wdt reset can be done by software periodically clearing the wdt counter. user should check wdtf bit of wdtc register whenever un-predicted reset happened. after an external reset the watchdog timer is disabled and all registers are set to zeros. the watchdog timer has a free running on-chip rc oscillator (250 khz). the wdt will keep on running even after the system clock has been turned off (for example, in sleep mode). during normal operation or sleep mode, a wdt time-out (if enabled) will cause the mcu to reset. the wdt can be enabled or disabled any time during the normal mode. please refer the wdte bit of wdtc register. the default wdt time-out period is approximately 16.38ms (wdtm [3:0] = 0100b). the wdt has selectable divider input for the time base source clock. to select the divider input, the setting of bit3 ~ bit0 (w dtm [3:0]) of watch dog timer control register (wdtc) should be set accordingly. wdtm 2 250khz = wdtclk watchdog reset time = wdtclk 256 table 9.1 wdt time-out period wdtm [3:0] divider (250 khz rc oscillator in) time period @ 250khz 0000 1 1.02ms 0001 2 2.05ms 0010 4 4.10ms 0011 8 8.19ms 0100 16 16.38ms (default) 0101 32 32.77ms 0110 64 65.54ms 0111 128 131.07ms 1000 256 262.14ms 1001 512 524.29ms 1010 1024 1.05s 1011 2048 2.10s 1100 4096 4.19s 1101 8192 8.39s 1110 16384 16.78s 1111 32768 33.55s when mcu is reset, the mcu will be read wdten control bit status. when wdten bit is set to 1, the watchdog function will be disabled no matter what the wdte bit status is. when wdten bit is clear to 0, the watchdog function will be enabled if wdte bit is set to 1 by program. user can to set wdten on the writer or isp. the program can enable the wdt function by programming 1 to the wdte bit premise that wdten control bit is clear to 0. after wdte set to 1, the 8 bit-counter starts to count with the selected time base source clock which set by wdtm [3:0]. it will gene rate a reset signal when overflows. the wdte bit will be cleared to 0 automatically when mcu been reset, either hardware reset or wdt reset. once the watchdog is started it cannot be stopped. user can refreshed the watchdog timer to zero by writing 0x55 to watch dog timer refresh key (wdtk) register. this will clear the content of the 8-bit counter and let the counter re-start to count from the beginning. the watchdog timer must be refreshed regularly to prevent reset request signal from becoming active.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 48 when watchdog timer is overflow, the wdtf flag will set to one and automatically reset mcu. the wdtf flag can be clear by software or external reset or power on reset. wdtm 2 1 fig. 9-1: watchdog timer block diagram mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t watchdog timer takey time access key register f7h takey [7:0] 00h wdtc watchdog timer control register b6h - - wdte - wdtm [3:0] 04h wdtk watchdog timer refresh key b7h wdtk[7:0] 00h rsts reset status register a1h - - - pdrf wdtf swrf lvrf porf 00h mnemonic: takey address: f7h 7 6 5 4 3 2 1 0 reset takey [7:0] 00h watchdog timer control register (wdtc) is read-only by default; software must write three specific values 55h, aah and 5ah sequentially to the takey register to enable the wdtc write attribute. that is: mov takey, #55h mov takey, #0aah mov takey, #5ah
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 49 mnemonic: wdtc address: b6h 7 6 5 4 3 2 1 0 reset - wdte - wdtm [3:0] 04h wdte: control bit used to enable watchdog timer. the wdte bit can be used only if wdten is "0". if the wdten bit is "0", then wdt can be disabled / enabled by the wdte bit. 0: disable wdt. 1: enable wdt. the wdte bit is not used if wdten is "1". that is, if the wdten bit is "1", wdt is always disabled no matter what the wdte bit status is. the wdte bit can be read and written. wdtm [3:0]: wdt clock source divider bit. please see table 9.1 to reference the wdt time-out period. mnemonic: rsts address: a1h 7 6 5 4 3 2 1 0 reset - - - pdrf wdtf swrf lvrf porf 00h wdtf: watchdog timer reset flag. when mcu is reset by watchdog, wdtf flag will be set to one by hardware. this flag clear by software mnemonic: wdtk address: b7h 7 6 5 4 3 2 1 0 reset wdtk[7:0] 00h wdtk: watchdog timer refresh key. a programmer must write 0x55 into wdtk register, and then the watchdog timer will be cleared to zero. for example, if enable wdt and select time-out reset period is 262.14ms. first, programming the information block op3 bit7 wdten to ?0?. secondly, mov takey, #55h mov takey, #0aah mov takey, #5ah ; enable wdtc write attribute. mov wdtc, #28h ; set wdtm [3:0] = 1000b. set wdte =1 to enable wdt ; function. . . mov wdtk, #55h ; clear wdt timer to 0.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 50 10 interrupt the SM39R16A2 provides 13 interrupt sources with four priority levels. each source has its own request flag(s) located in a spe cial function register. each interrupt requested by the corresponding flag could individually be enabled or disabled by the enable b its in sfr?s ien0, ien1, and ien2. when the interrupt occurs, the engine will vector to the predetermined address as shown in table 10.1. once interrupt service h as begun, it can be interrupted only by a higher priority interrupt. the interrupt service is terminated by a return from instruct ion reti. when an reti is performed, the processor will return to the instruction that would have been next when interrupt occurred. when the interrupt condition occurs, the processor will also indicate this by setting a flag bit. this bit is set regardless of whether the interrupt is enabled or disabled. each interrupt flag is sampled once per machine cycle, and then samples are polled by hardwar e. if the sample indicates a pending interrupt when the interrupt is enabled, then interrupt request flag is set. on the next instruc tion cycle the interrupt will be acknowledged by hardware forcing an lcall to appropriate vector address. interrupt response will require a varying amount of time depending on the state of microcontroller when the interrupt occurs. i f microcontroller is performing an interrupt service with equal or greater priority, the new interrupt will not be invoked. in ot her cases, the response time depends on current instruction. the fastest possible response to an interrupt is 7 machine cycles. this inclu des one machine cycle for detecting the interrupt and six cycles for perform the lcall. table 10-1: interrupt vectors interrupt request flags interrupt vector address interrupt number *(use keil c tool) ie0 ? external interrupt 0 0003h 0 tf0 ? timer 0 interrupt 000bh 1 ie1 ? external interrupt 1 0013h 2 tf1 ? timer 1 interrupt 001bh 3 ri/ti ? serial channel interrupt 0023h 4 tf2/exf2 ? timer 2 interrupt 002bh 5 pwmif ? pwm interrupt 0043h 8 spiif ? spi interrupt 004bh 9 adcif ? a/d converter interrupt 0053h 10 kbiif ? keyboard interface interrupt 005bh 11 lviif ? low voltage interrupt 0063h 12 iicif ? iic interrupt 006bh 13 comparator interrupt 0093h 18 *see keil c about c51 user?s guide about interrupt function description
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 51 mnemonic description direct bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t interrupt ien0 interrupt enable 0 register a8h ea - et2 es et1 ex1 et0 ex0 00h ien1 interrupt enable 1 register b8h exen2 - ieiic ielvi iekbi ieadc iespi iepwm 00h ien2 interrupt enable 2 register 9ah - - - - - ecmpi - - 00h ircon interrupt request register c0h exf2 tf2 iicif lviif kbiif adcif spiif pwmif 00h ircon2 interrupt request register 2 97h - - - - - cmpif - - 00h ip0 interrupt priority level 0 a9h - - ip0.5 ip0.4 ip0.3 ip0.2 ip0.1 ip0.0 00h ip1 interrupt priority level 1 b9h - - ip1.5 ip1.4 ip1.3 ip1.2 ip1.1 ip1.0 00h interrupt enable 0 register (ien0) mnemonic: ien0 address: a8h 7 6 5 4 3 2 1 0 reset ea - et2 es et1 ex1 et0 ex0 00h ea: ea=0 ? disable all interrupt. ea=1 ? enable all interrupt. et2: et2=0 ? disable timer 2 overflow or external reload interrupt. et2=1 ? enable timer 2 overflow or external reload interrupt. es: es=0 ? disable serial channel interrupt. es=1 ? enable serial channel interrupt. et1: et1=0 ? disable timer 1 overflow interrupt. et1=1 ? enable timer 1 overflow interrupt. ex1: ex1=0 ? disable external interrupt 1. ex1=1 ? enable external interrupt 1. et0: et0=0 ? disable timer 0 overflow interrupt. et0=1 ? enable timer 0 overflow interrupt. ex0: ex0=0 ? disable external interrupt 0. ex0=1 ? enable external interrupt 0. interrupt enable 1 register (ien1) mnemonic: ien1 address: b8h 7 6 5 4 3 2 1 0 reset exen2 - ieiic ielvi iekbi ieadc iespi iepwm 00h exen2: timer 2 reload interrupt enable. exen2 = 0 ? disable timer 2 external reload interrupt. exen2 = 1 ? enable timer 2 external reload interrupt. ieiic: iic interrupt enable. ieiics = 0 ? disable iic interrupt. ieiics = 1 ? enable iic interrupt. ielvi: lvi interrupt enable. ielvi = 0 ? disable lvi interrupt. ielvi = 1 ? enable lvi interrupt.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 52 iekbi: kbi interrupt enable. iekbi = 0 ? disable kbi interrupt. iekbi = 1 ? enable kbi interrupt. ieadc: a/d converter interrupt enable ieadc = 0 ? disable adc interrupt. ieadc = 1 ? enable adc interrupt. iespi: spi interrupt enable. iespi = 0 ? disable spi interrupt. iespi = 1 ? enable spi interrupt. iepwm: pwm interrupt enable. iepwm = 0 ? disable pwm interrupt. iepwm = 1 ? enable pwm interrupt. interrupt enable 2 register (ien2) mnemonic: ien2 address: 9ah 7 6 5 4 3 2 1 0 reset - - - - - ecmpi - - 00h ecmpi enable comparator interrupt(include comparator_0 and comparator_1) interrupt request register (ircon) mnemonic: ircon address: c0h 7 6 5 4 3 2 1 0 reset exf2 tf2 iicif lviif kbiif adcif spiif pwmif 00h exf2: timer 2 external reload flag. must be cleared by software. tf2: timer 2 overflow flag. must be cleared by software. iicif: iic interrupt flag. lviif: lvi interrupt flag. kbiif: kbi interrupt flag. adcif: a/d converter end interrupt flag. spiif: spi interrupt flag. pwmif: pwm interrupt flag. must be cleared by software. interrupt request register 2 (ircon2) mnemonic:ircon2 address: 97h 7 6 5 4 3 2 1 0 reset - - - - - cmpif - - 00h cmpif comparator interrupt flag hw will clear this flag automatically when enter interrupt vector. sw can clear this flag also.(in case analog comparator int disable)
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 53 10.1 priority level structure all interrupt sources are combined in groups: table 10-2: priority level groups groups external interrupt 0 - pwm interrupt timer 0 interrupt - spi interrupt external interrupt 1 comparator interrupt adc interrupt timer 1 interrupt - kbi interrupt serial channel interrupt - lvi interrupt timer 2 interrupt - iic interrupt each group of interrupt sources can be programmed individually to one of four priority levels by setting or clearing one bit in the special function register ip0 and one in ip1. if requests of the same priority level will be received simultaneously, an intern al polling sequence determines which request is serviced first. mnemonic: ip0 address: a9h 7 6 5 4 3 2 1 0 reset - - ip0.5 ip0.4 ip0.3 ip0.2 ip0.1 ip0.0 00h mnemonic: ip1 address: b9h 7 6 5 4 3 2 1 0 reset - - ip1.5 ip1.4 ip1.3 ip1.2 ip1.1 ip1.0 00h table 10-3: priority levels ip1.x ip0.x priority level 0 0 level0 (lowest) 0 1 level1 1 0 level2 1 1 level3 (highest) table 10-4: groups of priority bit group ip1.0, ip0.0 external interrupt 0 - pwm interrupt ip1.1, ip0.1 timer 0 interrupt - spi interrupt ip1.2, ip0.2 external interrupt 1 comparator interrupt adc interrupt ip1.3, ip0.3 timer 1 interrupt - kbi interrupt ip1.4, ip0.4 serial channel 0 interrupt - lvi interrupt ip1.5, ip0.5 timer 2 interrupt - iic interrupt
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 54 table 10-5: polling sequence interrupt source sequence external interrupt 0 pwm interrupt timer 0 interrupt spi interrupt external interrupt 1 comparator interrupt adc interrupt timer 1 interrupt kbi interrupt serial channel 0 interrupt lvi interrupt timer 2 interrupt iic interrupt polling sequence
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 55 11 power management unit power management unit serves two power management modes, idle and stop, for the users to do power saving function. mnemonic: pcon address: 87h 7 6 5 4 3 2 1 0 reset smod - - - - - stop idle 00h stop: stop mode control bit. setting this bit turning on the stop mode. stop bit is always read as 0 idle: idle mode control bit. setting this bit turning on the idle mode. idle bit is always read as 0 11.1 idle mode setting the idle bit of pcon register invokes the idle mode. the idle mode leaves internal clocks and peripherals running. power consumption drops because the cpu is not active. the cpu can exit the idle state with any interrupts or a reset. 11.2 stop mode setting the stop bit of pcon register invokes the stop mode. all internal clocking in this mode is turn off. the cpu will exit this state from a no-clocked interrupt (external int0/1 and lvi) or a reset (wdt and lvr) condition. internally generated interrupts (timer, serial port ...) have no effect on stop mode since they require clocking activity.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 56 12 pulse width modulation (pwm) SM39R16A2 provides two-channel pwm outputs. the interrupt vector is 43h. mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t pwm pwmc pwm control register b5h pwmcs[2:0] - - - pwm1e n pwm0e n 00h pwmd0h pwm 0 data register high byte bch pwmp0 - - - - - pwmd0[9:8] 00h pwmd0l pwm 0 data register low byte bdh pwmd0[7:0] 00h pwmd1h pwm 1 data register high byte beh pwmp1 - - - - - pwmd1[9:8] 00h pwmd1l pwm 1 data register low byte bfh pwmd1[7:0] 00h pwmmdh pwm max data register high byte ceh - - - - - - pwmmd[9:8] 00h pwmmdl pwm max data register low byte cfh pwmmd[7:0] ffh mnemonic: pwmc address: b5h 7 6 5 4 3 2 1 0 reset pwmcs[2:0] - - - pwm1en pwm0en 00h pwmcs[2:0]: pwm clock select. pwmcs [2:0] mode 000 fosc 001 fosc/2 010 fosc/4 011 fosc/6 100 fosc/8 101 fosc/12 110 timer 0 overflow 111 timer 0 external input (p1.2/t0) pwm1en: pwm channel 1 enable control bit. pwm1en = 1 ? pwm channel 1 enable. pwm1en = 0 ? pwm channel 1 disable. pwm0en: pwm 0 enable control bit. pwm0en = 1 ? pwm channel 0 enable. pwm0en = 0 ? pwm channel 0 disable. mnemonic: pwmd0h address: bch 7 6 5 4 3 2 1 0 reset pwmp0 - - - - - pwmd0[9:8] 00h mnemonic: pwmd0l address: bdh 7 6 5 4 3 2 1 0 reset pwmd0[7:0] 00h pwmp0: pwm channel 0 idle polarity select. ?0? ? pwm channel 0 will idle low. ?1? ? pwm channel 0 will idle high.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 57 pwmd0[9:0]: pwm channel 0 data register. mnemonic: pwmd1h address: beh 7 6 5 4 3 2 1 0 reset pwmp1 - - - - - pwmd1[9:8] 00h mnemonic: pwmd1l address: bfh 7 6 5 4 3 2 1 0 reset pwmd1[7:0] 00h pwmp1: pwm channel 1 idle polarity select. ?0? ? pwm channel 1 will idle low. ?1? ? pwm channel 1 will idle high. pwmd1[9:0]: pwm channel 1 data register. mnemonic: pwmmdh address: ceh 7 6 5 4 3 2 1 0 reset - - - - - - pwmmd[9:8] 00h mnemonic: pwmmdl address: cfh 7 6 5 4 3 2 1 0 reset pwmmd[7:0] ffh pwmmd[9:0]: pwm max data register. pwm count from 0000h to pwmmd[9:0]. when pwm count data equal pwmmd[9:0] is overflow. pwmpx = 0 & pwmdx = 00h pwmpx = 0 & pwmdx 00h pwmpx = 1 & pwmdx = 00h pwmpx = 1 & pwmdx 00h cloc k pwm 1 pwmmd period pwm + = clock pwm pwmdx pulse leader =
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 58 13 iic function the iic module uses the scl (clock) and the sda (data) line to communicate with external iic interface. its speed can be select ed to 400kbps (maximum) by software setting the iicbr [2:0] control bit. the iic module provided 2 interrupts (rxif, txif). it wil l generate start, repeated start and stop signals automatically in master mode and can detects start, repeated start and stop signals in slave mode. the maximum communication length and the number of devices that can be connected are limited by a maximum bus capacitance of 400pf. the interrupt vector is 6bh. mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t iic function aux auxiliary register 91h brgs - p2spi p2ur p2iic - - dps 00h iicctl iic control register f9h iicen mss mas ab_en bf_en iicbr[2:0] 04h iics iic status register f8h - mpif laif rxif txif rxak txak rw or bb 00h iica1 iic address 1 register fah iica1[7:1] match1 or rw1 a0h iica2 iic address 2 register fbh iica2[7:1] match2 or rw2 60h iicrwd iic read/write register fch iicrwd[7:0] 00h iicebt iic enaable bus transaction fdh fu_en - - - - - - 00h mnemonic: aux address: 91h 7 6 5 4 3 2 1 0 reset brgs - p2spi p2ur p2iic - - dps 00h p2iic: p2iic = 0 ? iic function on p1. p2iic = 1 ? iic function on p2. mnemonic: iicctl address: f9h 7 6 5 4 3 2 1 0 reset iicen mss mas ab_en bf_en iicbr[2:0] 04h iicen: enable iic module iicen = 1 is enable iicen = 0 is disable. mss: master or slave mode select. mss = 1 is master mode. mss = 0 is slave mode. *the software must set this bit before setting others register. mas: master address select (master mode only) mas = 0 is to use iica1. mas = 1 is to use iica2. ab_en: arbitration lost enable bit. (master mode only) if set ab_en bit, the hardware will check arbitration lost. once arbitration lost occurred, hardware will return to idle state. if this bit is cleared, hardware will not care arbitration lost condition. set this bit when multi-master and slave connection. clear this bit when single master to single slave. bf_en: bus busy enable bit. (master mode only) if set bf_en bit, hardware will not generate a start condition to bus until bf=0. clear this bit will always generate a start condition to bus when mstart is set. set this bit when multi-master and slave connection. clear this bit when single master to single slave. iicbr[2:0]: baud rate selection (master mode only), where fosc is the external crystal or oscillator frequency. the
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 59 default is fosc/512 for users? convenience. iicbr[2:0] baud rate 000 fosc/32 001 fosc/64 010 fosc/128 011 fosc/256 100 fosc/512 101 fosc/1024 110 fosc/2048 111 fosc/4096 mnemonic: iics address: f8h 7 6 5 4 3 2 1 0 reset - mpif laif rxif txif rxak txak rw or bb 00h mpif: the stop condition interrupt flag the stop condition occurred and this bit will be set. software need to clear this bit laif: arbitration lost bit. (master mode only) the arbitration interrupt flag, the bus arbitration lost occurred and this bit will be set. software need to clear this bit rxif: the data receive interrupt flag (rxif) is set after the iicrwd (iic read write data buffer) is loaded with a newly receive data. txif: the data transmit interrupt flag (txif) is set when the data of the iicrwd (iic read write data buffer) is downloaded to the shift register. rxak: the acknowledge status indicate bit. when clear, it means an acknowledge signal has been received after the complete 8 bits data transmit on the bus. txak: the acknowledge status transmit bit. when received complete 8 bits data, this bit will set (noack) or clear (ack) and transmit to master to indicate the receive status. rw or bb: master mode: bb : bus busy bit if detect scl=0 or sda=0 or bus start, this bit will be set. if detect stop,this bit will be cleared. this bit can be cleared by software to return ready state. slave mode: rw:the slave mode read (received) or wrote (transmit) on the iic bus. when this bit is clear, the slave module received data on the iic bus (sda).(slave mode only) fig. 13-1: acknowledgement bit in the 9 th bit of a byte transmission mnemonic: iica1 address: fah 7 6 5 4 3 2 1 0 rese t iica1[7:1] match1 or rw1 a0h r/w r or r/w
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 60 slave mode: iica1[7:1]: iic address registers this is the first 7-bit address for this slave module. it will be checked when an address (from master) is received match1: when iica1 matches with the received address from the master side, this bit will set to 1 by hardware. when iic bus gets first data, this bit will clear. master mode: iica1[7:1]: iic address registers this 7-bit address indicates the slave with which it wants to communicate. rw1: this bit will be sent out as rw of the slave side if the module has set the mstart or rstart bit. it appears at the 8 th bit after the iic address as shown in fig. 13-2. it is used to tell the salve the direction of the following communication. if it is 1, the module is in master receive mode. if 0, the module is in master transmit mode. rw1=1, master receive mode rw1=0, master transmit mode fig. 13-2: rw bit in the 8 th bit after iic address mnemonic: iica2 address: fbh 7 6 5 4 3 2 1 0 reset iica2[7:1] match2 or rw2 60h r/w r or r/w slave mode: iica2[7:1]: iic address registers this is the second 7-bit address for this slave module. it will be checked when an address (from master) is received match2: when iica2 matches with the received address from the master side, this bit will set to 1 by hardware. when iic bus gets first data, this bit will clear. master mode: iica2[7:1]: iic address registers this 7-bit address indicates the slave with which it wants to communicate. rw2: this bit will be sent out as rw of the slave side if the module has set the mstart or rstart bit. it is used to tell the salve the direction of the following communication. if it is 1, the module is in master receive mode. if 0, the module is in master transmit mode. rw2=1, master receive mode rw2=0, master transmit mode mnemonic: iicrwd address: fch 7 6 5 4 3 2 1 0 reset iicrwd[7:0] 00h iicrwd[7:0]: iic read write data buffer. in receiving (read) mode, the received byte is stored here.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 61 in transmitting mode, the byte to be shifted out through sda stays here. mnemonic: iicebt address: fdh 7 6 5 4 3 2 1 0 rese t fu_en - - - - - - 00h master mode 00: reserved 01: iic bus module will enable read/write data transfer on sda and scl. 10: iic bus module generate a start condition on the sda/scl, then send out address which is stored in the iica1/iica2(selected by mas control bit) 11: iic bus module generates a stop condition on the sda/scl. fu_en[7:6] will be auto-clear by hardware, so setting fu_en[7:6] repeatedly is necessary. slave mode: 01: fu_en[7:6] should be set as 01 only. the other value is inhibited. notice: 1. fu_en[7:6] should be set as 01 before read/write data transfer for bus release; otherwise, scl will be locked(pull low). 2. fu_en[7:6] should be set as 01 after read/write data transfer for receiving a stop condition from bus master. 3. in transmit data mode(slave mode), the output data should be filled into iicrwd before setting fu_en[7:6] as 01. 4. fu_en[7:6] will be auto-clear by hardware, so setting fu_en[7:6] repeatedly is necessary.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 62 14 spi function - serial peripheral interface serial peripheral interface (spi) is a synchronous protocol that allows a master device to initiate communication with slave de vices. the interrupt vector is 4bh. there are 4 signals used in spi, they are spi_mosi: data output in the master mode, data input in the slave mode, spi_miso: data input in the master mode, data output in the master mode, spi_sck: clock output from the master, the above data are synchronous to this signal spi_ss: input in the slave mode. this slave device detects this signal to judge if it is selected by the master. in the master mode, it can select the desired slave device by any io with value = 0. fig. 14-1 is an example showing the relat ion of the 4 signals between master and slaves. fig. 14-1: spi signals between master and slave devices there is only one channel spi interface. the spi sfrs are shown as below: spi description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t spi function aux auxiliary register 91h brgs - p2spi p2ur p2iic - - dps 00h spic1 spi control register 1 f1h spien spimss spissp spickp spicke spibr[2:0] 08h spic2 spi control register 2 f2h spifd tbc[2:0] spirst rbc[2:0] 00h spis spi status register f5h spirf spimls spiov spitxif spitdr spirxif spirdr spirs 40h spitxd spi transmit data buffer f3h spitxd[7:0] 00h spirxd spi receive data buffer f4h spirxd[7:0] 00h master mosi miso clk io io slave 1 mosi miso clk ss slave 2 mosi miso clk ss
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 63 mnemonic: aux address: 91h 7 6 5 4 3 2 1 0 reset brgs - p2spi p2ur p2iic - - dps 00h p2spi: p2spi = 0 ? spi function on p1. p2spi = 1 ? spi function on p2. p2spi mosi miso ss spiclk 0 p1.7 p1.6 p1.4 p0.0 1 p2.2 p2.3 p2.4 p2.5 mnemonic:spic1 address:f1h 7 6 5 4 3 2 1 0 reset spien spimss spissp spickp spicke spibr[2:0] 08h spien: enable spi module. ?1? is enable. ?0? is disable. spimss: master or slave mode select ?1? is master mode. ?0? is slave mode. spissp: ss or cs active polarity.(slave mode used only) ?1? - high active. ?0? - low active. spickp: clock idle polarity select. (master mode used only) ?1? - sck will idle high. ex : ?0? - sck will idle low. ex : spicke: clock sample edge select. ?1? ? rising edge latch data. ?0? ? falling edge latch data. * to ensure the data latch stability, SM39R16A2 generate the output data as given in the following example, the other side can latch the stable data no matter in rising or falling edge. spibr[2:0]: spi baud rate select. (master mode used only) spibr[2:0] baud rate 0:0:0 fosc/4 0:0:1 fosc /8 0:1:0 fosc /16 0:1:1 fosc /32 1:0:0 fosc /64 1:0:1 fosc /128 1:1:0 fosc /256 1:1:1 fosc /512 sufficient set-u p time sufficient hold time
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 64 mnemonic: spic2 address: f2h 7 6 5 4 3 2 1 0 reset spifd tbc[2:0] spirst rbc[2:0] 00h spifd: full-duplex mode enable. ?1? is enable full-duplex mode. ?0? is disable full-duplex mode. when it is set, the tbc[2:0] and rbc[2:0] will be reset and keep to zero. when the master device transmits data to the slave device via the mosi line, the slave device responds by sending data to the master device via the miso line. this implies full-duplex transmission with both data out and data in synchronized with the same clock. input shift register spirxd output shift register spitxd clock generator output shift register spitxd syncmos master input shift register spirxd syncmos slave miso mosi sck miso mosi sck spirst: spi re-start (slave mode used only) spirst=0:re-start function disable.spi transmit/receive data when ss active. in spitxd/spirxd buffer, data got from previous ss active period will not be removed (i.e. it's valid). spirst=1:re-start function enable.spi transmit/receive new data when ss re-active; in spitxd/spirxd buffer, data got from previous ss active period will be removed (i.e. it's invalid). tbc[2:0]: spi transmitter bit counter. tbc[2:0] bit counter 0:0:0 8 bits output 0:0:1 1 bit output 0:1:0 2 bits output 0:1:1 3 bits output 1:0:0 4 bits output 1:0:1 5 bits output 1:1:0 6 bits output 1:1:1 7 bits output
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 65 rbc[2:0]: spi receiver bit counter. rbc[2:0] bit counter 0:0:0 8 bits input 0:0:1 1 bit input 0:1:0 2 bits input 0:1:1 3 bits input 1:0:0 4 bits input 1:0:1 5 bits input 1:1:0 6 bits input 1:1:1 7 bits input mnemonic: spis address:f5h 7 6 5 4 3 2 1 0 reset spirf spimls spiov spitxif spitdr spirxif spirdr spirs 40h spirf: spi ss pin release flag. this bit is set when ss pin release & spirst as ?1?. spimls: msb or lsb first output /input select. ?1? is msb first output/input. ?0? is lsb first output/input. spiov: overflow flag. when spirdr is set and next data already into shift register, this flag will be set. it is clear by hardware, when spirdr is cleared. spitxif: transmit interrupt flag. this bit is set when the data of the spitxd register is downloaded to the shift register. spitdr: transmit data ready. when mcu finish writing data to spitxd register, the mcu needs to set this bit to ?1? to inform the spi module to send the data. after spi module finishes sending the data from spitxd, this bit will be cleared automatically. spirxif: receive interrupt flag. this bit is set after the spirxd is loaded with a newly receive data. spirdr: receive data ready. the mcu must clear this bit after it gets the data from spirxd register. the spi module is able to write new data into spirxd only when this bit is cleared. spirs: receive start. this bit set to ?1? to inform the spi module to receive the data into spirxd register. mnemonic: spitxd address: f3h 7 6 5 4 3 2 1 0 reset spitxd[7:0] 00h spitxd[7:0]: transmit data buffer. mnemonic: spirxd address: f4h 7 6 5 4 3 2 1 0 reset spirxd[7:0] 00h spirxd[7:0]: receive data buffer. p.s. miso pin must be float when ss or cs no-active in slave mode.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 66 15 kbi ? keyboard interface keyboard interface (kbi) can be connected to a 4 x n matrix keyboard or any similar devices. it has 4 inputs with programmable interrupt capability on either high or low level. these 4 inputs can be the external interrupts to leave from the idle and stop modes. the 4 inputs are independent from each other but share the same interrupt vector 5bh. figure 15.1 keyboard interface block diagram figure 15.2 keyboard input circuitry kbi description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t kbi function kbls kbi level selection 93h - - - - kbls3 kbls2 kbls1 kbls0 00h kbe kbi input enable 94h - - - - kbe3 kbe2 kbe1 kbe0 00h kbf kbi flag 95h - - - - kbf3 kbf2 kbf1 kbf0 00h kbd kbi de-bounce control register 96h kbden - - - - - kbd1 kbd0 00h mnemonic: kbls address: 93h 7 6 5 4 3 2 1 0 reset - - - - kbls.3 kbls.2 kbls.1 kbls.0 00h
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 67 kbls.3: keyboard line 3 level selection bit 0 : enable a low level detection on kbi3. 1 : enable a high level detection on kbi3. kbls.2: keyboard line 2 level selection bit 0 : enable a low level detection on kbi2. 1 : enable a high level detection on kbi2. kbls.1: keyboard line 1 level selection bit 0 : enable a low level detection on kbi1. 1 : enable a high level detection on kbi1. kbls.0: keyboard line 0 level selection bit 0 : enable a low level detection on kbi0. 1 : enable a high level detection on kbi0. mnemonic: kbe address: 94h 7 6 5 4 3 2 1 0 reset - - - - kbe.3 kbe.2 kbe.1 kbe.0 00h kbe.3: keyboard line 3 enable bit 0 : enable standard i/o pin. 1 : enable kbf.3 bit in kbf register to generate an interrupt request. kbe.2: keyboard line 2 enable bit 0 : enable standard i/o pin. 1 : enable kbf.2 bit in kbf register to generate an interrupt request. kbe.1: keyboard line 1 enable bit 0 : enable standard i/o pin. 1 : enable kbf.1 bit in kbf register to generate an interrupt request. kbe.0: keyboard line 0 enable bit 0 : enable standard i/o pin. 1 : enable kbf.0 bit in kbf register to generate an interrupt request. mnemonic: kbf address: 95h 7 6 5 4 3 2 1 0 reset - - - - kbf.3 kbf.2 kbf.1 kbf.0 00h kbf.3: keyboard line 3 flag this is set by hardware when kbi3 detects a programmed level. it generates a keyboard interrupt request if kbe.3 is also set. it must be cleared by software. kbf.2: keyboard line 2 flag this is set by hardware when kbi2 detects a programmed level. it generates a keyboard interrupt request if kbe.2 is also set. it must be cleared by software. kbf.1: keyboard line 1 flag this is set by hardware when kbi1 detects a programmed level. it generates a keyboard interrupt request if kbe.1 is also set. it must be cleared by software. kbf.0: keyboard line 0 flag this is set by hardware when kbi0 detects a programmed level. it generates a keyboard interrupt request if kbe.0 is also set. it must be cleared by software. mnemonic: kbd address: 96h 7 6 5 4 3 2 1 0 reset kbden - - - - - kbd.1 kbd.0 00h kbden: enable kbi de-bounce function. the default kbi function is enabled. kbden = 0, enable kbi de-bounce function. the de-bounce time is selected by kbd [1:0]. kbden = 1, disable kbi de-bounce function. the kbi input pin without de- b ounce mechanism. kbd[1:0]: select kbi de-bounce time. if kbden = ?0?, the default de-bounce time is 320 ms.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 68 kbd[1:0] = 00, the de-bounce time is 320 ms. kbd[1:0] = 01, the de-bounce time is 160 ms. kbd[1:0] = 10, the de-bounce time is 80 ms. kbd[1:0] = 11, the de-bounce time is 40 ms.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 69 16 lvi ? low voltage interrupt the interrupt vector 63h. mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t watchdog timer rsts reset status register a1h - - - pdrf wdtf swrf lvrf porf 00h lvc low voltage control register e6h lvi_en - lvre lvif - - - lvis 20h mnemonic: rsts address: a1h 7 6 5 4 3 2 1 0 reset - - - pdrf wdtf swrf lvrf porf 00h pdrf: pad reset flag. when mcu is reset by reset pad, pdrf flag will be set to one by hardware. this flag clear by software. lvrf: low voltage reset flag. when mcu is reset by lvr, lvrf flag will be set to one by hardware. this flag clear by software. porf: power on reset flag. when mcu is reset by por, porf flag will be set to one by hardware. this flag clear by software. mnemonic: lvc address: e6h 7 6 5 4 3 2 1 0 reset lvi_en - lvre lvif - - - lvis 20h lvi_en: low voltage interrupt function enable bit. lvi_en = 0 - disable low voltage detect function. lvi_en = 1 - enable low voltage detect function. lvre: external low voltage reset function enable bit. lvre = 0 - disable external low voltage reset function. lvre = 1 - enable external low voltage reset function. lvif: low voltage interrupt flag lvis lvi level select: lvis = 0 - the level of voltage is set at low-level lvis = 1 - the level of voltage is set at hi-level hi-level symbol parameter min typ max units v lvi low voltage interrupt voltage level 3.4 3.7 4.0 v v lvr low voltage reset voltage level 3.2 3.5 3.8 v notes: the v lvi always above v lvr about 0.2v. low-level symbol parameter min typ max units v lvi low voltage interrupt voltage level 2.1 2.3 2.5 v v lvr low voltage reset voltage level 1.9 2.1 2.3 v notes: the v lvi always above v lvr about 0.2v.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 70 17 10-bit analog-to-digital converter (adc) the SM39R16A2 provides eight channels 10-bit adc. the digital output data [9:0] were put into adcd [9:0]. the adc interrupt vector is 53h. the adc sfr show as below: mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t adc adcc1 adc control register 1 abh adc7en adc6en adc5en adc4en adc3en adc2en adc1en adc0en 00h adcc2 adc control register 2 ach start adjust adcr[1:0] - adcch[2:0] 00h adcdh adc data high byte adh adcdh [7:0] 00h adcdl adc data low byte aeh adcdl [7:0] 00h adccs adc clock select afh - - - adccs[4:0] 00h mnemonic: adcc1 address: abh 7 6 5 4 3 2 1 0 reset adc7en adc6en adc5en adc4en adc3en adc2en adc1en adc0en 00h adc7en: adc channels 7 enable. adc7en = 1 ? enable adc channel 7 adc6en: adc channels 6 enable. adc6en = 1 ? enable adc channel 6 adc5en: adc channels 5 enable. adc5en = 1 ? enable adc channel 5 adc4en: adc channels 4 enable. adc4en = 1 ? enable adc channel 4 adc3en: adc channels 3 enable. adc3en = 1 ? enable adc channel 3
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 71 adc2en: adc channels 2 enable. adc2en = 1 ? enable adc channel 2 adc1en: adc channels 1 enable. adc1en = 1 ? enable adc channel 1 adc0en: adc channels 0 enable. adc0en = 1 ? enable adc channel 0 mnemonic: adcc2 address: ach 7 6 5 4 3 2 1 0 reset start adjust adcr[1:0] - adcch[2:0] 00h start: when this bit is set, the adc will be start conversion continuous. adjust: adjust the format of adc conversion data. adjust = 0: (default value) adc data high byte adcd [9:2] = adcdh [7:0]. adc data low byte adcd [1:0] = adcdl [1:0]. adjust = 1: adc data high byte adcd [9:8] = adcdh [1:0]. adc data low byte adcd [7:0] = adcdl [7:0]. adcr[1:0]: adc range. adcr [1:0] range 00 0 ~ vdd 01 0 ~ 5 4 vdd 10 0 ~ 5 3 vdd 11 reserved adcch[2:0]: adc channel select. adcch [2:0] channel 000 0 001 1 010 2 011 3 100 4 101 5 110 6 111 7 adjust = 0: mnemonic: adcdh address: adh 7 6 5 4 3 2 1 0 reset adcd[9] adcd[8] adcd[7] adcd[6] adcd[5] adcd[4] adcd[3] adcd[2] 00h mnemonic: adcdl address: aeh 7 6 5 4 3 2 1 0 reset - - - - - - adcd[1] adcd[0] 00h adjust = 1: mnemonic: adcdh address: adh 7 6 5 4 3 2 1 0 reset - - - - - - adcd[9] adcd[8] 00h
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 72 mnemonic: adcdl address: aeh 7 6 5 4 3 2 1 0 reset adcd[7] adcd[6] adcd[5] adcd[4] adcd[3] adcd[2] adcd[1] adcd[0] 00h adcd[9:0]: adc data register. mnemonic: adccs address: afh 7 6 5 4 3 2 1 0 reset - - - adccs[4] adccs[3] adccs[2] adccs[1] adccs[0] 00h adccs[4:0]: adc clock select. *the adc clock maximum 12.5mhz. *the adc conversion rate maximum 500khz. adccs[4:0] adc clock(hz) clocks for adc conversion 00000 fosc /2 46 00001 fosc/4 92 00010 fosc /6 138 00011 fosc /8 184 00100 fosc /10 230 00101 fosc /12 276 00110 fosc /14 322 00111 fosc /16 368 01000 fosc /18 414 01001 fosc /20 460 01010 fosc /22 506 01011 fosc /24 552 01100 fosc /26 598 01101 fosc /28 644 01110 fosc /30 690 01111 fosc /32 736 10000 fosc /34 782 10001 fosc /36 828 10010 fosc /38 874 10011 fosc /40 920 10100 fosc /42 966 10101 fosc /44 1012 10110 fosc /46 1058 10111 fosc /48 1104 11000 fosc /50 1150 11001 fosc /52 1196 11010 fosc /54 1242 11011 fosc /56 1288 11100 fosc /58 1334 11101 fosc /60 1380 11110 fosc /62 1426 11111 fosc /64 1472 ) 1 ( 2 fosc _ + = adccs clock adc 23 adc_clock _ _ = rate conversion adc
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 73 18 in-system programming (internal isp) the SM39R16A2 can generate flash control signal by internal hardware circuit. users utilize flash control register, flash addre ss register and flash data register to perform the isp function without removing the SM39R16A2 from the system. the SM39R16A2 provides internal flash control signals which can do flash program/chip erase/page erase/protect functions. user need to design and use any kind of interface which SM39R16A2 can input data. user then utilize isp service program to perform the flash program/chip erase/page erase/protect functions. 18.1 isp service program the isp service program is a user developed firmware program which resides in the isp service program space. after user developed the isp service program, user then determine the size of the isp service program. user need to program the isp service program in the SM39R16A2 for the isp purpose. the isp service programs were developed by user so that it should includes any features which relates to the flash memory programming function as well as communication protocol between SM39R16A2 and host device which output data to the SM39R16A2. for example, if user utilize uart interface to receive/transmit data between SM39R16A2 and host device, the isp service program should include baud rate, checksum or parity check or any error-checking mechanism to avoid data transmission error. the isp service program can be initiated under SM39R16A2 active or idle mode. it can not be initiated under power down mode. 18.2 lock bit (n) the lock bit n has two functions: one is for service program size configuration and the other is to lock the isp service program space from flash erase function. the isp service program space address range $3000 to $3fff. it can be divided as blocks of n*256 byte. (n=0 to 16). when n=0 means no isp function, all of 16k byte flash memory can be used as program memory. when n=1 means isp service program occupies 256 byte while the rest of 15.75k byte flash memory can be used as program memory. the maximum isp service program allowed is 4k byte when n=16. under such configuration, the usable program memory space is 12k byte. after n determined, SM39R16A2 will reserve the isp service program space downward from the top of the program address $3fff. the start address of the isp service program located at $3x00 while x is depending on the lock bit n. please see section 3.1 program memory diagram for this isp service program space structure. the lock bit n function is different from the flash protect function. the flash erase function can erase all of the flash memor y except for the locked isp service program space. if the flash not has been protected, the content of isp service program still can be read. if the flash has been protected, the overall content of flash program memory space including isp service program space can not be read. table 18.1 isp code area. n isp service program address 0 no isp service program 1 256 bytes ($3f00h ~ $3fffh) 2 512 bytes ($3e00h ~ $3fffh) 3 768 bytes ($3d00h ~ $3fffh) 4 1.0 k bytes ($3c00h ~ $3fffh) 5 1.25 k bytes ($3b00h ~ $3fffh) 6 1.5 k bytes ($3a00h ~ $3fffh) 7 1.75 k bytes ($3900h ~ $3fffh) 8 2.0 k bytes ($3800h ~ $3fffh) 9 2.25 k bytes ($3700h ~ $3fffh) 10 2.5 k bytes ($3600h ~ $3fffh)
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 74 11 2.75 k bytes ($3500h ~ $3fffh) 12 3.0 k bytes ($3400h ~ $3fffh) 13 3.25 k bytes ($3300h ~ $3fffh) 14 3.5 k bytes ($3200h ~ $3fffh) 15 3.75 k bytes ($3100h ~ $3fffh) 16 4.0 k bytes ($3000h ~ $3fffh) isp service program configurable in n*256 byte (n= 0 ~ 16) 18.3 program the isp service program after lock bit n is set and isp service program been programmed, the isp service program memory will be protected (locked) automatically. the lock bit n has its own program/erase timing. it is different from the flash memory program/erase timing so the locked isp service program can not be erased by flash erase function. if user needs to erase the locked isp service program , he can do it by writer only. user can not change isp service program when SM39R16A2 was in system. 18.4 initiate isp service program to initiate the isp service program is to load the program counter (pc) with start address of isp service program and execute i t. there are four ways to do so: (1) blank reset. hardware reset with first flash address blank ($0000=#ffh) will load the pc with start address of isp service program. the hardware reset includes max810 (power on reset) and external pad reset. the hardware will issue a strobe window about 256us after hardware reset. (2) execute jump instruction can load the start address of the isp service program to pc. (3) enter?s isp service program by hardware setting. user can force SM39R16A2 enter isp service program by setting p2.6, p2.7 ?active low? or p1.6 ? active low? during hardware reset period. the hardware reset includes max810 (power on reset) and external pad reset. the hardware will issue after hardware reset. in application system design, user should take care of the setting of p2.6, p2.7 or p1.6 at reset period to prevent SM39R16A2 from entering isp service program. (4) enter?s isp service program by hardware setting, the p1.1(rxd) will be detected the two clock signals during hardware reset period. the hardware reset includes max810 (power on reset) and external pad reset. the hardware will issue to detect 2 clock signals after hardware reset. during the strobe window, the hardware will detect the status of p2.6/p2.7/p1.6/p1.1. if they meet one of above conditions, chip will switch to isp mode automatically. after isp service program executed, user need to reset the SM39R16A2, either by hardware reset or by wdt, or jump to the address $0000 to re-start the firmware program. there are 8 kinds of entry mechanisms for user different applications. this entry method will select on the writer or isp. (1) first address blank. i.e. $0000 = 0xff. and triggered by internal reset signal. (2) first address blank. i.e. $0000 = 0xff. and triggered by pad reset signal. (3) p2.6 = 0 & p2.7 = 0. and triggered by internal reset signal. (4) p2.6 = 0 & p2.7 = 0. and triggered by pad reset signal. (5) p1.6 = 0. and triggered by internal reset signal. (6) p1.6 = 0. and triggered by pad reset signal. (7) p1.1 input 2 clocks. and triggered by internal reset signal. (8) p1.1 input 2 clocks. and triggered by pad reset signal.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 75 18.5 isp register ? takey, ifcon, ispfah, ispfal, ispfd and ispfc mnemonic description direc t bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t isp function takey time access key register f7h takey [7:0] 00h ifcon interface control register 8fh - cdpr - - - - - ispe 00h ispfah isp flash address - high register e1h - - ispfah [5:0] ffh ispfal isp flash address - low register e2h ispfal [7:0] ffh ispfd isp flash data register e3h ispfd [7:0] ffh ispfc isp flash control register e4h emf1 emf2 emf3 emf4 - ispf.2 ispf.1 ispf.0 00h mnemonic: takey address: f7h 7 6 5 4 3 2 1 0 reset takey [7:0] 00h isp enable bit (ispe) is read-only by default, software must write three specific values 55h, aah and 5ah sequentially to the takey register to enable the ispe bit write attribute. that is: mov takey, #55h mov takey, #0aah mov takey, #5ah mnemonic: ifcon address: 8fh 7 6 5 4 3 2 1 0 reset - cdpr - - - - - ispe 00h the bit 0 (ispe) of ifcon is isp enable bit. user can enable overall SM39R16A2 isp function by setting ispe bit to 1, to disable overall isp function by set ispe to 0. the function of ispe behaves like a security key. user can disable overall isp function to prevent software program be erased accidentally. isp registers ispfah, ispfal, ispfd and ispfc are read-only by default. software must be set ispe bit to 1 to enable these 4 registers write attribute. mnemonic: ispfah address: e1h 7 6 5 4 3 2 1 0 reset - - ispfah5 ispfah4 ispfah3 ispfah2 ispfah1 ispfah0 ffh ispfah [5:0]: flash address-high for isp function mnemonic: ispfal address: e2h 7 6 5 4 3 2 1 0 reset ispfal7 ispfal6 ispfal5 ispfal4 ispfal3 ispfal2 ispfal1 ispfal0 ffh ispfal [7:0]: flash address-low for isp function the ispfah & ispfal provide the 14-bit flash memory address for isp function. the flash memory address should not include the isp service program space address. if the flash memory address indicated by ispfah & ispfal registers overlay with the isp service program space address, the flash program/page erase of isp function executed thereafter will have no effect. mnemonic: ispfd address: e3h 7 6 5 4 3 2 1 0 reset
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 76 ispfd7 ispfd6 ispfd5 ispfd4 ispfd3 ispfd2 ispfd1 ispfd0 ffh ispfd [7:0]: flash data for isp function. the ispfd provide the 8-bit data register for isp function. mnemonic: ispfc address: e4h 7 6 5 4 3 2 1 0 reset emf1 emf2 emf3 emf4 - ispf[2] ispf[1] ispf[0] 00h emf1: entry mechanism (1) flag, clear by reset. (read only) emf2: entry mechanism (2) flag, clear by reset. (read only) emf3: entry mechanism (3) flag, clear by reset. (read only) emf4: entry mechanism (4) flag, clear by reset. (read only) ispf [2:0]: isp function select bit. ispf[2:0] isp function 000 byte program 001 chip protect 010 page erase 011 chip erase 100 write option 101 read option 110 erase option 111 reserved one page of flash memory is 256 byte the option function can access the xtal1 and xtal2 swap to i/o pins select(description in section 1.2) internal reset time select(description in section 1.4.1) clock source select(description in section 1.5) reset swap to i/o pins function select(description in section 5) wdten control bit(description in section 9) or isp entry mechanisms select(description in section 18). when chip protected or no isp service, option can only read. the choice isp function will start to execute once the software write data to ispfc register. to perform byte program/page erases isp function, user need to specify flash address at first. when performing page erase function, SM39R16A2 will erase entire page which flash address indicated by ispfah & ispfal registers located within the page. e.g. flash address: $ xymn page erase function will erase from $xy00 to $xyff to perform the chip erase isp function, SM39R16A2 will erase all the flash program memory except the isp service program space. to perform chip protect isp function, the SM39R16A2 flash memory content will be read #00h. e.g. isp service program to do the byte program - to program #22h to the address $1005h mov takey, #55h mov takey, #0aah mov takey, #5ah ; enable ispe write attribute mov ifcon, #01h ; enable SM39R16A2 isp function mov ispfah, #10h ; set flash address-high, 10h mov ispfal, #05h ; set flash address-low, 05h mov ispfd, #22h ; set flash data to be programmed, data = 22h mov ispfc, #00h ; start to program #22h to the flash address $1005h
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 77 19 op/comparator SM39R16A2 had integrated an opa/comparator module on chip. this module supports opa and comparator modes individually according to user?s configuration. when opa mode enabled, dual op-amps may be applied to single or two-stage amplifier network, and may be applied as a front-end signal process and internally routed to specific adc channel. when comparator mode enabled, an internal reference voltage is available to be configured on comparator terminals. if opa and comparator mode both are enabled at same module, the opa mode has higher priority. mnemonic description addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese t op/comparator oppin opcmp pin select f6h op0_en cmp0_en c0posvbg c0pospad op1_en cmp1_en c1posvbg c1pospad 00h cmp0con comparator_ 0 control feh hys0en cmp0o cmf0ms[1:0] cmf0 -- -- toadc 00h cmp1con comparator_ 1 control ffh hys1en cmp1o cmf1ms[1:0] cmf1 -- -- -- 00h mnemonic: oppin address: f6h 7 6 5 4 3 2 1 0 reset op0_en cmp0_en c0posvbg c0pospad op1_en cmp1_en c1posvbg c1pospad 00h op0_en : op0 enable. 1: op0 circuit enables and switch to corresponding signal in multi-function pin p0.3/p0.4/p0.6 by hw automatically. cmp0_en : cmp0 enable. 1: comparator_0 circuit enables and switch to corresponding signal in multi-function pin p0.3/p0.4/p0.6 by hw automatically. c0posvbg : select comparator_0 positive input source 1: set positive input source as internal reference voltage (1.23v10%) c0pospad: select comparator_0 positive input source 1: set positive input source as external pin op1_en: op1 enable. 1:op1 circuit enables and switch to corresponding signal in multi-function pin p0.0/p0.1/p0.2 by hw automatically. cmp1_en : cmp1 enable. 1: comparator_1 circuit enables and switch to corresponding signal in multi-function pin p0.0/p0.1/p0.2 by hw automatically. c1posvbg: select comparator_1 positive input source 1: set positive input source as internal reference voltage (1.23v10%) c1pospad: select comparator_1 positive input source 1: set positive input source as external pin opx_en cmpx_en cxposvbg cxpospad setting table op/comparator opx_en cmpx_en cxposvbg cxpospad hysxen opxpin opxnin opxout 0 0 x x x io io io 0 1 0 0 0 io io io
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 78 0 1 0 0 1 io io io 0 1 0 1 0 cmp cmp io 0 1 0 1 1 cmp cmp io 0 1 1 0 0 io cmp io 0 1 1 0 1 io cmp io 0 1 1 1 0 io cmp io 0 1 1 1 1 io cmp io 1 0 0 0 x io io io 1 0 0 1 x op op op 1 0 1 0 x io op op 1 0 1 1 x x x x 1 1 0 0 x io io io 1 1 0 1 x op op op 1 1 1 0 x io op op 1 1 1 1 x x x x mnemonic: cmp0con address:feh 7 6 5 4 3 2 1 0 reset hys0en cmp0o cmf0ms[1:0] cmf0 - - toadc 00h hys0en: hysteresis function enable 0: disable hysteresis at comparator_0 input 1: enable cmp0o: comparator_0 output (read only) 0: the positive input source was lower than negative input source 1: the positive input source was higher than negative input source cmf0ms[1:0] : cmf0(comparator_0 flag) setting mode select 00: cmf0 will be set when comprator_0 output toggle 01: cmf0 will be set when comprator_0 output rising 10: cmf0 will be set when comprator_0 output falling 11: reserved cmf0: comparator_0 flag this bit is setting by hardware according to meet cmf0ms [1:0] select condition. this bit must clear by software. toadc: select adc channel as input source of op0 output 0:set adc input source as decided by sfr adcc2 register adcch [2:0] 1:set adc input source ( another adc channel, not adc channel 0~7) mnemonic: cmp1con address:ffh 7 6 5 4 3 2 1 0 reset hys1en cmp1o cmf1ms[1:0] cmf1 - - - 00h hys1en: hysteresis function enable 0: disable hysteresis at comparator_1 input 1: enable cmp1o: comparator_1 output (read only) 0: the positive input source was lower than negative input source 1: the positive input source was higher than negative input source cmf1ms[1:0] : cmf1(comparator_1 flag) setting mode select 00: cmf1 will be set when comprator_1 output toggle 01: cmf1 will be set when comprator_1 output rising 10: cmf1 will be set when comprator_1 output falling 11: reserved cmf1: comparator_1 flag this bit is setting by hardware according to meet cmf1ms [1:0] select condition. this bit must clear by software.
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 79 operating conditions symbol description min. typ. max. unit. remarks ta operating temperature -40 25 85 ambient temperature under bias vdd supply voltage 2.7 5.5 v dc characteristics t a = -40 to 85 , v cc = 5.0v symbol parameter valid min max units conditions vil1 input low-voltage port 0,1,2,3 -0.5 0.8 v vcc=5v vil2 input low-voltage res, xtal1 0 0.8 v vih1 input high-voltage port 0,1,2,3 2.0 v cc + 0.5 v vih2 input high-voltage res, xtal1 70%vcc v cc + 0.5 v vol output low-voltage port 0,1,2,3 0.4 v iol=4.9ma vcc=5v 90% v cc v ioh= -4.6ma voh1 output high-voltage using strong pull-up (1) port 0,1,2,3 2.4 v ioh= -14ma voh2 output high-voltage using weak pull-up (2) port 0,1,2,3 2.4 v ioh= -250ua iil logic 0 input current port 0,1,2,3 -75 ua vin= 0.45v itl logical transition current port 0,1,2,3 -650 ua vin= 2.0v ili input leakage current port 0,1,2,3 10 ua 0.45v SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 80 t a = -40 to 85 , v cc = 3.0v symbol parameter valid min max units conditions vil1 input low-voltage port 0,1,2,3 -0.5 0.8 v vcc=3.0v vil2 input low-voltage res, xtal1 0 0.8 v vih1 input high-voltage port 0,1,2,3 2.0 v cc + 0.5 v vih2 input high-voltage res, xtal1 70%vcc v cc + 0.5 v vol output low-voltage port 0,1,2,3 0.4 v iol=3.2ma vcc=3.0v voh1 output high-voltage using strong pull-up (1) port 0,1,2,3 90% v cc v ioh= -2.3ma voh2 output high-voltage using weak pull-up (2) port 0,1,2,3 2.4 v ioh= -77ua iil logic 0 input current port 0,1,2,3 -75 ua vin= 0.45v itl logical transition current port 0,1,2,3 -650 ua vin=1.5v ili input leakage current port 0,1,2,3 10 ua 0.45v SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 81 opa / comparator characteristics v cc = 5.0v symbol parameter conditions min typ max unit vos input offset voltage no load 3 5 mv vout output voltage swing rl=15k ? cl=100pf vin+ - vin- >200mv 0.1 vdd - 0.4 v bw gain band width product rl=10k ? cl=100pf 0.4 0.5 0.55 mhz cmrr common mode rejection ratio no load 65 70 72 db psrr power supply rejection ratio no load 75 80 84 db sr slew rate at unity gain no load 0.57 0.7 0.78 v/us rl max. load rl=10k ? cl=100pf >15 k ? h hysteresis no load 20 40 60 mv
SM39R16A2/sm39r12a2/sm39r08a2 8-bit micro-controller 16kb/12kb/8kb with isp flash & 256b ram embedded specifications subject to change without notice contact your sales representatives for the most recent information. issfd-m057 ver.h SM39R16A2 07/2012 82 v cc = 3.0v symbol parameter conditions min typ max unit vos input offset voltage no load 3 5 mv vout output voltage swing rl=15k ? cl=100pf vin+ -vin- >200mv 0.1 vdd ? 0.4 v bw gain band width product rl=10k ? cl=100pf 0.4 0.5 0.55 mhz cmrr common mode rejection ratio no load 60 65 68 db psrr power supply rejection ratio no load 60 65 68 db sr slew rate at unity gain no load 0.57 0.7 0.78 v/us rl max. load rl=10k ? cl=100pf >15 k ? h hysteresis no load 20 40 60 mv


▲Up To Search▲   

 
Price & Availability of SM39R16A2

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X