IBM EM78P312N Specification - 1 General

Manual is about: IBM 8-Bit Microcontroller Green Product Specification

Summary of EM78P312N

  • Page 1

    Em78p312n 8-b it microcontroller green product specification d oc . V ersion 1.0 elan microelectronics corp. October 2006.

  • Page 2

    Trademark acknowledgments: ibm is a registered trademark and ps/2 is a trademark of ibm. Windows is a trademark of microsoft corporation. Elan and elan logo are trademarks of elan microelectronics corporation. Copyright © 2006 by elan microelectronics corporation all rights reserved printed in taiwa...

  • Page 3

    Contents product specification (v1.0) 10.03.2006 • iii contents 1 general description.....................................................................................................1 2 features ........................................................................................................

  • Page 4

    Contents iv • product specification (v1.0) 10.03.2006 5.14 reset and wake-up............................................................................................ 42 5.14.1 reset ................................................................................................................ 42...

  • Page 5: 1 General

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 1 (this specification is subject to change without further notice) 1 general description the em78p312n is an 8-bit microprocessor with low-power, high-speed cmos technology and high noise immunity . It has an on-chip 4k×13-bit...

  • Page 6: 4 Pin

    Em78p312n 8-bit microcontroller 2 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 4 pin description table 1 symbol pin no. Type function vdd 28 − power supply osci 2 i crystal type: crystal input terminal rc type: rc oscillator input pin osc...

  • Page 7: 5 Function

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 3 (this specification is subject to change without further notice) 5 function description 5.1 functional block diagram rom r3 status reg. Acc instruction decoder instruction register alu pc interrupt circuit 8-level stack (13 ...

  • Page 8

    Em78p312n 8-bit microcontroller 4 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 5.2 operating registers 05 06 07 08 09 0a 0b 0c 0d 0e 0f 04 03 02 01 10 : 1f 20 : 3f r3 (7, 6) = (0, 1) address register bank 0 00 r0/ iar r1/ tcc r2/ pc r3/ s...

  • Page 9

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 5 (this specification is subject to change without further notice) r0 (indirect addressing register) r0 is not a physically implemented register. Its major function is to act as an indirect addressing pointer. Any instruction ...

  • Page 10

    Em78p312n 8-bit microcontroller 6 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) a11 a10 a9 a8 a7 ~ a0 r5 call ret retl reti 000 : page0 0000~03ff 001 : page1 0400~07ff 010 : page2 0800~0bff pc stack level 1 stack level 2 stack level 3 stac...

  • Page 11

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 7 (this specification is subject to change without further notice) bit 3 (p): power down bit. Set to “1” during power on or by a "wdtc" command and reset to “0” by a "slep" command. Bit 2 (z): zero flag. Set to "1" if the resu...

  • Page 12

    Em78p312n 8-bit microcontroller 8 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) r6 (port 6 i/o data register) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p67 p66 p65 p64 p63 p62 p61 p60 bit 7 ~ bit 0 ( p67 ~ p60 ) : 8-bit port 6 i/o da...

  • Page 13

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 9 (this specification is subject to change without further notice) bit 4 ~ bit 2 ( tc4ck2 ~ tc4ck 0 ) : timer/counter 4 clock source select tc4ck2 tc4ck1 tc4ck0 clock source ( normal, idle ) resolution ( fosc=8m ) max. Time ( ...

  • Page 14

    Em78p312n 8-bit microcontroller 10 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) re (interrupt status flag register 1) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 exif5 tcif2 adif 0 exif3 tcif4 spif tcif3 bit 7 ( exif5 ) : external int...

  • Page 15

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 11 (this specification is subject to change without further notice) z isfr2 can be cleared by instruction, but cannot be set by instruction z imr2 is the interrupt mask register z note that reading isfr2 will obtain the result...

  • Page 16

    Em78p312n 8-bit microcontroller 12 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) bank 1 r8 tc2cr/ addl (timer/counter 2 control register, ad low 2 bits data buffer) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 add1 add0 0 tc2m tc2s tc2c...

  • Page 17

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 13 (this specification is subject to change without further notice) bit 6 ( adrun ) : ad conversion start adrun = “0” : reset on completion of the conversion by hardware, this bit cannot be reset by software. Adrun = “1” : con...

  • Page 18

    Em78p312n 8-bit microcontroller 14 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) bank 1 re tbktc (tbt/keytone control) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ten tck1 tck0 0 tbten tbtck2 tbtck1 tbtck0 bit 7 ( ten ) : keytone enabl...

  • Page 19

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 15 (this specification is subject to change without further notice) bit 4 ~ bit 2 ( brate2 ~ brate1 ) : transmit baud rate select brate2 brate1 brate0 baud rate e.G. Fc=8mhz 0 0 0 fc/13 38400 0 0 1 fc/26 19200 0 1 0 fc/52 9600...

  • Page 20

    Em78p312n 8-bit microcontroller 16 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) bit 6 ( even ) : select parity check even = “0” : odd parity even = “1” : even parity bit 5 ( pre ) : enable parity addition pre = “0” : disable pre = “1” : e...

  • Page 21

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 17 (this specification is subject to change without further notice) in using the external clock, data input sample is fixed at the middle of data output time. Bit 6 ( dcol ) : spi data collision. Dcol = “0” : no occurrence of ...

  • Page 22

    Em78p312n 8-bit microcontroller 18 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) bit 2 ~ bit 1 ( spim1 ~ spim0) : spi transfer mode select tc2ck1 tc2ck0 transfer mode 0 0 8-bit transmit/receive mode 0 1 8-bit transmit mode 1 0 8-bit receiv...

  • Page 23

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 19 (this specification is subject to change without further notice) bank 3 rc phc2 (pull high control register 2) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - - - /phe73 /phe72 /phe71 /phe70 bit 3 ~ 0 ( /phe73 ~ /phe70 ...

  • Page 24

    Em78p312n 8-bit microcontroller 20 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) bit 2 ( psr2 ) ~ bit 0 ( psr0 ) : tcc prescaler bits psr2 psr1 psr0 operating mode 0 0 0 1:2 0 0 1 1:4 0 1 0 1:8 0 1 1 1:16 1 0 0 1:32 1 0 1 1:64 1 1 0 1:128 ...

  • Page 25

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 21 (this specification is subject to change without further notice) external interrupt int pin secondary function pin enable condition edge digital noise reject /int0 p60 eni + int0en (iocb) falling - int1 p61 eni + exie1 (imr...

  • Page 26

    Em78p312n 8-bit microcontroller 22 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) bit 1 ( spie ) : spi interrupt enable bit. Spie = “0” : disable spif interrupt spie = “1” : enable spif interrupt bit 0 ( tcie3 ) : timer/counter 3 interrupt ...

  • Page 27

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 23 (this specification is subject to change without further notice) 5.4 cpu operation mode registers for cpu operation mode r_bank address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bank 0 0x05 scr 0 ps2 ps1 ps0 0 1 ...

  • Page 28

    Em78p312n 8-bit microcontroller 24 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) in sleep mode, the internal oscillator is turned off and all system operation is halted. Sleep mode is released by /sleep pin (level sensitive or edge sensiti...

  • Page 29

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 25 (this specification is subject to change without further notice) 8 t o 1 a n a lo g sw it c h adc (successive approximation) ad7 (p97) ad6 (p96) ad5 (p95) ad4 (p94) ad3 (p93) ad2 (p92) ad1 (p91) ad0 (p90) 7 - 0 2 1 0 4 to 1...

  • Page 30

    Em78p312n 8-bit microcontroller 26 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 5.6 time base timer and keytone generator registers for ad converter circuit r_bank address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ten tck1 tck0...

  • Page 31

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 27 (this specification is subject to change without further notice) mux fosc/2 fosc/2 fosc/2 fosc/2 fosc/2 fosc/2 fosc/2 fosc/2 23 21 16 14 13 12 11 9 tbktc tbtck2:0 3 falling edge detector tbt interrupt tbten fig. 5-8 tbt con...

  • Page 32

    Em78p312n 8-bit microcontroller 28 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 5.7 uart (universal asynchronous receiver/transmitter) registers for uart circuit r_bank address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 urtd8 um...

  • Page 33

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 29 (this specification is subject to change without further notice) the figure below shows the general format of one character sent or received. The communication channel is normally held in the marked state (high). Character ...

  • Page 34

    Em78p312n 8-bit microcontroller 30 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 3. Start transmitting. 4. Serially transmitted data are transmitted in the following order from the tx pin. 5. Start bit: one “0” bit is output. 6. Transmit d...

  • Page 35

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 31 (this specification is subject to change without further notice) 5.8 spi (serial peripheral interface) registers for the spi circuit r_bank address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 smp dcol brs2 brs1 brs...

  • Page 36

    Em78p312n 8-bit microcontroller 32 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 5.8.1 serial clock six internal clocks can be selected by setting brs0 ~ brs2 and the clock output to the outside from /sck (p70) pin. The external clock can ...

  • Page 37

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 33 (this specification is subject to change without further notice) (b) 8-bit receive mode setting spim0 ~ spim1 to receive mode and setting spis to “1” to start receiving. The data are input sequentially from the si pin in sy...

  • Page 38

    Em78p312n 8-bit microcontroller 34 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) spis rbf wbe spif read data shift start shift start /sck pin si pin c0 c1 c2 c3 c4 c5 c6 c7 a spid d0 d1 d2 d3 d4 d5 d6 d7 read data d shift finish so pin a0 ...

  • Page 39

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 35 (this specification is subject to change without further notice) 5.9 timer/counter 2 registers for timer/counter 2 circuit r_bank address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 add1 add0 0 tc2m tc2s tc2ck2 tc2...

  • Page 40

    Em78p312n 8-bit microcontroller 36 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 5.9.1 timer mode in timer mode, counting up is performed using the internal clock. When the contents of the up-counter matched with the tcr2 (tcr2h+tcr2l), th...

  • Page 41

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 37 (this specification is subject to change without further notice) 0 1 2 n-3 n-1 n 1 2 3 internal clock up-counter n-2 tc2 pin tc2 interrupt 0 n match counter clear tcr2 fig. 5-21 window mode timing chart 5.10 timer/counter 3...

  • Page 42

    Em78p312n 8-bit microcontroller 38 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 8-bit up-counter comparator tcr3b tc3cr mux int3es tc3 pin tc2ck tc3s 2 tc3 interrupt tcr3a fc/2 12 fc/2 10 fc/2 7 edge detector capture control tc3m capture ...

  • Page 43

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 39 (this specification is subject to change without further notice) of the tc3 pin input, the contents of the counter are loaded into tcr3a, counter is cleared and interrupt is generated again. If an overflow before the edge i...

  • Page 44

    Em78p312n 8-bit microcontroller 40 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 8-bit up-counter comparator tcr4 tc4cr mux tc4 pin tc4ck tc4s 3 tc4 interrupt fc/2 11 fc/2 7 fc/2 3 clear tc4m (1,1) tc4m(1,*) tc4ff toggle set clear /pwm, /p...

  • Page 45

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 41 (this specification is subject to change without further notice) 5.11.4 pwm mode in pulse width modulation (pwm) output mode, counting up is performed using the internal clock. The contents of the tcr4 are compared with the...

  • Page 46

    Em78p312n 8-bit microcontroller 42 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 5.13 i/o ports the i/o registers, port 6, port 7, port 8, and port 9 are bi-directional tri-state i/o ports. Each i/o pin can be defined as “input” or “output...

  • Page 47

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 43 (this specification is subject to change without further notice) the watchdog timer and prescaler are cleared. Upon power on, the upper two bits of r3 are cleared. Upon power on, the upper two bits of r4 are cleared. Upon p...

  • Page 48

    Em78p312n 8-bit microcontroller 44 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) table 6. Summary of the initialized values for registers address name reset type bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit name c67 c66 c65 c64 c63 ...

  • Page 49

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 45 (this specification is subject to change without further notice) register bank 0 address name reset type bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit name x x x ps0 x x sis rem power-on u 0 0 0 u u 0 0 /reset and wdt...

  • Page 50

    Em78p312n 8-bit microcontroller 46 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) register bank 1 addres s name reset type bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit name tc3cap tc3s tc3ck1 tc3ck0 tc3m x x x power-on 0 0 0 0 0 u u ...

  • Page 51

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 47 (this specification is subject to change without further notice) register bank 2 address name reset type bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit name urtd8 umode1 umode0 brate2 brate1 brate0 utbe txe power-on u ...

  • Page 52

    Em78p312n 8-bit microcontroller 48 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) general purpose registers address name reset type bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit name - - - - - - - - power-on u u u u u u u u /reset and...

  • Page 53

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 49 (this specification is subject to change without further notice) voltage detector power-on reset wdte setup time vdd d q clk clr clk reset wdt timeout wdt /reset oscillator fig. 5-28 controller reset block diagram 5.15 inte...

  • Page 54

    Em78p312n 8-bit microcontroller 50 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) the flag (except icif bit) in the interrupt status register (isfr 2) is set regardless of the status of its mask bit or the execution of eni. The reti instruc...

  • Page 55

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 51 (this specification is subject to change without further notice) osci osco em78p809n ext. Clock fig. 5-29 crystal/resonator circuit c1 c2 xtal rs osci osco em78p809n fig. 5-30 crystal/resonator circuit table12. Capacitor se...

  • Page 56

    Em78p312n 8-bit microcontroller 52 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 740 4 4.7 k 10 k xtal 740 4 c1 vdd 10 k c2 osci em78p809n fig. 5-32 crystal/resonator-parallel mode circuit 5.16.3 external rc oscillator mode for application...

  • Page 57

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 53 (this specification is subject to change without further notice) table13. Rc oscillator frequencies cext rext average fosc 5v, 25 ° c average fosc 3v, 25 ° c 3.3k 4.32 mhz 3.56 mhz 5.1k 2.83 mhz 2.8 mhz 10k 1.62 mhz 1.57 mh...

  • Page 58

    Em78p312n 8-bit microcontroller 54 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) bit 4 (osc) : oscillator type selection osc = “0” : rc type osc = “1” : crystal type bit 3 (hlp) : power selection hlp = “0” : low power hlp = “1” : high powe...

  • Page 59

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 55 (this specification is subject to change without further notice) em78p809n /reset vdd d r rin c fig. 5-34 external power-up reset circuit 5.18.2 residue-voltage protection when battery is replaced, device power (v dd ) is t...

  • Page 60

    Em78p312n 8-bit microcontroller 56 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 5.19 instruction set each instruction in the instruction set is a 13-bit word divided into an op code and one or more operands. Normally, all instructions are...

  • Page 61

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 57 (this specification is subject to change without further notice) binary instruction hex mnemonic operation status affected 0 0000 01rr rrrr 00rr mov r, a a → r none 0 0000 1000 0000 0080 clra 0 → a z 0 0000 11rr rrrr 00rr c...

  • Page 62: 6 Absolute

    Em78p312n 8-bit microcontroller 58 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 6 absolute maximum ratings 6.1 absolute maximum ratings items rating temperature under bias -40 ° c to 85 ° c storage temperature -65 ° c to 150 ° c input vol...

  • Page 63: 7 Electrical

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 59 (this specification is subject to change without further notice) 7 electrical characteristics 7.1 dc electrical characteristics ta= 25 ° c, vdd= 5.0v ± 5%, vss= 0v symbol parameter condition min. Typ. Max. Unit fc crystal: ...

  • Page 64

    Em78p312n 8-bit microcontroller 60 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) ta= 25 ° c, vdd= 3.0v ± 5%, vss= 0v symbol parameter condition min. Typ. Max. Unit fc crystal: 2.5v to vdd two cyclea with two clocks 1 − 4 mhz erc erc: vdd =...

  • Page 65

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 61 (this specification is subject to change without further notice) a/d converter characteristic (vdd =2.5v to 5.5v, vss=0v, ta = -40 to 85°c) symbol parameter condition min. Typ. Max. Unit varef 2.5 − v dd v vass analog refer...

  • Page 66

    Em78p312n 8-bit microcontroller 62 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) 7.2 ac electrical characteristic ta=- 40 ° c ~ 85 ° c, vdd=5v ± 5%, vss=0v symbol parameter conditions min typ max unit dclk input clk duty cycle − 45 50 55 %...

  • Page 67

    Em78p312n 8-bit microcontroller product specification (v1.0) 10.03.2006 • 63 (this specification is subject to change without further notice) 7.3 timing diagram res et tim ing (clk="0") clk /r eset n op instruction 1 executed tdrh tcc input tim ing (clks="0") clk tcc ttcc t ins ac t esting : input i...

  • Page 68: Appendix

    Em78p312n 8-bit microcontroller 64 • product specification (v1.0) 10.03.2006 (this specification is subject to change without further notice) appendix a package types: otp mcu package type pin count package size em78p312np dip 28 600 mil em78p312nk sdip 28 400 mil em78p312nak sdip 28 300 mil em78p31...