Part Number Hot Search : 
20N6T LM311 S62LV256 HCS21MS AD7441 TD6720N HB02107 ADC311
Product Description
Full Text Search
 

To Download JTMP92CA25 Datasheet File

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


  Datasheet File OCR Text:
  toshiba original cmos 32-bit microcontroller tlcs-900/h1 series tmp92ca25fg semiconductor company
preface thank you very much for making us e of toshiba microcomputer lsis. before use this lsi, refer the section, ?points of note and restrictions?.
tmp92ca25 2007-02-28 92ca25-1 cmos 32-bit microcontroller tmp92ca25fg/JTMP92CA25 1. outline and device characteristics the tmp92ca25 is a high-speed advanced 32-b it microcontroller developed for controlling equipment which processes mass data. the tmp92ca25 has a high-performance cpu (900/h1 cpu) and various built-in i/os. the tmp92ca25fg is housed in a 144-pin flat package. the JTMP92CA25 is a chip form product. device characteristics are as follows: (1) cpu: 32-bit cpu (900/h1 cpu) ? compatible with tlcs-900/l1 instruction code ? 16 mbytes of linear address space ? general-purpose register and register banks ? micro dma: 8 channels (250 ns/4 bytes at f sys = 20 mhz, best case) (2) minimum instruction execution time: 50 ns (at f sys = 20 mhz) restrictions on product use 070208ebp ? the information contained herein is subject to change without notice. 021023_d ? toshiba is continually working to improve the quality and reliability of its products. nevertheless, semiconductor devices in general can malfunction or fail due to their i nherent electrical sensitivity and vulnerability to physical stress. it is the responsibility of t he buyer, when utilizing toshiba products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations in which a malfun ction or failure of such toshiba products could cause loss of human life, bodily injury or damage to property. in developing your designs, please ensure that toshiba products are used within s pecified operating ranges as set forth in the most recent toshiba products specific ations. also, please keep in mind the precautions and conditions set forth in the ?handling guide for semiconduct or devices,? or ?toshiba semiconductor reliability handbook? etc. 021023_a ? the toshiba products listed in this document are intend ed for usage in general electr onics applications (computer, personal equipment, office equipment, measuring equipmen t, industrial robotics, domesti c appliances, etc.). these toshiba products are neither intended nor warranted for us age in equipment that requ ires extraordinarily high quality and/or reliability or a malfunction or failure of which may cause loss of human life or bodily injury (?unintended usage?). unintended usage include atomic ener gy control instruments, airplane or spaceship instruments, transportation instrument s, traffic signal instruments, com bustion control instruments, medical instruments, all types of safety devic es, etc. unintended usage of toshiba pr oducts listed in this document shall be made at the customer?s own risk. 021023_b ? the products described in this document shall not be used or embedded to any downstream products of which manufacture, use and/or sale are prohibited under any applicable laws and regulations. 060106_q ? the information contained herein is presented only as a gu ide for the applications of our products. no responsibility is assumed by toshiba for any infringements of patents or ot her rights of the third parties which may result from its use. no license is granted by implicat ion or otherwise under any patents or other rights of toshiba or the third parties. 021023_c ? the products described in this document are subject to foreign exchange and foreign trade control laws. 060925_e ? for a discussion of how the reliability of microcontrollers can be predicted, please refer to section 1.3 of the chapter entitled quality and reliability assurance/handling precautions. 030619_s
tmp92ca25 2007-02-28 92ca25-2 (3) internal memory ? internal ram: 10 kbytes (can be used for program, data and display memory) ? internal rom: 0 kbytes (used as boot program) (4) external memory expansion ? expandable up to 512 mbytes (shared program/data area) ? can simultaneously support 8,- 16- or 32-bit width external data bus ... dynamic data bus sizing (5) memory controller ? chip select output: 4 channels (6) 8-bit timers: 4 channels (7) 16-bit timer/event counter: 1 channel (8) general-purpose serial interface: 1 channels ? uart/synchronous mode ? irda ver.1.0 (115 kbps) mode selectable (9) serial bus interface: 1 channel: 1 channel ? i 2 c bus mode only (10) i 2 s (inter-ic sound) interface: 1 channel ? i 2 s bus mode/sio mode selectable (master, transmission only) ? 32-byte fifo buffer (11) lcd controller ? supports monochrome for stn ? built-in ram lcd driver (12) spi controller ? supported only spi mode for sd card (13) sdram controller: 1 channel ? supports 16 m, 64 m, 128 m, 256 m, and up to 512-mbit sdr (single data rate)-sdram ? supported not only operate as ram and da ta for lcd display but also programming directly from sdram (14) timer for real-time clock (rtc) ? based on tc8521a (15) key-on wakeup (interrupt key input) (16) 10-bit ad converter (built-in sample hold circuit): 4 channels (17) touch screen interface ? available to reduce external components (18) watchdog timer (19) melody/alarm generator ? melody: output of clock 4 to 5461 hz ? alarm: output of 8 kinds of alarm patte rn and 5 kinds of interval interrupt
tmp92ca25 2007-02-28 92ca25-3 (20) mmu ? expandable up to 512 mbytes (3 local area/8 bank method) ? independent bank for each program, read data, write data and lcd display data (21) interrupts: 49 interrupt ? 9 cpu interrupts: software interrupt instruction and illegal instruction ? 34 internal interrupts: seven selectable priority levels ? 7 external interrupts: seven selectable priority levels (6-edge selectable) (21) input/output ports: 84 pins (except data bus (16bit), address bus (24bit) and rd pin) (22) nand flash interface: 2 channels ? direct nand flash connection capability ? ecc (error detection) calculation (for slc- type) (23) stand-by function ? three halt modes: idle2 (programmable), idle1, stop ? each pin status programmable for stand-by mode (24) triple-clock controller ? clock doubler (pll) supplies 40 system-clock from external 10mhz oscillator to cpu ? clock gear function: select high-frequency clock fc to fc/16 ? rtc (fs = 32.768 khz) (25) operating voltage: ? vcc = 3.0 v to 3.6 v (fc max = 40 mhz) ? vcc = 2.7 v to 3.6 v (fc max = 27 mhz) (26) package: ? 144-pin qfp (p-lqfp144 -1616-0.40c) ? 144-pin chip form is also available. fo r details, contact your local toshiba sales representative.
tmp92ca25 2007-02-28 92ca25-4 figure 1.1 tmp92ca25 block diagram 10-bit 4-channel ad converter serial i/o sio0 (i2scko, txd0) p90 (i2sdo, rxd0) p91 (i2sws, sclk0) p92 8-bit timer (timera0) 8-bit timer (timera1) 8-bit timer (timera2) 8-bit timer (timera3) (tb0out0, int2) pc2 (int3) pc3 16-bit timer (timerb0) sdram controller (lcp0) pk0 (llp) pk1 (lfr) pk2 (lbcd) pk3 pl0 to pl5 ( ld0 to ld5 ) wa bc de hl ix i y iz sp xwa xbc xde xhl xix xiy xiz xsp watchdog timer port 1 port 7 nand flash i/f (2 channel) h-osc interrupt controller rtcvcc dvcc [3] dvss [3] x1 x2 p10 to p17 (d8 to d15) 32 bits f sr pc 900/h1 cpu touch screen i/f (tsi) i 2 s lcd controller pll clock gear l-osc xt1 xt2 port 6 d0 to d7 port 8 keyboard i/f rtc melody/ alarm out 10-kb ram mmu (ta1out, int0) pc0 (ta3out, int1) pc1 a 0 to a7 a 8 to a15 p60 to p67 (a16 to a23) pa0 to pa7 (ki0 to ki7) pc6 (ko8,ea24) pm1 (mldalm) pg0 to pg1 (an0 to an1) an2/mx (pg2) an3/my/ adtrg (pg3) avcc, avss vrefh, vrefl (px, int4) p96 (py, int5) p97 ( sdras , srllb ) pj0 ( sdcas , srlub ) pj1 ( sdwe , srwr ) pj2 (sdlldqm) pj3 (sdludqm) pj4 (ndale) pj5 (ndcle) pj6 (sdcke) pj7 (sdclk) pf7 reset a m0 a m1 p70 ( rd ) p71 ( wrll , ndre ) p72 ( wrlu , ndwe ) p73 (ea24) p74 (ea25) p75 (r/ w , ndr/ b ) p76 ( wait ) p80 ( 0 cs ) p81 ( 1 cs , sdcs ) p82 ( 2 cs , csza ) p83 ( 3 cs ) p84 ( cszb , ce 0 nd ) p85 ( cszc , ce 1 nd ) p86 ( cszd ) p87 ( csze ) pc7 ( cszf , ea25 ) pm2 ( alarm , mldalm ) (txd0) pf0 (rxd0) pf1 (sclk0) pf2 be port n pn0 to pn7 (ko0 to ko7) port l (ld6, busrq ) pl6 (ld7, busak ) pl7 port f pf3 pf4 pf5 pf6 (sda) p93 (scl) p94 (clk32ko) p95 sbi (i 2 cbus) (spdi) pk4 (spdo) pk5 ( spcs ) pk6 (spclk) pk7 spi controller port c pc4 pc5
tmp92ca25 2007-02-28 92ca25-5 2. pin assignment and functions the assignment of input/output pins for the tmp92ca25fg, their names and functions are as follows: 2.1 pin assignment figure 2.1.1 shows the pin assignment of the tmp92ca25fg. figure 2.1.1 pin assignment diagram (144-pin qfp) tmp92ca25fg qfp144 top view p67, a23 p66, a22 p65, a21 p64, a20 dvcc3 p63, a19 p62, a18 p61, a17 p60, a16 a 15 a 14 a 13 a 12 a 11 a 10 a 9 a 8 a 7 a 6 a 5 a 4 a 3 a 2 a 1 a 0 pf6 pf5 dvss3 pf4 pf3 pk7, spclk pk6, spcs pk5, spdo pk4, spdi pn7, ko7 pn6, ko6 vrefl vrefh pg0, an0 pg1, an1 pg2, an2, mx pg3, an3, adtrg , my p96, px, int4 p97, py, int5 pa3, ki3 pa4, ki4 pa5, ki5 pa6, ki6 pa7, ki7 p90, txd0, i2scko p91, rxd0, i2sdo p92, sclk0, 0 cts , i2sws p93, sda p94, scl p95, clk32ko pc2, tb0out0, int2 pl0, ld0 pl1, ld1 pl2, ld2 pl3, ld3 pl4, ld4 pl5, ld5 pl6, ld6 pl7, ld7 pk0, lcp0 pk1, llp pk2, lfr pk3, lbcd pm2, alarm , mldalm pm1, mldalm xt1 xt2 rtcvcc be pc4 pc5 dvcc1 x1 dvss1 x2 am0 am1 reset pc3, int3 dvss2 dvcc2 d0 d1 d2 d3 d4 d5 d6 d7 p10, d8 p11, d9 p12, d10 p13, d11 p14, d12 p15, d13 p16, d14 p17, d15 pn0, ko0 pn1, ko1 pn2, ko2 pn3, ko3 pn4, ko4 pn5, ko5 a vcc a vss pa2, ki2 pa1, ki1 pa0, ki0 pj7, sdcke pj6, ndcle pj5, ndale pj4, sdludqm pj3, sdlldqm pj2, sdwe , srwr pj1, sdcas , srlub pj0, sdras , srllb pf7, sdclk pc1, ta3out, int1 pc0, ta1out, int0 pf2, sclk0, cts0 pf1, rxd0 pf0, txd0 pc7, cszf , ea25 p87, csze p86, cszd p85, cszc , nd1ce p84, cszb , nd0ce p83, cs3 p82, cs2 , csza p81, cs1 , sdcs pc6, ko8, ea24 p80, cs0 p76, wait p75, rw, ndr/b p74, ea25 p73, ea24 p72, wrlu , ndwe p71, wrll , ndre p70, rd 1 5 10 15 20 25 30 35 105 100 95 90 85 80 75 140 135 130 125 120 115 110 40 45 50 55 60 65 70
tmp92ca25 2007-02-28 92ca25-6 2.2 pad assignment (chip size 4.98 mm 5.61 mm) table 2.2.1 pad assignment diagram (144-pin chip) unit: m pin no. name x point y point pin no. name x point y point pin no. name x point y point 1 vrefl ? 2363 2309 49 dvss2 ? 447 ? 2678 97 a13 2359 822 2 vrefh ? 2363 2189 50 dvcc2 ? 297 ? 2678 98 a14 2359 939 3 pg0 ? 2363 1934 51 d0 ? 172 ? 2678 99 a15 2359 1055 4 pg1 ? 2363 1593 52 d1 ? 72 ? 2678 100 p60 2359 1171 5 pg2 ? 2363 1493 53 d2 28 ? 2678 101 p61 2359 1288 6 pg3 ? 2363 1393 54 d3 128 ? 2678 102 p62 2359 1400 7 p96 ? 2363 1293 55 d4 228 ? 2678 103 p63 2359 1514 8 p97 ? 2363 1192 56 d5 328 ? 2678 104 dvcc3 2359 1643 9 pa3 ? 2363 1088 57 d6 429 ? 2678 105 p64 2359 1779 10 pa4 ? 2363 988 58 d7 529 ? 2678 106 p65 2359 1902 11 pa5 ? 2363 888 59 p10 629 ? 2678 107 p66 2359 2027 12 pa6 ? 2363 788 60 p11 729 ? 2678 108 p67 2359 2309 13 pa7 ? 2363 688 61 p12 829 ? 2678 109 p70 1994 2675 14 p90 ? 2363 587 62 p13 929 ? 2678 110 p71 1874 2675 15 p91 ? 2363 487 63 p14 1029 ? 2678 111 p72 1753 2675 16 p92 ? 2363 387 64 p15 1129 ? 2678 112 p73 1633 2675 17 p93 ? 2363 287 65 p16 1229 ? 2678 113 p74 1527 2675 18 p94 ? 2363 187 66 p17 1329 ? 2678 114 p75 1420 2675 19 p95 ? 2363 87 67 pn0 1429 ? 2678 115 p76 1316 2675 20 pc2 ? 2363 ? 13 68 pn1 1529 ? 2678 116 p80 1211 2675 21 pl0 ? 2363 ? 113 69 pn2 1630 ? 2678 117 pc6 1104 2675 22 pl1 ? 2363 ? 213 70 pn3 1753 ? 2678 118 p81 999 2675 23 pl2 ? 2363 ? 313 71 pn4 1873 ? 2678 119 p82 893 2675 24 pl3 ? 2363 ? 413 72 pn5 1994 ? 2678 120 p83 787 2675 25 pl4 ? 2363 ? 514 73 pn6 2359 ? 2313 121 p84 682 2675 26 pl5 ? 2363 ? 614 74 pn7 2359 ? 2049 122 p85 574 2675 27 pl6 ? 2363 ? 714 75 pk4 2359 ? 1708 123 p86 468 2675 28 pl7 ? 2363 ? 814 76 pk5 2359 ? 1587 124 p87 363 2675 29 pk0 ? 2363 ? 914 77 pk6 2359 ? 1472 125 pc7 259 2675 30 pk1 ? 2363 ? 1014 78 pk7 2359 ? 1359 126 pf0 154 2675 31 pk2 ? 2363 ? 1114 79 pf3 2359 ? 1243 127 pf1 50 2675 32 pk3 ? 2363 ? 1215 80 pf4 2359 ? 1131 128 pf2 ? 55 2675 33 pm2 ? 2363 ? 1473 81 dvss3 2359 ? 1012 129 pc0 ? 158 2675 34 pm1 ? 2363 ? 1594 82 pf5 2359 ? 885 130 pc1 ? 261 2675 35 xt1 ? 2363 ? 1935 83 pf6 2359 ? 749 131 pf7 ? 364 2675 36 xt2 ? 2363 ? 2313 84 a0 2359 ? 639 132 pj0 ? 467 2675 37 rtcvcc ? 1986 ? 2678 85 a1 2359 ? 530 133 pj1 ? 568 2675 38 be ? 1853 ? 2678 86 a2 2359 ? 420 134 pj2 ? 669 2675 39 pc4 ? 1732 ? 2678 87 a3 2359 ? 311 135 pj3 ? 771 2675 40 pc5 ? 1612 ? 2678 88 a4 2359 ? 199 136 pj4 ? 872 2675 41 dvcc1 ? 1499 ? 2678 89 a5 2359 ? 88 137 pj5 ? 972 2675 42 x1 ? 1386 ? 2678 90 a6 2359 23 138 pj6 ? 1074 2675 43 dvss1 ? 1261 ? 2678 91 a7 2359 134 139 pj7 ? 1175 2675 44 x2 ? 972 ? 2678 92 a8 2359 245 140 pa0 ? 1278 2675 45 am0 ? 872 ? 2678 93 a9 2359 356 141 pa1 ? 1379 2675 46 am1 ? 772 ? 2678 94 a10 2359 473 142 pa2 ? 1499 2675 47 reset ? 672 ? 2678 95 a11 2359 589 143 avss ? 1860 2675 48 pc3 ? 572 ? 2678 96 a12 2359 705 144 avcc ? 1985 2675
tmp92ca25 2007-02-28 92ca25-7 2.3 pin names and functions the following table shows the names and functions of the input/output pins table 2.3.1 pin names and functions (1/5) pin name number of pins i/o function d0 to d7 8 i/o data: data bus 0 to 7 p10 to p17 d8 to d15 8 i/o i/o port 1: i/o port input or output specifiable in units of bits data: data bus 8 to 15 a0 to a7 8 output address: address bus 0 to 7 a8 to a15 8 output address: address bus 8 to 15 p60 to p67 a16 to a23 8 i/o output port 6: i/o port input or output specifiable in units of bits address: address bus 16 to 23 p70 rd 1 output output port70: output port read: outputs strobe signal to read external memory p71 wrll ndre 1 i/o output output port 71: i/o port write: output strobe signal for writing data on pins d0 to d7 nand flash read: outputs strobe si gnal to read external nand flash p72 wrlu ndwe 1 i/o output output port 72: i/o port write: output strobe signal for writing data on pins d8 to d15 write enable for nand flash p73 ea24 1 output output port 73: output port extended address 24 p74 ea25 1 output output port 74: output port extended address 25 p75 w r/ ndr/ b 1 i/o output input port 75: i/o port read/write: 1 represents read or dummy cycle; 0 represents write cycle nand flash ready (1)/busy (0) input p76 wait 1 i/o input port 76: i/o port wait: signal used to request cpu bus wait
tmp92ca25 2007-02-28 92ca25-8 table 2.3.2 pin names and functions (2/5) pin name number of pins i/o function p80 0 cs 1 output output port80: output port chip select 0: outputs ?low? when address is within specified address area p81 1 cs sdcs 1 output output output port81: output port chip select 1: outputs ?low? when address is within specified address area chip select for sdram: outputs ?0? when address is within sdram address area p82 2 cs csza 1 output output output port82: output port chip select 2: outputs ?low? when address is within specified address area expand chip select: za: outputs ?0? when a ddress is within specified address area p83 3 cs 1 output output port83: output port chip select 3: outputs ?low? when address is within specified address area p84 cszb ce 0 nd 1 output output output port84: output port expand chip select: zb: outputs ?0? when a ddress is within specified address area chip select for nand flash 0: outputs ?0? when nand flash 0 is enabled p85 cszc ce 1 nd 1 output output output port85: output port expand chip select: zc: outputs ?0? when a ddress is within specified address area chip select for nand flash 1: outputs ?0? when nand flash 1 is enabled p86 cszd 1 output output port86: output port expand chip select: zd: outputs ?0? when ad dress is within specified address area p87 csze 1 output output port87: output port expand chip select: ze: outputs ?0? when a ddress is within specified address area p90 txd0 i2scko 1 i/o output output port90: i/o port serial 0 send data: open-drain output programmable i 2 s clock output p91 rxd0 i2sdo 1 i/o input output port91: i/o port (schmitt-input) serial 0 receive data i 2 s data output p92 sclk0 0 cts i2sws 1 i/o i/o input output port92: i/o port (schmitt-input) serial 0 clock i/o serial 0 data send enable (clear to send) i 2 s word select output p93 sda 1 i/o i/o port 93: i/o port i 2 c data i/o p94 scl 1 i/o i/o port 94: i/o port i 2 c clock i/o p95 clk32ko 1 output output port95: output port output fs (32.768 khz) clock p96 int4 px 1 input input output port 96: input port (schmitt-input) interrupt request pin4: interrupt reques t with programmable rising/falling edge x-plus: pin connectted to x + for touch screen panel p97 int5 py 1 input input output port 97: input port (schmitt-input) interrupt request pin5: interrupt reques t with programmable rising/falling edge y-plus: pin connectted to y + for touch screen panel pa0 to pa7 ki0 to ki7 8 input input port: a0 to a7 port: pin used to input por ts (schmitt input, with pull-up resistor) key input 0 to 7: pin used for key-on wakeup 0 to 7
tmp92ca25 2007-02-28 92ca25-9 table 2.3.3 pin names and functions (3/5) pin name number of pins i/o function pc0 int0 ta1out 1 i/o input output port c0: i/o port (schmitt-input) interrupt request pin 0: interrupt request pi n with programmable level/rising/falling edge 8-bit timer 1 output: timer 1 output pc1 int1 ta3out 1 i/o input output port c1: i/o port (schmitt-input) interrupt request pin 1: interrupt reques t pin with programmable rising/falling edge 8-bit timer 3 output: timer 3 output pc2 int2 tb0out0 1 i/o input output port c2: i/o port (schmitt-input) interrupt request pin 2: interrupt reques t pin with programmable rising/falling edge timer b0 output pc3 int3 1 i/o input port c3: i/o port (schmitt-input) interrupt request pin 3: interrupt reques t pin with programmable rising/falling edge pc4 to pc5 2 i/o port c4 to c5: u/o port pc6 ko8 ea24 1 i/o output output port c6: i/o port key output 8: pin used of key-scan strobe (open-drain output programmable) extended address 24 pc7 cszf ea25 1 i/o output output port c7: i/o port expand chip select: zf: outputs ?0? when a ddress is within specified address area extended address 25 pf0 txd0 1 i/o output port f0: i/o port (schmitt-input) serial 0 send data: open-drain output programmable pf1 rxd0 1 i/o input port f1: i/o port (schmitt-input) serial 0 receive data pf2 sclk0 0 cts 1 i/o i/o input port f2: i/o port (schmitt-input) serial 0 clock i/o serial 0 data send enable (clear to send) pf7 sdclk 1 output output port f7: output port clock for sdram (when sdram is not used, sdclk can be used as system clock) pg0 to pg1 an0 to an1 2 input input port g0 to g1 port: pin used to input ports analog input 0 to 1: pin used to input to ad conveter pg2 an2 mx 1 input input output port g2 port: pin used to input ports analog input 2: pin used to input to ad conveter x-minus: pin connectted to x ? for touch screen panel pg3 an3 my adtrg 1 input input output intput port g3 port: pin used to input ports analog input 3: pin used to input to ad conveter y-minus: pin connectted to y ? for touch screen panel ad trigger: signal used to request ad start
tmp92ca25 2007-02-28 92ca25-10 table 2.3.4 pin names and functions (4/5) pin name number of pins i/o function pj0 sdras srllb 1 output output output port j0: output port row address strobe for sdram data enable for sram on pins d0 to d7 pj1 sdcas srlub 1 output output output port j1: output port column address strobe for sdram data enable for sram on pins d8 to d15 pj2 sdwe srwr 1 output output output port j2: output port write enable for sdram write for sram: strobe signal for writing data pj3 sdlldqm 1 output output port j3: output port data enable for sdram on pins d0 to d7 pj4 sdludqm 1 output output port j4: output port data enable for sdram on pins d8 to d15 pj5 ndale 1 i/o output port j5: i/o port address latch enable for nand flash pj6 ndcle 1 i/o output port j6: i/o port command latch enable for nand flash pj7 sdcke 1 output output port j7: output port clock enable for sdram pk0 lcp0 1 output output port k0: output port lcd driver output pin pk1 llp 1 output output port k1: output port lcd driver output pin pk2 lfr 1 output output port k2: output port lcd driver output pin pk3 lbcd 1 output output port k3: output port lcd driver output pin pk4 spdi 1 i/o input port k4: i/o port data input pin for sd card pk5 spdo 1 i/o output port k5: i/o port data output pin for sd card pk6 spcs 1 i/o output port k6: i/o port chip select pin for sd card pk7 spclk 1 i/o output port k7: i/o port clock output pin for sd card pl0 to pl3 ld0 to ld3 4 output output port l0 to l3: output port data bus for lcd driver pl4 to pl5 ld4 to ld5 2 i/o output port l4 to l5: i/o port data bus for lcd driver pl6 ld6 busrq 1 i/o output input port l6: i/o port data bus for lcd driver bus request: request pin that set external memory bus to high-impedance (for external dmac) pl7 ld7 busak 1 i/o output output port l7: i/o port data bus for lcd driver bus acknowledge: this pin show that external memory bus pin is set to high-impedance by receiving busrq (for external dmac)
tmp92ca25 2007-02-28 92ca25-11 table 2.3.5 pin names and functions (5/5) pin name number of pins i/o function pm1 mldalm 1 output output port m1: output port melody/alarm output pin pm2 alarm mldalm 1 output output output port m2: output port rtc alarm output pin melody/alarm output pin (inverted) pn0 to pn7 ko0 to ko7 8 i/o output port n0 to n7: i/o port key out pin (open-drain setting ) am0, am1 2 input operation mode: fix to am1 = ?0?, am0 = ?1? for 16-bit external bus starting fix to am1 = ?1?, am0 = ?0? for 32-bit external bus starting fix to am1 = ?1?, am0 = ?1? prohibit setting fix to am1 = ?0?, am0 = ?0? prohibit setting x1/x2 2 i/o high-frequency oscillator connection pins xt1/xt2 2 i/o low-frequency oscillator connection pins reset 1 input reset: initializes tmp92ca25 (with pull-up resistor, schmitt input) vrefh 1 input pin for reference voltage input to ad converter (h) vrefl 1 input pin for reference voltage input to ad converter (l) rtcvcc 1 ? power supply pin for rtc be 1 input back up enable pin: when power off dv cc and av ss during rtc is operating, set to ?l? level beforehand. usually, this pin used to ?h? level. (schmitt input) avcc 1 ? power supply pin for ad converter avss 1 ? gnd pin for ad converter (0 v) dvcc 3 ? power supply pins (all dv cc pins should be connected to the power supply pin) dvss 3 ? gnd pins (0 v) (all dv ss pins should be connected to gnd (0 v))
tmp92ca25 2007-02-28 92ca25-12 3. operation this section describes the basic components, functions and operation of the tmp92ca25. 3.1 cpu the tmp92ca25 contains an advanced hi gh-speed 32-bit cpu (tlcs-900/h1 cpu) 3.1.1 cpu outline the tlcs-900/h1 cpu is a high-speed, high-performance cpu based on the tlcs-900/l1 cpu. the tlcs-900/h1 cpu has an expanded 32-bit internal data bus to process instructions more quickly. the following is an outline of the cpu: table 3.1.1 tmp92ca25 outline parameter tmp92ca25 width of cpu address bus 24 bits width of cpu data bus 32 bits internal operating frequency max 20 mhz minimum bus cycle 1-clock access (50 ns at f sys = 20mhz) internal ram 32-bit 1-clock access 8-bit 2-clock access intc, sdramc, memc, ndfc, tsi, port 16-bit 2-clock access i2s, spic, lcdc internal i/o 8-bit 5 6-clock access tmra, tmrb, sio, rtc, mld/alm, sbi, cgear, adc external sram, masked rom 8- or 16-bit 2-clock access (waits can be inserted) external sdram 16-bit 1-clock access external nand flash 8-bit 4-clock access (waits can be inserted) minimum instruction execution cycle 1-clock (50 ns at f sys = 20mhz) conditional jump 2-clock (100 ns at f sys = 20mhz) instruction queue buffer 12 bytes instruction set compatible with tlcs-900/l1 (ldx instruction is deleted) cpu mode maximum mode only micro dma 8 channels
tmp92ca25 2007-02-28 92ca25-13 3.1.2 reset operation when resetting the tmp92ca25, ensure that the power supply voltage is within the operating voltage range, and that the internal high-frequency oscillator has stabilized. then hold the reset input low for at least 20 system clocks (16 s at fc = 40 mhz). at reset, since the clock doubler (pll) is by passed and the clock-gear is set to 1/16, the system clock operates at 1.25 mhz (fc = 40 mhz). when the reset has been accepted, the cpu performs the following: ? sets the program counter (pc) as follows in accordance with the reset vector stored at address ffff00h to ffff02h: pc<7:0> data in location ffff00h pc<15:8> data in location ffff01h pc<23:16> data in location ffff02h ? sets the stack pointer (xsp) to 00000000h. ? sets bits of the status register (sr) to 111 (thereby setting the interrupt level mask register to level 7). ? clears bits of the status register to 00 (there by selecting register bank 0). when the reset is released, the cpu starts executing instructions according to the program counter settings. cpu internal regist ers not mentioned above do not change when the reset is released. when the reset is accepted, the cpu sets inte rnal i/o, ports and ot her pins as follows. ? initializes the internal i/o registers as shown in the ?special function register? table in section 5. ? sets the port pins, including the pins that also act as internal i/o, to general-purpose input or output port mode. internal reset is released as soon as external reset is released. memory controller operation cannot be ensured until the power supply becomes stable after power-on reset. external ram data pr ovided before turning on the tmp92ca25 may be corrupted because the control signals are unstable until the power supply becomes stable after power on reset. figure 3.1.1 power on reset timing example high-frequency oscillation stabilized time + 20 system clock 0 s (min) vcc (3.3 v) reset
tmp92ca25 2007-02-28 92ca25-14 figure 3.1.2 tmp92ca25 reset timing chart read write f sys a23 a0 data-in d0 d31 d0 d31 ((after reset released, sta r ting 1 wait read cycle) sampling reset rd wrxx srwr 0ffff00h data-in data-out cs0,1, 3 cs2 srxxb srxxb fsys(13.5~14.5) clock pull up (internal) high-z (input mode) pa0~pa7 (output mode) pf7 pj3~pj4, pj7 pm1~pm2 (input mode) p71~p72, p75~p76, p90~p94, p96~p97, pc0~pc3, pc6~pc7, pf0~pf1, pg0~pg3, pj5~pj6, pl4~pl7, (output mode) p40~p47,p50~p57 p74~p72, pk0~pk3, pl0~pl3 note: this chart shows timing for a reset using a 32-bit external bus (am1:0=10).
tmp92ca25 2007-02-28 92ca25-15 3.1.3 setting of am0 and am1 set am1 and am0 pins as shown in table 3.1.2 according to system usage. table 3.1.2 operation mode setup table mode setup input pin operation mode reset am1 am0 16-bit external bus starting (multi 16 mode) 0 1 8-bit external bus starting (multi 8 mode) 1 0 prohibit setting 1 1 reserve (toshiba test mode) 0 0
tmp92ca25 2007-02-28 92ca25-16 3.2 memory map figure 3.2.1 is a memory map of the tmp92ca25. figure 3.2.1 memory map note 1: the provisional emulator control area, mapped f00000h to f0ffffh after reset, is for emulator use and so is not availab le. when emulator wr signal and rd signal are asserted, this area is access ed. ensure external memory is used. note 2: do not use the last 16-byte area (fffff0h to ffffffh). this area is reserved for an emulator. external memory external memory vector table (256 bytes) internal i/o (8 kbytes) internal ram (10 kbytes) direct area (n) 64-kbyte area (nn) 16-mbyte area (r) ( ? r) (r + ) (r + r8/16) (r + d8/16) (nnn) 000000h 000100h 001d00h 002000h 004800h f00000h f10000h ffff00h ffffffh ( = internal area) provisional emulator control (64 kbytes) 010000h (note 1) (note 2)
tmp92ca25 2007-02-28 92ca25-17 3.3 clock function and stand-by function the tmp92ca25 contains (1) clock gear, (2) clock doubler (pll), (3) stand-by controller and (4) noise reduction circuits. they are used for low power, low noise systems. this chapter is organized as follows: 3.3.1 block diagram of system clock 3.3.2 sfr 3.3.3 system clock controller 3.3.4 clock doubler (pll) 3.3.5 noise reduction circuits 3.3.6 stand-by controller
tmp92ca25 2007-02-28 92ca25-18 the clock operating modes are as follows: (a) single clock mode (x1, x2 pins only), (b) dual clock mode (x1, x2, xt1 and xt2 pins) and (c) tr iple clock mode (x1, x2, xt1 and xt2 pins and pll). figure 3.3.1 shows a transition figure. reset (f osch /32) release reset instruction interrupt stop mode (stops all circuits) normal mode (f osch /gear value/2) idle2 mode (i/o operate) idle1 mode (operate only oscillator) (a) single clock mode transition figure (b) dual clock mode transition figure slow mode (fs/2) reset (f osch /32) release reset normal mode (f osch /gear value/2) idle2 mode (i/o operate) idle1 mode (operate only oscillator) idle2 mode (i/o operate) idle1 mode (operate only oscillator) instruction instruction interrupt interrupt instruction instruction interrupt interrupt instruction instruction interrupt interrupt instruction interrupt stop mode (stops all circuits) instruction interrupt stop mode (stops all circuits) using pll note reset (f osch /32) release reset normal mode (f osch /gear value/2) idle2 mode (i/o operate) idle1 mode (operate only oscillator) stop mode (stops all circuits) slow mode (fs/2) normal mode (4 f osch /gear value/2) idle2 mode (i/o operate) idle1 mode (operate oscillator and pll) idle2 mode (i/o operate) idle1 mode (operate only oscillator) (c) triple clock mode transition figure instruction instruction interrupt interrupt instruction instruction instruction interrupt note instruction instruction interrupt instruction instruction interrupt interrupt interrupt interrupt instruction instruction instruction interrupt note 1: it is not possible to control pll in slow mode when shifting from slow mode to normal mode with use of pll. (pll start up/stop/change write to pllcr0, pllcr1 register) note 2: when shifting from normal mode with use of pll to normal mode, execute the following setting in the same order. 1) change cpu clock (pllcr0 ?0?) 2) stop pll circuit (pllcr1 ?0?) note 3: it is not possible to shift from normal mode with use of pll to stop mode directly. normal mode should be set once before shifting to st op mode. (sstop the high-frequency oscillator after stopping pll.) figure 3.3.1 system clock block diagram the clock frequency input from the x1 and x2 pins is called fc and the clock frequency input from the xt1 and xt2 pins is calle d fs. the clock frequency selected by syscr1 is called the clock f fph . the system clock f sys is defined as the divided clock of f fph , and one cycle of f sys is defined as one state.
tmp92ca25 2007-02-28 92ca25-19 3.3.1 block diagram of system clock figure 3.3.2 block diag ram of system clock tmra0 to 3, tmrb0 f sys cpu ram, rom i 2 s interrupt controller i/o ports prescaler t0 sio0 to sio1 rtc fs prescaler mld/alm sdramc f io clock-gear syscr1 selector fs f osch low-frequency oscillator xt1 xt2 syscr0 warm-up timer (high/low-frequency oscillator) syscr0 syscr2 x1 x2 clock doubler (pll) f pll = f osch 4 2 16 4 fc/16 fc/8 fc/4 fc/2 fc pllcr0 syscr1 4 8 f fph f sys 2 t0 fs t syscr0 high-frequency oscillator 8 2 f io lcdc memor y controller nand flash controller tsi lock up timer (pll) pllcr1, pllcr0 adc wdt spic i2c bus prescaler
tmp92ca25 2007-02-28 92ca25-20 3.3.2 sfr 7 6 5 4 3 2 1 0 bit symbol xen xten wuef read/write r/w r/w after reset 1 1 0 function high- frequency oscillator (fc) 0: stop 1: oscillation low- frequency oscillator (fs) 0: stop 1: oscillation warm-up timer 0: write don?t care 1: write start timer 0: read end warm-up 1: read do not end warm-up 7 6 5 4 3 2 1 0 bit symbol sysck gear2 gear1 gear0 read/write r/w after reset 0 1 0 0 function select system clock 0: fc 1: fs select gear value of high-frequency (fc) 000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: (reserved) 110: (reserved) 111: (reserved) 7 6 5 4 3 2 1 0 bit symbol ? wuptm1 wuptm0 haltm1 haltm0 read/write r/w r/w after reset 0 1 0 1 1 function always write ?0? warm-up timer 00: reserved 01: 2 8 /input frequency 10: 2 14 /input frequency 11: 2 16 /input frequency halt mode 00: reserved 01: stop mode 10: idle1 mode 11: idle2 mode note 1: the unassigned regist ers, syscr0, syscr0, syscr1, and syscr2 are read as undefined value. note 2: low-frequency oscillator is enabled on reset. figure 3.3.3 sfr for system clock syscr0 (10e0h) syscr1 (10e1h) syscr2 (10e2h)
tmp92ca25 2007-02-28 92ca25-21 7 6 5 4 3 2 1 0 bit symbol protect extin drvosch drvoscl read/write r r/w after reset 0 0 1 1 function protect flag 0: off 1: on 1: external clock fc oscillator driver ability 1: normal 0: weak fs oscillator driver ability 1: normal 0: weak bit symbol read/write after reset function bit symbol read/write after reset function switch the protect on/off by writing the following to 1st-key, 2nd-key 1st-key: write in sequence emccr1 = 5ah, emccr2 = a5h 2nd-key: write in sequence emccr1 = a5h, emccr2 = 5ah note: when restarting the oscillator from the stop oscillation state (e.g. restar ting the oscillator in stop mode), set emccr0, = ?1?. figure 3.3.4 sfr for system clock emccr0 (10e3h) emccr1 (10e4h) emccr2 (10e5h)
tmp92ca25 2007-02-28 92ca25-22 7 6 5 4 3 2 1 0 bit symbol fcsel lupfg read/write r/w r after reset 0 0 function select fc clock 0: f osch 1: f pll lock up timer status flag 0: not end 1: end note: ensure that the logic of pllcr0 is different from 900/l1?s dfm. 7 6 5 4 3 2 1 0 bit symbol pllon read/write r/w after reset 0 function control on/off 0: off 1: on figure 3.3.5 sfr for pll 7 6 5 4 3 2 1 0 bit symbol px7d px6d px5d px4d px3d px2d px1d px0d read/write r/w after reset 1 1 1 1 1 1 1 1 function output/input buffer drive-register for stand-by mode (purpose and use) this register is used to set each pin status at stand-by mode. all ports have registers of the format shown above. (?x? indicates the port name.) for each register, refer to ?3.5 function of ports?. before ?halt? instruction is executed, set each register according to the expected pin-status. they will be effective after the cpu has executed the ?halt? instruction. this is the case regardless of stand-by mode (idle2, idle1 or stop). the output/input buffer control table is shown below. oe pxnd output buffer input buffer 0 0 off off 0 1 off on 1 0 off off 1 1 on off note 1: oe denotes an output enable signal before stand-by mode. basically, pxcr is used as oe. note 2: ?n? in pxnd denotes the bit number of portx. figure 3.3.6 sfr for drive register pllcr0 (10e8h) pllcr1 (10e9h) pxdr (xxxxh)
tmp92ca25 2007-02-28 92ca25-23 3.3.3 system clock controller the system clock controller gene rates the system clock signal (f sys ) for the cpu core and internal i/o. it contains two oscillation circu its and a clock gear circuit for high-frequency (fc) operation. the register syscr1 changes the system clock to either fc or fs, syscr0 and syscr0 control enab ling and disabling of each oscillator, and syscr1 sets the high-frequency clock gear to either 1, 2, 4, 8 or 16 (fc, fc/2, fc/4, fc/8 or fc/16). these functions can reduce the power consumption of the equipment in which the device is installed. the combination of settings = 1, = 0 and = 100 will cause the system clock (f sys ) to be set to fc/32 (fc/16 1/2) after reset. for example, f sys is set to 1.25 mhz when the 40 mhz oscillator is connected to the x1 and x2 pins. (1) switching from normal mode to slow mode when the resonator is connected to the x1 and x2 pins, or to the xt1 and xt2 pins, the warm-up timer can be used to change the operation frequency after stable oscillation has been attained. the warm-up time can be sele cted using syscr2. this warm-up timer can be programmed to start and stop as shown in the following examples 1 and 2. table 3.3.1 shows the warm-up time. note 1: when using an oscillator (other than a resonator) with stable oscillation, a warm-up timer is not needed. note 2: the warm-up timer is operated by an oscillation clo ck. hence, there may be some variation in warm-up time. table 3.3.1 warm-up times at f osch = 40 mhz, fs = 32.768 khz warm-up time syscr2 change to normal mode change to slow mode 01 (2 8 /frequency) 6.4 ( s) 7.8 (ms) 10 (2 14 /frequency) 409.6 ( s) 500 (ms) 11 (2 16 /frequency) 1.638 (ms) 2000 (ms)
tmp92ca25 2007-02-28 92ca25-24 example 1: setting the clock changing from high-frequency (fc) to low-frequency (fs). syscr0 equ 10e0h syscr1 equ 10e1h syscr2 equ 10e2h ld (syscr2), 0 x 1 1 ? ? x x b ; sets warm-up time to 2 16 /fs. set 6, (syscr0) ; enables low-frequency oscillation. set 2, (syscr0) ; clears and starts warm-up timer. wup: bit 2, (syscr0) ; jr nz, wup ; detects stopping of warm-up timer. set 3, (syscr1) ; changes f sys from fc to fs. res 7, (syscr0) ; disables high-frequency oscillation. x: don?t care, ?: no change enables low-frequency clears and starts warm-up timer chages f sys from fc to fs end of warm-up timer disabiles high-frequency fc x1, x2 pins xt1, xt2 pins warm-up timer system clock f sys end of warm-up timer fs counts up by f sys counts up by fs
tmp92ca25 2007-02-28 92ca25-25 example 2: setting the clock changing from low-frequency (fs) to high-frequency (fc). syscr0 equ 10e0h syscr1 equ 10e1h syscr2 equ 10e2h ld (syscr2), 0 x 1 0 ? ? x x b ; sets warm-up time to 2 14 /fc. set 7, (syscr0) ; enables high-frequency oscillation. set 2, (syscr0) ; clears and starts warm-up timer. wup: bit 2, (syscr0) ; jr nz, wup ; detects stopping of warm-up timer. res 3, (syscr1) ; changes f sys from fs to fc. res 6, (syscr0) ; disables low-frequency oscillation. x: don?t care, ?: no change counts up by f sys counts up by fc disables low-frequency enables high-frequency clears and starts warm-up time r changes f sys from fs to fc end of warm-up time r x1, x2 pins xt1, xt2 pins warm-up timer system clock f sys end of warm-up timer fc fs
tmp92ca25 2007-02-28 92ca25-26 (2) clock gear controller f fph is set according to the contents of the clock gear select register syscr1 to either fc, fc /2, fc/4, fc/8 or fc/16. using the clock gear to select a lower value of f fph reduces power consumption. example 3: changing to a high-frequency gear syscr1 equ 10e1h ld (syscr1), xxxx0000b ; changes f sys to fc/2. ld (dummy), 00h ; dummy instruction x: don?t care (high-speed clock gear changing) to change the clock gear, write the register value to the syscr1 register.it is necessary for the warm-up time to elapse before the change occurs after writing the register value. there is the possibility that the instruction following the clock gear changing instruction is executed by the clock gear before changing.to execute the instruction following the clock gear switching instructio n by the clock gear after changing, input the dummy instruction as follows (instruction to execute the write cycle). example: syscr1 equ 10e1h ld (syscr1), xxxx0001b ; changes f sys to fc/4. ld (dummy), 00h ; dummy instruction instruction to be executed after clock gear has changed
tmp92ca25 2007-02-28 92ca25-27 3.3.4 clock doubler (pll) pll outputs the f pll clock signal, which is four times as fast as f osch . a low-speed-frequency oscillator can be used, even though the internal clock is high-frequency. a reset initializes pll to stop status, so setting to pllcr0, pllcr1 register is needed before use. as with an oscillator, this circuit requires time to stabilize. this is called the lock up time and it is measured by a 16-stage binary counter. lock up time is about 1.6 ms at f osch = 10 mhz. note 1: input frequency range for pll the input frequency range (high-frequency oscillation) for pll is as follows: f osch = 6 to 10 mhz (v cc = 3.0 to 3.6 v) note 2: pllcr0 the logic of pllcr0 is different from 900/l1?s dfm. exercise care in determining the end of lock up time. the following is an example of settings for pll starting and pll stopping. example 1: pll starting pllcr0 equ 10e8h pllcr1 equ 10e9h ld (pllcr1), 1 x x x x xx x b ; enables pll operation and starts lock up . lup: bit 5, (pllcr0) ; jr z, lup ; detects end of lock up. ld (pllcr0), x 1 x x x xx x b ; changes fc from 10 mhz to 40 mhz. x: don?t care counts up by f osch changes from 10 mhz to 40 mhz starts pll operation and starts lock up pll output: f pll lock up timer system clock f sys a fter lock u p during lock up lock up ends
tmp92ca25 2007-02-28 92ca25-28 example 2: pll stopping pllcr0 equ 10e8h pllcr1 equ 10e9h ld (pllcr0), x0xxxxxxb ; changes fc from 40 mhz to10 mhz. ld (pllcr1), 0xxxxxxxb ; stop pll. x: don?t care changes from 40 mhz to 10 mhz pll output: f pll system clock f sys stops pll operation
tmp92ca25 2007-02-28 92ca25-29 limitations on the use of pll 1. it is not possible to execute pll enable/disable control in the slow mode (fs) (writing to pllcr0 and pllcr1). pll should be controlled in the normal mode. 2. when stopping pll operation during pll use, execute the following settings in the same order. ld (pllcr0), 00h ; change the clock f pll to f osch ld (pllcr1), 00h ; pll stop 3. when stopping the high-frequency oscillator during pll use, stop pll before stopping the high-frequency oscillator. examples of setting s are shown below: (1) start up/change control (ok) low-frequency oscillator operation mode (fs) (high-frequency oscillator stop) high-frequency oscillator start up high-frequency oscillator operation mode (f osch ) pll start up pll use mode (f pll ) ld (syscr0), 1 1 ? ? ? 1 ? ? b ; high-frequency oscillator start/warm-up start wup: bit 2, (syscr0) ; jr nz, wup ; check for warm-up end flag ld (syscr1), ? ? ? ? 0 ? ? ? b ; change the system clock fs to f osch ld (pllcr1), 1 ? ? ? ? ? ? ? b ; pll start-up/lock up start lup: bit 5, (pllcr0) ; jr z, lup ; check for lock up end flag ld (pllcr0), ? 1 ? ? ? ? ? ? b ; change the system clock f osch to f pll (ok) low-frequency oscillator operation mode (fs) (high-frequency oscillator operate) high-frequency oscillator operation mode (f osch ) pll start up pll use mode (f pll ) ld (syscr1), ? ? ? ? 0 ? ? ? b ; change the system clock fs to f osch ld (pllcr1), 1 ? ? ? ? ? ? ? b ; pll start-up/lock up start lup: bit 5, (pllcr0) ; jr z, lup ; check for lock up end flag ld (pllcr0), ? 1 ? ? ? ? ? ? b ; change the system clock f osch to f pll (error) low-frequency oscillator operation mode (fs) (high-frequency oscillator stop) high-frequency oscillator start up pll start up pll use mode (f pll ) ld (syscr0), 1 1 ? ? ? 1 ? ? b ; high-frequency oscillator start/warm-up start wup: bit 2, (syscr0) ; jr nz, wup ; check for warm-up end flag ld (pllcr1), 1 ? ? ? ? ? ? ? b ; pll start-up/lock up start lup: bit 5, (pllcr0) ; jr z, lup ; check for lock up end flag ld (pllcr0), ? 1 ? ? ? ? ? ? b ; change the internal clock f osch to f pll ld (syscr1), ? ? ? ? 0 ? ? ? b ; change the system clock fs to f pll
tmp92ca25 2007-02-28 92ca25-30 (2) change/stop control (ok) pll use mode (f pll ) high-frequency oscillator operation mode (f osch ) pll stop low-frequency oscillator operation mode (fs) high-frequency oscillator stop ld (pllcr0), ? 0 ? ? ? ? ? ? b ; change the system clock f pll to f osch ld (pllcr1), 0 ? ? ? ? ? ? ? b ; pll stop ld (syscr1), ? ? ? ? 1 ? ? ? b ; change the system clock f osch to fs ld (syscr0), 0 ? ? ? ? ? ? ? b ; high-frequency oscillator stop (error) pll use mode (f pll ) low-frequency oscillator operation mode (fs) pll stop high-frequency oscillator stop ld (syscr1), ? ? ? ? 1 ? ? ? b ; change the system clock f pll to fs ld (pllcr0), ? 0 ? ? ? ? ? ? b ; change the internal clock (f c ) f pll to f osch ld (pllcr1), 0 ? ? ? ? ? ? ? b ; pll stop ld (syscr0), 0 ? ? ? ? ? ? ? b ; high-frequency oscillator stop (ok) pll use mode (f pll ) set the stop mode high-frequency oscillator operation mode (f osch ) pll stop halt (high-frequency oscillator stop) ld (syscr2), ? ? ? ? 01 ? ? b ; set the stop mode (this command can be executed before use of pll) ld (pllcr0), ? 0 ? ? ? ? ? ? b ; change the system clock f pll to f osch ld (pllcr1), 0 ? ? ? ? ? ? ? b ; pll stop halt ; shift to stop mode ( error) pll use mode (f pll ) set the stop mode halt (high-frequency oscillator stop) ld (syscr2), ? ? ? ? 01 ? ? b ; set the stop mode (this command can execute before use of pll) halt ; shift to stop mode
tmp92ca25 2007-02-28 92ca25-31 3.3.5 noise reduction circuits noise reduction circuits are built-in, allowing implementation of the following features. (1) reduced drivability for high -frequency oscillator (2) reduced drivability for low-frequency oscillator (3) single drive for high-frequency oscillator (4) sfr protection of register contents when above function is used, set emccr0 and emccr2 registers (1) reduced drivability for high -frequency oscillator (purpose) reduces noise and power for oscillator when a resonator is used. ( block diagram) (setting method) the drive ability of the oscillator is reduced by writing ?0? to emccr0 register. at reset, is initialized to ?1? and the oscillator starts oscillation by normal drivability when the power-supply is on. note: this function (emccr0 = ?0?) is available when f osch = 6 to 10 mhz. f osch enable oscillation emccr0 x1 pin x2 pin c1 c2 resonator
tmp92ca25 2007-02-28 92ca25-32 (2) reduced drivability for low-frequency oscillator (purpose) reduces noise and power for oscillator when a resonator is used. (block diagram) (setting method) the drive ability of the oscillator is reduced by writing 0 to the emccr0 register. at reset, is initialized to ?1?. (3) single drive for high-frequency oscillator (purpose) remove the need for twin drives and prevent operational errors caused by noise input to x2 pin when an external oscillator is used . (block diagram) ( setting method) the oscillator is disabled and starts operation as buffer by writing ?1? to emccr0 register. x2 pi n?s output is always ?1?. at reset, is initialized to ?0?. f osch enable oscillation emccr0 x1 pin x2 pin f s enable oscillation emccr0 xt1 pin xt2 pin c1 c2 resonator
tmp92ca25 2007-02-28 92ca25-33 (4) runaway prevention using sfr protection register (purpose) prevention of program runaway caused by introduction of noise. write operations to a specified sfr ar e prohibited so that the program is protected from runaway caused by stopping of the clock or by changes to the memory control register (memory controller, mmu) which prevent fetch operations. runaway error handling is also facilitated by intp0 interruption. specified sfr list 1. memory controller b0csl/h, b1csl/h, b2cs l/h, b3csl/h, becsl/h msar0, msar1, msar2, msar3, mamr0, mamr1, mamr2, mamr3, pmemcr, memcr0 2. mmu localpx/py/pz, locallx/ly/lz, localrx/ry/rz, localwx/wy/wz, 3. clock gear syscr0, syscr1, syscr2, emccr0 4. pll pllcr0, pllcr1 (operation explanation) execute and release of protection (write operation to specified sfr) becomes possible by setting up a double key to emccr1 and emccr2 registers. (double key) 1st key: writes in sequence, 5ah at emccr1 and a5h at emccr2 2nd key: writes in sequence, a5h at emccr1 and 5ah at emccr2 protection state can be confirmed by reading emccr0. at reset, protection becomes off. intp0 interruption also occurs when a write operation to the specified sfr is executed with protection in the on state.
tmp92ca25 2007-02-28 92ca25-34 3.3.6 stand-by controller (1) halt modes and port drive register when the halt instruction is executed, the operating mode switches to idle2, idle1 or stop mode, depending on the contents of the syscr2 register and each pin-status is set according to the pxdr register, as shown below: 7 6 5 4 3 2 1 0 bit symbol px7d px6d px5d px4d px3d px2d px1d px0d read/write r/w after reset 1 1 1 1 1 1 1 1 function output/input buffer drive register for stand-by mode (purpose and use) ? this register is used to set each pin status at stand-by mode. ? all ports have this registers of the format shown above. (?x? indicates the port name.) ? for each register, refer to 3.5 function of ports. ? before ?halt? instruction is executed, set each register according to the expected pin status. they will be effective after the cpu has executed the ?halt? instruction. ? this is the case regardless of stand-by mode (idle2, idle1 or stop). ? the output/input buffer control table is shown below. oe pxnd output buffer input buffer 0 0 off off 0 1 off on 1 0 off off 1 1 on off note 1: oe denotes an output enable signal before stand-by mode. basically, pxcr is used as oe. note 2: ?n? in pxnd denotes the bit number of portx the subsequent actions performed in each mode are as follows: 1. idle2: only the cpu halts. the internal i/o is available to select operation during idle2 mode by setting the following register. table 3.3.2 shows the register se tting operation during idle2 mode . table 3.3.2 sfr setting operation during idle2 mode internal i/o sfr tmra01 ta01run tmra23 ta23run tmrb0 tb0run sio0 sc0mod1 i 2 c bus sbi0br0 ad converter admod1 wdt wdmod 2. idle1: only the oscillator, rtc (real-time clock) and mld continue to operate. 3. stop: all internal circuits stop operating. pxdr (xxxxh)
tmp92ca25 2007-02-28 92ca25-35 the operation of each of the different halt modes is described in table 3.3.3. table 3.3.3 i/o operation during halt modes halt mode idle2 idle1 stop syscr2 11 10 01 cpu stop i/o ports depend on pxdr register setting tmra, tmrb sio, sbi ad converter wdt available to select operation block i2s, lcdc, sdramc, interrupt controller, usbc, stop block rtc, mld operate operate (2) how to release the halt mode these halt states can be released by resetting or requesting an interrupt. the halt release sources are determined by the combination of the states of the interrupt mask register and the halt modes. the details for releasing the halt status are shown in table 3.3.4. ? release by interrupt requesting the halt mode release method depends on the status of the enabled interrupt .when the interrupt request level set before executing the halt instruction exceeds the value of the interrupt mask register, the interrupt is processed depending on its status after the halt mode is released, and the cpu status executing the instruction that follows the halt instruction. when the interrupt request level set before executing the halt instruction is less than the value of the interrupt mask register, halt mode release is not executed. (in non-maskable interrupts, interrupt proces sing is processed after releasing the halt mode regardless of the value of the mask register.) however only for int0 to int4, intkey, intrtc, intalm and interru pts, even if the interrupt request level set before executing the halt instruction is less than the value of the interrupt mask register, halt mode release is executed. in this case, the interrupt is processed, and the cpu starts executing the instruction following the halt instruction, but the interrupt request flag is held at ?1?. ? release by resetting release of all halt statuses is executed by resetting. when the stop mode is released by reset, it is necessary to allow enough resetting time (see table 3.3.5) for operation of the oscillator to stabilize. when releasing the halt mode by resetting, the internal ram data keeps the state before the halt instruction is executed. however the other settings contents are initialized. (releasing due to interrupts keeps the state before the halt instruction is executed.)
tmp92ca25 2007-02-28 92ca25-36 table 3.3.4 source of halt state cl earance and halt clearance operation status of received interrupt interrupt enabled ( interrupt level) (interrupt mask) interrupt disabled ( interrupt level) < (interrupt mask) halt mode idle2 idle1 stop idle2 idle1 stop intwd ? ? ? ? int0 to int4 (note 1) ? ? ? * 1 * 1 intalm0 to intalm4 ? ? intta0 to intta3, inttb0 to inttb1 ? intrx0 to inttx0, intsbi ? inttbo0, inti2s ? intad, int5, intspi ? intkey ? ? ? * 1 * 1 intrtc ? ? ? * 1 * 1 interrupt intlcd ? source of halt state clearance reset initialize lsi ? : after clearing the halt mode, cpu starts interrupt processing. : after clearing the halt mode, cpu resumes executing starting from the instruction following the halt instruction. : cannot be used to release the halt mode. ? : the priority level (interrupt request level) of non-m askable interrupts is fixed to 7, the highest priority level. this combination is not available. * 1: release of the halt mode is exec uted after warm-up time has elapsed. note 1: when the halt mode is cleared by an in t0 interrupt of the level mode in the interrupt enabled status, hold level h until starting interrupt processing. if level l is set before holding level l, interrupt processing is correctly started. example: releasing idle1 mode an int0 interrupt clears the halt st ate when the device is in idle1 mode. address 8200h ld (pcfc), 01h ; sets pc0 to int0. 8203h ld (iimc), 00h ; selects int0 interrupt rising edge. 8206h ld (inte0ad), 06h ; sets int0 interrupt level to 6. 8209h ei 5 ; sets interrupt level to 5 for cpu. 820bh ld (syscr2), 28h ; sets halt mode to idle1 mode. 820eh halt ; halts cpu. int0 int0 interrupt routine reti 820fh ld xx, xx
tmp92ca25 2007-02-28 92ca25-37 (3) operation 1. idle2 mode in idle2 mode only specific internal i/o operations, as designated by the idle2 setting register, can take place. instruction execution by the cpu stops. figure 3.3.7 illustrates an example of the timing for clearance of the idle2 mode halt state by an interrupt. figure 3.3.7 timing chart for idle2 mo de halt state cleared by interrupt 2. idle1 mode in idle1 mode, only the internal oscillator and the rtc and mld continue to operate. the system clock stops. in the halt state, the interrupt request is sampled asynchronously with the system clock; however, clearance of the halt state (e.g., restart of operation) is synchronous with it. figure 3.3.8 illustrates the timing for clearance of the idle1 mode halt state by an interrupt. figure 3.3.8 timing chart for idle1 mo de halt state cleared by interrupt data data idle2 mode x1 a0 to a23 d0 to d15 rd wr interrupt for release data data idle1 mode x1 a0 to a23 d0 to d15 rd wr interrupt fo r release
tmp92ca25 2007-02-28 92ca25-38 3. stop mode when stop mode is selected, all internal circuits stop, including the internal oscillator. after stop mode has been cleared system clock output starts when the warm-up time has elapsed, in order to allow oscillation to stabilize. figure 3.3.9 illustrates the timing for clearance of the stop mode halt state by an interrupt. figure 3.3.9 timing chart for stop mo de halt state cleared by interrupt table 3.3.5 example of warm-up time after releasing stop mode at f osch = 40 mhz, fs = 32.768 khz syscr2 syscr1 01 (2 8 ) 10 (2 14 ) 11 (2 16 ) 0 (fc) 6.4 s 409.6 s 1.638 ms 1 (fs) 7.8 ms 500 ms 2000 ms data data stop mode x1 a0 to a23 d0 to d15 rd wr interrupt fo r release warm-up time
tmp92ca25 2007-02-28 92ca25-39 table 3.3.6 input buffer state table input buffer state in halt mode (idle1/2/stop) when the cpu is operating = 1 = 0 port name input function name during reset when used as function pin when used as input pin when used as function pin when used as input pin when used as function pin when used as input pin d0~d7 d0~d7 ? ? ? p10~p17 d8~d15 on upon external read off off p60~p67 ? off ? ? ? p71~p72 ? ? ? ? p75 b / ndr p76 wait on on off p90 ? ? ? ? p91 rxd0 p92 0 cts , sclk0 p93~p94 sda, scl p96 * 1 int4 p97 int5 pa0~pa7 * 1 ki0-ki7 pc0 int0 pc1 int1 pc2 int2 pc3 int3 on on off pc4~pc7 ? pf0 ? ? ? ? pf1 rxd0 pf2 0 cts sclk0 on on on on on off pg0~pg2 * 2 ? ? ? ? pg3 * 2 adtrg off on on upon port read on off on pj5~pj6 ? ? ? ? pk4 spdi on on off pk5~pk5 ? pl4~pl5, pl7 ? ? ? ? pl6 busrq on on off pn0~pn7 ? ? on ? on ? off be ? reset ? am0, am1 ? on ? on ? x1, xt1 ? on on ? idle2/idle1:on, stop:off on: the buffer is always turned on. a current flows the input buffer if the input pin is not driven. off: the buffer is always turned off. ? : no applicable * 1: port having a pull-up/pull-down resistor. * 2: ain input does not cause a current to flow through the buffer.
tmp92ca25 2007-02-28 92ca25-40 table 3.3.7 output buffer state table (1/2) output buffer state in halt mode (idle1/2/stop) when the cpu is operating = 1 = 0 port name output function name during reset when used as function pin when used as output pin when used as function pin when used as output pin when used as function pin when used as output pin d0~d7 d0~d7 ? ? ? p10~p17 d8~d15 off on upon external write on off on off a0~a15 a16~a15, ? ? ? p60~p67 a16~a23 p70 rd on p71 wrll , ndre p72 wrlu , ndwe p73 ea24 p74 ea25 p75 r/w on on off p76 ? off ? ? ? p80 0 cs p81 1 cs , sdcs p82 2 cs , csza p83 3 cs p84 cszb , ce 0 nd p85 cszc , ce 1 nd p86 cszd p87 csze on p90 txd0, i2scko p91 i2sdo p92 i2sws p93 sda p94 scl off p95 clk32ko on on on off p96 px p97 py off on ? on ? off ? on: the buffer is always turned on. * 1: port having a pull-up/pull-down resistor. off: the buffer is always turned off. ? : not applicable
tmp92ca25 2007-02-28 92ca25-41 table 3.3.8 output buffer state table (2/2) output buffer state in halt mode (idle1/2/stop) when the cpu is operating = 1 = 0 port name output function name during reset when used as function pin when used as output pin when used as function pin when used as output pin when used as function pin when used as output pin pc0 ta1out pc1 ta3out pc2 tb0out0 on on off pc3 ? ? ? ? pc6 ko8, ea24 pc7 cszf , ea25 pf0 txd0 on on off pf1 ? ? ? ? pf2 sclk0 off pf7 sdclk on on on off pg2 mx pg3 my off ? ? ? pj0 sdras srllb pj1 sdcas , srlub pj2 sdwe , srwr pj3 sdlldqm pj4 sdludqm on pj5 ndale pj6 ndcle off pj7 sdcke pk0 lcp pk1 llp pk2 lfr pk3 lbcd on on on off pk4 ? ? ? ? pk5 spdo pk6 spcs pk7 spclk off pl0~pl3 ld0~ld3 on pl4~pl6 ld4~ld6 pl7 ld7, busak off pm1 mldalm pm2 mldalm , alarm on pn0~pn7 ko0~ko7 off on on off x2 ? idle2/1:on, stop: output ?h? xt2 ? on ? ? idle2/1:on, stop: output ?hz? on: the buffer is always turned on. * 1: port having a pull-up/pull-down resistor. off: the buffer is always turned off. ? : not applicable
tmp92ca25 2007-02-28 92ca25-42 3.4 interrupts interrupts are controlled by the cpu interrupt mask register (bits12 to 14 of the status register) and by the built-in interrupt controller. the tmp92ca25 has a total of 49 interrupts divided into the following five types: interrupts generated by cpu: 9 sources software interrupts: 8 sources illegal instruction interrupt: 1 source internal interrupts: 33 sources internal i/o interrupts: 25 sources micro dma transfer end interrupts: 8 sources external interrupts: 7 sources interrupts on external pins (int0 to int5, intkey) a fixed individual interrupt vector number is assigned to each interrupt source. any one of six levels of priority can also be assigned to each maskable interrupt. non-maskable interrupts have a fixed priority level of 7, the highest level. when an interrupt is generated, the interrupt controller sends the priority of that interrupt to the cpu. when more than one interrupt is generated simultaneously, the interrupt controller sends the priority value of the interrupt with the highest priority to the cpu. (the highest priority level is 7, the level used for non-maskable interrupts.) the cpu compares the interrupt priority level which it receives with the value held in the cpu interrupt mask register . if the prio rity level of the interrupt is greater than or equal to the value in the interrupt mask register, the cpu accepts the interrupt. however, software interrupts and illegal instruction interrupts generated by the cpu are processed irrespective of the value in . the value in the interrupt mask register can be changed using the ei instruction (ei num sets to num). for example, the command ei 3 enables the acceptance of all non-maskable interrupts and of maskable interrupts whose priority level, as set in the interrupt controller, is 3 or higher. the commands ei and ei 0 enable the acceptance of all non-maskable interrupts and of maskable interrupt s with a priority level of 1 or above (hence both are equivalent to the command ei 1). the di instruction (sets to 7) is exactly equivalent to the ei 7 instruction. the di instruction is used to disable all maskable interrupts (since the priority level for maskable interrupts ranges from 1 to 6). the ei instruction takes effect as soon as it is executed. in addition to the general purpose interrupt pr ocessing mode described above, there is also a micro dma processing mode. in micro dma mode the cpu automatically transfers data in one-byte, two-byte or four-byte blocks; this mode allows high-speed data transf er to and from internal and external memory and internal i/o ports. in addition, the tmp92ca25 also has a soft ware start function in which micro dma processing is requested in software rather than by an interrupt. figure 3.4.1 is a flowchart showing overall interrupt processing.
tmp92ca25 2007-02-28 92ca25-43 figure 3.4.1 interrupt and mi cro dma processing sequence micro dma soft start request interrupt processing interrupt vector calue ?v? read interrupt request f/f clear interrupt specified by micro dma start vector ? push pc push sr sr level of accepted interrupt + 1 intnest intnest + 1 pc (ffff00h + v) interrupt processing program reti instruction pop sr pop pc intnest intnest ? 1 end clear interrupt request flag yes no data transfer by micro dma count count ? 1 count = 0 no clear vector register generating micro dma transfer end interrupt (inttc0 to 7) yes micro dma processing general-purpose interrupt processing
tmp92ca25 2007-02-28 92ca25-44 3.4.1 general-purpose interrupt processing when the cpu accepts an interrupt, it usually performs the following sequence of operations. however, in the case of software interrupts and illegal instruction interrupts generated by the cpu, the cpu sk ips steps (1) and (3), and executes only steps (2), (4) and (5). (1) the cpu reads the interrupt vector from the interrupt controller. when more than one interrupt with the same priority level has been generated simultaneously, the interrupt controller gene rates an interrupt vector in accordance with the default priority and clears the interrupt requests. (the default priority is determined as follows: the smaller the vector value, the higher the priority.) (2) the cpu pushes the program counter (pc) and status register (sr) onto the top of the stack (pointed to by xsp). (3) the cpu sets the value of the cpu?s interrupt mask register to the priority level for the accepted interrupt plus 1. howe ver, if the priority level for the accepted interrupt is 7, the register?s value is set to 7. (4) the cpu increments the interrupt nesting counter intnest by 1. (5) the cpu jumps to the address given by adding the contents of address ffff00h + the interrupt vector, then starts the interrupt processing routine. on completion of interrupt processing, the ret i instruction is used to return control to the main routine. reti restores the contents of the program counter and the status register from the stack and decrements the interrupt nesting counter intnest by 1. non-maskable interrupts cannot be disabled by a user program. maskable interrupts, however, can be enabled or disabled by a user program. a program can set the priority level for each interrupt source. (a priority level setting of 0 or 7 will disable an interrupt request.) if an interrupt request is received for an inte rrupt with a priority level equal to or greater than the value set in the cpu interrupt mask register , the cpu will accept the interrupt. the cpu interrupt mask register is then set to the value of the priority level for the accepted interrupt plus 1. if during interrupt processing, an interrupt is generated with a higher priority than the interrupt currently being processed, or if, during the processing of a non-maskable interrupt processing, a non-maskable interrupt request is generated from another source, the cpu will suspend the routine which it is currently executing and accept the new interrupt. when processing of the new interrupt has been completed, the cpu will resume processing of the suspended interrupt. if the cpu receives another interrupt request while performing processing steps (1) to (5), the new interrupt will be sampled immediately af ter execution of the first instruction of its interrupt processing routine. specifying di as the start instruction disables nesting of maskable interrupts. a reset initializes the interrupt mask register to 111, disabling all maskable interrupts. table 3.4.1 shows the tmp92ca25 interrupt vectors and micro dma start vectors. ffff00h to ffffffh (256 bytes) is designat ed as the interrupt vector area.
tmp92ca25 2007-02-28 92ca25-45 table 3.4.1 tmp92ca25 interrupt ve ctors and micro dma start vectors default priority type interrupt source and source of micro dma request vector value address refer to vector micro dma start vector 1 reset or [swi0] instruction 0000h ffff00h 2 [swi1] instruction 0004h ffff04h 3 illegal instruction or [swi2] instruction 0008h ffff08h 4 [swi3] instruction 000ch ffff0ch 5 [swi4] instruction 0010h ffff10h 6 [swi5] instruction 0014h ffff14h 7 [swi6] instruction 0018h ffff18h 8 [swi7] instruction 001ch ffff1ch 9 (reserved) 0020h ffff20h 10 non- maskable intwd: watchdog timer 0024h ffff24h ? micro dma ? ? ? (note1) 11 int0: int0 pin input 0028h ffff28h 0ah ( note 2) 12 int1: int1 pin input 002ch ffff2ch 0bh 13 int2: int2 pin input 0030h ffff30h 0ch 14 int3: int3 pin input 0034h ffff34h 0dh 15 int4: int4 pin input (tsi) 0038h ffff38h 0eh 16 intalm0: alm0 (8192 hz) 003ch ffff3ch 0fh 17 intalm1: alm1 (512 hz) 0040h ffff40h 10h 18 intalm2: alm2 (64 hz) 0044h ffff44h 11h 19 intalm3: alm3 (2 hz) 0048h ffff48h 12h 20 intalm4: alm4 (1 hz) 004ch ffff4ch 13h 21 intp0: protect0 (write to special sfr) 0050h ffff50h 14h 22 (reserved) 0054h ffff54h 15h 23 intta0: 8-bit timer 0 0058h ffff58h 16h 24 intta1: 8-bit timer 1 005ch ffff5ch 17h 25 intta2: 8-bit timer 2 0060h ffff60h 18h 26 intta3: 8-bit timer 3 0064h ffff64h 19h 27 inttb0: 16-bit timer 0 0068h ffff68h 1ah 28 inttb1: 16-bit timer 0 006ch ffff6ch 1bh 29 intkey: key-on wakeup 0070h ffff70h 1ch 30 intrtc: rtc (alarm interrupt) 0074h ffff74h 1dh 31 inttbo0: 16-bit timer 0 (overflow) 0078h ffff78h 1eh 32 intlcd: lcdc/lp pin 007ch ffff7ch 1fh 33 intrx0: serial receive (channel 0) 0080h ffff80h 20h ( note 2) 34 inttx0: serial transmission (channel 0) 0084h ffff84h 21h 35 (reserved) 0088h ffff88h 22h ( note 2) 36 (reserved) 008ch ffff8ch 23h 37 (reserved) 0090h ffff90h 24h 38 (reserved) 0094h ffff94h 25h 39 int5: int5 pin input 0098h ffff98h 26h 40 inti2s: i 2 s (channel 0) 009ch ffff9ch 27h 41 intndf0 (nand flash controller channel 0) 00a0h ffffa0h 28h 42 intndf1 (nand flash controller channel 1) 00a4h ffffa4h 29h 43 intspi: spic 00a8h ffffa8h 2ah 44 intsbi: sbi 00ach ffffach 2bh 45 (reserved) 00b0h ffffb0h 2ch 46 (reserved) 00b4h ffffb4h 2dh 47 (reserved) 00b8h ffffb8h 2eh 48 (reserved) 00bch ffffbch 2fh 49 (reserved) 00c0h ffffc0h 30h 50 maskable (reserved) 00c4h ffffc4h 31h
tmp92ca25 2007-02-28 92ca25-46 default priority type interrupt source and source of micro dma request vector value address refer to vector micro dma start vector 51 (reserved) 00c8h ffffc8h 32h 52 intad: ad conversion end 00cch ffffcch 33h 53 inttc0: micro dma end (channel 0) 00d0h ffffd0h 34h 54 inttc1: micro dma end (channel 1) 00d4h ffffd4h 35h 55 inttc2: micro dma end (channel 2) 00d8h ffffd8h 36h 56 inttc3: micro dma end (channel 3) 00dch ffffdch 37h 57 inttc4: micro dma end (channel 4) 00e0h ffffe0h 38h 58 inttc5: micro dma end (channel 5) 00e4h ffffe4h 39h 59 inttc6: micro dma end (channel 6) 00e8h ffffe8h 3ah 60 inttc7: micro dma end (channel 7) 00ech ffffech 3bh ? to ? maskable (reserved) 00f0h : 00fch fffff0h : fffffch ? to ? note 1: micro dma default priority. micro dma initiation take s priority over other maskable interrupts. note 2: when initiating micro dma, set at edge detect mode.
tmp92ca25 2007-02-28 92ca25-47 3.4.2 micro dma processing in addition to general purpose interrupt processing, the tmp92ca25 also includes a micro dma function. micro dma processing fo r interrupt requests set by micro dma is performed at the highest priority level for maskable interrupts (level 6), regardless of the priority level of the interrupt source. because the micro dma function is implemented through the cpu, when the cpu is placed in a stand-by state by a halt instruct ion, the requirements of the micro dma will be ignored (pending). micro dma supports 8 channels and can be tr ansferred continuously by specifying the micro dma burst function as below. note: when using the micro dma transfer end interrup t, always write ?1? to bit 7 of simc register. (1) micro dma operation when an interrupt request is generated by an interrupt source specified by the micro dma start vector register, the micro dma tr iggers a micro dma request to the cpu at interrupt priority level 6 and starts processing the request. the eight micro dma channels allow micro dma processing to be set for up to eight types of interrupt at once. when micro dma is accepted, the interrupt request flip-flop assigned to that channel is cleared. data in one-byte, two-byte or four-byte blocks, is automatically transferred at once from the transfer source address to the transfer destination address set in the control register, and the tr ansfer counter is decremented by 1. if the value of the counter after it has been decremented is not 0, dma processing ends with no change in the value of the micro dma start vector register. if the value of the decremented counter is 0, a micro dma transfer end interrupt (inttc0 to inttc7) is sent from the cpu to the interrupt controll er. in addition, the micro dma start vector register is cleared to 0, the next micro dma operation is disabled and micro dma processing terminates. if micro dma requests are set simultaneously for more than one channel, priority is not based on the interrupt priority level but on the channel number: the lower the channel number, the higher the priority (channel 0 thus has the highest priority and channel 7 the lowest). if an interrupt request is triggered for the interrupt source in use during the interval between the time at which the micro dma star t vector is cleared and the next setting, general purpose interrupt processing is performed at the interrupt level set. therefore, if the interrupt is only being used to initiate micro dma (and not as a general-purpose interrupt), the interrupt level should first be set to 0 (i.e., interrupt requests should be disabled). if micro dma and general purpose interrupt s are being used together as described above, the level of the interrupt which is being used to initiate micro dma processing should first be set to a lower value than all the other interrupt levels. (note) in this case, edge triggered interrupts are the only kinds of general interrupts which can be accepted. note: if the priority level of micro dma is set higher than that of other interrupts, cpu operates as follows. in case intxxx interrupt is generated first and then intyyy interrupt is generated between checking ?interrupt specified by micro dma start vector? (in the figure 3.4.1) and reading interrupt vector with setting below. the vector shifts to that of intyyy at the time. this is because the priority level of intyyy is higher than that of intxxx. in the interrupt routine, cpu reads the vector of intyyy because cheking of micro dma has finished. and intyyy is generated regardless of transfer counter of micro dma. intxxx: level 1 without micro dma intyyy: level 6 with micro dma
tmp92ca25 2007-02-28 92ca25-48 although the control registers used for se tting the transfer source and transfer destination addresses are 32 bits wide, this type of register can only output 24-bit addresses. accordingly, micro dma can only access 16 mbytes (the upper eight bits of a 32-bit address are not valid). three micro dma transfer modes are supported: one-byte transfers, two-byte (one-word) transfer and four-byte transfer. after a transfer in any mode, the transfer source and transfer destination addresses will either be incremented or decremented, or will remain unchanged. this simplifies the transfer of data from memory to memory, from i/o to memory, from memory to i/o, and from i/o to i/o. for details of the various transfer modes, see section 3.4. 2 (1), detailed description of the transfer mode register. since a transfer counter is a 16-bit counter, up to 65536 micro dma processing operations can be performed per interrupt source (provided that the transfer counter for the source is initially set to 0000h). micro dma processing can be initiated by any one of 34 different interrupts ? the 33 interrupts shown in the micro dma start vectors in table 3.4.1 and a micro dma soft start. figure 3.4.2 shows a 2-byte transfer carried out using a micro dma cycle in transfer destination address inc mode (micro dma transfers are the same in every mode except counter mode). (the conditions for this cycle are as follows: both source and destination memory are internal ram an d multiples by 4 numbered source and destination addresses.) note: in fact, src and dst address are not output to a23 to a0 pins because they are internal ram address. figure 3.4.2 timing for micro dma cycle state (1), (2): instruction fetch cycle (prefetc hes the next instruction code) state (3): micro dma read cycle state (4): micro dma write cycle state (5): (the same as in state (1), (2)) src 1 state f sys a 23 to a0 (1) dst (2) (3) (4) (5)
tmp92ca25 2007-02-28 92ca25-49 (2) soft start function the tmp92ca25 can initiate micro dma either with an interrupt or by using the micro dma soft start function, in which micro dma is initiated by a write cycle which writes to the register dmar. writing 1 to any bit of the register dmar causes micro dma to be performed once. (if write ?0? to each bit, micro dma doesn?t operate). on completion of the transfer, the bits of dmar which support the end channel are automatically cleared to 0. only one channel can be set for dma request at once. (do not write ?1? to plural bits.) when writing again 1 to the dmar register, check whether the bit is ?0? before writing ?1?. if read ?1?, micro dma transfer isn?t started yet. when a burst is specified by the dmab register, data is transferred continuously from the initiation of micro dma until the value in the micro dma transfer counter is 0. if execatee soft start during micro dma transfer by interrupt source, micro dma transfer counter doesn?t change. don?t us e read-modify-write instruction to avoid writign to other bits by mistake. symbol name address 7 6 5 4 3 2 1 0 dreq7 dreq6 dreq5 dreq4 dre q3 dreq2 dreq1 dreq0 r/w 0 0 0 0 0 0 0 0 dmar dma request 109h (prohibit rmw) 1: dma request in software (3) transfer control registers the transfer source address and the tran sfer destination address are set in the following registers. an instruction of the form ldc cr, r can be used to set these registers. channel 0 dmas0 dma source address register 0 dmad0 dma destination address register 0 dmac0 dma counter register 0 dmam0 dma mode register 0 channel 7 dmas7 dma source address register 7 dmad7 dma destination address register 7 dmac7 dma counter register 7 dmam7 dma mode register 7 8 bits 16 bits 32 bits
tmp92ca25 2007-02-28 92ca25-50 (4) detailed description of the transfer mode register 0 0 0 mode dmam0 to dmam7 dmamn[4:0] mode description execution state number 0 0 0 z z destination inc mode (dmadn + ) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 0 0 1 z z destination dec mode (dmadn ? ) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 0 1 0 z z source inc mode (dmadn) (dmasn + ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 0 1 1 z z source dec mode (dmadn) (dmasn ? ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 1 0 0 z z source and destination inc mode (dmadn + ) (dmasn + ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 6 states 1 0 1 z z source and destination dec mode (dmadn ? ) (dmasn ? ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 6 states 1 1 0 z z source and destination fixed mode (dmadn) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 1 1 1 0 0 counter mode dmasn dmasn + 1 dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states zz: 00 = 1-byte transfer 01 = 2-byte transfer 10 = 4-byte transfer 11 = (reserved) note1: n stands for the micro dma channel number (0 to 7) dmadn + /dmasn + : post-increment (register value is incremented after transfer) dmadn ? /dmasn ? : post-decrement (register value is decremented after transfer) ?i/o? signifies fixed memory addresses; ?memory? signifies incremented or decremented memory addresses. note2: the transfer mode register should not be set to any value other than those listed above. note3: the execution state number shows number of best case (1-state memory access).
tmp92ca25 2007-02-28 92ca25-51 3.4.3 interrupt controller operation the block diagram in figure 3.4.3 shows the interrupt circuits. the left hand side of the diagram shows the interrupt controller circu it. the right hand side shows the cpu interrupt request signal circuit and the halt release circuit. for each of the 52 interrupts channels there is an interrupt request flag (consisting of a flip-flop), an interrupt priority setting register and a micro dma start vector register. the interrupt request flag latches interrupt requests from the peripherals. the flag is cleared to zero in the following cases: when a reset occu rs, when the cpu reads the channel vector of an interrupt it has received, when the cp u receives a micro dma request (when micro dma is set), when a micro dma burst transfer is terminated, and when an instruction that clears the interrupt for that channel is execut ed (by writing a micro dma start vector to the intclr register). an interrupt priority can be set independentl y for each interrupt source by writing the priority to the interrupt priority setting re gister (e.g., inte0ad or inte12). 6 interrupt priorities levels (1 to 6) are provided. setting an interrupt source?s priority level to 0 (or 7) disables interrupt requests from that sou rce. the priority of no n-maskable interrupt (watchdog timer interrupts) is fixed at 7. if more than one interrupt request with a given priority level are generated simultaneously, th e default priority (the interrupt with the lowest priority or, in other words, the interrupt with the lowest vector value) is used to determine which interrupt request is accepted first. the 3rd and 7th bit of the interrupt priority setting register indicate the state of the interrupt request flag and thus whether an interrupt request for a given channel has occurred. if several interrupts are gene rated simultaneously, the interrupt controller sends the interrupt request for the interrupt with the highest priority and the interrupt?s vector address to the cpu. the cpu compares the mask value set in of the status register (sr) with the priority level of the re quested interrupt; if the latter is higher, the interrupt is accepted. then the cpu sets sr to the priority level of the accepted interrupt + 1. hence, during processing of the accepted interrupt, new interrupt requests with a priority value equal to or higher than the value set in sr (e.g., interrupts with a priority higher than the interrupt being processed) will be accepted. when interrupt processing has been co mpleted (e.g., after execution of a reti instruction), the cpu restores to sr the priority value which was saved on the stack before the interrupt was generated. the interrupt controller also includes eight registers which are used to store the micro dma start vector. writing the start vector of the interrupt source for the micro dma processing (see table 3.4.1), enables the corresponding interrupts to be processed by micro dma processing. the values must be set in the micro dma parameter registers (e.g., dmas and dmad) prior to micro dma processing.
tmp92ca25 2007-02-28 92ca25-52 figure 3.4.3 block diagram of interrupt controller int01 to int4, intkey,intrtc, intalm interrupt request si g nal to cpu if iff = 7 then 0 micro dma start vector setting registe r inttc0 inttc1 inttc2 inttc3 inttc4 inttc5 inttc6 inttc7 v = d0h v = d4h v = d8h v = dch v = e0h v = e4h v = e8h v = ech soft start micro dm a counter 0 interrupt 6 inttc0 during idle1 45 3 3 3 1 6 1 7 3 3 8 6 51 8 input or micro dma channel priority decoder priority encoder dma0v dma1v : dma7v reset interrupt request f/f reset decode r reset priority setting register v = 20h v = 24h interrupt controller cpu s q r v = 28h v = 2ch v = 30h v = 34h v = 38h v = 3ch v = 40h v = 44h v = 48h v = 4ch d q clr y1 y2 y3 y4 y5 y6 a b c dn dn + 1 dn + 2 interrupt request f/f interrupt vector read micro dma acknowledge interrupt request f/f dn + 3 a b c i n t errup t vector read d2 d3 d4 d5 d6 d7 selector s q r 0 1 2 3 4 5 6 7 a b c d0 d1 interrupt vector read interrupt mask f/f micro dma request halt release if intrq2 to 0 iff 2 to 0 then 1. intrq2 to 0 iff2 to 0 interrupt level detect reset ei 1 to 7 di interrupt request signal during stop micro dma channel specification reset intwd int0 int1 int2 int3 int4 intalm0 intalm1 intalm2 intalm3 intalm4 s interrupt vector generator highest priority interrupt level select 1 2 3 4 5 6 7 d5 d4 d3 d2 d1 d0 d q clr
tmp92ca25 2007-02-28 92ca25-53 (1) interrupt level se tting registers symbol name address 7 6 5 4 3 2 1 0 intad int0 iadc iadm2 iadm1 iadm0 i0c i0m2 i0m1 i0m0 r r/w r r/w inte0ad int0 & intad enable f0h 0 0 0 0 0 0 0 0 int2 int1 i2c i2m2 i2m1 i2m0 i1c i1m2 i1m1 i1m0 r r/w r r/w inte12 int1 & int2 enable d0h 0 0 0 0 0 0 0 0 int4 int3 i4c i4m2 i4m1 i4m0 i3c i3m2 i3m1 i3m0 r r/w r r/w inte34 int3 & int4 enable d1h 0 0 0 0 0 0 0 0 inti2s int5 ii2sc ii2sm2 ii2sm1 ii2sm0 i5c i5m2 i5m1 i5m0 r r/w r r/w inte5i2s int5 & inti2s enable ebh 0 0 0 0 0 0 0 0 intta1 (tmra1) intta0 (tmra0) ita1c ita1m2 ita1m1 ita1m0 it a0c ita0m2 ita0m1 ita0m0 r r/w r r/w inteta01 intta0 & intta1 enable d4h 0 0 0 0 0 0 0 0 intta3 (tmra3) intta2 (tmra2) ita3c ita3m2 ita3m1 ita3m0 it a2c ita2m2 ita2m1 ita2m0 r r/w r r/w inteta23 intta2 & intta3 enable d5h 0 0 0 0 0 0 0 0 inttb1 (tmrb1) inttb0 (tmrb0) itb1c itb1m2 itb1m1 itb1m0 it b0c itb0m2 itb0m1 itb0m0 r r/w r r/w intetb01 inttb0 & inttb1 enable d8h 0 0 0 0 0 0 0 0 ? inttbo0 ? ? ? ? itbo0c itbo0m2 itbo0m1 itbo0m0 r r/w intetbo0 inttbo0 (overflow) enable dah note: always write 0 0 0 0 0 inttx0 intrx0 itx0c itx0m2 itx0m1 itx0m0 irx0c irx0m2 irx0m1 irx0m0 r r/w r r/w intes0 intrx0 & inttx0 enable dbh 0 0 0 0 0 0 0 0 inttx1 ? itx1c itx1m2 itx1m1 itx1m0 ? ? ? ? r r/w intespi intspi enable e0h 0 0 0 0 note: always write 0 intalm1 intalm0 ia1c ia1m2 ia1m1 ia1m0 ia0c ia0m2 ia0m1 ia0m0 r r/w r r/w intealm01 intalm0 & intalm1 enable e5h 0 0 0 0 0 0 0 0 intalm3 intalm2 ia3c ia3m2 ia3m1 ia3m0 ia2c ia2m2 ia2m1 ia2m0 r r/w r r/w intealm23 intalm2 & intalm3 enable e6h 0 0 0 0 0 0 0 0
tmp92ca25 2007-02-28 92ca25-54 symbol name address 7 6 5 4 3 2 1 0 ? intalm4 ? ? ? ? ia4c ia4m2 ia4m1 ia4m0 r r/w intealm4 intalm4 enable e7h note: always write 0 0 0 0 0 ? intrtc ? ? ? ? irc irm2 irm1 irm0 r r/w intertc intrtc enable e8h note: always write 0 0 0 0 0 ? intkey ? ? ? ? ikc ikm2 ikm1 ikm0 r r/w intekey intkey enable e9h note: always write 0 0 0 0 0 ? intlcd ? ? ? ? ilcd1c ilcdm2 ilcdm1 ilcdm0 r r/w intelcd intlcd enable eah note: always write 0 0 0 0 0 intndf1 intndf0 in1c in1m2 in1m1 in1m0 in0c in0m2 in0m1 in0m0 r r/w r r/w intend01 intndf0 & intndf1 enable ech 0 0 0 0 0 0 0 0 ? intp0 ? ? ? ? ip0c ip0m2 ip0m1 ip0m0 r r/w intep0 intp0 enable eeh note: always write 0 0 0 0 0 lxxm2 lxxm1 lxxm0 function (write) 0 0 0 disables interrupt requests 0 0 1 sets interrupt priority level to 1 0 1 0 sets interrupt priority level to 2 0 1 1 sets interrupt priority level to 3 1 0 0 sets interrupt priority level to 4 1 0 1 sets interrupt priority level to 5 1 1 0 sets interrupt priority level to 6 1 1 1 disables interrupt requests interrupt request flag
tmp92ca25 2007-02-28 92ca25-55 interrupt request flag symbol name address 7 6 5 4 3 2 1 0 inttc1 (dma1) inttc0 (dma0) itc1c itc1m2 itc1m1 itc1m0 itc0c itc0m2 itc0m1 itc0m0 r r/w r r/w intetc01 inttc0 & inttc1 enable f1h 0 0 0 0 0 0 0 0 inttc3 (dma3) inttc2 (dma2) itc3c itc3m2 itc3m1 itc3m0 itc2c itc2m2 itc2m1 itc2m0 r r/w r r/w intetc23 inttc2 & inttc3 enable f2h 0 0 0 0 0 0 0 0 inttc5 (dma5) inttc4 (dma4) itc5c itc5m2 itc5m1 itc5m0 itc4c itc4m2 itc4m1 itc4m0 r r/w r r/w intetc45 inttc4 & inttc5 enable f3h 0 0 0 0 0 0 0 0 inttc7 (dma7) inttc6 (dma6) itc7c itc7m2 itc7m1 itc7m0 itc6c itc6m2 itc6m1 itc6m0 r r/w r r/w intetc67 inttc6 & inttc7 enable f4h 0 0 0 0 0 0 0 0 ? intwd ? ? ? ? itcwd ? ? ? r intwdt intwd enable f7h note: always write 0 0 ? ? ? lxxm2 lxxm1 lxxm0 function (write) 0 0 0 disables interrupt requests 0 0 1 sets interrupt priority level to 1 0 1 0 sets interrupt priority level to 2 0 1 1 sets interrupt priority level to 3 1 0 0 sets interrupt priority level to 4 1 0 1 sets interrupt priority level to 5 1 1 0 sets interrupt priority level to 6 1 1 1 disables interrupt requests
tmp92ca25 2007-02-28 92ca25-56 (2) external interrupt control symbol name address 7 6 5 4 3 2 1 0 i5edge i4edge i3edge i2edge i1edge i0edge i0le ? w r/w 0 0 0 0 0 0 0 0 iimc interrupt input mode control f6h (prohibit rmw) int5edge 0: rising 1: falling int4edge 0: rising 1: falling int3edge 0: rising 1: falling int2edge 0: rising 1: falling int1edge 0: rising 1: falling int0edge 0: rising 1: falling 0: int0 edge mode 1: int0 level mode always write ?0? * int0 level enable 0 edge detect int 1 ?h? level int note 1: disable int0 request before changing int0 pin mode from level sense to edge sense. setting example: di ld (iimc), xxxxxx00b ; switches from level to edge. ld (intclr), 0ah ; clears interrupt request flag. nop ; wait ei execution nop nop ei x: don?t care, ?: no change. note 2: see electrical characteristics in sect ion 4 for external interrupt input pulse width. settings of external interrupt pin function interrupt pin name mode setting method rising edge = 0, = 0 falling edge = 0, = 1 int0 pc0 high level = 1 rising edge = 0 int1 pc1 falling edge = 1 rising edge = 0 int2 pc2 falling edge = 1 rising edge = 0 int3 pc3 falling edge = 1 rising edge = 0 int4 p96 falling edge = 1 rising edge = 0 int5 p97 falling edge = 1
tmp92ca25 2007-02-28 92ca25-57 (3) sio receive interrupt control symbol name address 7 6 5 4 3 2 1 0 ? ? ir0le w w 0 1 1 simc sio interrupt mode control f5h (prohibit rmw) always write ?0? (note) always write ?0? 0: intrx0 edge mode 1: intrx0 level mode note: when using the micro dma transfer end interrupt, always write ?1?. intrx0 rising edge enable 0 edge detect intrx0 1 ?h? level intrx0
tmp92ca25 2007-02-28 92ca25-58 (4) interrupt request flag clear register the interrupt request flag is cleared by writing the appropriate micro dma start vector, as given in table 3.4.1, to the register intclr. for example, to clear the interrupt flag int0, perform the following register operation after execution of the di instruction. intclr 0ah clears interrupt request flag int0. symbol name address 7 6 5 4 3 2 1 0 clrv7 clrv6 clrv5 clrv4 clrv3 clrv2 clrv1 clrv0 w 0 0 0 0 0 0 0 0 intclr interrupt clear control f8h (prohibit rmw) interrupt vector (5) micro dma start vector registers these registers assign micro dma processing to sets which source corresponds to dma. the interrupt source whose micro dma start vector value matches the vector set in one of these registers is designated as the micro dma start source. when the micro dma transfer counter valu e reaches zero, the micro dma transfer end interrupt corresponding to the channel is sent to the interrupt controller, the micro dma start vector register is cleared, and th e micro dma start source for the channel is cleared. therefore, in order for micro dma processing to continue, the micro dma start vector register must be set again during processing of the micro dma transfer end interrupt. if the same vector is set in the micro dma start vector registers of more than one channel, the lowest numbered channel takes priority. accordingly, if the same vector is set in the micro dma start vector registers for two different channels, the interrupt generated on the lower numbered channel is executed until micro dma transfer is complete. if th e micro dma start vector for this channel has not been set in the channel?s micro dm a start vector register again, micro dma transfer for the higher-numbered channel will be commenced. (this process is known as micro dma chaining.)
tmp92ca25 2007-02-28 92ca25-59 symbol name address 7 6 5 4 3 2 1 0 dma0v5 dma0v4 dma0v3 dma0v2 dma0v1 dma0v0 r/w 0 0 0 0 0 0 dma0v dma0 start vector 100h dma0 start vector dma1v5 dma1v4 dma1v3 dma1v2 dma1v1 dma1v0 r/w 0 0 0 0 0 0 dma1v dma1 start vector 101h dma1 start vector dma2v5 dma2v4 dma2v3 dma2v2 dma2v1 dma2v0 r/w 0 0 0 0 0 0 dma2v dma2 start vector 102h dma2 start vector dma3v5 dma3v4 dma3v3 dma3v2 dma3v1 dma3v0 r/w 0 0 0 0 0 0 dma3v dma3 start vector 103h dma3 start vector dma4v5 dma4v4 dma4v3 dma4v2 dma4v1 dma4v0 r/w 0 0 0 0 0 0 dma4v dma4 start vector 104h dma4 start vector dma5v5 dma5v4 dma5v3 dma5v2 dma5v1 dma5v0 r/w 0 0 0 0 0 0 dma5v dma5 start vector 105h dma5 start vector dma6v5 dma6v4 dma6v3 dma6v2 dma6v1 dma6v0 r/w 0 0 0 0 0 0 dma6v dma6 start vector 106h dma6 start vector dma7v5 dma7v4 dma7v3 dma7v2 dma7v1 dma7v0 r/w 0 0 0 0 0 0 dma7v dma7 start vector 107h dma7 start vector
tmp92ca25 2007-02-28 92ca25-60 (6) specification of a micro dma burst specifying the micro dma burst function ca uses micro dma transfer, once started, to continue until the value in the transfer counter register reaches zero. setting any of the bits in the register dmab which correspond to a micro dma channel (as shown below) to 1 specifies that any micro dma transfer on that channel will be a burst transfer. symbol name address 7 6 5 4 3 2 1 0 dbst7 dbst6 dbst5 dbst4 d bst3 dbst2 dbst1 dbst0 r/w 0 0 0 0 0 0 0 0 dmab dma burst 108h 1: dma burst request
tmp92ca25 2007-02-28 92ca25-61 (7) notes the instruction execution unit and the bus interface unit in this cpu operate independently. therefore, immediately before an interrupt is generated, if the cpu fetches an instruction which clears the co rresponding interrupt request flag, the cpu may execute this instruction in between accepting the interrupt and reading the interrupt vector. in this case, the cpu will read the default vector 0004h and jump to interrupt vector address ffff04h. to avoid this, an instruction which clears an interrupt request flag should always be placed after a di instruction. and in the case of setting an interrupt enable again by ei instruction after the execution of clearing instruction, execute ei instruction after clearing and more than 3 ? instructions (e.g., ?nop? 3 times). if it placed ei instruction without waiting nop instruction after execution of clearing instruction, interrupt will be en abled before request flag is cleared. in the case of changing the value of the interrupt mask register by execution of pop sr instruction, disable an interrupt by di instruction before execution of pop sr instruction. in addition, please note that the following two circuits are exceptional and demand special attention. in level mode int0 is not an edge triggered interrupt. hence, in level mode the interrupt request flip-flop for int0 does not function. the peripheral interrupt request passes through the s input of the flip-flop and becomes the q output. if the interrupt input mode is changed from edge mode to level mode, the interrupt request flag is cleared automatically. int0 level mode if the cpu enters the interrupt response sequence as a result of int0 going from 0 to 1, int0 must then be held at 1 until the interrupt response sequence has been completed. if int0 is set to level mode so as to release a halt state, int0 must be held at 1 from the time int0 changes from 0 to 1 until the halt state is released. (hence, it is necessary to ensure that input noise is not interpreted as a 0, causing int0 to revert to 0 before the halt state has been released.) when the mode changes from level mode to edge mode, interrupt request flags which were set in level mode will not be cleared. interrupt request flags must be cl eared using the following sequence. di ld (iimc), 00h ; switches from level to edge. ld (intclr), 0ah ; clears interrupt request flag. nop ; wait ei execution nop nop ei intrx in level mode (the register simc set to ?0?), the interrupt request flip-flop can only be cleared by a reset or by reading the serial channel receive buffer. it cannot be cleared by writing intclr register. note: the following instructions or pin input state changes are equivalent to instructions which clear the interrupt request flag. int0: instructions which switch to level mode after an interrupt request has been generated in edge mode. the pin input changes from high to low after an interrupt request has been generated in level mode. (?h? ?l?) intrx: instructions which read the receive buffer. intrx: instructions which read the receive buffer.
tmp92ca25 2007-02-28 92ca25-62 3.5 function of ports the tmp92ca25 i/o port pins are shown in table 3.5.1 and table 3.5.2. in addition to functioning as general-purpose i/o ports, these pins are also used by the internal cpu and i/o functions. table 3.5.3 to table 3.5.5 list the i/o regist ers and their sp ecifications. table 3.5.1 port functions (1/2) ( r: pd = with programmable pull-down resistor, u = with pull-up resistor) port name pin name number of pins i/o r i/o setting pin name for built-in function port 1 p10 to p17 8 i/o ? bit d8 to d15 port 6 p60 to p67 8 i/o ? bit a16 to a23 p70 1 output ? (fixed) rd p71 1 i/o ? bit wrll , ndre p72 1 i/o ? bit wrlu , ndwe p73 1 i/o ? bit ea24 p74 1 i/o ? bit ea25 p75 1 i/o ? bit r/ w , ndr/ b port 7 p76 1 i/o ? bit wait p80 1 output ? (fixed) 0 cs p81 1 output ? (fixed) 1 cs , sdcs p82 1 output ? (fixed) 2 cs , csza p83 1 output ? (fixed) 3 cs p84 1 output ? (fixed) cszb , wrul , ce 0 nd p85 1 output ? (fixed) cszc , wruu , ce 1 nd p86 1 output ? (fixed) cszd port 8 p87 1 output ? (fixed) csze p90 1 i/o ? bit txd0, i2scko p91 1 i/o ? bit rxd0, i2sdo p92 1 i/o ? bit sclk0, 0 cts , i2sws p93 1 i/o ? bit sda p94 1 i/o ? bit scl p95 1 output ? (fixed) clk32ko p96 1 input pd (fixed) int4, px port 9 p97 1 input ? (fixed) int5, py port a pa0 to pa7 8 input u (fixed) ki0 to ki7 pc0 1 i/o ? bit int0, ta1out pc1 1 i/o ? bit int1, ta3out pc2 1 i/o ? bit int2, tb0out0 pc3 1 i/o ? bit int3 pc4 1 i/o ? bit pc5 1 i/o ? bit pc6 1 i/o ? bit ko8, ea24 port c pc7 1 i/o ? bit cszf , ea25 pf0 1 i/o ? bit txd0 pf1 1 i/o ? bit rxd0 pf2 1 i/o ? bit sclk0, 0 cts pf3 1 i/o ? bit pf4 1 i/o ? bit pf5 1 i/o ? bit pf6 1 i/o ? bit port f pf7 1 output ? (fixed) sdclk
tmp92ca25 2007-02-28 92ca25-63 table 3.5.2 port functions (2/2) ( r: pd = with programmable pull-down resistor, u = with pull-up resistor) port name pin name number of pins i/o r i/o setting pin name for built-in function pg0 to pg1 2 input ? (fixed) an0 to an1 pg2 1 input ? (fixed) an2, mx port g pg3 1 input ? (fixed) an3, adtrg , my pj0 1 output ? (fixed) sdras , srllb pj1 1 output ? (fixed) sdcas , srlub pj2 1 output ? (fixed) sdwe , srwr pj3 1 output ? (fixed) sdlldqm pj4 1 output ? (fixed) sdludqm pj5 1 i/o ? bit ndale pj6 1 i/o ? bit ndcle port j pj7 1 output ? (fixed) sdcke pk0 1 output ? (fixed) lcp0 pk1 1 output ? (fixed) llp pk2 1 output ? (fixed) lfr pk3 1 output ? (fixed) lbcd pk4 1 i/o ? bit spdi pk5 1 i/o ? bit spdo pk6 1 i/o ? bit spcs port k pk7 1 i/o ? bit spclk pl0 to pl3 4 output ? (fixed) ld0 to ld3 pl4 to pl5 2 i/o ? bit ld4 to ld5 pl6 1 i/o ? bit ld6, busrq port l pl7 1 i/o ? bit ld7, busak pm1 1 output ? (fixed) mldalm port m pm2 1 output ? (fixed) alarm , mldalm port n pn0 to pn7 8 i/o ? bit ko0 to ko7
tmp92ca25 2007-02-28 92ca25-64 table 3.5.3 i/o registers and specifications (1/3) x: don?t care i/o register port pin name specification pn pncr pnfc pnfc2 input port x 0 0 output port x 1 0 d8 to d15 bus x x 1 port 1 p10 to p17 a0 to a7 output x 1 none input port x 0 0 output port x 1 0 port 6 p60 to p67 a16 to a23 output x x 1 none p70 to p76 output port x 1 0 p71 to p76 input port x 0 0 p70 rd output x none 1 wrll output 1 1 1 p71 ndre output 0 1 1 wrlu output 1 1 1 p72 ndwe output 0 1 1 p73 ea24 output x 1 1 p74 ea25 output x 1 1 r/ w output x 1 1 p75 ndr/ b input x 0 1 port 7 p76 wait input x 0 1 none p80 to p87 output port x 0 0 p80 0 cs output x 1 0 1 cs output x 1 0 p81 sdcs output x x 1 2 cs output x 1 0 p82 csza output x 0 1 p83 3 cs output x 1 0 cszb output x 1 0 p84 ce 0 nd output x 1 1 cszc output x 1 0 p85 ce 1 nd output x 1 1 p86 cszd output x 1 0 port 8 p87 csze output x none 1 0
tmp92ca25 2007-02-28 92ca25-65 table 3.5.4 i/o registers and specifications (2/3) x: don?t care i/o register port pin name specification pn pncr pnfc pnfc2 p90 to p94, p96 to p97 input port x 0 0 p90 to p94 x 1 0 p95 output port x 0 0 txd0 output x 1 1 i2scko output x 0 1 0 p90 txd0 output (open drain) x 1 1 1 rxd0 input x 0 0 p91 i2sdo output x 0 1 sclk0 output x 1 1 i2sws output x 0 1 p92 sclk0, 0 cts input (note1) x 0 0 none sda i/o x 1 1 0 p93 sda i/o (open drain) x 1 1 1 scl i/o x 1 1 0 p94 scl i/o (open drain) x 1 1 1 p95 clk32ko output x 1 0 p96 int4 input x none 1 port 9 p97 int5 input x none 1 none input port 0 port a pa0 to pa7 ki0 to ki7 input none none 1 none input port x 0 0 pc0 to pc3 pc6 to pc7 output port x 1 0 int0 input x 0 1 none pc0 ta1out output x 1 1 none int1 input x 0 1 pc1 ta3out output x 1 1 none int2 input x 0 1 none pc2 tb0out0 output x 1 1 none pc3 int3 input x 0 1 ko8 output (open drain) x 0 1 pc6 ea24 output 0 1 1 cszf output x 0 1 port c pc7 ea25 output 0 1 1 none pf0 to pf6 input port x 0 0 pf0 topf7 output port x 1 0 0 txd0 output x 1 1 0 pf0 txd0 output (open drain) x 1 1 1 pf1 rxd0 input x 0 0 sclk0 output x 1 1 pf2 sclk0, 0 cts input x 0 0 port f pf7 sdclk output x none 1 none note: to use p92-pin as sclk0 input or 0 cts input, set ?1? to pf
tmp92ca25 2007-02-28 92ca25-66 table 3.5.5 i/o registers and specifications (3/3) x: don?t care i/o register port pin name specification pn pncr pnfc pnfc2 input port pg0 to pg3 an0 to an3 input pg3 adtrg input pg2 mx output port g pg3 my output x none none none pj0 to pj7 output port x 1 0 pj5 to pj6 input port x 0 0 pj0 sdras , srllb output x 1 pj1 sdcas , srlub output x 1 pj2 sdwe , srwr output x 1 pj3 sdlldqm output x 1 pj4 sdludqm output 1 none 1 pj5 ndale output 0 1 1 pj6 ndcle output 0 1 1 port j pj7 sdcke output x none 1 none pk4 to pk7 input port x 0 0 none pk0 to pk3 output port x none 0 pk4 to pk7 output port x 1 0 pk0 lcp0 output x 1 pk1 llp output x 1 pk2 lfr output x 1 pk3 lbcd output x none 1 pk4 spdi input x 0 1 pk5 spdo output x 1 1 pk6 spcs output x 1 1 port k pk7 spclk output x 1 1 none pl4 to pl7 input port x 0 0 pl0 to pl7 output port x 1 0 pl0 to pl7 ld0 to ld7 output x 1 1 pl6 busrq input x 1 1 port l pl7 busak output x 1 1 none pm1 to pm2 output port x 0 pm1 mldalm output x 1 mldalm output 0 1 port m pm2 alarm output 1 none 1 none input port x 0 0 output port (cmos output) x 1 0 port n pn0 to pn7 ko output (open drain output) x 1 1 none
tmp92ca25 2007-02-28 92ca25-67 3.5.1 port 1 (p10 to p17) port 1 is an 8-bit general-purpose i/o port. bits can be individually set as either inputs or outputs by control register p1 cr and function register p1fc. in addition to functioning as a general-purpose i/o port, port1 can also function as a data bus (d8 to d15). am1 am0 function setting after reset is released 0 0 don?t use this setting 0 1 data bus (d8 to d15) 1 0 data bus (d8 to d15) 1 1 input port figure 3.5.1 port 1 p1cr register p1fc register p1 register external write enable d8 to d15 s 0 1 s 1 0 p10 to p17 ( d8 to d15 ) external read enable d8 to d15 port read data selecto r selecto r
tmp92ca25 2007-02-28 92ca25-68 port 1 register 7 6 5 4 3 2 1 0 bit symbol p17 p16 p15 p14 p13 p12 p11 p10 read/write r/w after reset data from external port (output latch register is cleared to ?0?) port 1 control register 7 6 5 4 3 2 1 0 bit symbol p17c p16c p15c p14c p13c p12c p11c p10c read/write w after reset 0 0 0 0 0 0 0 0 function 0: input 1: output port 1 function register 7 6 5 4 3 2 1 0 bit symbol p1f read/write w after reset 0/1 note 2 function 0: port 1: data bus (d8 to d15) port 1 drive register 7 6 5 4 3 2 1 0 bit symbol p17d p16d p15d p14d p13d p12d p11d p10d read/write w after reset 1 1 1 1 1 1 1 1 function input/output buffer driv e register for standby mode note1: read-modify-write is prohibited for p1cr and p1fc. note2: it is set to ?port? or ?data bus? by am pin setting. figure 3.5.2 register for port 1 p1 (0004h) p1cr (0006h) p1fc (0007h) p1dr (0081h)
tmp92ca25 2007-02-28 92ca25-69 3.5.2 a0 to a7 a0 to a7 pin function is address bus function only. driver register is following register. port 4 drive register 7 6 5 4 3 2 1 0 bit symbol p57d p56d p55d p54d p53d p52d p51d p50d p4dr (0084h) read/write w after reset 1 1 1 1 1 1 1 1 function input/output buffer driv e register for standby mode figure 3.5.3 driver register for a0 to a7 3.5.3 a8 to a15 a8 to a15 pin function is address bus function only. driver register is following register. port 5 drive register 7 6 5 4 3 2 1 0 bit symbol p57d p56d p55d p54d p53d p52d p51d p50d p5dr (0085h) read/write w after reset 1 1 1 1 1 1 1 1 function input/output buffer driv e register for standby mode figure 3.5.4 drive regi ster for a8 to a15
tmp92ca25 2007-02-28 92ca25-70 3.5.4 port 6 (p60 to p67) port 6 is an 8-bit general-purpose i/o port. bits can be individually set as either inputs or outputs by control register p6 cr and function register p6fc. in addition to functioning as a general-purpos e i/o port, port 6 can also function as an address bus (a16 to a23). am1 am0 function setting after reset is released 0 0 don?t use this setting 0 1 address bus (a16 to a23) 1 0 address bus (a16 to a23) 1 1 input port figure 3.5.5 port 6 p6cr register p6fc register p6 register (reserved) a16 to a23 s 0 1 s 1 0 p60 to p67 (a16 to a23) port read data selecto r selecto r
tmp92ca25 2007-02-28 92ca25-71 port 6 register 7 6 5 4 3 2 1 0 bit symbol p67 p66 p65 p64 p63 p62 p61 p60 read/write r/w after reset data from external port (output latch register is cleared to ?0?) port 6 control register 7 6 5 4 3 2 1 0 bit symbol p67c p66c p65c p64c p63c p62c p61c p60c read/write w after reset 0 0 0 0 0 0 0 0 function 0: input 1: output port 6 function register 7 6 5 4 3 2 1 0 bit symbol p67f p66f p65f p64f p63f p62f p61f p60f read/write w after reset note 2 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 function 0: port 1: address bus (a16 to a23) port 6 drive register 7 6 5 4 3 2 1 0 bit symbol p67d p66d p65d p64d p63d p62d p61d p60d read/write w after reset 1 1 1 1 1 1 1 1 function input/output buffer driv e register for standby mode note 1: read-modify-write is prohibited for p6cr and p6fc. note 2: it is set to ?port? or ?address bus? by am pin setting. figure 3.5.6 register for port 6 p6 (0018h) p6fc (001bh) p6dr (0086h) p6cr (001ah)
tmp92ca25 2007-02-28 92ca25-72 3.5.5 port 7 (p70 to p76) port 7 is a 7-bit general-purpose i/o po rt (p70 is used for output only). bits can be individually set as either inputs or outputs by control register p7cr and function register p7fc. in addition to functioning as a general-purpose i/o port, p70 to p76 pins can also function as interface pins for external memory. a reset initializes p70 pin to output port mode, and p71to p76 pin to input port mode. am1 am0 function setting after reset is released 0 0 don?t use this setting 0 1 rd pin 1 0 rd pin 1 1 p70 output port figure 3.5.7 port 7 p7fc register p7 register rd s 0 1 p70( rd ) port read data selecto r ndre , ndwe port read data wrll , wrlu p7cr register p7fc register p7 register s 0 1 s 1 0 p71 ( wrll , ndre ) p72 ( wrlu , ndwe ) selecto r selecto r s 0 1
tmp92ca25 2007-02-28 92ca25-73 figure 3.5.8 port 7 p7cr register p7fc register p7 register p76 ( wait ) wait port read data p7cr register p7fc register p7 register s 0 1 s 1 0 p75 (r/ w , ndr/ b ) selector port read data ndr/ b r/ w p7cr register p7fc register p7 register s 0 1 s 1 0 p73 (ea24) p74 (ea25) selector port read data ea24, ea25 selector
tmp92ca25 2007-02-28 92ca25-74 port 7 register 7 6 5 4 3 2 1 0 bit symbol p76 p75 p74 p73 p72 p71 p70 read/write r/w after reset data from external port (output latch register is set to ?1?) data from external port (output latch register is set to ?0?) data from external port (output latch register is set to ?1?) 1 port 7 control register 7 6 5 4 3 2 1 0 bit symbol p76c p75c p74c p73c p72c p71c read/write w after reset 0 0 0 0 0 0 function 0: input 1: output port 7 function register 7 6 5 4 3 2 1 0 bit symbol p76f p75f p74f p73f p72f p71f p70f read/write w after reset 0 0 0 0 0 0 0/1 note 2 function 0: input port 1: wait refer to following table 0: port 1: rd port 7 drive register 7 6 5 4 3 2 1 0 bit symbol p76d p75d p94d p73d p72d p71d p70d read/write r/w after reset 1 1 1 1 1 1 1 function input/output buffer dr ive register for standby mode note 1: read-modify-write is prohibited for p7cr and p7fc. note 2: it is set to ?port? or ? rd ? by am pin setting. note 3: when ndre and ndwe are used, set registers in the following order to avoid outputting a negative glitch. order register bit2 bit1 (1) p7 0 0 (2) p7fc 1 1 (3) p7cr 1 1 figure 3.5.9 register for port 7 p72 setting 0 1 0 input port output port 1 (reserved) ndwe output (at = 0) wrlh output (at = 1) p71 setting 0 1 0 input port output port 1 (reserved) ndre output at ( = 0) wrll output (at = 1) p76 setting 0 1 0 input port output port 1 wait input (reserved) p75 setting 0 1 0 input port output port 1 ndr/ b input (at = 1) r/ w output p7 (001ch) p7cr (001eh) p7fc (001fh) p7dr (0087h) p73 setting 0 1 0 input port output port 1 (reserved) ea24 output p74 setting 0 1 0 input port output port 1 (reserved) ea25 output
tmp92ca25 2007-02-28 92ca25-75 3.5.6 port 8 (p80 to p87) ports 80 to 87 are 8-bit output ports. resetting sets the output latch of p82 to ?0? and the output latches of p80 to p81, p83 to p87 to ?1?. port 8 can also be set to function as an in terface pin for external memory using function register p8fc. writing ?1? in the corresponding bit of p8fc and p8fc2 enables the respective functions. resetting to of p8fc to ?0? an d p8fc2 to ?0?, sets all bits to output ports. figure 3.5.10 port 8 internal data bus function control 2 reset p8fc2 write ouptut latch p8 write selector p8 read p80 ( cs0 ) p81 ( cs1 , sdcs ) p82 ( cs2 , csza ) p83 ( cs3 ) p84 ( cszb , ce 0 nd ) p85 ( cszc , ce 1 nd ) p86 ( cszd ) p87 ( csze ) function contol p8fc write ?1?, ?1?, ?1?, ?1?, ce 0 nd , ce 1 nd , ?1?, ?1?, cs0 , cs1 , cs2 , cs3 , cszb , cszc , cszd , csze ?1?, sdcs , csza , ?1?
tmp92ca25 2007-02-28 92ca25-76 port 8 register 7 6 5 4 3 2 1 0 bit symbol p87 p86 p85 p84 p83 p82 p81 p80 p8 (0020h) read/write r/w after reset 1 1 1 1 1 0 1 1 port 8 function register 7 6 5 4 3 2 1 0 bit symbol p87f p86f p85f p84f p83f p82f p81f p80f p8fc (0023h) read/write w after reset 0 0 0 0 0 0 0 0 function 0: port 1: csze 0: port 1: cszd refer to following table refer to following table 0: port 1: 3 cs refer to following table 0: port 1: 1 cs 0: port 1: 0 cs port 8 function register 2 7 6 5 4 3 2 1 0 bit symbol p87f2 p86f2 p85f2 p84f2 p83f2 p82f2 p81f2 p80f2 p8fc2 (0021h) read/write w after reset 0 0 0 0 0 0 0 0 function 0: 1:reserved 0: 1:reserved refer to following table refer to following table always write ?0? refer to table below 0: 1: sdcs always write ?0? port 8 drive register 7 6 5 4 3 2 1 0 bit symbol p87d p86d p85d p84d p83d p82d p81d p80d p8dr (0088h) read/write r/w after reset 1 1 1 1 1 1 1 1 function input/output buffer dr ive register for standby mode note 1: read-modify-write is prohibited for p8fc and p8fc2. note 2: don?t write ?1? to p8 register before setting p82 pin to 2 cs or csza because p82 pin output ?0? as ce for program memory by reset. figure 3.5.11 register for port 8 p85 setting 0 1 0 output port cszc output 1 (reserved) nd1ce output p84 setting 0 1 0 output port cszb output 1 (reserved) nd0ce output p82 setting 0 1 0 output port 2 cs output 1 csza output reserved
tmp92ca25 2007-02-28 92ca25-77 3.5.7 port 9 (p90 to p97) p90 to p94 are 5-bit general-purpose i/o port s. i/o can be set on a bit basis using the control register. resettin g sets p90 to p94 to input port and all bits of output latch to?1?. p95 is 1-bit general-purpose output port an d p96 to p97 are 2-bit general-purpose input ports. setting the corresponding bits of p9fc enables the respective functions. resetting resets the p9fc to ?0?, and sets all bits except p95 to input ports. (1) port 90 (txd0, i2scko), port91 (rxd0, i2sdo), port 92 (sclk0, cts0 i2sws) ports 90 to 92 are general-purpose i/o ports. they also function as either sio0 or i 2 s. each pin is detailed below. sio mode (sio0 module) uart, irda mode (sio0 module) i 2 s mode (i 2 s module) sio mode (i 2 s module) p90 txd0 (data output) txd0 (data output) i2scko (clock output) i2scko (clock output) p91 rxd0 (data input) rxd0 (data input) i2sdo (data output) i2sdo (data output) p92 sclk0 (clock input or output) 0 cts (clear to send) i2sws (word select output) (no use) figure 3.5.12 p90 internal data bus direction control (on bit basis) reset p9cr write p9 write p9 read p90 (txd0, i2scko) function control (on bit basis) p9fc write txd0, i2scko output s output latch s b selector a s a selector b spdi input
tmp92ca25 2007-02-28 92ca25-78 figure 3.5.13 p91 and p92 (2) p93 (sda), p94 (scl) figure 3.5.14 port 93 and 94 internal data bus direction control (on bit basis) reset p9cr write p9 write p9 read p91 (rxd0, i2sdo) p92 (sclk0, 0 cts , i2sws) function control (on bit basis) p9fc write i2sdo output sclk0,i2sws output s output latch s b selector a s a selector b (to port f1) p91rxd0 input (to port f2) p92sclk0 input internal data bus direction control (on bit basis) reset p9cr write p9 write p9 read p93(sda), p94(scl) function control (on bit basis) p9fc write sda, scl output s output latch s b selector a s a selector b open drain enable p9fc2 sda, scl input
tmp92ca25 2007-02-28 92ca25-79 (3) p95 (clk32ko) figure 3.5.15 port 95 (4) p96 (int4, px), p97 (int5, py) figure 3.5.16 port 96, 97 internal data bus reset p9 read p96 (int4, px) p97 (int5, py) function control p9fc write int4 int5 s a selector b rising/falling edge detection tsicr1 de-bounce circuit tsicr0 tsicr0 < pyen > tsicr0 tsicr0 tsicr0 iimc pull-down resistor t y p.200k only for p96 avcc switch for tsi typ.20 internal data bus direction control (on bit basis) reset p9cr write p9 write p9 read p95 (clk32ko) funtcion control (on bit basis) p9fc write fs s output latch s a selector b
tmp92ca25 2007-02-28 92ca25-80 port 9 register 7 6 5 4 3 2 1 0 bit symbol p97 p96 p95 p94 p93 p92 p91 p90 p9 (0024h) read/write r r/w after reset data from external port 0 data from ex ternal port (output latch register is set to ?1?) port 9 control register 7 6 5 4 3 2 1 0 bit symbol p95c p94c p93c p92c p91c p90c p9cr (0026h) read/write w after reset 0 0 0 0 0 0 function refer to following table port 9 function register 7 6 5 4 3 2 1 0 bit symbol p97f p96f p95f p94f p93f p92f p91f p90f p9fc (0027h) read/write w after reset 0 0 0 0 0 0 0 0 function 0: input port 1: int5 0: input port 1: int4 refer to following table port 9 function register 2 7 6 5 4 3 2 1 0 bit symbol p94f2 p93f2 p90f2 p9fc2 (0025h) read/write w w after reset 0 0 0 function 0: cmos 1: open drain 0: cmos 1: open drain 0: cmos 1: open drain port 9 drive register 7 6 5 4 3 2 1 0 bit symbol p97d p96d p95d p94d p93d p92d p91d p90d p9dr (0089h) read/write r/w after reset 1 1 1 1 1 1 1 1 function output/input buffer dr ive register for standby mode note 1: read modify write is prohibited for p9cr, p9fc and p9fc2. note 2: when setting p97 and p96 pin to int5 and int4 i nput, set p9dr to ?00?(prohibit input), and when driving p96 and p97 pins to ?0?, execute halt instruct ion. this setting generates int5 and int4 inside. if don?t use external interrupt in halt condition, set lik e a interrupt don?t generated. (e.g. change port setting) figure 3.5.17 register for port 9 p92 setting 0 1 0 input port sclk0, 0 cts input output port 1 i2sws output sclk0 output p91 setting 0 1 0 input port rxd0 input output port 1 i2sdo output (reserved) p90 setting 0 1 0 input port output port 1 i2scko output txd0 output p95 setting 0 1 0 output port clk32ko output 1 (reserved) (reserved) p94 setting 0 1 0 input port output port 1 (reserved) (reserved) p93 setting 0 1 0 input port output port 1 (reserved) sda i/o
tmp92ca25 2007-02-28 92ca25-81 3.5.8 port a (pa0 to pa7) ports a0 to a7 are 8-bit input general-purpose ports with pull-up resistor. in addition to functioning as general-purpose i/o ports, ports a0 to a7 can also, as a keyboard interface, operate a key-on wakeup function. the various functions can each be enabled by writing a ?1? to the corresponding bit of the port a function register (pafc). resetting resets all bits of the register pafc to ?0? and sets all pins to be input port. figure 3.5.18 port a when pafc = ?1?, if the input of any of ki0 to ki7 pins fall down, an intkey interrupt is generated. an intkey interrupt can be used to release all halt modes. internal data bus pa0 (ki0) pa1 (ki1) pa2 (ki2) pa3 (ki3) pa4 (ki4) pa5 (ki5) pa6 (ki6) pa7 (ki7) intkey edge detection key-on enable (on bit basis) pafc write pa read pull-up resistor reset pa0 to pa7 8-input or
tmp92ca25 2007-02-28 92ca25-82 port a register 7 6 5 4 3 2 1 0 bit symbol pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 read/write r/w after reset data from external port port a function register 7 6 5 4 3 2 1 0 bit symbol pa7f pa6f pa5f pa4f pa3f pa2f pa1f pa0f read/write w after reset 0 0 0 0 0 0 0 0 function 0: key input disable 1: key input enable port a drive register 7 6 5 4 3 2 1 0 bit symbol pa7d pa6d pa5d pa4d pa3d pa2d pa1d pa0d read/write w after reset 1 1 1 1 1 1 1 1 function input/output buffer driv e register for standby mode note: read-modify-write is prohibited for pacr and pafc. figure 3.5.19 register for port a padr (008ah) pa (0028h) pafc (002bh)
tmp92ca25 2007-02-28 92ca25-83 3.5.9 port c (pc0 to pc3, pc6 to pc7) pc0 to pc7 are 8-bit general-purpose i/o ports. each bit can be set individually for input or output. resetting sets port c to an input port. in addition to functioning as a general-purpos e i/o port, port c can also function as an output pin for timers (ta1out, ta3out and tb0out0), input pin for external interruption (int0 to int3), output pin for memory ( cszf ), output pin for key (ko8). these settings are made using the function register pcfc. the edge select for external interruption is determined by the iimc register in the interruption controller. (1) pc0 (int0, ta1out) figure 3.5.20 port c0 internal data bus direction control reset pccr write pc read pc0 (int0, ta1out) pc write s output latch s b selector a function control pcfc write int0 s a selector b iimc ta1out level/edge select and rising/falling select internal data bus direction control (on bit basis) reset pccr write pc read pc0 (int0, ta1out) pc write s output latch s b selector a function control (on bit basis) pcfc write int0 s a selector b iimc ta1out level/edge select and rising/falling select
tmp92ca25 2007-02-28 92ca25-84 (2) pc1 (int1, ta3out), pc2 (int2, tb0out0), pc3 (int3, tb0out1) figure 3.5.21 port c1, c2, c3 (3) pc4, pc5 figure 3.5.22 port c4, c5 internal data bus direction control (on bit basis) reset pccr write pc read pc1 (int1, ta3out) pc2 (int2, tb0out0) pc3 (int3) pc write s output latch s b selector a pcfc write int1 to int3 s a selector b rising/falling edge detection iimc ta3out tb0out0 function control (on bit basis) internal data bus direction control (on bit basis) reset pccr write pc write pc read pc4 pc5 pcfc write s output latch s b selector a function control (on bit basis)
tmp92ca25 2007-02-28 92ca25-85 (4) pc6 (ko8, ea24) figure 3.5.23 port c6 (4) pc7 ( cszf , ea25) figure 3.5.24 port c7 s a selector b c internal data bus direction control (on bit basis) reset pccr write pc read pc7 ( cszf , ea25) pc write s output latch s b selector a funtcion control (on bit basis) pffc write cszf ea25 internal data bus direction control (on bit basis) reset pccr write pc read pc6 (ko8, ea24) pc write s output latch s b selector a funtcion control (on bit basis) pcfc write s a selector b ea24 open drain enable
tmp92ca25 2007-02-28 92ca25-86 port c register 7 6 5 4 3 2 1 0 bit symbol pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 pc (0030h) read/write r/w after reset data from external port (o utput latch register is set to ?1?) port c control register 7 6 5 4 3 2 1 0 bit symbol pc7c pc6c pc5c pc4c pc3c pc2c pc1c pc0c pccr (0032h) read/write w after reset 0 0 0 0 0 0 0 0 function refer to following table port c function register 7 6 5 4 3 2 1 0 bit symbol pc7f pc6f pc5f pc4f pc3f pc2f pc1f pc0f pcfc (0033h) read/write w after reset 0 0 0 0 0 0 0 0 function refer to following table port c drive register 7 6 5 4 3 2 1 0 bit symbol pc7d pc6d pc5d pc4d pc3d pc2d pc1d pc0d read/write r/w after reset 1 1 1 1 1 1 1 1 function input/output buffer dr ive register for standby mode note1: read-modify-write is prohibi ted for the registers pccr and pcfc. note2: when setting pc3-pc0 pins to int3-int0 input, set pcdr to ?0000?(prohibit input), and when driving pc3-pc0 pins to ?0?, execute halt instructi on. this setting generates int3-int0 inside. if don?t use external interrupt in halt condition, set like an in terrupt don?t generated. (e.g. change port setting) figure 3.5.25 register for port c pc2 setting 0 1 0 input port output port 1 int2 tb0out pc1 setting 0 1 0 input port output port 1 int1 ta3out pc0 setting 0 1 0 input port output port 1 int0 ta1out pc5 setting 0 1 0 input port output port 1 (reserved) (reserved) pc4 setting 0 1 0 input port output port 1 (reserved) (reserved) pc3 setting 0 1 0 input port output port 1 int3 (reserved) pcdr (008ch) pc6 setting 0 1 0 input port output port 1 ko8 (open drain) ea24 output at = 0 pc7 setting 0 1 0 input port output port 1 cszf i/o ea25 output at = 0
tmp92ca25 2007-02-28 92ca25-87 3.5.10 port f (pf0 to pf7) ports f0 to f6 are 7-bit general-purpose i/o po rts. resetting sets pf0 to pf6 to be input ports. it also sets all bits of the output latch register to ?1?. in addition to functioning as general-purpose i/o port pins, pf0 to pf6 can al so function as the i/o for serial channels 0 and 1. a pin can be enabled for i/o by writing a ?1? to the corresponding bit of the port f function register (pffc). port f7 is a 1-bit general-purpose output port. in addition to functioning as a general-purpose output port , pf7 can also f unction as the sdclk output. resetting sets pf7 to be an sdclk output port. (1) port f0 (txd0), f1 (rxd0), f2 (sclk0, cts0 ) ports f0 to f2 are general-purpose i/o ports. they also function as either sio0. each pin is detailed below. sio mode (sio0 module) uart, irda mode (sio0 module) pf0 txd0 (data output) txd0 (data output) pf1 rxd0 (data input) rxd0 (data input) pf2 sclk0 (clock input or output) 0 cts (clear to send) figure 3.5.26 port f0 internal data bus direction control (on bit basis) reset pfcr write pf write pf read pf0 (txd0) pffc write txd0 s output latch s b selector a s a bselector open drain set possible pffc2 function control (on bit basis)
tmp92ca25 2007-02-28 92ca25-88 figure 3.5.27 port f1 figure 3.5.28 port f2 internal data bus direction control (on bit basis) reset pfcr write pf read pf1 (rxd0) pf write s output latch s a selector b s b selector a pffc rxd0 p91rxd0 input internal data bus direction control (on bit basis) reset pfcr write pf read pf2 (sclk0, 0 cts ) pf write s output latch s a selector b s b selector a sclk0 input, 0 cts input pffc write selector s sclk0 output p92sclk0 input function control (on bit basis) pffc
tmp92ca25 2007-02-28 92ca25-89 (2) pf3, pf4, pf5, pf6, pf7 figure 3.5.29 port f3, f4. f5 and f6 figure 3.5.30 port f7 internal data bus direction control (on bit basis) reset pfcr write pf write pf read pf3 pf4 pf5 pf6 function control (on bit basis) pffc write s output latch s b selector a internal data bus reset pf read pf7 (sdclk) pf write s output latch function control (on bit basis) pffc write s a selector b sdclk
tmp92ca25 2007-02-28 92ca25-90 port f register 7 6 5 4 3 2 1 0 bit symbol pf7 pf6 pf 5 pf4 pf3 pf2 pf1 pf0 pf (003ch) read/write r/w after reset 1 data from external port (output latch register is set to ?1?) port f control register 7 6 5 4 3 2 1 0 bit symbol pf6c pf5c pf 4c pf3c pf2c pf1c pf0c pfcr (003eh) read/write w after reset 0 0 0 0 0 0 0 function refer to following table port f functon register 7 6 5 4 3 2 1 0 bit symbol pf7f pf6f pf5f pf4f pf3f pf2f pf1f pf0f pffc (003fh) read/write w after reset 1 0 0 0 0 0 0 0 function refer to following table rxd0 pin selection 0: port f1 1: port 91 refer to following table pf2 setting 0 1 0 input port, sclk0, 0 cts input from pf2 pin at = 0 from p92 pin at = 1 output port 1 (reserved) sclk0 output pf1 setting 0 1 0 input port, rxd0 input from pf1, output port 1 rxd0 input from p91 reserved pf0 setting 0 1 0 input port output port 1 (reserved) txd0 output pf4 setting 0 1 0 input output 1 (reserved) (reserved) pf3 setting 0 1 0 input port output port 1 (reserved) (reserved) pf5 setting 0 1 0 input port output port 1 (reserved) (reserved) pf6 setting 0 1 0 input port output port 1 (reserved) (reserved) pf7 setting 0 output port 1 sdclk output
tmp92ca25 2007-02-28 92ca25-91 port f functon register 2 7 6 5 4 3 2 1 0 bit symbol ? ? pf0f2 pffc2 (003dh) read/write w w w after reset 0 0 0 function always write ?0? always write ?0? output buffer 0: cmos 1: open drain port f drive register 7 6 5 4 3 2 1 0 bit symbol pf7d pf6d pf5d pf4d pf3d pf2d pf1d pf0d read/write r/w after reset 1 1 1 1 1 1 1 1 function input/output buffer dr ive register for standby mode note: read-modify-write is prohibited fo r the registers pfcr, pffc and pffc2. figure 3.5.31 register for port f pfdr (008fh)
tmp92ca25 2007-02-28 92ca25-92 3.5.11 port g (pg0 to pg3) pg0 to pg3 are 4-bit input ports and can also be used as the analog input pins for the internal ad converter. pg3 can also be us ed as the adtrg pin for the ad converter. pg2 and pg3 can also be used as the mx and my pins for a touch screen interface. figure 3.5.32 port g port g register 7 6 5 4 3 2 1 0 bit symbol pg2 pg2 pg1 pg0 pg (0040h) read/write r after reset data from external port note: the input channel selection of the ad converter and the permission for adtrg input are set by ad converter mode register admod1. port g drive register 7 6 5 4 3 2 1 0 bit symbol pg3d pg2d pgdr (0090h) read/write r/w after reset 1 1 function input/output buffer drive register for standby mode figure 3.5.33 register for port g internal data bus adtrg (only for pg3) port g read pg0 (an0), pg1 (an1), pg2 (an2, mx), pg3 (an3, my, adtrg ) ad converter channel selector ad read conversion result register tsicr0 tsicr0 (only for pg2, pg3) switch for tsi typ. 20
tmp92ca25 2007-02-28 92ca25-93 3.5.12 port j (pj0 to pj7) pj0 to pj4 and pj7 are 6-bit output ports. rese tting sets the output latch pj to ?1?, and they output ?1?. pj5 to pj6 are 2-bit i/o ports. in addition to functioning as a port, port j also functions as output pins for sdram ( sdras , sdcas , sdwe , sdlldqm, sdludqm and sdcke), sram ( srwr , srllb , srlub ) and nand flash (ndale and ndcle). the above settings are made using the function register pjfc. however, h either sdram or sram output signals for pj0 to pj2 are selected automatically according to the setting of the memory controller. figure 3.5.34 port j0, j1, j2, j3, j4 and j7 internal data bus function control 2 (on bit basis) reset pjfc2 write pj write pj read pj0 ( sdras , srllb ) pj1 ( sdcas , srlub ) pj2 ( sdwe , srwr ) pj3 (sdlldqm) pj4 (sdludqm) pj7 (sdcke) function control (on bit basis) pjfc write output latch s selector srllb , srlub , srwr sdras , sdcas , sdwe , sdlldqm, sdludqm, sdcke
tmp92ca25 2007-02-28 92ca25-94 figure 3.5.35 port j5 and j6 pj5 (ndale), pj6 (ndcle) internal data bus direction control (on bit basis) reset pjcrwrite pj write pj read function control (on bit basis) pjfc write ndale, ndcle s output latch s b selector a s selector
tmp92ca25 2007-02-28 92ca25-95 port j register 7 6 5 4 3 2 1 0 bit symbol pj7 pj6 pj 5 pj4 pj3 pj2 pj1 pj0 pj (004ch) read/write r/w after reset 1 data from external port (output latch register is set to ?1?) 1 1 1 1 1 port j control register 7 6 5 4 3 2 1 0 bit symbol pj6c pj5c pjcr (004eh) read/write w after reset 0 0 function 0: input 1: output port j function register 7 6 5 4 3 2 1 0 bit symbol pj7f pj6f pj5f pj4f pj3f pj2f pj1f pj0f pjfc (004fh) read/write w after reset 0 0 0 0 0 0 0 0 function 0: port 1: sdcke at = 1 0: port 1: ndcle at = 0, 0: port 1: ndale at = 0 0: port 1: sdludqm at = 1 0: port 1: sdlldqm at = 1 0: port 1 : sdwe , sdwr 0: port 1 : sdcas , srlub 0: port 1 : srras , srllb port j drive register 7 6 5 4 3 2 1 0 bit symbol pj7d pj6d pj5d pj4d pj3d pj2d pj1d pj0d pjdr (0093h) read/write r/w after reset 1 1 1 1 1 1 1 1 function input/output buffer dr ive register for standby mode note: read-modify-write is prohibi ted for the registers pjcr and pjfc. figure 3.5.36 register for port j
tmp92ca25 2007-02-28 92ca25-96 3.5.13 port k (pk0 to pk7) port k is a 4-bit output port. resetting sets the output latch pk to ?0?, and pk0 to pk3 pins output ?0?. pk4 to pk7 are 4-bit input ports. resetting sets the plcr to ?0?, and set input port. in addition to functioning as an output port, port k also functions as output pins for an lcd controller (lcp0, llp, lfr and lbcd) and pin for an spi controller (spclk, spcs , spdo and spdi). the above settings are made using the function register pkfc. figure 3.5.37 port k0 to k3 internal data bus reset output latch pk write s a selector b pk read pk0 (lcp0) pk1(llp) pk2 (lfr) pk3 (lbcd) function control (on bit basis) pkfc write output buffer lcp0, llp, lfr, lbcd
tmp92ca25 2007-02-28 92ca25-97 figure 3.5.38 port k4 figure 3.5.39 port k5 to k7 internal data bus direction contorl (on bit basis) reset pkcr write pk write pk read pk4 (spdi) function control (on bit basis) pkfc write s output latch s b selector a internal data bus reset pkcr write pk write pj read pk5 (spdo) pk6 ( spcs ) pk7 (spclk) function control (on bit basis) pkfc write s output latch s b selector a s a selector b spdo spcs spclk spdi input direction control (on bit basis)
tmp92ca25 2007-02-28 92ca25-98 port k register 7 6 5 4 3 2 1 0 bit symbol pk7 pk6 pk5 pk4 pk3 pk2 pk1 pk0 pk (0050h) read/write r/w after reset data from external port (output latch register is cleared to ?0?) 0 0 0 0 port k control register 7 6 5 4 3 2 1 0 bit symbol pk7c pk6c pk5c pk4c pkcr (0052h) read/write w after reset 0 0 0 0 function 0: input 1: output port k function register 7 6 5 4 3 2 1 0 bit symbol pk7f pk6f pk5f pk4f pk3f pk2f pk1f pk0f pkfc (0053h) read/write w after reset 0 0 0 0 0 0 0 0 function 0: port 1: spclk output 0: port 1: spcs output 0: port 1: spdo output 0: port 1: spdi output 0: port 1: lbcd 0: port 1: lfr 0: port 1: llp 0: port 1: lcp0 port k drive register 7 6 5 4 3 2 1 0 bit symbol pk7d pk6d pk5d pk4d pk3d pk2d pk1d pk0d pkdr (0094h) read/write r/w after reset 1 1 1 1 1 1 1 1 function input/output buffer drive register for standby mode note: read-modify-write is prohibited for the register pkfc. figure 3.5.40 register for port k pk5 setting 0 1 0 input port output port 1 reserved spdo output pk4 setting 0 1 0 input port output port 1 spdi input reserved pk7 setting 0 1 0 input port output port 1 reserved spclk output pk6 setting 0 1 0 input port output port 1 reserved spcs output
tmp92ca25 2007-02-28 92ca25-99 3.5.14 port l (pl0 to pl7) pl0 to pl3 are 4-bit output ports. resetting se ts the output latch pl to ?0?, and pl0 to pl3 pins output ?0?. pl4 to pl7 are 4-bit general-purpose i/o ports. each bit can be set individually for input or output using the control register plcr. rese tting resets the control register plcr to ?0? and sets pl4 to pl7 to input ports. in addition to functioning as a general-purpose i/o port, port l can also function as a data bus for an lcd controller (ld0 to ld7) and external bus open request input ( busrq ),answer output ( busak ). the above settings are made using the function register plfc. figure 3.5.41 register for port l0 to l3 figure 3.5.42 register for port l4 to l5 internal data bus direction control (on bit basis) reset plcr write pl write pl read pl4 to pl5 (ld4 to ld5) function control (on bit basis) plfc write s output latch s b selector a s a selector b ld4 to ld5 internal data bus reset r output latch pl write s a selector b pl read pl0 to pl3 (ld0 to ld3) function control (on bit basis) plfc write ld0 to ld3
tmp92ca25 2007-02-28 92ca25-100 figure 3.5.43 port l6 figure 3.5.44 port l7 internal data bus direction control (on bit basis) reset plcr write pl write pl read pl6 (ld6, busrq ) functino control (on bit basis) plfc write r output latch s b selector a s a selector b busrq internal data bus direction control (on bit basis) reset plcr write pl write pl read pl7 (ld7, busak ) function control (on bit basis) plfc write r output latch s b selector a s a selector b s a selector b ld7 busak busrq
tmp92ca25 2007-02-28 92ca25-101 port l register 7 6 5 4 3 2 1 0 bit symbol pl7 pl6 pl5 pl4 pl3 pl2 pl1 pl0 pl (0054h) read/write r/w after reset data from external port (output latch register is cleared to ?0?) 0 0 0 0 port l control register 7 6 5 4 3 2 1 0 bit symbol pl7c pl6c pl5c pl4c plcr (0056h) read/write w after reset 0 0 0 0 function 0: input 1: output port l function register 7 6 5 4 3 2 1 0 bit symbol pl7f pl6f pl5f pl4f pl3f pl2f pl1f pl0f plfc (0057h) read/write w after reset 0 0 0 0 0 0 0 0 function refer following table 0: port 1: data bus for lcdc (ld3 to ld0) port l drive register 7 6 5 4 3 2 1 0 bit symbol pl7d pl6d pl5d pl4d pl3d pl2d pl1d pl0d pldr (0095h) read/write r/w after reset 1 1 1 1 1 1 1 1 function input/output buffer drive register for standby mode note1: read-modify-write is prohibited for the registers plcr and plfc. note2: when port l are used at ld0 to ld7, if set pl6 pin to busrq function input temporarily, cpu may not be operate normally. therefore, set registers by following order. order register setting value (1) plcr 1 (2) plfc 1 figure 3.5.45 port l register pl5 setting 0 1 0 input port output port 1 reserved ld5 output pl4 setting 0 1 0 input port output port 1 reserved ld4 output pl7 setting 0 1 0 input port output port 1 busak output ld7 output pl6 setting 0 1 0 input port output port 1 busrq input ld6 output
tmp92ca25 2007-02-28 92ca25-102 3.5.15 port m (pm1 to pm2) pm1 and pm2 are 2-bit output ports. resetting sets the output latch pm to ?1?, and pm1 and pm2 pins output ?1?. in addition to functioning as a port, port m also functions as output pins for the rtc alarm ( alarm ), and as the output pin for the melody/alarm generator (mldalm, mldalm ). the above settings are made using the function register pmfc. only pm2 has two output functions - alarm and mldalm . these are selected using pm. figure 3.5.46 port m1 figure 3.5.47 port m2 internal data bus reset s output latch pm write s a selector b pm read pm1 (mldalm) function control (on bit basis) pmfc write mldalm internal data bus reset s output latch pm write s a selector b pm read pm2 ( alarm , mldalm ) function control (on bit basis) pmfc write mldalm s a selector b alarm
tmp92ca25 2007-02-28 92ca25-103 port m register 7 6 5 4 3 2 1 0 bit symbol pm2 pm1 pm (0058h) read/write r/w after reset 1 1 port m function register 7 6 5 4 3 2 1 0 bit symbol pm2f pm1f pmfc (005bh) read/write w after reset 0 0 function 0: port 1: alarm at = ?1? 1: mldalm at = ?0? 0 : port 1: mldalm output port m drive register 7 6 5 4 3 2 1 0 bit symbol pm2d pm1d pmdr (0096h) read/write r/w after reset 1 1 function input/output buffer drive register for standby mode note: read-modify-write is prohibited for the register pmfc. figure 3.5.48 register for port m
tmp92ca25 2007-02-28 92ca25-104 3.5.16 port n (pn0 to pn7) pn0 to pn7 are 8-bit general-purpose i/o port. each bit can be set individually for input or output. resetting sets port n to an input port. in addition to functioning as a general-purpos e i/o port, port n can also as interface pin for key-board (ko0 to ko7). this function can set to open-drain type output buffer. figure 3.5.49 port n internal data bus direction control (on bit basis) reset pncr write pn write pn read pn0 to pn7 (ko0 to ko7) function control (on bit basis) pnfc write s output latch s b selector a open drian enable
tmp92ca25 2007-02-28 92ca25-105 port n register 7 6 5 4 3 2 1 0 bit symbol pn7 pn6 pn5 pn4 pn3 pn2 pn1 pn0 pn (005ch) read/write r/w after reset data from external port (output latch register is set to ?1?) port n control register 7 6 5 4 3 2 1 0 bit symbol pn7c pn6c pn5c pn4c pn3c pn2c pn1c pn0c pncr (005eh) read/write w after reset 0 0 0 0 0 0 0 0 function 0: input 1: output port n function register 7 6 5 4 3 2 1 0 bit symbol pn7f pn6f pn5f pn4f pn3f pn2f pn1f pn0f pnfc (005fh) read/write w after reset 0 0 0 0 0 0 0 0 function 0: cmos output 1:open drain output port n drive register 7 6 5 4 3 2 1 0 bit symbol pn7d pn6d pn5d pn4d pn3d pn2d pn1d pn0d pndr (0097h) read/write r/w after reset 1 1 1 1 1 1 1 1 function input/output buffer drive register for standby mode note: read modify write is prohibited for the registers pncr and pnfc. figure 3.5.50 register for port n
tmp92ca25 2007-02-28 92ca25-106 3.6 memory controller 3.6.1 functions the tmp92ca25 has a memory controller with a variable 4-block address area that controls as follows. (1) 4-block address area support specifies a start address and a block size fo r the 4-block address area (block 0 to 3). ? sram or rom: all cs blocks (cs0 to cs3) are supported. ? sdram : only either cs1 or cs2 blocks are supported. ? page rom : only cs2 blocks are supported. ? nand flash : cs setting is not needed. (2) connecting memory specifications specifies sram, rom and sdram as memories that connect with the selected address areas. (3) data bus width selection whether 8 bits, 16 bits is selected as th e data bus width of the respective block address areas. (4) wait control wait specification bit in the control register and wait input pin control the number of waits in the external bus cycle. read cycle and write cycle can specify the number of waits individually. the number of waits is controlled in the 6 modes listed below. 0 waits, 1 wait, 2 waits, 3 waits, 4 waits n waits (controls with wait pin) 3.6.2 control register and operation after reset release this section describes the registers that control the memory controller, the state following reset release and the necessary settings. (1) control register the control registers of the memory controller are as follows and in table 3.6.1 and table 3.6.2. ? control register: bncsh/bncsl (n = 0 to 3, ex) sets the basic functions of the memory controller; the memory type that is connected, the number of waits which are read and written. ? memory start address register: msarn (n = 0 to 3) sets a start address in th e selected address areas. ? memory address mask register: mamr (n = 0 to 3) sets a block size in the selected address areas. ? page rom control register: pmemcr sets the method of accessing page rom. ? memory controls control register: memcr0 sets waveform selection of rd pin and setting method of 0 cs to 3 cs .
tmp92ca25 2007-02-28 92ca25-107 table 3.6.1 control register 7 6 5 4 3 2 1 0 bit symbol b0ww2 b0ww1 b0ww0 b0wr2 b0wr1 b0wr0 b0csl (0140h) read/write w w after reset 0 1 0 0 1 0 bit symbol b0e ? ? b0rec b0om1 b0om0 b0bus1 b0bus0 b0csh (0141h) read/write w after reset 0 0 (note) 0 (note) 0 0 0 0 0 bit symbol m0v20 m0v19 m0v18 m0v17 m0v16 m0v15 m0v14 to m0v9 m0v8 mamr0 (0142h) read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol m0s23 m0s22 m0s21 m0s20 m0s19 m0s18 m0s17 m0s16 msar0 (0143h) read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol b1ww2 b1ww1 b1ww0 b1wr2 b1wr1 b1wr0 b1csl (0144h) read/write w w after reset 0 1 0 0 1 0 bit symbol b1e ? ? b1rec b1om1 b1om0 b1bus1 b1bus0 b1csh (0145h) read/write w after reset 0 0 (note) 0 (note) 0 0 0 0 0 bit symbol m1v21 m1v20 m1v19 m1v18 m1v17 m1v16 m1v15 to m1v9 m1v8 mamr1 (0146h) read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol m1s23 m1s22 m1s21 m1s20 m1s19 m1s18 m1s17 m1s16 msar1 (0147h) read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol b2ww2 b2ww1 b2ww0 b2wr2 b2wr1 b2wr0 b2csl (0148h) read/write w w after reset 0 1 0 0 1 0 bit symbol b2e b2m ? b2rec b2om1 b2om0 b2bus1 b2bus0 b2csh (0149h) read/write w after reset 1 0 0 (note) 0 0 0 0 0 bit symbol m2v22 m2v21 m2v20 m2v19 m2v18 m2v17 m2v16 m2v15 mamr2 (014ah) read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol m2s23 m2s22 m2s21 m2s20 m2s19 m2s18 m2s17 m2s16 msar2 (014bh) read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol b3ww2 b3ww1 b3ww0 b3wr2 b3wr1 b3wr0 b3csl (014ch) read/write w w after reset 0 1 0 0 1 0 bit symbol b3e ? ? b3rec b3om1 b3om0 b3bus1 b3bus0 b3csh (014dh) read/write w after reset 0 0 (note) 0 (note) 0 0 0 0 0 bit symbol m3v22 m3v21 m3v20 m3v19 m3v18 m3v17 m3v16 m3v15 mamr3 (014eh) read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol m3s23 m3s22 m3s21 m3s20 m3s19 m3s18 m3s17 m3s16 msar3 (014fh) read/write r/w after reset 1 1 1 1 1 1 1 1 note 1: always write ?0?. note 2:read-modify-write is prohibited for bncs0 and bncsh (n = 0 to 3) registers.
tmp92ca25 2007-02-28 92ca25-108 table 3.6.2 control register 7 6 5 4 3 2 1 0 bit symbol bexom1 bexom0 bexbus1 bexbus0 bexcsh (0159h) read/write w after reset 0 0 0 0 bit symbol bexww2 bexww1 bexww0 bexwr2 bexwr1 bexwr0 bexcsl (0158h) read/write w w after reset 0 1 0 0 1 0 bit symbol opge opwr1 opwr0 pr1 pr0 pmemcr (0166h) read/write r/w after reset 0 0 0 1 0 bit symbol csdis rdtmg1 rdtmg0 memcr0 (0168h) read/write r/w after reset 0 0 0 note: read-modify-write is prohibited for bexcsh and bexcsl registers. (2) operation after reset release the start data bus width is determined by the state of am1/am0 pins just after reset release. the external memory is then accessed as follows am1 am0 start mode 0 0 don?t use this setting 0 1 start with 16-bit data bus (note) 1 0 start with 8-bit data bus (note) 1 1 don?t use this setting note: the memory to be used on starting after reset must be either nor flash or masked rom. nand flash and sdram cannot be used. am1/am0 pins are valid only just after rese t release. in other cases, the data bus width is set by the control register . on reset, only the control register (b2csh/b2csl) of the block address area 2 becomes effective automatically (b2c sh is set to ?1? on reset). the data bus width which is specified by am1/am0 pins is loaded to the bit for specification of the bus width of the control register in the block address area 2. the block address area 2 is set to 000000h to ffffffh address on reset (b2csh is reset to ?0?). after reset release, the block address areas are specified by the memory start address register (msarn) and the memory address mask register (mamrn). the control register (bncs) is then set. set the enable bit (bne) of the control register to ?1? to enable the setting.
tmp92ca25 2007-02-28 92ca25-109 3.6.3 basic functions and register setting this section describes the se tting of the block address area, the connecting memory and the number of waits out of the memory controller?s functions. (1) block address area specification the block address area is specified by two registers. the memory start address register (msarn ) sets the start address of the block address areas. the memory controller compares the register value and the address every bus cycle. the address bit which is masked by the memory address mask register (mamrn) is not compared by the memory controller. the block address area size is determined by setting the memory address ma sk register. the value that is set to the register is compared with the block address area on the bus. if the result is a match, the memory controller sets the chip select signal (csn) to ?low?. (i) memory start addr ess register setting the ms23 to ms16 bits of the memory start address register correspond with addresses a23 to a16 respectively. the lower start addresses a15 to a0 are always set to address 0000h. therefore the start addresses of the block address area are set to all 64 kbytes of addresses 000000h to ff0000h. (ii) memory address ma sk register setting the memory address mask register determines whether an address bit is compared or not. in register setting, ?0 ? is ?compare?, and ?1? is ?do not compare?. the address bits that can be set depends on the block address area. block address area 0: a20 to a8 block address area 1: a21 to a8 block address area 2 to 3: a22 to a15 the upper bits are always compared. the block address area size is determined by the result of the comparison. the size to be set depending on the block address area is as follows. size (bytes) cs area 256 512 32 k 64 k 128 k 256 k 512 k 1 m 2 m 4 m 8 m cs0 cs1 cs2 to cs3 note: after reset release, only the control register of the block address area 2 is valid. the control register of block address area 2 has the bit. if the bit is set to ?0?, block address area 2 is set to addresses 000000h to ffffffh. (this is the state fo llowing reset release .) if the bit is set to ?1?, the start address and the address area size are set, as in the other block address areas.
tmp92ca25 2007-02-28 92ca25-110 (iii) example of register setting to set the block address area 64 kbytes from address 110000h, set the register as follows. msar1 register bit 7 6 5 4 3 2 1 0 bit symbol m1s23 m1s22 m1s21 m1s20 m1s19 m1s18 m1s17 m1s16 specified value 0 0 0 1 0 0 0 1 m1s23 to m1s16 bits of the memory start address register msar1 correspond with address a23 to a16. a15 to a0 are set to ?0?. therefore, if msar1 is set to the above mentioned value, the start address of the block address area is set to address 110000h. mamr1 register bit 7 6 5 4 3 2 1 0 bit symbol m1v21 m1v20 m1v19 m1v18 m1v17 m1v16 m1v15 to m1v9 m1v8 specified value 0 0 0 0 0 0 0 1 m1v21 to m1v16 and m1v8 bits of the memory address mask register mamr1 are set whether addresses a21 to a16 and a8 are compared or not. in register setting, ?0? is ?compare?, and ?1? is ?do not compare?. m1v15 to m1v9 bits determine whether addresses a15 to a9 ar e compared or not with bit 1. a23 and a22 are always compared. when set as above, a23 to a9 are compared with the value that is set as the start addresses. therefore, 512 bytes (addresses 110000h to 1101ffh) are set as block address area 1, and if it is compared with the addresses on the bus, the chip select signal cs1 is set to ?low?. the other block address area sizes are specified in the same way. a23 and a22 are always compared with block address area 0. whether a20 to a8 are compared or not is determined by the register. similarly, a23 is always compared with block address areas 2 to 5. whether a22 to a15 are compared or not is determined by the register. note 1: when the set block address area ov erlaps with the built-in memory area, or both two address areas overlap, t he block address area is processed according to priority as follows. note 2: if an address area other than 0 cs to 3 cs is accessed, this area is regarded as csex . therefore, wait number and data bus width controls follow the setting of csex (bexcsh, bexcsl register). built-in i/o > built-in memory > block address area 0 > 1 > 2 > 3
tmp92ca25 2007-02-28 92ca25-111 (2) connection memory specification setting the bit of the control register (bncsh) specifies the memory type that is connected with the block address areas. the interface signal is outputted according to the set memory as follows. bit (bncsh register) function 0 0 sram/rom (default) 0 1 reserved 1 0 reserved 1 1 sdram note 1: sdram should be set to block either 1 or 2. note 2: set ?00? for nand flash, ram built-in lcdd. (3) data bus width specification the data bus width is set for every block a ddress area. the bus size is set by setting the control register (bncsh) as follows. bit (bncsh register) bnbus 1 bnbus 0 function 0 0 8-bit bus mode (default) 0 1 16-bit bus mode 1 0 reserved 1 1 don?t use this setting note: sdram should be set to either ?01? (16-bit bus). this method of changing the data bus width depending on the accessing address is called ?dynamic bus sizing?. the part of the data bus to which the data is output depends on the data size, baus width and start address. number of external data bus pin in tmp92ca25 are 16 pins. therefore, please ignore case of memory data size is 32 in each tables. note: since there is a possibility of abnormal writing/reading of the data if two memories with different bus width are put in c onsecutive addresses, do not execute an access to both memories with one command.
tmp92ca25 2007-02-28 92ca25-112 cpu data operand data size (bit) operand start address memory data size (bit) cpu address d31 to d24 d23 to d16 d15 to d8 d7 to d0 4n + 0 8/16/32 4n + 0 xxxxx xxxxx xxxxx b7 to b0 8 4n + 1 xxxxx xxxxx xxxxx b7 to b0 4n + 1 16/32 4n + 1 xxxxx xxxxx b7 to b0 xxxxx 8/16 4n + 2 xxxxx xxxxx xxxxx b7 to b0 4n + 2 32 4n + 2 xxxxx b7 to b0 xxxxx xxxxx 8 4n + 3 xxxxx xxxxx xxxxx b7 to b0 16 4n + 3 xxxxx xxxxx b7 to b0 xxxxx 8 4n + 3 32 4n + 3 b7 to b0 xxxxx xxxxx xxxxx (1) 4n + 0 xxxxx xxxxx xxxxx b7 to b0 8 (2) 4n + 1 xxxxx xxxxx xxxxx b15 to b8 4n + 0 16/32 4n + 0 xxxxx xxxxx b15 to b8 b7 to b0 (1) 4n + 1 xxxxx xxxxx xxxxx b7 to b0 8 (2) 4n + 2 xxxxx xxxxx xxxxx b15 to b8 (1) 4n + 1 xxxxx xxxxx b7 to b0 xxxxx 16 (2) 4n + 2 xxxxx xxxxx xxxxx b15 to b8 4n + 1 32 4n + 1 xxxxx b15 to b8 b7 to b0 xxxxx (1) 4n + 2 xxxxx xxxxx xxxxx b7 to b0 8 (2) 4n + 1 xxxxx xxxxx xxxxx b15 to b8 16 4n + 2 xxxxx xxxxx b15 to b8 b7 to b0 4n + 2 32 4n + 2 b15 to b8 b7 to b0 xxxxx xxxxx (1) 4n + 3 xxxxx xxxxx xxxxx b7 to b0 8 (2) 4n + 4 xxxxx xxxxx xxxxx b15 to b8 (1) 4n + 3 xxxxx xxxxx b7 to b0 xxxxx 16 (2) 4n + 4 xxxxx xxxxx xxxxx b15 to b8 (1) 4n + 3 b7 to b0 xxxxx xxxxx xxxxx 16 4n + 3 32 (2) 4n + 4 xxxxx xxxxx xxxxx b15 to b8 (1) 4n + 0 xxxxx xxxxx xxxxx b7 to b0 (2) 4n + 1 xxxxx xxxxx xxxxx b15 to b8 (3) 4n + 2 xxxxx xxxxx xxxxx b23 to b16 8 (4) 4n + 3 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 0 xxxxx xxxxx b15 to b8 b7 to b0 16 (2) 4n + 2 xxxxx xxxxx b31 to b24 b23 to b16 4n + 0 32 4n + 0 b31 to b24 b23 to b16 b15 to b8 b7 to b0 (1) 4n + 0 xxxxx xxxxx xxxxx b7 to b0 (2) 4n + 1 xxxxx xxxxx xxxxx b15 to b8 (3) 4n + 2 xxxxx xxxxx xxxxx b23 to b16 8 (4) 4n + 3 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 1 xxxxx xxxxx b7 to b0 xxxxx (2) 4n + 2 xxxxx xxxxx b23 to b16 b15 to b8 16 (3) 4n + 4 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 1 b23 to b16 b15 to b8 b7 to b0 xxxxx 4n + 1 32 (2) 4n + 4 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 2 xxxxx xxxxx xxxxx b7 to b0 (2) 4n + 3 xxxxx xxxxx xxxxx b15 to b8 (3) 4n + 4 xxxxx xxxxx xxxxx b23 to b16 8 (4) 4n + 5 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 2 xxxxx xxxxx b15 to b8 b7 to b0 16 (2) 4n + 4 xxxxx xxxxx b31 to b24 b23 to b16 (1) 4n + 2 b15 to b8 b7 to b0 xxxxx xxxxx 4n + 2 32 (2) 4n + 4 xxxxx xxxxx b31 to b24 b23 to b16 (1) 4n + 3 xxxxx xxxxx xxxxx b7 to b0 (2) 4n + 4 xxxxx xxxxx xxxxx b15 to b8 (3) 4n + 5 xxxxx xxxxx xxxxx b23 to b16 8 (4) 4n + 6 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 3 xxxxx xxxxx b7 to b0 xxxxx (2) 4n + 4 xxxxx xxxxx b23 to b16 b15 to b8 16 (3) 4n + 6 xxxxx xxxxx xxxxx b31 to b24 (1) 4n + 3 b7 to b0 xxxxx xxxxx xxxxx 32 4n + 3 32 (2) 4n + 4 xxxxx b31 to b24 b23 to b16 b15 to b8 xxxxx: during a read, data input to the bus ignored. at write, the bus is at high impedance and the write strobe signal remains non active.
tmp92ca25 2007-02-28 92ca25-113 (4) wait control the external bus cycle completes a wait of at least two states (100 ns at f sys = 20 mhz). setting the and of bncsl specifies the number of waits in the read cycle and the write cycle. is set using the same method as . / (bncsl register) function 0 0 1 2 states (0 waits) access fixed mode 0 1 0 3 states (1 wait) access fixed mode (default) 1 0 1 4 states (2 waits) access fixed mode 1 1 0 5 states (3 waits) access fixed mode 1 1 1 6 states (4 waits) access fixed mode 0 1 1 wait pin input mode others (reserved) note 1: for sdram, the above setting is ine ffective. refer to 3.16 sdram controller. note 2: for nand flash, this setting is ineffective. for ram built-in lcdd, this setting is effective. (i) waits number fixed mode the bus cycle is completed following the number of states set. the number of states is selected from 2 states (0 waits) to 6 states (4 waits). (ii) wait pin input mode this mode samples the wait input pins. in this mode, a wait is inserted continuously while the signal is active. the bus cycle is a minimum 2 states. the bus cycle is completed if the wait signal is non active (?high? level) at the second state. the bus cycle continues if the wait signal is active after 2 states or more.
tmp92ca25 2007-02-28 92ca25-114 (5) recovery (data hold) cycle control some memory is defined by ac specification about data hold time by ce or oe for read cycle. therefore, a data conflict problem may occur. to avoid this problem, 1-dummy cycle can be inserted after cs m-block access cycle by setting ?1? to bmcsh register. this 1-dummy cycle is inserted when th e next cycle is for another cs-block. (bncsh register) 0 no dummy cycle is inserted (default). 1 dummy cycle is inserted. ? when no dummy cycle is inserted (0 waits) ? when inserting a dummy cycle (0 waits) above function (bncsh) is inserted dummy cycle and performance go down. therefore, tmp92ca25 have changing function of rd pin falling timing except for . this function can be changed falling timing of rd pin by changing memcr0. this function can be av oided a.c speck shortage about data-hold time from oe , and it can be avoided data conflict problem. this function can use with . and, th is function doesn?t depend on cs block. cycle until from memory oe to data output becomes short by using this function. if using this function, please be careful. (memcr0 register) 00 rd ?h? pulse width = 0.5t(default) 01 rd ?h? pulse width = 0.75t 10 rd ?h? pulse width = 1.0t 11 (reserved) sdclk a23 to a0 csm csn rd sdclk a23 to a0 csm csn rd dumm y
tmp92ca25 2007-02-28 92ca25-115 a23 to a0 csn t1 t2 sdclk (20mhz) srxxb input d15 to d0 = ?00? = ?01? = ?10? rd
tmp92ca25 2007-02-28 92ca25-116 (6) basic bus timing (a) external read/write cycle (0 waits) (b) external read/write cycle (1 wait) csn wrxx rd , srxxb a 23 to a0 in p ut output read write sdclk (20 mhz) d15 to d0 d15 to d0 t1 t2 srwr , srxxb csn wrxx rd , srxxb a 23 to a0 output sdclk (20 mhz) d15 to d0 d15 to d0 t1 tw in p ut read write t2 srwr , srxxb
tmp92ca25 2007-02-28 92ca25-117 (c) external read/write cycle (0 waits at wait pin input mode) (d) external read/write cycle (n waits at wait pin input mode) csn wrxx rd , srxxb a 23 to a0 in p ut output read write sdclk (20 mhz) d15 to d0 d15 to d0 t1 t2 srwr , srxxb wait sampling csn wrxx rd , srxxb a 23 to a0 output sdclk (20 mhz) d15 to d0 d15 to d0 t1 tw in p ut read write t2 srwr , srxxb wait sampling sampling
tmp92ca25 2007-02-28 92ca25-118 example of wait input cycle (5 waits) csn srwr rd wait d q ck res d q ck res d q ck res d q ck res d q ck res sdclk ff0 ff1 ff2 ff3 ff4 sdclk (20 mhz) 1 2 3 4 5 6 7 csn rd wait ff _ res ff0 _ d ff0 _ q ff1 _ q ff2 _ q ff3 _ q
tmp92ca25 2007-02-28 92ca25-119 (7) connecting external memory figure 3.6.1 shows an example of how to connect an external 16-bit sram and 16-bit nor flash to the tmp92ca25. figure 3.6.1 example of external 16-bit sram and nor flash connection tmp92ca25 16-bit sram rd srllb srlub srwr 0 cs d [15:0] a0 a1 a2 a3 2 cs oe lds uds r/w ce i/o [16:1] a 0 a 1 a 2 16-bit nor flash oe we ce dq [15:0] a 0 a 1 a 2 not connect
tmp92ca25 2007-02-28 92ca25-120 3.6.4 rom control (page mode) this section describes rom page mode acce ssing and how to set registers. rom page mode is set by the page rom control register. (1) operation and how to set the registers the tmp92ca25 supports rom access of the page mode. rom access of the page mode is specified only in block address area 2. rom page mode is set by the page rom control register (pmemcr). setting of the pmemcr register to ?1? sets the memory access of the block address area to rom page mode access. the number of read cycles is set by the of the pmemcr register. (pmemcr register) number of cycle in a page 0 0 1 state (n-1-1-1 mode) (n 2) 0 1 2 state (n-2-2-2 mode) (n 3) 1 0 3 state (n-3-3-3 mode) (n 4) 1 1 (reserved) note: set the number of waits (?n?) using t he control register (bncsl) in each block address area. the page size (the number of bytes) of rom in the cpu size is set by the of the pmemcr register. when data is read ou t up to the border of the set page, the controller completes the page reading operation. the start data of the next page is read in the normal cycle. the following data is set to page read again. bit (pmemcr register) rom page size 0 0 64 bytes 0 1 32 bytes 1 0 16 bytes (default) 1 1 8 bytes figure 3.6.2 page mode access timing (8-byte example) sdclk a0 to a23 2 cs rd d0 to d31 + 0 + 1 + 2 + 3 data input data input data input data input t ad3 t ad2 t ad2 t ad2 t h a t hr t rd3 t h a t h a t h a t cyc
tmp92ca25 2007-02-28 92ca25-121 3.6.5 cautions (1) note on timing between cs and rd if the parasitic capacitance of the rd (read signal) is greater than that of the cs (chip select signal), it is possible that an unintended read cycle occu rs due to a delay in the read signal. such an unintended read cycle may cause a problem, as in the case of (a) in figure 3.6.3. figure 3.6.3 read signal delay read cycle example: when using an externally connec ted nor flash which uses jedec standard commands, note that the toggle bit ma y not be read out correctly. if the read signal in the cycle immediately precedi ng the access to the nor flash does not go high in time, as shown in figure 3.6.4, an unintended read cycle like the one shown in (b) may occur. figure 3.6.4 nor flash toggle bit read cycle when the toggle bit is reversed by this unexpected read cycle, the cpu cannot read the toggle bit correctly since it always reads same value for the toggle bit. to avoid this phenomenon, data polling function control is recommended. rd a 23 to a0 sdclk (20 mhz) csm csn (a) a23 to a0 sdclk (20 mhz) nor flash chip select rd (b) toggle bit memory access toggle bit rd cycle
tmp92ca25 2007-02-28 92ca25-122 (2) note on nand flash area setting, lcd dr iver area setting with built-in ram figure 3.6.5 shows a memory map for a na nd flash and ram built-in lcd driver. since it is recommended that cs3 area be assigned to the address 000000h to 3fffffh, the following explanation is given. in this case, the nand flash and ram buil t-in lcd driver overlap with cs3 area. however, each access contro l circuit in the tmp92ca25 operates independently. so, if a program on cs3 area accesses nand flash, both cs3 and nand flash will be accessed at the same time and a proble m such as data conflict will occur. to avoid this phenomenon, tmp92ca25 ha ve memcr0. if set to ?1?, cs3 pin don?t active in case of access 001d 00h to 001fffh (768b) in area that is set as cs3 area. above phenomenon can be av oided by this setting. this function is valid not only cs3 but also all 0 cs to 3 cs pins. note1: in above setting, the address from 0 00000h to 005fffh of 24 kbytes for cs3?s memory can?t be used. note2: 512 byte area (001d00h to 001effh ) for nand flash are fixedlike a following without relation ship to setting cs block. therefore, nand flas h area don?t conform to cs3 area setting. (nand flash area specification) 1. bus width : fixed 8 bit 2. wait control : depend on ndnfspr of nand flash controller figure 3.6.5 recommended cs3 and cs0 setting nand flash (512byte) (no assigned) lcdd with built-in ram (16byte) common-x (2 m byte) local-x (2 m byte) internal i/o internal ram (10k byte) 0 cs 3 cs pins become to non-active by setting memcr0 to ?1? 000000h 001d00h 001f00h 001fe0h 001ff0h 00 2 000 h 400000h 004800h 008000h 200000h cs3 area setting 000000h~3fffffh (4 mb)
tmp92ca25 2007-02-28 92ca25-123 (3) the cautions at the time of the functional change of a csn . a chip select signal output has the case of a combination terminal with a general-purpose port function. in this case, an output latch register and a function control register are initialized by the reset action, and an object terminal is initialized by the port output (?1? or ?0?) by it. functional change although an object terminal is changed from a port to a chip select signal output by setting up a function control register (pnf c register), the short pulse for several ns may be outputted to the changing timing. although it does not become especially a problem when using the usual memory, it ma y become a problem when using a special memory. x x n+2 internal address bus function control signal pxx n n+2 a23 to a0 a port is set as csn . n output port csn internal signal external signal output pulse t ad3 * xx is a function register address.(when an output port is initialized by ?0?) the measure by software the countermeasures in s/w for avoiding this phenomenon are explained. since cs signal decodes the address of the access area and is generated, an unnecessary pulse is outputted by access to the object cs area immediately after setting it as a csn function. then, if intern al area is accessed also immediately after setting a port as cs function, an unnecessary pulse will not output. 1. the ban on interruption under functional change (di command) 2. a dummy command is added in order to carry out continuous internal access. 3. (access to a functional change register is corresponded by 16-bit command. (ldw command)) xx+1 n+2 internal address bus function control signal pxx n n+2 a23 to a0 a port is set as csn . xx output port csn internal signal external signal dummy access
tmp92ca25 2007-02-28 92ca25-124 3.7 8-bit timers (tmra) the tmp92ca25 features 4 built-in 8-bit timers (tmra0-tmra3). these timers are paired into two modules: tmra01 and tmra23. each module consists of two channels and can operate in any of the following four operating modes. ? 8-bit interval timer mode ? 16-bit interval timer mode ? 8-bit programmable square wave pulse generation output mode (ppg: variable duty cycl e with variable period) ? 8-bit pulse width modulation output mode (pwm: variable duty cycle with constant period) figure 3.7.1 and figure 3.7.2 show block diagrams for tmra01 and tmra23. each channel consists of an 8-bit up counter, an 8-bit comparator and an 8-bit timer register. in addition, a timer flip-flop and a prescale r are provided for each pair of channels. the operation mode and timer flip-flops are cont rolled by a five-byte sfr (special function register). each of the two modules (tmra01 and tmra23) can be operated independently. all modules operate in the same manner; hence only the operation of tmra01 is explained here. the contents of this chapter are as follows. 3.7.1 block diagrams 3.7.2 operation of each circuit 3.7.3 sfr 3.7.4 operation in each mode (1) 8-bit timer mode (2) 16-bit timer mode (3) 8-bit ppg (programmable pulse generation) output mode (4) 8-bit pwm (pulse width modulation) output mode (5) mode settings table 3.7.1 registers and pins for each module module tmra01 tmra23 input pin for external clock no no external pin output pin for timer flip-flop ta1out (shared with pc0) ta3out (shared with pc1) timer run register ta01run (1100h) ta23run (1108h) timer register ta0reg (1102h) ta1reg (1103h) ta2reg (110ah) ta3reg (110bh) timer mode register ta01mod (1104h) ta23mod (110ch) sfr (address) timer flip-flop control register ta1ffcr (1105h) ta3ffcr (110dh)
tmp92ca25 2007-02-28 92ca25-125 3.7.1 block diagrams figure 3.7.1 tmra01 block diagram t1 t16 t256 8-bit comparator (cp1) 8-bit up counter (cp0) 8-bit up counter (uc0) 2 n over flow 8-bit up counter (uc1) timer flip-flop ta1ff match detect match detect 8-bit timer register ta1reg t1 t4 t16 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 run/clea r prescale r ta01mod prescale r clock: t0 ta01run selecto r 8-bit timer register ta0reg ta01mod ta01mod tmra0 interrupt output: intta0 tmra0 interrupt output: ta0trg ta01mod ta01run ta1ffcr timer flip-flop output: ta1out tmra1 interrupt output: intta1 internaldata bus ta01run ta01run selecto r internal data bus t a 0trg register buffer 0
tmp92ca25 2007-02-28 92ca25-126 figure 3.7.2 tmra23 block diagram t1 t16 t256 8-bit comparator (cp3) 8-bit comparator (cp2) 8-bit up counter (uc2) 2 n over flow 8-bit up comparator (uc3) timer flip-flop ta3ff match detect match detect 8-bit timer register ta3reg t1 t4 t16 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 run/clea r prescale r ta23mod prescale r clock: t0 ta23run selecto r 8-bit timer register ta2reg ta23mod ta23mod tmra2 interrupt output: intta2 tmra2 interrupt output: ta2trg ta23mod ta23run ta3ffcr timer flip-flop output: ta3out tmra3 interrupt output: intta3 internal data bus ta23run ta23run selecto r internal data bus ta2trg register buffer 2
tmp92ca25 2007-02-28 92ca25-127 3.7.2 operation of each circuit (1) prescalers a 9-bit prescaler generates the input clock to tmra01. the clock t0 is divided into 8 by the cpu clock f sys and input to this prescaler. the prescaler operation can be controlled using ta01run in the timer control register. setting to ?1? starts the count; setting to ?0? clears the prescaler to ?0? and stops operation. table 3.7.2 shows the various prescaler output clock resolutions. table 3.7.2 prescaler output clock resolution timer counter input clock tmra prescaler taxmod system clock selection syscr1 clock gear selection syscr1 ? t1(1/2) t4(1/8) t16(1/32) t256(1/512) 1 (fs) ? fs/16 fs/64 fs/256 fs/4096 000 (1/1) fc/16 fc/64 fc/256 fc/4096 001 (1/2) fc/32 fc/128 fc/512 fc/8192 010 (1/4) fc/64 fc/256 fc/1024 fc/16384 011 (1/8) fc/128 fc/512 fc/2048 fc/32768 0 (fc) 100 (1/16) 1/8 fc/256 fc/1024 fc/4096 fc/65536 xxx: don?t care (2) up counters (uc0 and uc1) these are 8-bit binary counters which count up the input clock pulses for the clock specified by ta01mod. the input clock for uc0 is selectable and ca n be either the external clock input via the ta0in pin or one of the three internal clocks t1, t4 or t16. the clock setting is specified by the value set in ta01mod. the input clock for uc1 depends on the operation mode. in 16-bit timer mode, the overflow output from uc0 is used as the input clock. in any mode other than 16-bit timer mode, the input clock is selectable and can either be one of the internal clocks t1, t16 or t256, or the comparator output (the match detection signal) from tmra0. for each interval timer the timer operation control register bits ta01run and ta01run can be used to stop and clear the up counters and to control their count. a reset clears both up counters, stopping the timers.
tmp92ca25 2007-02-28 92ca25-128 (3) timer registers (ta0reg and ta1reg) these are 8-bit registers, which can be used to set a time interval. when the value set in the timer register ta0reg or ta1reg matches the value in the corresponding up counter, the comparator match detect signal goes active. if the value set in the timer register is 00h, the signal goes active when the up counter overflows. ta0reg has a double buffer structure, ma king a pair with the register buffer. the setting of the bit ta01run determines whether ta0reg?s double buffer structure is enabled or disabled. it is disabled if = ?0? and enabled if = ?1?. when the double buffer is enabled, data is transferred from the register buffer to the timer register when a 2 n overflow occurs in pwm mode, or at the start of the ppg cycle in ppg mode. hence the double buffer cannot be used in timer mode. a reset initializes to ?0?, disabling the double buffer. to use the double buffer, write data to the timer register, set to ?1?, and write the following data to the re gister buffer. figure 3.7.3 show the configuration of ta0reg. figure 3.7.3 configuration of ta0reg note: the same memory address is allocated to the timer register and the register buffer. when = 0, the same value is written to the register buffer and the timer register; when = 1, only the register buffer is written to. the address of each timer register is as follows. ta0reg: 001102h ta1reg: 001103h ta2reg: 00110ah ta3reg: 00110bh all these registers are write only and cannot be read. internal data bus timer registers 0 (ta0reg) register buffers 0 shift trigger b selector sa write write to ta0reg matching detection ppg cycle 2 n overflow of pwm ta01run
tmp92ca25 2007-02-28 92ca25-129 (4) comparator (cp0) the comparator compares the value in an up counter with the value set in a timer register. if they match, the up counter is cleared to ?0? and an interrupt signal (intta0 or intta1) is generated. if timer flip-flop inversion is enabled, the timer flip-flop is inverted at the same time. (5) timer flip-flop (ta1ff) the timer flip-flop (ta1ff) is a flip-flop inverted by the match detects signals (8-bit comparator output) of each interval timer. whether inversion is enabled or disabled is determined by the setting of the bit ta1ffcr in the timer flip-flops cont rol register. a reset clears the value of ta1ff to ?0?. writing ?01? or ?10? to ta1 ffcr sets ta1ff to ?0? or ?1?. writing ?00? to these bits inverts the value of ta1ff (this is known as software inversion). the ta1ff signal is output via the ta1out pin (which can also be used as pc0). when this pin is used as the timer output, the timer flip-flop should be set beforehand using the port c function register pccr and pcfc. note: when the double buffer is enabled for an 8-bit timer in pwm or ppg mode, caution is required as explained below. if new data is written to the register buffer immediately before an overflow occurs by a match between the timer register value and t he up-counter value, the timer flip-flop may output an unexpected value. for this reason, make sure that in pwm mode new data is written to the register buffer by six cycles (f sys 6) before the next overflow occurs by using an overflow interrupt. when using ppg mode, make sure that new data is written to the register buffer by six cycles before the next cycle compare matc h occurs by using a cycle compare match interrupt. example when using pwm mode ta1out 2 n overflow interrupt (intta0) t pwm (pwm cycle) match between ta0reg and up-counter desired pwm cycle change point write new data to the register buffer before the next overflow occurs by using an overflow interrupt
tmp92ca25 2007-02-28 92ca25-130 3.7.3 sfr tmra01 run register 7 6 5 4 3 2 1 0 bit symbol ta0rde i2ta01 ta01prun ta1run ta0run ta01run (1100h) read/write r/w r/w after reset 0 0 0 0 0 tmra01 prescaler up counter (uc1) up counter (uc0) function double buffer 0: disable 1: enable idle2 0: stop 1: operate 0: stop and clear 1: run (count up) note: the values of bits 4 to 6 of ta01run are undefined when read. tmra23 run register 7 6 5 4 3 2 1 0 bit symbol ta2rde i2ta23 ta23prun ta3run ta2run ta23run (1108h) read/write r/w r/w after reset 0 0 0 0 0 tmra23 prescaler up counter (uc3) up counter (uc4) function double buffer 0: disable 1: enable idle2 0: stop 1: operate 0: stop and clear 1: run (count up) note: the values of bits 4 to 6 of ta23run are undefined when read. figure 3.7.4 tmra01 run regist er and tmra23 run register timer run/stop control 0 stop and clear 1 run (count up) ta0reg double buffer control 0 disable 1 enable timer run/stop control 0 stop and clear 1 run (count up) ta2reg double buffer control 0 disable 1 enable
tmp92ca25 2007-02-28 92ca25-131 tmra01 mode register 7 6 5 4 3 2 1 0 bit symbol ta01m1 ta01m0 pwm01 pwm 00 ta1clk1 ta1clk0 ta0clk1 ta0clk0 ta01mod (1104h) read/write r/w after reset 0 0 0 0 0 0 0 0 function operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra1 00: ta0trg 01: t1 10: t16 11: t256 source clock for tmra0 00: reserved 01: t1 10: t4 11: t16 tmra0 source clock selection 00 (reserved) 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) tmra1 source clock selection ta01mod 01 ta01mod = 01 00 comparator output from tmra0 01 t1 10 t16 11 t256 overflow output from tmra0 (16-bit timer mode) pwm cycle selection 00 reserved 01 2 6 source clock 10 2 7 source clock 11 2 8 source clock tmra01 operation mode selection 00 8-bit timers 2ch 01 16-bit timer 10 8-bit ppg 11 8-bit pwm (tmra0) 8-bit timer (tmra1) figure 3.7.5 tmra mode register
tmp92ca25 2007-02-28 92ca25-132 tmra23 mode register 7 6 5 4 3 2 1 0 bit symbol ta23m1 ta23m0 pwm21 pwm 20 ta3clk1 ta3clk0 ta2clk1 ta2clk0 ta23mod (110ch) read/write r/w after reset 0 0 0 0 0 0 0 0 function operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra3 00: ta2trg 01: t1 10: t16 11: t256 source clock for tmra2 00: reserved 01: t1 10: t4 11: t16 tmra2 source clock selection 00 (reserved) 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) tmra3 source clock selection ta23mod 01 ta23mod = 01 00 comparator output from tmra2 01 t1 10 t16 11 t256 overflow output from tmra2 (16-bit timer mode) pwm cycle selection 00 reserved 01 2 6 source clock 10 2 7 source clock 11 2 8 source clock tmra23 operation mode selection 00 8-bit timers 2ch 01 16-bit timer 10 8-bit ppg 11 8-bit pwm (tmra2) 8-bit timer (tmra3) figure 3.7.6 tmra23 mode register
tmp92ca25 2007-02-28 92ca25-133 tmra1 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ta1ffc1 ta1ffc0 ta1ffie ta1ffis ta1ffcr (1105h) read/write r/w after reset 1 1 0 0 read-modify- write instruction is prohibited. function 00: invert ta1ff 01: set ta1ff 10: clear ta1ff 11: don?t care ta1ff control for inversion 0: disable 1: enable ta1ff inversion select 0: tmra0 1: tmra1 inverse signal for timer flop-flop 1 (ta1ff) (don?t care except in 8-bit timer mode) 0 inversion by tmra0 1 inversion by tmra1 inversion of ta1ff 0 disabled 1 enabled control of ta1ff 00 inverts the value of ta1ff 01 sets ta1ff to ?1? 10 clears ta1ff to ?0? 11 don?t care note: the values of bits4 to 6 of ta1ffcr are undefined when read. figure 3.7.7 tmra flip-f lop control register
tmp92ca25 2007-02-28 92ca25-134 tmra3 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ta3ffc1 ta3ffc0 ta3ffie ta3ffis ta3ffcr (110dh) read/write r/w after reset 1 1 0 0 read- modify- write instruction is prohibited. function 00: invert ta3ff 01: set ta3ff 10: clear ta3ff 11: don?t care ta3ff control for inversion 0: disable 1: enable ta3ff inversion select 0: tmra2 1: tmra3 inverse signal for timer flip-flop 3 (ta3ff) (don?t care except in 8-bit timer mode) 0 inversion by tmra2 1 inversion by tmra3 inversion of ta3ff 0 disabled 1 enabled control of ta3ff 00 inverts the value of ta3ff 01 sets ta3ff to ?1? 10 clears ta3ff to ?0? 11 don?t care note: the values of bits4 to 6 of ta3ffcr are undefined when read. figure 3.7.8 tmra3 flip-f lop control register
tmp92ca25 2007-02-28 92ca25-135 tmra register symbol address 7 6 5 4 3 2 1 0 ? w ta0reg 1102h undefined ? w ta1reg 1103h undefined ? w ta2reg 110ah undefined ? w ta3reg 110bh undefined note: read-modify-write instruction is prohibited. figure 3.7.9 8-bit timers register
tmp92ca25 2007-02-28 92ca25-136 3.7.4 operation in each mode (1) 8-bit timer mode both tmra0 and tmra1 can be used independently as 8-bit interval timers. 1. generating interrupts at a fixed interval (using tmra1) to generate interrupts at constant inte rvals using tmra1 (intta1), first stop tmra1 then set the operation mode, input clock and a cycle to ta01mod and ta1reg register, respecti vely. then, enable the interrupt intta1 and start tmra1 counting. example: to generate an intta1 interrupt every 40 s at f c = 40 mhz, set each register as follows: msb lsb 7 6 5 4 3 2 1 0 ta01run ? x x x ? ? 0 ? stop tmra1 and clear it to ?0?. ta01mod 0 0 x x 0 1 ? ? select 8-bit timer mode and select t1 ( = (16/fc)s at f c = 40 mhz) as the input clock. ta1reg 0 1 1 0 0 1 0 0 set treg1 to 40 s t1 = 100 = 64h. inteta01 x 1 0 1 ? ? ? ? enable intta1 and set it to level 5. ta01run ? x x x ? 11 ? start tmra1 counting. x: don?t care, ? : no change select the input clock using table 3.7.3. table 3.7.3 selecting interrupt interval and the input clock using 8-bit timer input clock interrupt interval (at f sys = 20 mhz) resolution t1 (8/f sys ) 0.4 s to 102.4 s 0.4 s t4 (32/f sys ) 1.6 s to 409.6 s 1.6 s t16 (128/f sys ) 6.4 s to 1.638 ms 6.4 s t256 (2048/f sys ) 102.4 s to 26.21 ms 102.4 s note: the input clocks for tmra0 and tmra1 differ as follows: tmra0: uses tmra0 input (ta0in) and can be selected from t1, t4 or t16 tmra1: matches output of tmra0 (ta0trg) and can be selected from t1, t16, t256
tmp92ca25 2007-02-28 92ca25-137 2. generating a 50 % duty ratio square wave pulse the state of the timer flip-flop (ta1ff1) is inverted at constant intervals and its status output via the timer output pin (ta1out). example: to output a 2.4- s square wave pulse from the ta1out pin at f c = 40 mhz, use the following procedure to make th e appropriate register settings. this example uses tmra1; however, either tmra0 or tmra1 may be used. 7 6 5 4 3 2 1 0 ta01run ? x x x ? ? 0 ? stop tmra1 and clear it to ?0?. ta01mod 0 0 x x 0 1 ? ? select 8-bit timer mode and select t1 ( = (16/fc)s at f c = 40 mhz) as the input clock. ta1reg 0 0 0 0 0 0 1 1 set the timer register to 2.4 s t1 2 = 3 ta1ffcr x x x x 1 0 1 1 clear ta1ff to ?0? and set it to invert on the match detect signal from tmra1. pccr ? ? ? ? ? ? ? 1 pcfc ? ? ? ? ? ? ? 1 set pc0 to function as the ta1out pin. ta01run ? x x x ? 11 ? start tmra1 counting. x: don?t care, ? : no change figure 3.7.10 square wave output timing chart (50 % duty) 0 1 2 3 0 1 2 3 0 1 2 3 0 t1 ta01run bit7 to bit2 bit1 bit0 intta1 ta1ff ta1out up counter comparato r timing comparator output (match detect) uc1 clea r 1.2 s at f c = 40 mhz
tmp92ca25 2007-02-28 92ca25-138 3. making tmra1 count up on the match signal from the tmra0 comparator select 8-bit timer mode an d set the comparator output from tmra0 to be the input clock to tmra1. figure 3.7.11 tmra1 count up on signal from tmra0 ( 2) 16-bit timer mode a 16-bit interval timer is configured by pairing the two 8-bit timers tmra0 and tmra1. to make a 16-bit interval timer in which tmra0 and tmra1 are cascaded together, set ta01mod to ?01?. in 16-bit timer mode, the overflow output from tmra0 is used as the input clock for tmra1, regardless of the value set in ta01mod. table 3.7.2 shows the relationship between the timer (interrupt) cycle and the input clock selection. to set the timer interrupt interval, set the lower eight bits in timer register ta0reg and the upper eight bits in ta1reg. be sure to set ta0reg first (as entering data in ta0reg temporarily disables the compare, while entering data in ta1reg starts the compare). setting example: to generate an intta1 interrupt every 0.4 s at f c = 40 mhz, set the timer registers ta0reg and ta1reg as follows: if t16 ( = (256 / fc)s at f c = 40 mhz) is used as the input clock for counting, set the following value in the registers: 0.4 s = (256 / fc)s = 62500 = f424h; e.g. set ta1reg to f4h and ta0reg to 24h. 2 345 1 234 5 12 3 1 1 2 1 comparator output (tmra0 match) tmra0 up counter (when ta0reg = 5) tmra1 up counter (when ta1reg = 2) tmra1 match out p ut
tmp92ca25 2007-02-28 92ca25-139 the comparator match signal is output from tmra0 each time the up counter uc0 matches ta0reg, though the up counter uc0 is not cleared. in the case of the tmra1 comparator, the match detect signal is output on each comparator pulse on which the values in the up counter uc1 and ta1reg match. when the match detect signal is output simultaneously from both the comparator tmra0 and tmra1, the up counters uc0 and uc1 are cleared to ?0? and the interrupt intta1 is generated. also, if inversion is enabled, the value of the timer flip-flop ta1ff is inverted. example: when ta1reg = 04h and ta0reg = 80h figure 3.7.12 timer output by 16-bit timer mode (3) 8-bit ppg (programmable pulse generation) output mode square wave pulses can be generated at any frequency and duty ratio by tmra0. the output pulses may be active low or active high. in this mode tmra1 cannot be used. tmra0 outputs pulses on the ta1out pin (which can also be used as pc0). figure 3.7.13 8-bit ppg output waveforms inversion value of up counte r (uc1, uc0) tmra0 comparator match detect signal interru p t intta1 0080h 0180h 0280h 0380h 0480h time r out p ut ta1out tmra1 comparator match detect signal interru p t intta0 0080h t ta0reg ta1reg example: = ?01? ta0reg and uc0 match (interrupt intta0) ta1reg and uc0 match ( inter r u p t intta1 ) ta1out t h t l = ?10? t t l t h = ?01?
tmp92ca25 2007-02-28 92ca25-140 in this mode a programmable square wave is generated by inverting the timer output each time the 8-bit up counter (uc0) matches the value in one of the timer registers ta0reg or ta1reg. the value set in ta0reg must be smaller than the value set in ta1reg. although the up counter for tmra1 (u c1) is not used in this mode, ta01run should be set to ?1? so that uc1 is set for counting. figure 3.7.14 shows a block diagram representing this mode. figure 3.7.14 block diagram of 8-bit ppg output mode if the ta0reg double buffer is enabled in this mode, the value of the register buffer will be shifted into ta0reg each time ta1reg matches uc0. use of the double buffer facilitates the handling of low duty waves (when duty is varied). figure 3.7.15 operation of register buffer q 2 q 1 match with ta0reg and up counter match with ta1reg q 3 q 2 (up counter = q 1 ) (up counter = q 2 ) shift from register buffer ta0reg (register buffer) write ta0reg (value to be compared) register buffe r 8-bit up counter (uc0) comparator comparator t1 t4 t16 ta01mod ta1ff ta0reg register buffer ta1reg ta01run ta0reg-wr ta01run ta1out ta1ffcr intta0 intta1 shift trigge r internal data bus selecto r inversion selecto r
tmp92ca25 2007-02-28 92ca25-141 example: to generate 1/4 duty 62.5 khz pulses (at f c = 40 mhz) calculate the value which should be set in the timer register. to obtain a frequency of 62.5 khz, the pulse cycle t should be: t = 1/62.5 khz = 16 s t1 ( = (16/fc)s (at f c = 40 mhz); 16 s (16/fc)s = 40 therefore set ta1reg to 40 (28h) the duty is to be set to 1/4: t 1/4 = 16 s 1/4 = 4 s 4 s (16/fc)s = 10 therefore, set ta0reg = 10 = 0ah. 7 6 5 4 3210 ta01run 0 x x x ? 0 0 0 stop tmra0 and tmra1 and clear it to ?0?. ta01mod 1 0 x x x x 0 1 set the 8-bit ppg mode, and select t1 as input clock. ta0reg 0 0 0 0 1010 write 0ah. ta1reg 0 0 1 0 1000 write 28h. ta1ffcr x x x x 011x set ta1ff, enabling both inversion and the double buffer. 10 generate a negative logic pulse. pccr ? ? ? ? ? ? ? 1 pcfc ? ? ? ? ? ? ? 1 set pc0 as the ta1out pin. ta01run 1 x x x ? 1 1 1 start tmra0 and tmra1 counting. x: don't care, ? : no change 16 s
tmp92ca25 2007-02-28 92ca25-142 (4) 8-bit pwm output mode this mode is only valid for tmra0. in this mode, a pwm pulse with the maximum resolution of 8 bits can be output. when tmra0 is used the pwm pulse is output on the ta1out pin (which is also used as pc1). tmra1 can also be used as an 8-bit timer. the timer output is inverted when the up counter (uc0) matches the value set in the timer register ta0reg or when 2 n counter overflow occurs (n = 6, 7 or 8 as specified by ta01mod). the up counter uc0 is cleared when 2 n counter overflow occurs. the following conditions must be sa tisfied before this pwm mode can be used. value set in ta0reg < value set for 2 n counter overflow value set in ta0reg 0 figure 3.7.16 8-bit pwm waveforms figure 3.7.17 shows a block diagram representing this mode. figure 3.7.17 block diagram of 8-bit pwm mode ta0reg and uc0 match ta1out t pwm (pwm cycle) 2 n overflow (intta0 interrupt) selector 8-bit up counter (uc0) comparator t1 t4 t16 ta01mod ta1ff ta0reg register buffer selector ta01run ta0reg-wr ta01run ta1out ta1ffcr shift trigge r internal data bus clear 2 n overflow control intta0 ta01mod overflow inversion
tmp92ca25 2007-02-28 92ca25-143 in this mode the value of the register buffer will be shifted into ta0reg if 2 n overflow is detected when the ta0reg double buffer is enabled. use of the double buffer facilitates th e handling of low duty ratio waves. figure 3.7.18 register buffer operation example: to output the following pwm waves on the ta1out pin (at f c = 40 mhz). to achieve a 51.2- s pwm cycle by setting t1 ( = (16/fc)s (@f c = 40 mhz): 51.2 s (16/fc)s = 128 2 n = 128 therefore n should be set to 7. since the low level period is 36.0 s when t1 = (16/fc)s, set the following value for treg0: 36.0 s (16/fc)s = 90 = 5ah msb lsb 7 6 5 4 3210 ta01run ? x x x ? ? ? 0 stop tmra0 and clear it to 0 ta01mod 1 1 1 0 ? ? 0 1 select 8-bit pwm mode (cycle: 2 7 ) and select t1 as the input clock. ta0reg 0 1 0 1 1010 write 5ah. ta1ffcr x x x x 101x clear ta1ff to 0; enable the inversion and double buffer. pccr ? ? ? ? ? ? ? 1 pcfc ? ? ? ? ? ? ? 1 set pc0 as the ta1out pin. ta01run 1 x x x ? 1 ? 1 start tmra0 counting. x: don't care, ? : no change q 2 q 1 match with ta0reg q 3 q 2 up counter = q 1 up counter = q 2 shift into ta0reg ta0reg (register buffer) write ta0reg (value to be compared) re g ister buffe r 2 n overflow 36.0 s 51.2 s
tmp92ca25 2007-02-28 92ca25-144 table 3.7.4 pwm cycle pwm cycle taxxmod 2 6 (x64) 2 7 (x128) 2 8 (x256) taxxmod taxxmod taxxmod system clock syscr0 clock gear syscr1 ? t1(x2) t4(x8) t16(x32) t1(x2) t4(x8) t16(x32) t1(x2) t4(x8) t16(x32) 1(fs) ? 1024/fs 4096/fs 16384/fs 2048/fs 8192/ fs 32768/fs 4096/fs 16384/fs 65536/fs 000(x1) 1024/fc 4096/fc 16384/fc 2048/fc 8192/ fc 32768/fc 4096/fc 16384/fc 65536/fc 001(x2) 2048/fc 8192/fc 32768/fc 4096/fc 16384 /fc 65536/fc 8192/fc 32768/fc 131072/fc 010(x4) 4096/fc 16384/fc 65536/fc 8192/fc 32768 /fc 131072/fc 16384/fc 65536/fc 262144/fc 011(x8) 8192/fc 32768/fc 131072/fc 16384/fc 65536/fc 262144/fc 32768/fc 131072/fc 524288/fc 0(fc) 100(x16) 8 16384/fc 65536/fc 262144/fc 32768/fc 131072/fc 524288/fc 65536/fc 262144/fc 1048576/fc (5) settings for each mode table 3.7.5 shows the sfr settings for each mode. table 3.7.5 timer mode setting registers register name ta01mod ta1ffcr function timer mode pwm cycle upper timer input clock lower timer input clock timer f/f invert signal select 8-bit timer 2 channels 00 ? lower timer match, t1, t16, t256 (00, 01, 10, 11) external clock, t1, t4, t16 (00, 01, 10, 11) 0: lower timer output 1: upper timer output 16-bit timer mode 01 ? ? external clock, t1, t4, t16 (00, 01, 10, 11) ? 8-bit ppg 1 channel 10 ? ? external clock, t1, t4, t16 (00, 01, 10, 11) ? 8-bit pwm 1 channel 11 2 6 , 2 7 , 2 8 (01, 10, 11) ? external clock, t1, t4, t16 (00, 01, 10, 11) ? 8-bit timer 1 channel 11 ? t1, t16, t256 (01, 10, 11) ? output disabled ? : don?t care
tmp92ca25 2007-02-28 92ca25-145 3.8 external memory extension function (mmu) by providing 3 local areas, the mmu function allows for the expansion of the program/data area up to 512 mbytes. the recommended address memory map is shown in figure 3.8.1. however, when the memory used is less than 16 mbytes, it is not necessary to set the mmu register. in this case, please refer to the memo ry controller section. an area which can be set as a bank is called a local area. since the address for local areas is fixed, it cannot be changed. and, area which cannot be set as a bank is called common area. basically one series of program should be closed within one bank. please don?t jump to the same local-area in the different bank directly by jp instruction and so on. refer to the examples as follows. it is not possible for a program to branch be tween different banks of the same local area. the tmp92ca25 has the foll owing external pins for memory lsi connection. address bus: ea25, ea24 and a23 to a0 chip select: cs0 to cs3 , csza to cszf , sdcs nd0ce and nd1ce data bus: d15 to d0 3.8.1 recommended memory map figure 3.8.1 shows one recommended address memory map. this is for maximum expanded memory size and for a system in which an internal boot rom with nand flash is not required.
tmp92ca25 2007-02-28 92ca25-146 note: csza is a chip select for not only bank 0 to 15 of local-z but also common-z. figure 3.8.1 recommended memory map for ma ximum specification (logical address) bank 0 000000h a ddress memory map common-x (2 mbytes) local-x (2 mbytes) local-y (2 mbytes) common-y (2 mbytes) local-z (4 mbytes) common-z (4 mbytes) vector area internal i/o, ram 200000h 400000h 600000h 800000h c00000h ffff00h ffffffh 1 2 3 15 31 bank 0 1 2 3 15 31 cs0 area 32 mbytes cs3 area 4 mbytes cs1 area 4 mbytes cs2 area 8 mbytes bank 0 1 2 3 15 31 16 80 95 ce 0 nd pin (128 mbytes) ce 1 nd pin (128 mbytes) memory controller setting 3 cs pin 64 mbytes(2 mbytes 32) sdcs or 1 cs pin 64 mbytes(2 mbytes 32) csza pin (note) 64 mbytes(4 mbytes 16) cszb pin cszf pin : internal area : overlapped with common area and disabled setting as local area.
tmp92ca25 2007-02-28 92ca25-147 figure 3.8.2 recommended memory map for ma ximum specification (physical address) 000000h internal i/o and ram local-x 3 cs 64 mbytes tmp92ca25 bank 0 31 local-y sdcs or 1 cs 64 mbytes bank 0 31 local-z csza to cszf , ea24, ea25 64 mbytes 6 = 384 mbytes bank 0 15 bank 48 63 csza cszd bank 16 31 bank 64 79 cszb csze bank 32 47 bank 80 95 cszc cszf
tmp92ca25 2007-02-28 92ca25-148 3.8.2 control registers there are 12 mmu registers, covering 4 functions (program, data read, data write and lcdc display data), in each of 3 local areas (local-x, y and z), providing easy data access. (instructions for use) first, set the enable register and bank number for each local register. the relevant pin and memory settings shou ld then be set to the ports and memory controller. when the cpu or lcdc outputs a local area logical address, the mmu converts and outputs this to the physical address according to the bank number. the physical address bus is output to the external address bus pin, thereby enabling access to external memory. note 1: since the common area cannot be used as local area, do not set a bank number to local register which overlaps with the common area. note 2: changing program bank number (localpx, y or z) is disabled in the local area. the program bank setting for each local area must be changed in the common area. (but bank setting of read data, write data and data for lcd display can be changed in the local area.) note 3: after data bank number register (localrn, localwn or localln; where ?n? means x, y or z) is set by an instru ction, do not access its memory by the following instruction because several clocks are required for effective mmu setting. for this reason, insert between them a dummy instruction which accesses sfr or another memory, as in the following example. (example) ld xix, 200000h ; ld (localrx), 81h ; data bank number is set ld wa, (localrx) ; inserted dummy instruction which accesses sfr ld wa, (xix) ; instruction which reads bank 1 of local-x area. note 4: when local-z area is used, chip select signal csza should be assigned to p82 pin. in this case, csza works as chip select signal for not only bank 0 to 15 but also common-z. the following setting after reset is required before setting port82. ld (localpz), 80h ; loca l-z bank enable for program ld (localrz), 80h ; loca l-z bank enable for data read ld (localwz), 80h ; local-z bank enable for data write ( * 1) ld (locallz), 80h ; local-z bank enable for lcd display memory ( * 2) ld (p8fc), ? ? ? ? ? 0 ? ? b ; set p82 pin to csza output ld (p8fc2), ? ? ? ? ? 1 ? ? b; ( * 1) if common-z area is not used as data wr ite memory, this setting is not required. ( * 2) if common-z area is not used as lcd disp lay memory, this setting is not required.
tmp92ca25 2007-02-28 92ca25-149 (1) program bank register the bank number used as program memory is set to these registers. it is not possible to change program bank number in the same local area. local-x register for program 7 6 5 4 3 2 1 0 bit symbol lxe x4 x3 x2 x1 x0 localpx (01d0h) read/write r/w r/w after reset 0 0 0 0 0 0 function use bank for local-x 0: not use 1: use set wbank number for local-x (?0? is disabled because of ov erlap with common area.) local-y register for program 7 6 5 4 3 2 1 0 bit symbol lye y4 y3 y2 y1 y0 localpy (01d1h) read/write r/w r/w after reset 0 0 0 0 0 0 function use bank for local-y 0: not use 1: use set bank number for local-y (?3? is disabled because of ov erlap with common area.) local-z register for program 7 6 5 4 3 2 1 0 bit symbol lze z6 z5 z4 z3 z2 z1 z0 localpz (01d3h) read/write r/w after reset 0 0 0 0 0 0 0 0 function use bank for local-z 0: disable 1: enable set bank number for local-z (?3? is disabled because of ov erlap with common area.)
tmp92ca25 2007-02-28 92ca25-150 (2) lcd display bank register the bank number used as lcd display memory is set to these registers. since the bank registers for cpu and lcdc are prepared independently, the bank number for cpu (program, read data or write data) can be changed during lcd display. local-x register for lcdc display data 7 6 5 4 3 2 1 0 bit symbol lxe x4 x3 x2 x1 x0 locallx (01d4h) read/write r/w r/w after reset 0 0 0 0 0 0 function use bank for local-x 0: not use 1: use set bank number for local-x (?0? is disabled because of ov erlap with common area.) local-y register for lcdc display data 7 6 5 4 3 2 1 0 bit symbol lye y4 y3 y2 y1 y0 locally (01d5h) read/write r/w r/w after reset 0 0 0 0 0 0 function use bank for local-y 0: not use 1: use set bank number for local-y (?3? is disabled because of ov erlap with common area.) local-z register for lcdc display data 7 6 5 4 3 2 1 0 bit symbol lze z6 z5 z4 z3 z2 z1 z0 locallz (01d7h) read/write r/w after reset 0 0 0 0 0 0 0 0 function use bank for local-z 0: disable 1: enable set bank number for local-z (?3? is disabled because of ov erlap with common area.)
tmp92ca25 2007-02-28 92ca25-151 (3) read data bank register the bank register number used as read data memory is set to these registers. the following is an example where the read data bank register of local-x is set to ?1?. when ?ld wa, (xix)? instruction is executed, the bank becomes effective only at the read cycle for xix address. (example) ld xix, 200000h ; ld (localrx), 81h ; set read data bank. ld wa, (localrx) ; <-- insert dummy instruction which accesses sfr ld wa, (xix) ; read bank1 of local-x area local-x register for read data 7 6 5 4 3 2 1 0 bit symbol lxe x4 x3 x2 x1 x0 localrx (01d8h) read/write r/w r/w after reset 0 0 0 0 0 0 function use bank for local-x 0: not use 1: use set bank number for local-x (?0? is disabled because of ov erlap with common area.) local-y register for read data 7 6 5 4 3 2 1 0 bit symbol lye y4 y3 y2 y1 y0 localry (01d9h) read/write r/w r/w after reset 0 0 0 0 0 0 function use bank for local-y 0: not use 1: use set bank number for local-y (?3? is disabled because of ov erlap with common area.) local-z register for read data 7 6 5 4 3 2 1 0 bit symbol lze z6 z5 z4 z3 z2 z1 z0 localrz (01dbh) read/write r/w after reset 0 0 0 0 0 0 0 0 function use bank for local-z 0: disable 1: enable set bank number for local-z (?3? is disabled because of ov erlap with common area.)
tmp92ca25 2007-02-28 92ca25-152 (4) write data bank register the bank number used as write data memory is set to these registers. the following is an example where the data bank register of local-x is set to ?1?. when ?ld (xix), wa? instruction is executed, the bank becomes effective only at the write cycle for xix address. (example) ld xix, 200000h ; ld (localx), 81h ; set write data bank. ld wa, (localwx) ; <--insert dummy instruction which accesses sfr ld wa, (xix) ; write to bank 1 of local-x area local-x register for write data 7 6 5 4 3 2 1 0 bit symbol lxe x4 x3 x2 x1 x0 localwx (01dch) read/write r/w r/w after reset 0 0 0 0 0 0 function use bank for local-x 0: not use 1: use set bank number for local-x (?0? is disabled because of ov erlap with common area.) local-y register for write data 7 6 5 4 3 2 1 0 bit symbol lye y4 y3 y2 y1 y0 localwy (01ddh) read/write r/w r/w after reset 0 0 0 0 0 0 function use bank for local-y 0: not use 1: use set bank number for local-y (?3? is disabled because of ov erlap with common area.) local-z register for write data 7 6 5 4 3 2 1 0 bit symbol lze z6 z5 z4 z3 z2 z1 z0 localwz (01dfh) read/write r/w after reset 0 0 0 0 0 0 0 0 function use bank for local-z 0: disable 1: enable set bank number for local-z (?3? is disabled because of ov erlap with common area.)
tmp92ca25 2007-02-28 92ca25-153 3.8.3 setting example below is a setting example. no. used as memory setting mmu area logical address physical address (a) main routine common-z c00000h to ffffffh (b) character rom nor flash (16 mbytes, 1 pcs) csza , 32 bits, 1 wait bank 0 in local-z 800000h to bfffffh 000000h to 3fffffh (c) sub routine bank 0 in local-y 000000h to 1fffffh (d) lcd display ram sram (16 mbytes, 1 pcs) 1 cs , 16 bits, 0 waits bank 1 in local-y 400000h to 5fffffh 200000h to 3fffffh (e) stack ram internal ram (16 kbytes) ? (32 bits, 1 clock) ? 002000h to 005fffh (a) main routine (common-z) logical address physical address no instruction comment 1 org c00000h ; c00000h (same) 2 ldw (mamr2), 80ffh ; cs2 800000-ffffff/8 mbytes c000xxh 3 ldw (b2csl), c222h ; cs2 32-bit rom, 1 wait 4 ldw (mamr1), 40ffh ; cs1 400000-7fffff/4 mbytes 5 ldw (b1csl), 8111h ; cs1 16-bit ram, 0 waits 5.1 ld (localpz), 80h ; local-z bank enable for program 5.2 ld (localrz), 80h ; loc al-z bank enable for data read 6 ld (p8fc), 02h ; p81: 1 cs 7 ld (p8fc2), 04h ; p82: csza 8 ld (pjfc), 07h ; pj2: srwr , pj1: srlub , pj0: srllb 9 ld xsp, 6000h ; stack pointer = 6000h 10 ld (localpy), 80h ; bank 0 in local-y is set as program for sub routine 11 : ; c000yyh 12 call 400000h ; call sub routine 13 : ; 14 : ; 15 : ; ? instructions from no.2 to no.8 are settings for ports and memory controller. ? no.9 is a setting for stack pointer. it is assigned to internal ram. ? no.10 is a setting to execute no.12?s instruction. ? no.12 is an instruction to call sub routine. when cpu outputs 400000h address, this mmu will convert and output 000000 h address to external add ress bus: a23 to a0. and cs1 for sram will be asserted because its logical add ress is in the cs1are a at the same time. these instructions allow the cpu to branch to sub routine. note:this example assumes a sub routi ne program is already written on sram.
tmp92ca25 2007-02-28 92ca25-154 (b) sub routine (bank 0 in local-y) logical address physical address no instruction comment 16 org 400000h ; 400000h 000000h 17 ld (localwy), 81h ; bank 1 in local-y is set as write data for lcd display ram 4000xxh 0000xxh 18 ld (locally), 81h ; bank 1 in local-y is set as lcd display data for lcd display ram 19 ld (localrz), 80h ; bank 0 in local-z is set as read data for character rom 20 ld xiy, 800000h ; index address register to read character rom 21 ld wa, (xiy) ; reading character rom 22 : ; convert it to display data 23 ld (localpy), 82h ; 24 ld xix, 400000h ; index address register to write lcd display data 25 ld (xix), bc ; writing lcd display data 26 : ; setting lcd controller 27 : ; 28 ld xiz, 400000h ; setting lcd start address to lcdc 29 ld (lsarcl), xiz ; 30 ld (lcdctl0), 01h ; start lcd display operation 31 : ; 5000yyh 1000yyh 32 ret ; ? no.17 and no.18 are settings for bank 1 of lo cal-y. in this case, lcd display data is written to sram by cpu. so, (localwy) and (locally) should be set to the same bank 1. ? no.19 is a setting for bank 0 of loca l-z to read data from character rom. ? no.20 and no.21 are instructions to read data from character rom. when cpu outputs 800000h address, this mmu will convert and out put 000000h address to external address bus: a23 to a0. and csza for nor flash will be asserted beca use its logical address is in the cs2 area at the same time. these instructions allow the cpu to read data from character rom. ? no.23 is an instruction which changes the program bank number in the local area. this setting is disabled. ? no.24 and no.25 are instructions to write data to sram. when cpu outputs 400000h address, this mmu will convert and output 200000h address to external address bus: a23 to a0. and cs1 for sram will be asserted because its logical address is in the cs1area at the same time. these instructions allow the cpu to write data to sram. ? no.28 and no.29 are settings to set lcd starting address to lcd controller. when lcdc outputs 400000h address in dma cycle, this mmu will convert and output 200000h address to external address bus: a23 to a0. and cs1 for sram will be asserted because its logical address is in the cs1 area at the same time. these instructions allow the lcdc to read data from sram. ? no.30 is an instruction to start lcd display operation.
tmp92ca25 2007-02-28 92ca25-155 3.9 serial channels the tmp92ca25 includes 1 serial i/o channels. for the channel, either uart mode (asynchronous transmission ) or i/o interface mode (synchrono us transmission) can be selected. and sio0 includes data modulator that supports the irda 1.0 infrared data communication specification. i/o interface mode mode 0: for transm itting and receiving i/o data using the synchronizing signal sclk for extending i/o. uart mode mode 1: 7-bit data mode 2: 8-bit data mode 3: 9-bit data in mode 1 and mode 2 a parity bit can be added. mode 3 has a wakeup function for making the master controller start slave controllers via a serial link (a multi controller system). figure 3.9.2 is block diagrams for sio0. sio0 is compounded mainly prescaler, serial clock generation circuit, receiving buffer and control circuit, transmission buffer and control circuit. this chapter contains the following sections: 3.9.1 block diagram 3.9.2 operation of each circuit 3.9.3 sfr 3.9.4 operation in each mode 3.9.5 support for irda mode
tmp92ca25 2007-02-28 92ca25-156 figure 3.9.1 data formats bit0 1 2 3 4 5 6 7 bit0 1 2 3 4 5 6 stop start bit0 1 2 3 4 5 parity stop start 6 bit0 1 2 3 4 5 7 stop start bit0 1 2 3 4 5 parity stop start 7 6 6 bit0 1 2 3 4 5 8 stop start bit0 1 2 3 4 5 stop start bit8 6 6 7 7 transfer direction ? mode 0 (i/o interface mode) ? mode 1 (7-bit uart mode) no parity parity no parity parity ? mode 2 (8-bit uart mode) ? mode 3 (9-bit uart mode) when bit8 = 1, address (select code) is denoted. when bit8 = 0, data is denoted. wakeup
tmp92ca25 2007-02-28 92ca25-157 3.9.1 block diagrams figure 3.9.2 block diagram of serial channel 0 selector t0 t2 t8 t32 sc0mod0 receive buffer 1 (shift register) rxdclk sc0mod0 prescaler selector ta0trg (from tmra0) uart mode br0cr baud rate generator selector sc0mod0 selector 2 i/o interface mode sc0cr receive counter (uart only 16) transmision counter (uart only 16) receive control transmission control intrx0 inttx0 receive buffer 2 (sc0buf) rb8 error flag sc0cr serial channel interrupt control tb8 cts0 txd0 transmission buffer (sc0buf) rxd0 txdclk sc0mod0 f io sc0mod0 sclk0 sclk0 sioclk internal data bus parity control sc0cr serial clock generation circuit br0cr br0add br0cr i/o interface mode t0 2 64 4 8 16 32 prescale r t2 t8 t32 int request
tmp92ca25 2007-02-28 92ca25-158 3.9.2 operation for each circuit (1) sio prescaler and prescaler clock select there is a 6-bit prescaler for waking serial clock. the prescaler can be run by selecting the ba ud rate generator as the waking serial clock. table 3.9.1 shows prescaler clock resolution into the baud rate generator. table 3.9.1 prescaler clock resolution to baud rate generator baud rate generator input clock sio prescaler br0cr system clock selection syscr1 clock gear selection syscr1 ? t0 t2(1/4) t8(1/16) t32(1/64) 1(fs) ? fs/8 fs/32 fs/128 fs/512 000(1/1) fc/8 fc/32 fc/128 fc/512 001(1/2) fc/16 fc/64 fc/256 fc/1024 010(1/4) fc/32 fc/128 fc/512 fc/2048 011(1/8) fc/64 fc/256 fc/1024 fc/4096 0(fc) 100(1/16) 1/8 fc/128 fc/512 fc/2048 fc/8192 the baud rate generator selects between 4 clock inputs: t0, t2, t8, and t32 among the prescaler outputs.
tmp92ca25 2007-02-28 92ca25-159 (2) baud rate generator the baud rate generator is a circuit whic h generates transmi ssion and receiving clocks that determine the transfer rate of the serial channels. the input clock to the baud rate generator, t0, t2, t8 or t32, is generated by the 6-bit sio prescaler, which is shared by the timers. one of these input clocks is selected using the br0cr fiel d in the baud rate generator control register. the baud rate generator includes a frequenc y divider, which divides the frequency by 1 or n + (16 ? k)/16 or 16 values, thereby determining the transfer rate. the transfer rate is determined by th e settings of br0cr and br0add. ? in uart mode (1) when br0cr = 0 the settings br0add are igno red. the baud rate generator divides the selected prescaler clock by n, which is set in br0ck. (n = 1, 2, 3 ?16) (2) when br0cr = 1 the n + (16 ? k)/16 division function is enabled. the baud rate generator divides the selected prescaler clock by n + (16 ? k)/16 using the value of n set in br0cr (n = 2, 3?15) and the value of k set in br0add (k = 1, 2, 3?15) note: if n = 1 or n = 16, the n + (16 ? k)/16 division function is disabled. set br0cr to 0. ? in i/o interface mode the n + (16 ? k)/16 division function is not available in i/o interface mode. set br0cr to 0 before dividing by n. the method for calculating the transfer rate when the baud rate generator is used is explained below. ? in uart mode input clock of baud rate generator baud rate = frequency divider for baud rate generator 16 ? in i/o interface mode input clock of baud rate generator baud rate = frequency divider for baud rate generator 2
tmp92ca25 2007-02-28 92ca25-160 ? integer divider (n divider) for example, when the source clock frequency (f c ) is 39.3216 mhz, the input clock is t2 (f c /32), the frequency divi der n (br0cr) = 8, and br0cr = 0, the baud rate in uart mode is as follows: * clock condition clock gear : 1/1 input clock of baud rate generator baud rate = frequency divider for baud rate generator 16 f c /32 = 8 16 = 39.3216 10 6 16 8 16 = 9600 (bps) note: the n + (16 ? k)/16 division function is disabled and setting br0add is invalid. ? n + (16 ? k)/16 divider (uart mode only) accordingly, when the source clock frequency (f c ) = 31.9488 mhz, the input clock is t2 (f c /32), the frequency divider n (br0cr) = 6, k (br0add) = 8, and br0cr = 1, the baud rate in uart mode is as follows: * clock condition clock gear : 1/1 input clock of baud rate generator baud rate = frequency divider for baud rate generator 16 f c /32 (16 ? 8) = 6 + 16 16 8 = 31.9488 10 6 16 (6 + 16 ) 16 = 9600 (bps) table 3.9.2 show examples of uart mode transfer rates. additionally, the external clock input is available in the serial clock. (serial channels 0 and 1). the method for calculating the baud rate is explained below: ? in uart mode baud rate = external clock input frequency 16 it is necessary to satisfy (external clock input cycle) 4/f sys ? in i/o interface mode baud rate = external clock input frequency it is necessary to satisfy (external clock input cycle) 16/f sys
tmp92ca25 2007-02-28 92ca25-161 table 3.9.2 selection of transfer rate (1) (when baud rate generator is used and br0cr = 0) unit (kbps) f sys [mhz] input clock frequency divider t0 (f sys /4) t2 (f sys /16) t8 (f sys /64) t32 (f sys /256) 9.8304 2 76.800 19.200 4.800 1.200 4 38.400 9.600 2.400 0.600 8 19.200 4.800 1.200 0.300 10 9.600 2.400 0.600 0.150 12.2880 5 38.400 9.600 2.400 0.600 a 19.200 4.800 1.200 0.300 14.7456 2 115.200 28.800 7.200 1.800 3 76.800 19.200 4.800 1.200 6 38.400 9.600 2.400 0.600 c 19.200 4.800 1.200 0.300 19.6608 1 307.200 76.800 19.200 4.800 2 153.600 38.400 9.600 2.400 4 76.800 19.200 4.800 1.200 8 38.400 9.600 2.400 0.600 10 19.200 4.800 1.200 0.300 22.1184 3 115.200 28.800 7.200 1.800 24.5760 1 384.000 96.000 24.000 6.000 2 192.000 48.000 12.000 3.000 4 96.000 24.000 6.000 1.500 5 76.800 19.200 4.800 1.200 8 48.000 12.000 3.000 0.750 a 38.400 9.600 2.400 0.600 10 24.000 6.000 1.500 0.375 note: transfer rates in i/o interface mode are eight times faster than the values given above. in uart mode, tmra match detect sign al (ta0trg) can be used for serial transfer clock. method for calculating the timer output frequency which is needed when outputting trigger of timer ta0trg frequency = baud rate 16 note: the tmra0 match detect signal cannot be used as the transfer clock in i/o interface mode.
tmp92ca25 2007-02-28 92ca25-162 (3) serial clock generation circuit this circuit generates the basic clock for transmitting and receiving data. ? in i/o interface mode in sclk output mode with the setting sc0cr = 0, the basic clock is generated by dividing the output of the baud rate generator by 2, as described previously. in sclk input mode with the setting sc0cr = 1, the rising edge or falling edge will be detected according to the setting of the sc0cr register to generate the basic clock. ? in uart mode the sc0mod0 setting determines whether the baud rate generator clock, the internal clock f io , the match detect signal from tmra0 or the external clock (sclk0) is used to generate the basic clock sioclk. (4) receiving counter the receiving counter is a 4-bit binary counter used in uart mode, which counts up the pulses of the sioclk clock. it takes 16 sioclk pulses to receive 1 bit of data; each data bit is sampled three times, on the 7th, 8th and 9th clock cycles. the value of the data bit is determined from these three samples using the majority rule. for example, if the data bit is sampled resp ectively as 1, 0 and 1 on 7th, 8th and 9th clock cycles, the received data bit is taken to be 1. a data bit sampled as 0, 0 and 1 is taken to be 0. (5) receiving control ? in i/o interface mode in sclk output mode with the setting sc0cr = 0, the rxd0 signal is sampled on the rising edge or falling of the shift clock, which is output on the sclk0 pin, according to th e sc0cr setting. in sclk input mode with the setting sc0cr = 1, the rxd0 signal is sampled on the rising or falling edge of the sclk0 input, according to the sc0cr setting. ? in uart mode the receiving control block has a circui t which detects a start bit using the majority rule. received bits are sampled three times; when two or more out of three samples are 0, the bit is recogniz ed as the start bit and the receiving operation commences. the values of the data bits that are received are also determined using the majority rule.
tmp92ca25 2007-02-28 92ca25-163 (6) the receiving buffers to prevent overrun errors, the receiving bu ffers are arranged in a double buffer structure. received data is stored one bit at a time in receiving buffer 1 (which is a shift register). when 7 or 8 bits of data have been stored in receiving buffer 1, the stored data is transferred to receiving buffer 2 (sc0buf); this causes an intrx0 interrupt to be generated. the cpu only reads receiving buffer 2 (sc0buf). even before the cpu reads receiving buffer 2 (sc0buf), the received data can be stored in receiving buffer 1. however, unless receiving buffer 2 (sc0buf) is read before all bits of the next data are received by receiving buffer 1, an overrun error occurs. if an overrun error occurs, the contents of receiving buffer 1 will be lost, although the contents of receiving buffer 2 and sc0cr wi ll be preserved. sc0cr is used to store either the parity bit ? added in 8-bit uart mode ? or the most significant bit (msb) ? in 9-bit uart mode. in 9-bit uart mode the wakeup function for the slave controller is enabled by setting sc0mod0 to 1; in this mode intrx0 interrupts occur only when the value of sc0cr is 1. sio interrupt mode is select able by the register simc. (7) transmission counter the transmission counter is a 4-bit binary counter used in uart mode and which, like the receiving counter, counts the sioclk clock pulses; a txdclk pulse is generated every 16 sioclk clock pulses. figure 3.9.3 generation of the transmission clock (8) transmission controller ? in i/o interface mode in sclk output mode with the setting sc0cr = 0, the data in the transmission buffer is output one bit at a time to the txd0 pin on the rising or falling edge of the shift clock which is output on the sclk0 pin, according to the sc0cr setting. in sclk input mode with the setting sc0cr = 1, the data in the transmission buffer is output one bit at a time on the txd0 pin on the rising or falling edge of the sclk0 input, according to the sc0cr setting. ? in uart mode when transmission data sent from the cpu is written to the transmission buffer, transmission starts on the rising edge of the next txdclk, generating a transmission shift clock txdsft. 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 sioclk txdclk
tmp92ca25 2007-02-28 92ca25-164 handshake function use of cts0 pin allows data to be sent in units of one frame; thus, overrun errors can be avoided. the handshake function is enabled or disabled by the sc0mod setting. when the cts0 pin goes high on completion of the current data send, data transmission is halted until the cts0 pin goes low again. however, the inttx0 interrupt is generated, and it requests the next data send from the cpu. the next data is written in the transmission buffer and data sending is halted. though there is no rts pin, a handshake function can be easily configured by setting any port assigned to be the rts function. the rts should be output ?high? to request send data halt after data receive is completed by software in the rxd interrupt routine. figure 3.9.4 handshake function note 1: if the cts0 signal goes high during transmission, no more dat a will be sent after completion of the current transmission. note 2: transmission starts on the first falling edge of the txdclk clock after the cts0 signal has fallen. figure 3.9.5 cts0 (clear to send) timing txd cts0 rxd rts (any port) tmp92ca25 tmp92ca25 sender receiver 3 13 14 15 16 1 2 sioclk 3 14 15 16 1 2 start bit bit0 (1) (2) send is suspended from (1) and (2) timing of writing to the transmission buffe r txdclk txd cts0
tmp92ca25 2007-02-28 92ca25-165 (9) transmission buffer the transmission buffer (sc0buf) shifts out and sends the transmission data written from the cpu in order from the leas t significant bit (lsb). when all the bits are shifted out, the transmission buffer becomes empty and generates an inttx0 interrupt. (10) parity control circuit when sc0cr in the serial channel control register is set to ?1?, it is possible to transmit and receive data with parity. howe ver, parity can be added only in 7-bit uart mode or 8-bit uart mode. the sc0cr field in the serial channel control register allows either even or odd parity to be selected. in the case of transmission, parity is au tomatically generated when data is written to the transmission buffer sc0buf. the data is transmitted after the parity bit has been stored in sc0buf in 7-bit uart mode or in sc0mod0 in 8-bit uart mode. sc0cr and sc0cr mu st be set before the transmission data is written to the transmission buffer. in the case of receiving, data is shifted into receiving buffer 1, and the parity is added after the data has been transferred to rece iving buffer 2 (sc0buf), and then compared with sc0buf in 7-bit uart mode or with sc0cr in 8-bit uart mode. if they are not equal, a parity error is generated and the sc0cr flag is set. (11) error flags three error flags are provided to increase the reliability of data reception. 1. overrun error if all the bits of the next data item have been received in receiving buffer 1 while valid data still remains stored in receiving buffer 2 (sc0buf), an overrun error is generated. the below is a recommended flow when the overrun-error is generated. (intrx interrupt routine) 1) read receiving buffer 2) read error flag 3) if = 1 then a) set to disable receiving (write ?0? to sc0mod0) b) wait to terminate current frame c) read receiving buffer d) read error flag e) set to enable receiving (write ?1? to sc0mod0) f) request to transmit again 4) other
tmp92ca25 2007-02-28 92ca25-166 2. parity error the parity generated for the data shifte d into receiving buffer 2 (sc0buf) is compared with the parity bit received via the rxd pin. if they are not equal, a parity error is generated. 3. framing error the stop bit for the received data is sampled three times around the center. if the majority of the samples are 0, a framing error is generated.
tmp92ca25 2007-02-28 92ca25-167 (12) timing generation 1. in uart mode receiving mode 9 bits (note) 8 bits + parity (note) 8 bits, 7 bits + parity, 7 bits interrupt timing center of last bit (bit8) center of last bit (parity bit) center of stop bit framing error timing center of stop bit center of stop bit center of stop bit parity error timing ? center of last bit (parity bit) center of stop bit overrun error timing center of last bit (bit8) center of last bit (parity bit) center of stop bit note1: in 9-bit and 8-bit + parity modes, interrupts coincide with the ninth bit pulse. thus, when servicing the interrupt, it is necessary to wait for a 1-bit period (to allow the stop bit to be transferred) to allow checking for a framing error. note2: the higher the transfer rate, the later than the middle receive interrupts and errors occur. transmitting mode 9 bits 8 bits + parity 8 bits, 7 bits + parity, 7 bits interrupt timing just before stop bit is transmitted just before stop bit is transmitted just before stop bit is transmitted 2. i/o interface sclk output mode immediately after last bit data. (see figure 3.9.13.) transmission interrupt timing sclk input mode immediately after rise of last sclk signal rising mode, or immediately after fall in falling mode. (see figure 3.9.14.) sclk output mode timing used to transfer received to data receive buffer 2 (sc0buf) (e.g. immediately after last sclk). (see figure 3.9.15.) receiving interrupt timing sclk input mode timing used to transfer received dat a to receive buffer 2 (sc0buf) (e.g. immediately after last sclk). (see figure 3.9.16.)
tmp92ca25 2007-02-28 92ca25-168 3.9.3 sfr 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 sc0mod0 (1202h) read/write r/w after reset 0 0 0 0 0 0 0 0 function transfer data bit8 hand shake 0: cts disable 1: cts enable receive function 0: receive disable 1: receive enable wakeup function 0: disable 1: enable serial transmission mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transmission clock (uart) 00: tmra0 trigger 01: baud rate generator 10: internal clock f io 11: external clcok (sclk0 input) serial transmission clock source (uart) 00 tmra0 match detect signal 01 baud rate generator 10 internal clock f io 11 external clock (sclk0 input) note: the clock selection for the i/o interface mode is controlled by the serial control register (sc0cr). serial transmission mode 00 i/o interface mode 01 7-bit mode 10 8-bit mode 11 uart mode 9-bit mode wakeup function 9-bit uart other modes 0 interrupt generated when data is received 1 interrupt generated only when sc0cr = 1 don?t care receiving function 0 receive disabled 1 receive enabled handshake function ( cts pin) 0 disabled (always transferable) 1 enabled transmission data bit8 figure 3.9.6 serial mode control register (channel 0, sc0mod0)
tmp92ca25 2007-02-28 92ca25-169 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc sc0cr (1201h) read/write r r/w r (cleared to 0 when read) r/w after reset undefined 0 0 0 0 0 0 0 1: error function received data bit8 parity 0: odd 1: even parity addition 0: disable 1: enable overrun parity framing 0: sclk0 1: sclk0 0: baud rate generator 1: sclk0 pin input i/o interface input clock selection 0 baud rate generator 1 sclk0 pin input edge selection for sclk pin (i/o mode ) 0 transmits and receives data on rising edge of sclk0. 1 transmits and receives data on falling edge sclk0. framing error flag parity error flag overrun error flag cleared to 0 when read parity additions enable 0 disabled 1 enabled even parity addition/check 0 odd parity 1 even parity received data bit8 note: as all error flags are cleared after reading do not test only a single bit with a bit testing instruction. figure 3.9.7 serial control register (channel 0, sc0cr)
tmp92ca25 2007-02-28 92ca25-170 7 6 5 4 3 2 1 0 bit symbol ? br0adde br0ck1 br0ck0 br0s3 br0s2 br0s1 br0s0 br0cr (1203h) read/write r/w after reset 0 0 0 0 0 0 0 0 function always write ?0?. + (16 ? k)/16 division 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 divided frequency setting 7 6 5 4 3 2 1 0 bit symbol br0k3 br0k2 br0k1 br0k0 br0add (1204h) read/write r/w after reset 0 0 0 0 function sets frequency divisor ?k? (divided by n + (16 ? k)/16). sets baud rate generator frequency divisor br0cr = 1 br0cr = 0 br0cr br0add 0000 (n = 16) or 0001 (n = 1) 0010 (n = 2) to 1111 (n = 15) 0001 (n = 1) (only uart) to 1111 (n = 15) 0000 (n = 16) 0000 disable disable 0001 (k = 1) to 1111 (k = 15) disable divided by n + (16 ? k)/16 divided by n note1:availability of +(16-k)/16 division function n uart mode i/o mode 2 to 15 1 , 16 the baud rate generator can be set to ?1? in uart mode onl y when the +(16-k)/16 division function is not used. do not use in i/o interface mode. note2:set br0cr to 1 after setting k (k = 1 to 15 ) to br0add when +( 16-k)/16 division function is used. writes to unused bits in the br0add register do not affect operation, and undefined data is read from these unused bits. figure 3.9.8 baud rate generator c ontrol (channel 0, br0cr, br0add) setting the input clock of baud rate generator 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 + (16 ? k)/16 division enable 0 disable 1 enable
tmp92ca25 2007-02-28 92ca25-171 7 6 5 4 3 2 1 0 tb7 tb6 tb5 tb4 tb3 tb2 tb1 tb0 (transmission) sc0buf (1200h) 7 6 5 4 3 2 1 0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 (receiving) note: prohibit read-modify-write for sc0buf. figure 3.9.9 serial transmission/receivi ng buffer registers (channel 0, sc0buf) 7 6 5 4 3 2 1 0 bit symbol i2s0 fdpx0 read/write r/w r/w after reset 0 0 function idle2 0: stop 1: run duplex 0: half 1: full figure 3.9.10 serial mode control register 1 (channel 0, sc0mod1) sc0mod1 (1205h)
tmp92ca25 2007-02-28 92ca25-172 3.9.4 operation in each mode (1) mode 0 (i/o interface mode) this mode allows an increase in the number of i/o pins available for transmitting data to or receiving data from an external shift register. this mode includes the sclk output mode to output synchronous clock sclk, and sclk input mode to input external synchronous clock sclk. figure 3.9.11 sclk output mode connection example figure 3.9.12 example of sclk input mode connection output extension tc74hc595 or equivalent a b si c d sck e f rck g h txd sclk port shift register tmp92ca25 input extension tc74hc165 or equivalent a b qh c d clock e f s/ l g h rxd sclk port shift register tmp92ca25 output extension tc74hc595 or equivalent a b si c d sck e f rck g h txd sclk port shift register tmp92ca25 input extension tc74hc165 or equivalent a b qh c d clock e f s/ l g h rxd sclk port shift register tmp92ca25 external clock external clock
tmp92ca25 2007-02-28 92ca25-173 1. transmission in sclk output mode 8-bit data and a synchronous clock are output on the txd0 and sclk0 pins respectively each time the cpu writes data to the transmission buffer. when all data is output, intes0 will be set to generate the inttx0 interrupt. figure 3.9.13 transmitting operation in i/o interface mode (sclk0 output mode) (channel 0) in sclk input mode, 8-bit data is output on the txd0 pin when the sclk0 input becomes active after the data has been written to the transmission buffer by the cpu. when all data is output, inte s0 will be set to generate an inttx0 interrupt. figure 3.9.14 transmitting operation in i/o in terface mode (sclk0 input mode) (channel 0) bit0 bit1 bit6 bit7 bit5 sclk0 input ( = 0: rising edge mode) sclk0 input ( = 1: falling edge mode) txd0 itx0c (inttx0 intterrupt reqest) txd0 itx0c (inttx0 interrupt request) sclk0 output ( = 0: rising edge mode) timing of transmitted data writing bit0 bit1 bit6 bit7 sclk0 output ( = 1: falling edge mode) (internal clock timing)
tmp92ca25 2007-02-28 92ca25-174 2. receiving in sclk output mode the synchronous clock is output on the sclk0 pin and the data is shifted to receiving buffer 1. this is initiated when the receive interrupt flag intes0 is cleared as the received data is read. when 8-bit data is received, the data is transferred to receiving buffer 2 (sc0buf) following the timing shown below and intes0 is set to 1 again, causing an intrx0 interrupt to be generated. setting sc0mod0 to 1 initiates sclk0 output. figure 3.9.15 receiving operation in i/o interface mode (sclk0 output mode) in sclk input mode the data is shifted to receiving buffer 1 when the sclk input goes active. the sclk input goes active when the receive interrupt flag intes0 is cleared as the received data is read. when 8-bit data is received, the data is shifted to receiving buffer 2 (sc0buf) following the timing shown below and intes0 is set to 1 again, causing an intrx0 interrupt to be generated. figure 3.9.16 receiving operation in i/o interface mode (sclk0 input mode) note: the system must be put in the receive-enable state (sc0mod0 = 1) before data can be received. sclk0 output ( = 0: risin g ed g e mode ) irx0c (intrx0 interrupt request) rxd0 bit0 bit1 bit6 bit7 sclk0 output ( = 1: fallin g ed g e mode ) sclk0 input ( = 0: rising edge mode) sclk0 input ( = 1: falling edge mode) irx0c (intrx0 interrupt request) rxd1 bit1 bit6 bit7 bit5 bit 0
tmp92ca25 2007-02-28 92ca25-175 3. transmission and receiving (full duplex mode) when full duplex mode is used, set the receive interrupt level to 0, and only set the interrupt level (from 1 to 6) of the transmit interrupt. ensure that the program which transmits the interrupt reads the receiving buffer before setting the next transmit data. the following is an example of this: example: channel 0, sclk output baud rate = 9600 bps fc = 4.9152 mhz * clock condition: clock gear 1/1(fc) main routine 7 6543210 intes0 x 0 0 1 x 0 0 0 set the inttx0 level to 1. set the intrx0 level to 0. pfcr ? ? ? ? ? 101 pffc ? ? ? ? ? 101 set pf0, pf1 and pf2 to function as the txd0, rxd0 and sclk0 pins respectively. sc0mod0 0 0 0 0 0 0 0 0 select i/o interface mode. sc0mod1 1 1 0 0 0 0 0 0 select full duplex mode. sc0cr 0 0 0 0 0 0 0 0 sclk output, transmit on negative edge, receive on positive edge. br0cr 0 0 0 1 1 0 0 0 baud rate = 9600 bps. sc0mod0 0 0 1 0 0 0 0 0 enable receiving. sc0buf * ******* set the transmit data and start. inttx0 interrupt routine a cc sc0buf read the receiving buffer. sc0buf * ******* set the next transmit data. x: don't care, ? : no change
tmp92ca25 2007-02-28 92ca25-176 (2) mode 1 (7-bit uart mode) 7-bit uart mode is selected by setting the serial channel mode register sc0mod0 field to 01. in this mode a parity bit can be added. use of a parity bit is enabled or disabled by the setting of the serial channel control re gister sc0cr bit; whether even parity or odd parity will be used is determined by the sc0cr setting when sc0cr is set to 1 (enabled). setting example: when transmitting data of the following format, the control registers should be se t as described below. * clock condition: clock gear 1/1(fc) 7 6 5 4 3 2 1 0 pfcr ? ? ? ? ? ? ? 1 pffc ? ? ? ? ? ? ? 1 set pf0 to function as the txd0 pin. sc0mod0 x 0 ? x 0 1 0 1 select 7-bit uart mode. sc0cr x 1 1 x x x 0 0 add even parity. br0cr 0 0 1 0 1 0 0 0 set the transfer rate to 2400 bps. intes0 x 1 0 0 ? ? ? ? enable the inttx0 interrupt and set it to interrupt level 4. sc0buf * * * * * * * * set data for transmission. x: don't care, ?: no change (3) mode 2 (8-bit uart mode) 8-bit uart mode is selected by setting sc0mod0 to 10. in this mode a parity bit can be added (use of a parity bi t is enabled or disabled by the setting of sc0cr); whether even parity or odd pari ty will be used is determined by the sc0cr setting when sc0cr is set to 1 (enabled). setting example: when receiving data of the following format, the control registers should be se t as described below. transmission direction (trans mission rate: 9600 bps at f c = 39.3216 mhz) start bit0 1 2 3 4 5 6 odd parity stop 7 start bit0 1 2 3 4 5 6 even parity stop transmission direction (trans mission rate: 2400 bps at f c = 39.3216 mhz)
tmp92ca25 2007-02-28 92ca25-177 main settings 7 6543210 pfcr ? ? ? ? ? ? 0 ? set pf1 to function as the rxd0 pin. pffc ? ? ? ? ? ? 0 ? sc0mod0 ? 0 1 x 1 0 0 1 enable receiving in 8-bit uart mode. sc0cr x 0 1 x x x 0 0 add odd parity. br0cr 0 0 0 1 1 0 0 0 set the transfer rate to 9600 bps. intes0 ? ? ? ? x 1 0 0 enable the inttx0 interrupt and set it to interrupt level 4. interrupt processing a cc sc0cr and 00011100 if a cc 0 then error check for errors a cc sc0buf read the received data x: don't care, ? : no change (4) mode 3 (9-bit uart mode) 9-bit uart mode is selected by setting sc0mod0 to 11. in this mode a parity bit cannot be added. in the case of transmission the msb (9th bit) is written to sc0mod0. in the case of receiving it is stored in sc0cr. when the buffer is written or read, or is read or written first, before the rest of the sc0buf data. wakeup function in 9-bit uart mode, the wakeup function for slave controllers is enabled by setting sc0mod0 to 1. the interru pt intrx0 can only be generated when = 1. note: the txd pin of each slave controller must be in open-drain output mode. figure 3.9.17 serial link using wakeup function txd rxd master txd rxd slave1 txd rxd slave 2 txd rxd slave 3
tmp92ca25 2007-02-28 92ca25-178 protocol 1. select 9-bit uart mode on the master and slave controllers. 2. set the sc0mod0 bit on each slave controller to 1 to enable data receiving. 3. the master controller transmits data one frame at a time. each frame includes an 8-bit select code which identifies a slave controller. the msb (bit8) of the data () is set to 1. 4. each slave controller receives the above frame. each controller checks the above select code against its own select code. the controll er whose code matches clears its bit to 0. 5. the master controller transmits data to the specified slave controller (the controller whose sc0mod0 bit has been cleared to 0). the msb (bit8) of the data () is cleared to 0. 6. the other slave controllers (whose bits remain at 1) ignore the received data because their msbs (bit8 or ) are set to 0, disabling intrx0 interrupts. the slave controller whose bit = 0 can also transmit to the master controller. in this way it can signal the master controller that the data transmission from the master controller has been completed. start bit0123456 select code of slave controller 7 stop 8 ?1? data ?0? start bit0123456 7 stop bit8
tmp92ca25 2007-02-28 92ca25-179 setting example: to link two slave controllers serially with the master controller using the internal clock f io as the transfer clock. ? setting the master controller main pfcr ? ? ? ? ? ? 01 pffc ? ? ? ? ? ? 01 set pf0 and pf1 to function as the txd0 and rxd0 pins respectively. intes0 1 1 0 0 1 1 0 1 enable the inttx0 interrupt and set it to interrupt level 4. enable the intrx0 interrupt and set it to interrupt level 5. sc0mod0 1 0 1 0 1 1 1 0 set f io as the transmission clock for 9-bit uart mode. sc0buf 0 0 0 0 0 0 0 1 set the select code for slave controller 1. inttx0 interrupt sc0mod0 0 ? ? ? ? ? ? ? set tb8 to 0. sc0buf * * * * * * * * set data for transmission. ? setting the slave controller main pfcr ? ? ? ? ? ? 01 pffc ? ? ? ? ? ? 01 pffc2 x x x x x x x 1 select pf1 and pf0 to function as the rxd0 and txd0 pins respectively (open-drain output). intes0 1 1 0 1 1 1 1 0 enable intrx0 and inttx0. sc0mod0 1 0 1 1 1 1 1 0 set to 1 in 9-bit uart transmission mode using f sys as the transfer clock. intrx0 interrupt a cc sc0buf if a cc = select code then sc0mod0 ? ? ? 0 ? ? ? ? clear to 0 txd rxd master txd rxd slave1 txd rxd slave 2 select code 00000001 select code 00001010
tmp92ca25 2007-02-28 92ca25-180 3.9.5 support for irda sio0 includes support for the irda 1.0 in frared data communication specification. figure 3.9.18 shows the block diagram. figure 3.9.18 block diagram (1) modulation of the transmission data when the transmit data is 0, the modem ou tputs 1 to txd0 pin with either 3/16 or 1/16 times for width of baud rate. the pulse width is selected by the sircr. when the transmit data is 1, the modem outputs 0. figure 3.9.19 transmission example (2) modulation of the receive data when the receive data has an effective pulse width of ?1?, the modem outputs ?0? to sio0. otherwise the modem outputs ?1? to sio0. the effective pulse width is selected by sircr. figure 3.9.20 receiving example start transmission data stop 0 0 0 0 1 01 1 txd0 pin start receive data stop 1 1 0 0 10 1 0 rxd0 pin transmission data sio0 ir modulator ir demodulator receive data ir transmitter & led ir receiver modem txd0 rxd0 ir output ir input tmp92ca25
tmp92ca25 2007-02-28 92ca25-181 (3) data format the data format is fixed as follows: ? data length: 8 bits ? parity bits: none ? stop bits: 1 bit (4) sfr figure 3.9.21 shows the control register sircr. set sircr data while sio0 is stopped. the following example desc ribes how to set this register: 1) sio setting ; set the sio to uart mode. 2) ld (sircr), 07h ; set the receive data pulse width to 16 . 3) ld (sircr), 37h ; txen, rxen enable the transmission and receiving. 4) start transmission and receiving for sio0 ; the modem operates as follows: ? sio0 starts transmitting. ? ir receiver starts receiving.
tmp92ca25 2007-02-28 92ca25-182 (5) notes 1. baud rate for irda when irda is operated, set 01 to sc 0mod0 to generate baud rate. settings other than the above (ta0trg, f io and sclk0 input) cannot be used. 2. the pulse width for transmission the irda 1.0 specification is defined in table 3.9.3. table 3.9.3 baud rate and pulse width specifications baud rate modulation rate tolerance (% of rate) pulse width (min) pulse width (typ.) pulse width (max) 2.4 kbps rzi 0.87 1.41 s 78.13 s 88.55 s 9.6 kbps rzi 0.87 1.41 s 19.53 s 22.13 s 19.2 kbps rzi 0.87 1.41 s 9.77 s 11.07 s 38.4 kbps rzi 0.87 1.41 s 4.88 s 5.96 s 57.6 kbps rzi 0.87 1.41 s 3.26 s 4.34 s 115.2 kbps rzi 0.87 1.41 s 1.63 s 2.23 s the pulse width is defined as either baud rate t 3/16 or 1.6 s (1.6 s is equal to 3/16 pulse width when baud rate is 115.2 kbps). the tmp92ca25 has a function which can select the pulse width of transmission as either 3/16 or 1/16. however, 1/16 pulse width can only be selected when the baud rate is equal to or less than 38.4 kbps. for the same reason, when using irda 115.2 kbps with usb, the + (16 ? k)/16 division function in the baud rate genera tor of sio0 cannot be used to generate a 115.2 kbps baud rate, except under special conditions as explained in (6) below. the + (16 ? k)/16 division function cannot be used alsowhen the baud rate is 38.4 kbps and the pulse width is 1/16. table 3.9.4 baud rate and pulse width for (16 ? k)/16 division function baud rate pulse width 115.2 kbps 57.6 kbps 38.4 kbps 19.2 kbps 9.6 kbps 2.4 kbps t 3/16 (note) t 1/16 ? ? : (16 ? k)/16 division function can be used. : (16 ? k)/16 division function cannot be used. ? : cannot be set to 1/16 pulse width. note: (16 ? k)/16 division function can be used under special conditions.
tmp92ca25 2007-02-28 92ca25-183 7 6 5 4 3 2 1 0 bit symbol plsel rxsel txen rxen sirwd3 sirwd2 sirwd1 sirwd0 sircr (1207h) read/write r/w after reset 0 0 0 0 0 0 0 0 function select transmit pulse width 0: 3/16 1: 1/16 receive data 0: ?h? pulse 1: ?l? pulse transmit 0: disable 1: enable receive 0: disable 1: enable select receive pulse width set effective pulse width to equal to or more than 2x (value + 1) + 100 ns can be set: 1 to 14 cannot be set: 0, 15 select receive pulse width formula: effective pulse width 2x (value + 1) + 100 ns x = 1/f sys 0000 cannot be set 0001 equal to or more than 4x + 100 ns to 1110 equal to or more than 30x + 100 ns 1111 cannot be set receive operation 0 disable (received input is ignored) 1 enable transmit operation 0 disable (input from sio is ignored) 1 enable select transmit pulse width 0 3/16 1 1/16 figure 3.9.21 irda control register note: if a pulse width complying with irda1.0 standard (1.6 s min.) can be guaranteed with a low baud rate, setting this bit to ?1? will result in reduced power dissipation.
tmp92ca25 2007-02-28 92ca25-184 3.10 serial bus interface (sbi) the tmp92ca25 has 1-channel serial bus interface which an i 2 c bus mode. the serial bus interface is connected to an ex ternal device through p93 (sda) and p94 (scl) in the i 2 c bus mode. each pin is specified as follows. p9f2 p9cr p9fc i 2 c bus mode 11 11 11 x: don?t care 3.10.1 configuration figure 3.10.1 serial bus interface (sbi) sio clock control divider i 2 c bus clock sync. + control sbi0cr2/ sbi0sr scl sck input/ output control so si sda i2c0ar sbi0br sbi0cr1 sbi0br0, 1 shift register transfer control circuit noise canceller t noise canceller i 2 c bus data control sio data control intsbi interrupt request p94 (so/sda) p93 (scl) sbi0 control register 2/ sbi0 status registe r i 2 c bus address register sbi data buffer register sbi control register 1 sbi baud rate register 0, 1
tmp92ca25 2007-02-28 92ca25-185 3.10.2 serial bus interface (sbi) control the following registers are used to control the serial bus interface and monitor the operation status. ? serial bus interface 0 control register 1 (sbi0cr1) ? serial bus interface 0 control register 2 (sbi0cr2) ? serial bus interface 0 data buffer register (sbi0dbr) ? i 2 c bus 0 address register (i2c0ar) ? serial bus interface 0 status register (sbi0sr) ? serial bus interface 0 baud rate register 0 (sbi0br0) ? serial bus interface 0 baud rate register 1 (sbi0br1) the above registers differ depending on a mo de to be used. refer to section 3.10.4 ?i 2 c bus mode control register?. 3.10.3 the data formats in the i 2 c bus mode the data formats in the i 2 c bus mode is shown below. (a) addressing format (b) addressing format (with restart) (c) free data format (data transferred from master device to slave device) figure 3.10.2 data format in the i 2 c bus mode s slave address r / w data a c k a c k s slave address r / w data a c k a c k p 8 bits 1 1 to 8 bits 1 8 bits 1 1 to 8 bits 1 1 1 or more 1 1 or more s slave address r / w data a c k a c k data a c k p 8 bits 1 1 to 8 bits 1 1 to 8 bits 1 1 1 or more s data data a c k a c k data a c k p 8 bits 1 1 to 8 bits 1 1 to 8 bits 1 1 1 or more s: start condition r/ w : direction bit ack: acknowledge bit p: stop condition
tmp92ca25 2007-02-28 92ca25-186 3.10.4 i 2 c bus mode control register the following registers are used to control and monitor the operation status when using the serial bus interface (sbi) in the i 2 c bus mode. serial bus interface 0 control register 1 7 6 5 4 3 2 1 0 bit symbol bc2 bc1 bc0 ack sck2 sck1 sck0/ swrmon read/write w r/w w r/w after reset 0 0 0 0 0 0 0/1 (note 2) function number of transferred bits acknowl- edge mode specifica- tion 0: not generate 1: generate internal serial clock selection and software reset monitor (note 1) internal serial clock selection at write 000 001 010 011 100 101 110 111 n = 5 n = 6 n = 7 n = 8 n = 9 n = 10 n = 11 reserved ? (note 3) ? (note 3) ? (note 3) ? (note 3) 76.9 khz 38.8 khz 19.5 khz (reserved) system clock: f sys f sys = 20 mhz (internal scl output) fscl = [hz] software reset state monitor at read 0 during software reset 1 initial data acknowledge mode specification 0 not generate clock pulse for acknowledge signal 1 generate clock pulse for acknowledge signal number of bits transferred = 0 = 1 number of clock pulses bits number of clock pulses bits 000 001 010 011 100 101 110 111 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 9 2 3 4 5 6 7 8 8 1 2 3 4 5 6 7 note 1: for the frequency of the scl pin clock, see 3.10.5 (3) ?serial clock?. note 2: initial data of sck0 is ?0?, swrmon is ?1?. note 3: this i 2 c bus circuit does not support fast mode, it supports the standard mode only. although the i 2 c bus circuit itself allows the setting of a baud ra te over 100kbps, the compliance with the i 2 c specification is not guaranteed in that case. figure 3.10.3 registers for the i 2 c bus mode f sys 2 n + 8 sbi0cr1 (1240h) prohibit read- modify- write
tmp92ca25 2007-02-28 92ca25-187 serial bus interface control register 2 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin sbim1 sbim0 swrst1 swrst0 read/write w w (note 1) w (note 1) after reset 0 0 0 1 0 0 0 0 function master/ slave selection transmitter/ receiver selection start/stop condition generation cancel intsbi interrupt request serial bus interface operating mode selection (note 2) 00: port mode 01: (reserved) 10: i 2 c bus mode 11: (reserved) software reset generate write ?10? and ?01?, then an internal software reset signal is generated. serial bus interface operating mode selection (note 2) 00 port mode (serial bus interface output disabled) 01 (reserved) 10 i 2 c bus mode 11 (reserved) intsbi interrupt request 0 ? (cannot clear to ?0?) 1 cancel interrupt request start/stop condition generation 0 generates the stop condition (when mst, trx, pin are ?1?) 1 generates the start condition (when mst, trx, pin are ?1?) transmitter/receiver selection 0 receiver 1 transmitter master/slave selection 0slave 1master note 1: reading this register function as sbi0sr register. note 2: switch a mode to port mode after confirming that the bus is free. switch a mode between i 2 c bus mode after confirming that i nput signals via port are high level. figure 3.10.4 registers for the i 2 c bus mode sbi0cr2 (1243h) prohibit read- modify- write
tmp92ca25 2007-02-28 92ca25-188 serial bus interface status register 7 6 5 4 3 2 1 0 bit symbol mst trx bb pin al aas ad0 lrb read/write r after reset 0 0 0 1 0 0 0 0 function master/ slave status monitor transmitter/ receiver status monitor i 2 c bus status monitor intsbi interrupt request monitor arbitration lost detection monitor 0: ? 1: detected slave address match detection monitor 0: undetected 1: detected general call detection monitor 0: undetected 1: detected last received bit monitor 0: ?0? 1: ?1? last received bit monitor 0 last received bit was ?0? 1 last received bit was ?1? general call detection monitor 0 undetected 1 general call detected slave address match detection monitor 0 undetected 1 slave address match or general call detected arbitration lost detection monitor 0 ? 1 arbitration lost intsbi interrupt request monitor 0 interrupt requested 1 interrupt canceled i 2 c bus status monitor 0 free 1busy transmitter/receiver status monitor 0 receiver 1 transmitter master/slave status monitor 0slave 1master note: writing in this register functions as sbi0cr2. figure 3.10.5 registers for the i 2 c bus mode sbi0sr (1243h) prohibit read- modify- write
tmp92ca25 2007-02-28 92ca25-189 serial bus interface baud rate register 0 7 6 5 4 3 2 1 0 bit symbol ? i2sbi0 read/write w r/w after reset 0 0 function always write ?0?. idle2 0: stop 1: run operation during idle2 mode 0 stop 1 operation serial bus interface baud rate register 1 7 6 5 4 3 2 1 0 bit symbol p4en ? read/write w after reset 0 0 function internal clock 0: stop 1: operate always write ?0?. baud rate clock control 0 stop 1 operate serial bus interface data buffer register 7 6 5 4 3 2 1 0 bit symbol db7 db6 db5 db4 db3 db2 db1 db0 read/write r (received)/w (transfer) after reset undefined note 1: when writing transmitted data, start from the msb (bit7). receiving data is placed from lsb (bit0). note 2: sbi0dbr can?t be read the written data. therefore read-modify-write instruction (e.g., ?bit? instruction) is prohibitted. i 2 c bus 0 address register 7 6 5 4 3 2 1 0 bit symbol sa6 sa5 sa4 sa3 sa2 sa1 sa0 als read/write w after reset 0 0 0 0 0 0 0 0 function slave address selection for when dev ice is operating as slave device address recognition mode specification address recognition mode specification 0 slave address recognition 1 non slave address recognition figure 3.10.6 registers for the i 2 c bus mode sbi0br0 (1244h) prohibit read- modify- write sbi0br1 (1245h) prohibit read- modify- write sbi0dbr (1241h) prohibit read- modify- write i2c0ar (1242h) prohibit read- modify- write
tmp92ca25 2007-02-28 92ca25-190 3.10.5 control in i 2 c bus mode (1) acknowledge mode specification set the sbi0cr1 to ?1? for oper ation in the acknowledge mode. the tmp92ca25 generates an additional clock pulse for an acknowledge signal when operating in master mode. in the transmitter mode during the clock pulse cycle, the sda pin is released in order to receive the acknowledge signal from the receiver. in the receiver mode during the clock pulse cycle, the sda pin is set to the low in order to generate the acknowledge signal. clear the to ?0? for operation in the non-acknowledge mode. the tmp92ca25 does not generate a clock pulse for the acknowledge signal when operating in the master mode. (2) number of transfer bits since the sbi0cr1 is cleared to ?000? on start up, a slave address and direction bit transmissions are executed in 8 bits. other than these, the retains a specified value. (3) serial clock 1. clock source the sbi0cr1 is used to specify the maximum transfer frequency for output on the scl pin in the master mode. set the baud rates, which have been calculated according to the formula below, to meet the specifications of the i 2 c bus, such as the smallest pulse width of t low . sbi0cr1 n 000 5 001 6 010 7 011 8 100 9 101 10 110 11 figure 3.10.7 clock source t high t low 1/fscl t low = 2 n ? 1 /f sbi t high = 2 n ? 1 /f sbi + 8/f sbi fscl = 1/(t low + t high ) = f sbi 2 n + 8 note: f sbi is the clock f sys .
tmp92ca25 2007-02-28 92ca25-191 2. clock synchronization in the i 2 c bus mode, in order to wired-and a bus, a master device which pulls down a clock pin to the low level, in the first place, invalidate a clock pulse of another master device which generates a high-level clock pulse. the master device with a high-level clock pulse needs to detect the situation and implement the following procedure. this device has a clock synchronizatio n function which allows normal data transfer even when more than one master exists on the bus. the following example explains the clock synchronization procedures used when there are two masters present on the bus. figure 3.10.8 clock synchronization when master a pulls the internal scl output to the low level at point ?a?, the bus?s scl pin goes to the low level. after detecting this, master b resets a counter of high-level width of an own clock pulse and sets the internal scl output the low level. master a finishes counting low-level width of an own clock pulse at point ?b? and sets the internal scl output to the high level. since master b is holding the bus?s scl pin the low level, master a waits for counting high-level width of an own clock pulse. after master b has finished counting low-level width of an own clock pulse at point ?c? and master a detects the scl pin of the bus at the high level, and starts counting high level of an own clock pulse. the clock pulse on the bus is determined by the master device with the shortest high-level width and the master device with the longest low-level width from among those master devices connected to the bus. (4) slave address and address re cognition mode specification when this device is to be used as a sl ave device, set the slave address and in i2c0ar. clear the to ?0? for the address recognition mode. (5) master/slave selection to operate this device as a master device set the sbi0cr2 to ?1?. to operate it as a slave device clear the sbi0cr2 to ?0?. the is cleared to ?0? in hardware when a stop co ndition is detected on the bus or when arbitration is lost. start couting high-level width of a clock pulse internal scl output (master a) internal scl output (master b) scl pin wait counting high-level width of a clock pulse reset a counter of high-level width of a clock pulse abc
tmp92ca25 2007-02-28 92ca25-192 (6) transmitter/receiver selection to operate this device as a transmitter se t the sbi0cr2 to ?1?. to operate it as a receiver clear the sbi0cr2 to ?0?. when data with an addressing format is transferred in the slave mode, when a slave address with the same value that an i2c0ar or a general call is received (all 8-bit data are ?0? after a start condition), th e is set to ?1? in hardware if the direction bit ( w r/ ) sent from the master device is ?1?, and is cleared to ?0? in hardware if the bit is ?0?. in the master mode, when an acknowledge si gnal is returned from the slave device, the is cleared to ?0? in hardware if the value of the transmitted direction bit is ?1?, and is set to ?1? in hardware if the value of the bit is ?0?. if an acknowledge signal is not returned, the current state is maintained. the is cleared to ?0? in hardware when a stop condition is detected on the i 2 c bus or when arbitration is lost. (7) start/stop condition generation when the sbi0sr = ?0?, slave address and direction bit which are set to sbi0dbr is output on the bus after generating a start condition by writing ?1111? to the sbi0cr2. it is nece ssary to set transmitted data to the data buffer register (sbi0dbr) and set ?1? to the beforehand. figure 3.10.9 start condition generation and slave address generation when the sbi0sr = ?1?, the sequence for generating a stop condition can be initiated by writing ?111? to the sbi0cr2 and writing ?0? to the sbi0cr2. do not modify the contents of the sbi0cr2 until a stop condition has been generated on the bus. figure 3.10.10 stop condition generation the state of the bus can be ascertained by reading the contents of the sbi0sr. the sbi0sr will be set to ?1? if a star t condition has been detected on the bus, and will be cleared to ?0? if a stop condition has been detected. stop condition generation in master mode have limit. therefore, please refer to 3.10.6 (4) ?stop condition generation?. 1 2 34567 8 9 a6 a5 a4 a3 a2 a1 a0 r/ w slave address and the direction bit a cknowledge signal start condition scl pin sda pin scl pin sda pin stop condition
tmp92ca25 2007-02-28 92ca25-193 (8) interrupt service requests and interrupt cancellation when a serial bus interface interrupt request 0 by transfer of the slave address or the data (intsbi) is generated, the sbi0sr is cleared to ?0?. the scl pin is pulled down to the low-level while the = ?0?. the is cleared to ?0? when a single word of data is transmitted or received. either writing data to or reading data from sbi0dbr sets the to ?1?. the time from the being set to ?1? until the release of the scl pin is t low . in the address recognition mode (e.g., when = ?0?), the is cleared to ?0? when the slave address matches the value set in i2c0ar or when a general call is received (all 8-bit data are ?0? after a start condition). although the sbi0cr2 can be set to ?1? by a program, writing ?0? to the sbi0cr2 does not clear it to ?0?. (9) serial bus interface operation mode selection the sbi0cr2 is used to specify the serial bus interface operation mode. set the sbi0cr2 to ?10? when the device is to be used in i 2 c bus mode after confirming pin condition of serial bus interface to ?h?. switch a mode to port after confirming a bus is free. (10) arbitration lost detection monitor since more than one master device can exist simultaneously on the bus in i 2 c bus mode, a bus arbitration procedure has been implemented in order to guarantee the integrity of transferred data. data on the sda pin is used for i 2 c bus arbitration. the following example illustrates the bus arbitration procedure when there are two master devices on the bus. master a and master b output the same data until point ?a?. after master a outputs ?l? and master b, ?h?, the sda pin of the bus is wire-and and the sda pin is pulled down to the low level by master a. when the scl pin of the bus is pulled up at point ?b?, the slave device reads the data on the sda pin, that is, data in master a. data transmitted from master b becomes invalid. the master b state is known as ?arbitration lost?. master b device which loses arbitration releases the internal sda output in order not to affect data transmitted from other masters with arbitration. when more than one mast er sends the same data at the first word, arbitration occurs continuous ly after the second word. figure 3.10.11 arbitration lost internal sda output becomes ?1? after arbitration has been lost. scl pin internal sda output (master a) internal sda output (master b) sda pin ab
tmp92ca25 2007-02-28 92ca25-194 this device compares the levels on the bus?s sda pin with those of the internal sda output on the rising edge of the scl pin. if the levels do not match, arbitration is lost and the sbi0sr is set to ?1?. when the is set to ?1?, the sbi0sr are cleared to ?00? and the mode is switched to a slave receiver mode. thus, clock output is stopped in data transfer after setting = ?1?. the is cleared to ?0? when data is written to or read from sbi0dbr or when data is written to sbi0cr2. figure 3.10.12 example of a master device b (d7a = d7b, d6a = d6b) (11) slave address match detection monitor the sbi0sr is set to ?1? in the slave mode, in the address recognition mode (e.g., when the i2c0ar = ?0?), when a gene ral call is received, or when a slave address matches the value set in i2c0ar. when the i2c0ar = ?1?, the sbi0sr is set to ?1? after the firs t word of data has been received. the sbi0sr is cleared to ?0? when data is written to or read from the data buffer register sbi0dbr. (12) general call detection monitor the sbi0sr is set to ?1? in the slave mode, when a general call is received (all 8-bit received data is ?0?, after a start condition). the sbi0sr is cleared to ?0? when a start condition or stop condition is detected on the bus. (13) last received bit monitor the value on the sda pin detected on the rising edge of the scl pin is stored in the sbi0sr. in the acknowledge mode, immediately after an intsbi interrupt request has been generated, an acknowledge signal is read by reading the contents of the sbi0sr. stop the clock pulse 1 keep internal sda output to high level as losing arbitration a ccessed to sbi0dbr or sbi0cr2 internal scl output internal sda output internal sda output internal scl output master a master b 2 3456789 1 2 34 d7a d6b d5a d4a d3a d2a d1a d0a d7a? d6a? d5a? d4a? 1 2 3 4 d7b d6a
tmp92ca25 2007-02-28 92ca25-195 (14) software reset function the software reset function is used to initia lize the sbi circuit, when sbi is locked by external noises, etc. an internal reset signal pulse can be generated by setting sbi0cr2 to ?10? and ?01?. this initializes the sbi circuit internally. all command (except sbi0cr2) registers and status registers are initialized as well. the sbi0cr1 is auto matically set to ?1? after the sbi circuit has been initialized. (15) serial bus interface data buffer register (sbi0dbr) the received data can be read and the transferred data can be written by reading or writing the sbi0dbr. when the start condition has been generated in the master mode, the slave address and the direction bit are set in this register. (16) i 2 c bus address register (i2c0ar) i2c0ar is used to set the slave address when this device functions as a slave device. the slave address output from the master device is recognized by setting i2c0ar is set to ?0?. the data format is the addressing format. when the slave address in not recognized at the is set to ?1?, the data format is the free data format. (17) baud rate register (sbi0br1) write ?1? to the sbi0br1 before operation commences. (18) setting register for idle2 mode operation (sbi0br0) the setting of sbi0br0 determines whether the device is operating or is stopped in idle2 mode. therefore, setting is necessary before the halt instruction is executed.
tmp92ca25 2007-02-28 92ca25-196 3.10.6 data transfer in i 2 c bus mode (1) device initialization set the sbi0br1 and the sbi0cr1. set the sbi0br1 to ?1? and clear bits 7 to 5 and 3 of the sbi0cr1 to ?0?. set a slave address in i2c0ar and the i2c0ar ( = ?0? when an addressing format.) for specifying the default setting to a slav e receiver mode, clear ?000? to the , set ?1? to the , set ?10? to the and set ?00? to the . (2) start condition and slave address generation 1. master mode in the master mode the start condition and the slave address are generated as follows. check a bus free status (when = ?0?). set the sbi0cr1 to ?1? (acknowled ge mode) and specify a slave address and a direction bit to be transmitted to the sbi0dbr. when the is ?0?, the start condition is generated by writing ?1111? to the sbi0cr2. subsequently to the start condition, 9 clocks are output from the scl pin. while 8 clocks are output, the slave address and the direction bit which are set to the sbi0dbr. at the 9th clock pulse the sda pin is released and the acknowledge signal is received from the slave device. an intsbi interrupt request occurs on the falling edge of the 9th clock pulse. the is cleared to ?0?. in the master mode the scl pin is pulled down to the low level while the is ?0?. when an intsbi interrupt request occurs, the value of is changed according to the direction bit setting only if the slave device returns an acknowledge signal. 2. slave mode in the slave mode, the start condition and the slave address are received. after the start condition is received from the master device, while 8 clocks are output from the scl pin, the slave address and the direction bit which are output from the master device are received. when a general call or the same a ddress as the slave address set in i2c0ar is received, the sda line is pulled down to the low level at the 9th clock, and the low level at the 9th clock, and the acknowledge signal is output. an intsbi interrupt request occurs on the falling edge of the 9th clock. the is cleared to ?0?. in slave mode th e scl line is pulled down to the low-level while the = ?0?.
tmp92ca25 2007-02-28 92ca25-197 figure 3.10.13 start condition generation and slave address transfer (3) 1-word data transfer check the setting using an intsbi interrupt process after the transfer of each word of data is completed and determine whether the device is in the master mode or the slave mode. 1. when the is ?1? (master mode) check the setting and determine whether the device is in the transmitter mode or the receiver mode. when the is ?1? (transmitter mode) check the setting. when the = ?1?, there is no receiver requesting data. implement the process for generating a stop condition (see section 3.10.6 (4).) and terminate data transfer. when the = ?0?, the receiver is requesting new data. when the next transmitted data is 8 bits, write the transmitted data to the sbi0dbr. when the next transmitted data is other than 8 bits, set the , set the to ?1? and write the transmitted data to the sbi0dbr. after the data has been written, the is set to ?1?, a seri al clock pulse is generated to trigger transfer of the next word of data via the scl pin, and the word is transmitted. after the data has been transmitted, an intsbi interrupt request is generated. the is set to ?0? and the scl pin is pulled down to the low level. if the length of the data to be transferred is greater than one word, repeat the latter steps of the procedure, starting from the check of the setting. figure 3.10.14 example in which = ?000? and = ?1? in transmitter mode 1 2 345678 9 a6 a5 a4 a3 a2 a1 ack r/ w slave address + direction bit a cknowledge signal from a slave device start condition scl pin sda pin intsbi interrupt request output of master output of slave a0 1 2 345678 9 d7 d6 d5 d4 d3 d2 d1 d0 a cknowledge signal from a receiver write to sbi0dbr scl pin sda pin intsbi interrupt request ack output from master output from slave
tmp92ca25 2007-02-28 92ca25-198 when the is ?0? (receiver mode) when the next transmitted data is othe r than 8 bits, set the again. set the to ?1? and read the received data from the sbi0dbr so as to release the scl pin. (the value of data which is read immediately after a slave address is sent is undefined.) after the data has been read, the is set to ?1?. serial clock pulse for transfe rring new 1 word of data is defined scl and outputs ?l? level from sda pin with acknowledge timing. an intsbi interrupt request is generated and the is set to ?0?. then this device pulls down the scl pin to th e low level. this device outputs a clock pulse for 1 word of data transfer and the acknowledge signal each time that received data is read from sbi0dbr. figure 3.10.15 example of when = ?000?, = ?1? in receiver mode in order to terminate the transmission of data to a transmitter, clear the to ?0? before reading data which is 1 word before the last data to be received. the last data does not generate a clock pulse for the acknowledge signal. after the data has been transmitted and an interrupt request has been generated, set the to ?001? and read the data . this device generates a clock pulse for a 1-bit data transfer. since the master device is a receiver, the sda pin on a bus keeps the high level. the transmitter receives the high-level signal as an ack signal. the receiver indicates to the transmitter that data transfer is complete. after 1-bit data is received and an inte rrupt request has occurred, this device generates a stop condition (see section 3. 10.6 (4).) and terminates data transfer. figure 3.10.16 termination of data transfer in master receiver mode 1 2 3 45678 1 d7 d6 d5 d4 d3 d2 d1 d0 a cknowledge signal sent to a transmitter scl pin sda pin intsbi interrupt request ?001? read sbi0dbr ?0? read sbi0dbr 9 output of master output of slave 1 2 3 45678 9 d7 d6 d5 d4 d3 d2 d1 d0 a cknowledge signal to a transmitter read sbi0dbr scl pin sda pin intsbi interrupt request new d7 output from master output from slave ack
tmp92ca25 2007-02-28 92ca25-199 2. when the is ?0? (slave mode) in the slave mode, this device operates either in normal slave mode or in slave mode after losing arbitration. in the slave mode, an intsbi interrupt request occurs when this device receives a slave address or a general call from the master device, or when a general call is received and data transfer is complete, or after matching a received slave address. in the master mode, this device operates in a slave mode if it is losing arbitration. an intsbi in terrupt request occurs when word data transfer terminates after losing arbitration. when an intsbi interrupt request occurs, the is cleared to ?0?, and the scl pin is pulled down to the low level. either reading data to or writing data from the sbi0dbr, or setting the to ?1? releases the scl pin after taking t low time. check the sbi0sr, , , and and implements processes according to conditions listed in the next table.
tmp92ca25 2007-02-28 92ca25-200 table 3.10.1 operation in the slave mode conditions process 1 1 0 this device loses arbitration when transmitting a slave address and receives a slave address of which the value of the direction bit sent from another master is ?1?. 1 0 in the slave receiver mode, this device receives a slave address of which the value of the direction bit sent from the master is ?1?. set the number of bits in 1 word to the and write the transmitted data to the sbi0dbr. 1 0 0 0 in the slave transmitter mode, 1-word data is transmitted. check the . if the is set to ?1?, set the to ?1? since the receiver does not request the next data. then, clear the to ?0? to release the bus. if the is cleared to ?0?, set the number of bits in a word to the and write transmitted data to the sbi0dbr since the receiver requests next data. 1 1/0 this device loses arbitration when transmitting a slave address and receives a general call or slave address of which the value of the direction bit sent from another master is ?0?. 1 0 0 this device loses arbitration when transmitting a slave address or data and terminates transferring word data. 1 1/0 in the slave receiver mode, this device receives a general call or slave address of which the value of the direction bit sent from the master is ?0?. read the sbi0dbr for setting the to ?1? (reading dummy data) or set the to ?1?. 0 0 0 1/0 in the slave receiver mode, the device terminates receiving 1-word data. set the number of bits in a word to the and read received data from the sbi0dbr.
tmp92ca25 2007-02-28 92ca25-201 (4) stop condition generation when the sbi0sr is ?1?, the sequence for generating a stop condition is started by writing ?111? to sbi0cr2 and ?0? to sbi0cr2. do not modify the contents of sbi0cr2 until a stop condition is generated on a bus. when the bus?s scl line has been pulled down by other devices, this device generates a stop condition when the other device has released the scl line and the sda pin rising. figure 3.10.17 stop condition generation (single master) figure 3.10.18 stop condition generation (multi master) internal scl sda pin (read) stop condition ?1? ?1? ?0? ?1? scl pin the case of pulled low by other devices scl pin sda pin (read) stop condition ?1? ?1? ?0? ?1? internal scl
tmp92ca25 2007-02-28 92ca25-202 (5) restart restart is used during data transfer between a master device and a slave device to change the data transfer direction. the fo llowing description explains how to restart when this device is in the master mode. clear the sbi0cr2 to ?000 ? and set the sbi0cr2 to ?1? to release the bus. the sda line remains the high level and the scl pin is released. since a stop condition is not generated on the bus, other devices assume the bus to be in a busy state. check the sbi0sr until it becomes ?0? to check that the scl pin of this device is released. check the until it becomes 1 to check that the scl line on a bus is not pulled down to the low level by other devices. after confirming that the bus stays in a free state, generate a start condition with procedure described in 3.10.6 (2). in order to meet setup time when restarting, take at least 4.7 s of waiting time by software from the time of restarting to co nfirm that the bus is free until the time to generate the start condition. figure 3.10.19 timing diagram when restarting start condition scl line internal scl output sda line 4.7 s (min) ?0? ?0? ?0? ?1? ?1? ?1? ?1? ?1? 9
tmp92ca25 2007-02-28 92ca25-203 3.11 spic (spi controller) spic is the controller that can be connected to sd card, mmc (multi media card) etc. in spi mode. the features as follows. double buffer (transmit/receive) generate crc7 and crc16 (transmit/receive data) baud rate : 20mbps max and 400kbps min connect several sd cards and mmc .( use other output port for spcs pin as cs ) use as general clock synchronous sio msb/lsb-first, 8/16bit data leng th, clock rising/falling edge 1 interrupt : intspi read, mask, clear interrupt and clear enable ca n control each 4 interrupts: rfr (receive buffer of spird: full), rfw (transmission buffer of spitd: empty), rend (receive buffer of spirs: full), tend (transmissi on buffer of spits: empty). rfr, rfw can high-speed transaction by micro dma.
tmp92ca25 2007-02-28 92ca25-204 3.11.1 block diagram it shows block diagram and connection to sd card in figure 3.11.1 note1: spclk, spcs , spdo and spdi pins are set to input port (port k7, k6, k5, k4) by reset. these signals are needed pull-up resister to fix voltage level, could you adjust resistance value for your final set. note2: please use general input port or interrupt si gnal for wp (write protect) and cd (card detect). figure 3.11.1 spic block di agram and connection example f sys baud rate generator spimd/ct spclk spitd spcs spits transmit ,receive controller spdo spird spirs spdi spiie/is/we intspi spicr spic (spi controller) tmp92ca25 sd card sclk cs di do pxx wp (write protect) pyy/inty cd (card detect) 100k 100k 100k 100k internal data bus spist 16bit 16bit 16bit 16bit 16bit 16bit
tmp92ca25 2007-02-28 92ca25-205 3.11.2 sfr sfr of spic are as follows. these are connected to cpu with 16bit data bus. (1) spimd (spi mode setting register) spimd register is for operation mode or clock etc. spimd register 7 6 5 4 3 2 1 0 bit symbol xen clksel2 clksel1 clksel0 read/write r/w r/w after reset 0 1 0 0 function sysck 0: disable 1: enable select baud rate 000:f sys 100: f sys /16 001: f sys /2 101: f sys /32 010: f sys /4 111: f sys /64 011: f sys /8 111:reserved 15 14 13 12 11 10 9 8 bit symbol loopback msb1st dostat tcpol rcpol tdinv rdinv read/write r/w r/w after reset 0 1 1 0 0 0 0 function loopback test mode 0:disbale 1:enable start bit for transmit/rece ive 0:lsb 1:msb spdo pin (no transmit) 0:fixed to ?0? 1:fixed to ?1? synchronous clock edge during transmitting 0: fall 1: rise synchronous clock edge during receiving 0: fall 1: rise invert data during transmitting 0: disable 1: enable invert data during receiving 0: disable 1: enable figure 3.11.2 spimd register (a) because internal spdo can be input to inte rnal spdi, it can be used as test. set =1 and =1, outputs clock from spclk pin regardless of operation of transmit/receive. please change the setting when transmi tting/receiving is not in operation. figure 3.11.3 register function (b) select the start bit of transmit/receive data please change the setting when transmi tting/receiving is not in operation. (c) set the status of spdo pin during no transmitti ng (after transmitting or during receiving). please change the setting when transmi tting/receiving is not in operation. y b spdi pin spdo pin transmitting data receiving data a s spimd spimd (0820h) (0821h)
tmp92ca25 2007-02-28 92ca25-206 (d) select the edge of synchronous clock during transmitting. please change the setting during = ?0?. and set the same value of . figure 3.11.4 register function (e) select the edge of synchronous clock during receiving. please change the setting during = ?0?. and set the same value of . figure 3.11.5 register function (f) select logical invert/no invert when ou tput transmitted data from spdo pin. please change the setting when transmi tting/receiving is not in operation. data that input to crc calculation circuit is transmission data that is written to spitd. this input data is not corresponded to . is not corresponded to : it set condition of spdo pin when it is not transferred. (g) select logical invert/no invert fo r received data from spdi pin. please change the setting when transmi tting/receiving is not in operation. data that input to crc calculation circuit is selected by . (h) select the operation for the internal clock. lsb spclk pin ( = ?0?) spdo pin bit0 bit1 bit2 bit3 bit4 bit7 msb spclk pin ( = ?1?) lsb spclk pin ( = ?0?) spdi pin bit0 bit1 bit2 bit3 bit4 bit7 msb spclk pin ( = ?1?)
tmp92ca25 2007-02-28 92ca25-207 (i) select baud rate. baud rate is created from f sys and settings are in under table. please change the setting when transmi tting/receiving is not in operation. table 3.11.1 example of baud rate baud rate [mbps] f sys = 12mhz f sys = 16mhz f sys = 20mhz f sys 12 16 20 f sys /2 6 8 10 f sys /4 3 4 5 f sys /8 1.5 2 2.5 f sys /16 0.75 1 1.25 f sys /32 0.375 0.5 0.625 f sys /64 0.1875 0.25 0.3125
tmp92ca25 2007-02-28 92ca25-208 (2) spict(spi control register) spict register is for data length or crc etc. spict register figure 3.11.6 spict register (a) select crc7 or crc16 to calculate. (b) select input data to crc calculation circuit. (c) initialize crc calculate register. the process that calculating crc16 of transmits data and sending crc next to transmit data is explained as follows. 1. set spict for select crc7 or crc16 and for select calculating data. 2. for reset spicr register, write ?1? after set to ?0?. 3. write transmit data to spitd register, and wait for finish transmission all data. 4. read spicr register, and obtain the result of crc calculation. 5. transmit crc which is obtained in (4) by the same way as (3). crc calculation of receive data is the same process. 7 6 5 4 3 2 1 0 bit symbol cen spcs_b unit16 algnen rxwen rxuen read/write r/w r/w after reset 0 1 0 0 0 0 function communication control 0: disable 1: enable spcs pin 0: output ?0? 1: output ?1? data length 0: 8bit 1: 16bit full duplex alignment 0: disable 1: enable sequential receive 0: disable 1: enable receive unit 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol crc16_7_b crcrx_tx_b crcreset_b dmaerfw dmaerfr read/write r/w r/w after reset 0 0 0 0 0 function crc select 0: crc7 1: crc16 crc data 0: transmit 1: receive crc calculate register 0:reset 1:release reset micro dma 0: disable 1: enable micro dma 0: disable 1: enable spict (0822h) (0822h)
tmp92ca25 2007-02-28 92ca25-209 figure 3.11.7 flow chart of crc calculation start = ?1?, = ?0? = ?0? ?1? transmit all data read crc from spicr write crc to spitd and send end
tmp92ca25 2007-02-28 92ca25-210 (d) set clearing interrupt in cpu to unnecessary because be supported rfr interrupt to micro dma. if write ?1? to, it be set to one-shot interrupt, clearing interrupt by spiwe register become to unnecessary. spist flag generate 1-shot interrupt when change from ?0? to ?1?(rising). (e) set clearing interrupt in cpu to unnecessary because be supported rfr interrupt to micro dma. if write ?1? to, it be set to one-shot interrupt, clearing interrupt by spiwe register become to unnecessary. spist flag genera te 1-shot interrupt when change from ?0? to ?1?(rising). (f) select enable/disable of the pin for sd card or mmc. when the card isn?t inserted or no-power supply to dvcc, penetrated current is flowed because spdi pin becomes floating. in addition, current is flowed to the card because spcs , spclk and spdo pin output ?1?. this register can avoid these matters. if write ?0? to with pkcr and pkfc selecting spcs , spclk, spdo and spdi signal, spdi pin is prohibit to input (avoiding penetrated current) and spcs , spclk, spdo pin become high impedance. please write = ?1? after card is inserted, supply power to vcc of card and supply clock to this circuit (spimd = ?1?). (g) set the value output to spcs pin. (h) select the length of transmit/receive data. data length is described as unit downward. please change the setting when transmi tting/receiving is not in operation. (i) select whether using alignment function for transmit/receive per unit during full duplex. please change the setting when transmi tting/receiving is not in operation. (j) set enable/disable of sequential receiving. (k) set enable/disable of receiving oper ation per unit. in case = ?1?, this bit is not valid. please change the setting when transmi tting/receiving is not in operation.
tmp92ca25 2007-02-28 92ca25-211 [transmit / receive operation mode] it is supported 8 operation modes. they are selected in , and registers. table 3.11.2 transmit/receive operation mode register setting operation mode note (1) transmit unit 0 0 0 transmit written data per unit (2) sequential transmit 0 0 0 transmit written data sequentially (3) receive unit 0 0 1 receive data of only 1 unit (4) sequential receive 0 1 0 receive automatically if buffer has space (5)transmit/receive unit with no alignment 0 0 1 transmit/receive 1 unit at once with no alignment per each unit (6) sequential transmit/receive unit with no alignment 0 1 0 transmit/receive sequentially at once with no alignment per each unit (7) transmit/receive unit with alignment 1 0 1 transmit/receive 1 unit with alignment per each unit (8) sequential transmit/receive unit with alignment 1 1 0 transmit/receive sequentially with alignment per each unit
tmp92ca25 2007-02-28 92ca25-212 difference between unit transmission and sequential transmission unit transmit mode is transmitted every 1 unit by writing data after confirmed spist = 1.the written transmission da ta is shifted in turn. in hard ware, transmission is kept executing as long as data exists. if it transmit data sequentially, write next data when spitd is empty and spist = 1. unit transmission and sequential transmission depend on the way of using. hardware doesn?t depend on. figure 3.11.8 show flow chart of unit tr ansmission and sequen tial transmission. figure 3.11.8 flow chart of unit tr ansmission and sequential transmission y n n n y y n unit transmission sequential transmission y write transmission data to spitd does spits have space? spist = 1? does spitd have space? spist = 1? does spitd have space? spist = 1? transmission all data end? transmission all data end? transmission end? spist = 1? transmission end? spist = 1? start transmission end transmission end y n n n y y write transmission data to spitd start
tmp92ca25 2007-02-28 92ca25-213 difference between unit receiv e and sequential receive unit receive is the mode that receiving only 1 unit data. by writing ?1? to spict, receives 1unit data, and received data is loaded in receive data register (spird). when spird re gister is read, read it after wrote ?0? to spict. if data was read from spird with the condition spict = ?1?, 1 unit data is received again automatically. in hardware, this mode receives sequentially by single buffer. spist is changed during unit receiving. sequential receive is the mode that receive data and automatically when receive fifo has space. whenever buffer has space, next data is received automatically. therefore, if data was read after data is loaded in spird, it is received sequentially every unit. in hardware, this mode receives sequentially by double buffer. figure 3.11.9 show flow chart of unit receive and sequential receive.
tmp92ca25 2007-02-28 92ca25-214 figure 3.11.9 flow chart of unit receive and sequential receive start program receive number -1 receiving end? end y n n y read receive data from spird receiving end? spist = 1? n y write ?1? to spict write ?0? to spict read last receiving data from spird last receiving end? spist = 1? start program receive number -2 receiving end? end y n n y read receiving data from spird n y write ?1? to spict write ?0? to spict read last receiving data from spird n y n y read second data from last from spird receiving end? spist = 1? last second receiving end ? spist = 1? last second receiving end ? spist = 1? does last-data exist in spird? spist=1? unit receive sequential receive
tmp92ca25 2007-02-28 92ca25-215 no alignment transmit/receive and alignment transmit/receive in no-alignment mode, transmit/receive operate asynchronous and individually. this is the sample waveform when starts unit receive by writing = ?1?, and then write transmit data in (spitd) register before finishing the receiving. note: in no-alignment mode, clock is sometimes output from tr ansmitter/receiver even when no data is in receiver/transmitter. figure 3.11.10 no-alignment transmit/receive bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 lsb receiver spclk output spdi input start receiving lsb spclk output spdo output transmitter spclk output lsb spdi input lsb spdo output in this spi circuit, output waveform is overlapped as follows; start transmitting bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7
tmp92ca25 2007-02-28 92ca25-216 in alignment mode, it differs from no-alignment mode in transmit/receive is synchronous every unit though it is identical in transmit and receive operate simultaneously. writing = ?1? first, and spict= ?1? and keep waiting state for starting unit receiving. when writing spict= ?1? after = ?1?, receiving does not start right away. this is because the data to transmit at the same time has not been prepared. transmit/receive start when writing the data to (spitd) register with the condition = ?1?. the waveform of each transmit/receive operation is as follows; figure 3.11.11 alignment transmit/receive transmitter spclk output spdi input lsb spclk output spdo output receiver lsb start receiving start transmitting bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7
tmp92ca25 2007-02-28 92ca25-217 (3) interrupt , status register read of condition, mask of condition, clear interrupt and clear enable can control each 4 interrupts; rfr (spird receiving buffer is full), rfw (spitd transmission buffer is empty), rend (spirs receiving buffer is full), tend (spits transmission buffer is empty). rfr, rfw can high-speed transaction by micro dma. following is description of interrupt ? status (example rfw). status register spist show rfw (inter nal signal that show whether transmission data register exist or not). this register is ?0? when transmission data exist. this register is ?1? when transmission data doesn?t exist. it ca n read internal signal directly. therefore, it can confirm transmission data at any time. interrupt status register spiis is set by rising edge of rfw. this register keeps that condition until write ?1? to this register and reset when spiwe is ?1?. rfw interrupt generate when interrupt enable register spiie is ?1?. when it is ?0?, interrupt is not generated. interrupt request register spiir show whether interrupt is generating or not. interrupt status write enable register spiwe set that enables reset for reset interrupts status regi ster by mistake. circuit config of transmission data shift register (spits), receiving register (spird), receiving data shift register (spirs) are same with above register. control register spict, spict is register for using micro dma. when micro dma transfer is executed by using rfw interrupt, set ?1? to , and when it is executed by us ing rfr interrupt, set ?1? to , and prohibit other interrupt. figure 3.11.12 figurer for interrupt, status interrupt enable register spiie d q ck q s r interrupt status register spiis interrupt request register spiir no transmit of tansmission data register (spitd) 0: exist data, 1:no data write ?1? d q ck interrupt status write enable register spiwe status (tend) of transmission data shift register (spist) 0: exist data, 1: no data status (rfr) of receiving data register (spird) 0: exist data, 1: no data status (rend) of receiving data shift register (spirs) 0: exist data, 1: no data control register spict control register spict status register spist stattus (rfw) of transmission data register (spitd): exist data:0, no data: 1 rising edge detection intspi
tmp92ca25 2007-02-28 92ca25-218 (3-1) spist(spi status register) spist shows 4 status. spist register 7 6 5 4 3 2 1 0 bit symbol tend rend rfw rfr read/write r after reset 1 0 1 0 function receiving 0:operation 1: no operation receive shift register 0: no data 1: exist data transmit buffer 0: untransmitted data exist 1: no untransmitted data receive buffer 0:no valid data 1:valid data exist 15 14 13 12 11 10 9 8 bit symbol read/write after reset function figure 3.11.13 spist register (a) this bit is set to ?0? when valid data to transm it exists in the shift register for transmit. it is set to ?1? when finish transmitting all the data. (b) this bit is set to ?0? when receiving is in operation or no valid data exist in receive shift register. it is set to ?1?, when valid data exist in re ceive read register and keep the data without shifting. it is cleared to ?0?, when cpu read the data and shift to receive read register. (c) after wrote the received data to receive data write register, shift the data to receive data shift register. it keeps ?0? until all valid data has moved. and it is set to ?1? when it can accept the next data with no valid data. (d) this bit is set to ?1? when received data is shifted from received da ta shift register to received data read register and valid data exist. it is set to ?0? when the data is read and no valid data. spist (0824h) (0825h)
tmp92ca25 2007-02-28 92ca25-219 (3-2) spiis(spi interrupt status register) spiis register read 4 interrupt status and clear interrupt. this register is cleared to ?0? by writing ?1? to applicable bit. status of this register show interrupt source state. this register can confir m changing of interrupt condition, even if spi interrupt enable register (spiie) is masked. spiis register 7 6 5 4 3 2 1 0 bit symbol tendis rendis rfwis rfris read/write r/w after reset 0 0 0 0 function read 0:no interrupt 1:interrupt write 0:don?t care 1:clear read 0:no interrupt 1:interrupt write 0:don?t care 1:clear read 0:no interrupt 1:interrupt write 0:don?t care 1:clear read 0:nointerrupt 1:interrupt write 0:don?t care 1:clear 15 14 13 12 11 10 9 8 bit symbol read/write after reset function figure 3.11.14 spiis register (a) this bit read status of tend interrupt and clear interrupt. if write this bit, set ?1? to spiwe. (b) this bit read status of rend interrupt and clear interrupt. if write this bit, set ?1? to spiwe. (c) this bit read status of rfw interrupt and clear interrupt. if write this bit, set ?1? to spiwe. (d) this bit read status of rfr interrupt and clear interrupt. if write this bit, set ?1? to spiwe. spiis (0828h) (0829h)
tmp92ca25 2007-02-28 92ca25-220 (3-3) spiwe(spi interrupt status write enable register) spiwe register set clear enable for 4 interrupt stasus bit. spiwe register 7 6 5 4 3 2 1 0 bit symbol tendwe rendwe rfwwe rfrwe read/write r/w after reset 0 0 0 0 function clear spiis 0: disable 1: enable clear spiis 0: disable 1: enable clear spiis 0: disable 1: enable clear spiis 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol read/write after reset function figure 3.11.15 spiwe register (a) this bit set clear enable of spiis. (b) this bit set clear enable of spiis. (c) this bit set clear enable of spiis. (d) this bit set clear enable of spiis. spiwe (082ah) (082bh)
tmp92ca25 2007-02-28 92ca25-221 (3-4) spiie(spi interrupt enable register) spiie register set output enable for 4 interrupt. spiie register 7 6 5 4 3 2 1 0 bit symbol tendie rendie rfwie rfrie read/write r/w after reset 0 0 0 0 function tend interrupt 0: disable 1: enable rend interrupt 0: disable 1: enable rfw interrupt 0: disable 1: enable rfr interrupt 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol read/write after reset function figure 3.11.16 spiie register (a) this bit set tend interrupt enable. (b) this bit set rend interrupt enable. (c) this bit set rfw interrupt enable. (d) this bit set rfr interrupt enable. spiie (082ch) (082dh)
tmp92ca25 2007-02-28 92ca25-222 (3-5) spiir(spi interrupt request register) spiir register show generation condition for 4 interrupts. this regiter read ?0? (interrupt doesn?t ge nerate) always when spininterrupt enable register (spiie) is masled. spiir register 7 6 5 4 3 2 1 0 bit symbol tendir rendir rfwir rfrir read/write r after reset 0 0 0 0 function tend interrupt 0: none 1:generate rend interrupt 0: none 1:generate rfw interrupt 0: none 1:generate rfr interrupt 0: none 1:generate 15 14 13 12 11 10 9 8 bit symbol read/write after reset function figure 3.11.17 spiir register (a) this bit shows condition of tend interrupt generation. (b) this bit shows condition of rend interrupt generation. (c) this bit shows condition of rfw interrupt generation. (d) this bit shows condition of rfr interrupt generation. spiir (082eh) (082fh)
tmp92ca25 2007-02-28 92ca25-223 (4) spicr (spi crc register) spicr register load result of crc calculation for transmission/receiving in it. spicr register 7 6 5 4 3 2 1 0 bit symbol crcd7 crcd6 crcd5 crcd4 crcd3 crcd2 crcd1 crcd0 read/write r after reset 0 0 0 0 0 0 0 0 function crc calculation result load register [7:0] 15 14 13 12 11 10 9 8 bit symbol crcd15 crcd14 crcd13 crcd12 crcd11 crcd10 crcd9 crcd8 read/write r after reset 0 0 0 0 0 0 0 0 function crc calculation result load register [15:8] figure 3.11.18 spicr register (a) the result that is calculated according to the setting; spict, and , are loaded in this register. in case crc16, all bits are valid. in case crc7, lower 7 bits are valid. the flow will be showed to calculate crc16 of received data for instance by flowchart. firstly, initialize crc calculation register by writing = ?1? after set = ?1?, = ?0?, = ?0?. next, finish transmitting all bits to calculate crc by writing data in spitd register. confirming whether receiving is finished or not use spist. if spicr register was read after finish , crc16 of transmission data can read. spicr (0826h) (0827h)
tmp92ca25 2007-02-28 92ca25-224 (5) spitd(spi transmisson data register) spitd register is register for write transmission data. spitd register 7 6 5 4 3 2 1 0 bit symbol txd7 txd6 txd5 txd4 txd3 txd2 txd1 txd0 read/write r/w after reset 0 0 0 0 0 0 0 0 function transmission data register [7:0] 15 14 13 12 11 10 9 8 bit symbol txd15 txd14 txd13 txd12 txd11 txd10 txd9 txd8 read/write r/w after reset 0 0 0 0 0 0 0 0 function transmission data register [15:8] figure 3.11.19 spitd register (a) this bit is bit for write transmission data. when read, the last written data is read. the data is overwritten when next data was written with condition of this register does not empty. in this case, please write after checked the status of rfw. in case spict = ?1?, all bits are valid. in case spict = ?0?, lower 7 bits are valid. spitd (0830h) (0831h)
tmp92ca25 2007-02-28 92ca25-225 (6) spird(spi receiving data register) spird register is register for read receiving data. spird register 7 6 5 4 3 2 1 0 bit symbol rxd7 rxd6 rxd5 rxd4 rxd3 rxd2 rxd1 rxd0 read/write r after reset 0 0 0 0 0 0 0 0 function receive data register [7:0] 15 14 13 12 11 10 9 8 bit symbol rxd15 rxd14 rxd13 rxd12 rxd11 rxd10 rxd9 rxd8 read/write r after reset 0 0 0 0 0 0 0 0 function receive data register [15:8] figure 3.11.20 spird register (a) spird register is register for reading receiving data. please read after checked status of rfk. in case spict = ?1?, all bits are valid. in case spict = ?0?, lower 7 bits are valid. spird (0832h) (0833h)
tmp92ca25 2007-02-28 92ca25-226 (7) spits (spi receiving data shift register) spits register change tr ansmission data to serial. this register is used for confirming changing condition when lsi test. spits register 7 6 5 4 3 2 1 0 bit symbol tsd7 tsd6 tsd5 tsd4 tsd3 tsd2 tsd1 tsd0 read/write r after reset 0 0 0 0 0 0 0 0 function transmit data shift register [7:0] 15 14 13 12 11 10 9 8 bit symbol tsd15 tsd14 tsd13 tsd12 tsd11 tsd10 tsd9 tsd8 read/write r after reset 0 0 0 0 0 0 0 0 function transmit data shift register [15:8] figure 3.11.21 spits register (a) this register is register for reading the st atus of transmission data shift register. in case spict = ?1?, all bits are valid. in case spict = ?0?, lower 8 bits are valid. spits (0834h) (0835h)
tmp92ca25 2007-02-28 92ca25-227 (8) spirs(spi receive data shift register) spirs register is register for re ading receive data shift register. spirs register 7 6 5 4 3 2 1 0 bit symbol rsd7 rsd6 rsd5 rsd4 rsd3 rsd2 rsd1 rsd0 read/write r after reset 0 0 0 0 0 0 0 0 function receive data shift register [7:0] 15 14 13 12 11 10 9 8 bit symbol rsd15 rsd14 rsd13 rsd12 rsd11 rsd10 rsd9 rsd8 read/write r after reset 0 0 0 0 0 0 0 0 function receive data shift register [15:8] figure 3.11.22 spirs register (a) this register is register for reading the status of receives data shift register. in case spict = ?1?, all bits are valid. in case spict = ?0?, lower 7 bits are valid. spirs (0836h) (0837h)
tmp92ca25 2007-02-28 92ca25-228 3.11.3 operation timing following examples show operation timing. ? setting condition 1: transmission in unit = 8bit, lsb first figure 3.11.23 transmission timing in above condition, spist flag is set to ?0? just after wrote transmission data. when data of spitd register finish sh ifting to transmission register (spits), spist is set to ?1?, it is informed that can write next transmi ssion data, start transmission clock and data from spclk pin and spdo pin at same time with inform. in this case, spiis, spiir change and intspi interrupt generate by synchronization to rising of spist flag. when spiir register is setting to ?1?, interrupt is not generated even if spist was set to ?1?. when finish transmission and lose data that must to transmit to spitd register and spits register, transmission data and clock are stopped by setting ?1? to spist, and intspi interrupt is generated at same time. in this case, if spist is set to ?1? at different interrupt source, intspi is not generated. th erefore must to clear spiis to ?0?. spclk pin ( = ?0? ) spdo pin spclk pin ( = ?1?) msb msb spiis spiis spist spist intspi interrupt signal spitd write p ulse spiir (spiie = ?1?) spiis clear write p ulse spiir (spiie = ?1?) lsb lsb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7
tmp92ca25 2007-02-28 92ca25-229 ? setting condition 2: unit transmission in unit = 8bit, lsb first figure 3.11.24 unit receiving (spict = 1) if set spict to ?1? without valid receiving data to spird register (spist = ?0?), unit receiving is started. when rece iving is finished and stored receiving data to spird register, spist flag is set to ?1?, and inform that can read receiving data. just after read spird register, spist flag is cleared to ?0? and it start receiving next data automatically. if be finished unit receiving, set spict to ?0? after confirmed that spist was set to ?1?. spird read p ulse spclk pin ( = ?0? ) spdi pin spclk pin ( = ?1?) lsb msb msb spiis spiis spist spist lsb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7
tmp92ca25 2007-02-28 92ca25-230 ? setting condition 3: sequential receiving in unit = 8 bit, lsb first figure 3.11.25 continuous re ceiving (spict=1) if set spict to ?1? without va lid receiving data in spird register (spist = 0), sequential receiving is started. when first receiving is finished and stored receiving data to spird register, spist flag is set to ?1?, and inform that can read receiving data. sequential receiving is received until receiving data is stored to spird and spirs registers if finished se quential receiving, set spict< rxwen> to ?0? after confirmed that spist was set to ?1?. spird read p ulse spclk pin ( = ?0? ) spdi pin spclk pin ( = ?1?) spiis spist spist spiis lsb msb lsb msb lsb msb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7
tmp92ca25 2007-02-28 92ca25-231 ? setting condition 4: transmission by using micro dma in unit = 8bit, lsb first figure 3.11.26 micro dma transmission (transmission) if all bits of spiie register are ?0? and spic t is ?1?, transmission is started by writing transmission data to spitd register. if data of spitd register is shifted to spits register and spist is set to ?1? and can write next transmission data, intspi interrupt (rfw interrupt) is generated. by starting micro dma at this interrupt, can transmit sequential data automatically. however, if transmit it at micr o dma, set micro dma beforehand. spitd write p ulse spclk pin ( = ?0? ) spdo pin spclk pin ( = ?1?) spiis spiis spist spist intspi interrupt pulse spiir lsb msb lsb msb lsb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7 bit0
tmp92ca25 2007-02-28 92ca25-232 ? setting condition 5: receiving by using micro dma in unit = 8bit, lsb first figure 3.11.27 micro dma transmission (unit receiving (spict=1)) if all bits of spiie register is ?0? and spict is ?1?, unit receiving is started by setting spict to ?1?. if receiving data is stored to spird register and can read receiving data, intspi interrupt (rfr interrupt) is generated. by starting micro dma at this interrupt, it can be received sequential data automatically. however, if receive it at micro dma, set micro dma beforehand. spird read p ulse spiis spiis spist spist intspi interrupt pulse spclk pin ( = ?0? ) spdi pin spclk pin ( = ?1?) lsb msb lsb msb bit0 bit1 bit2 bit3 bit4 bit7 bit0 bit1 bit2 bit3 bit4 bit7
tmp92ca25 2007-02-28 92ca25-233 3.11.4 example following is discription of spidcc setting method. (1) unit transmission this example show case of transmission is executed by following setting, and it is generated intspi interrupt by finish transmission. unit: 8bit lsb first baud rate : f sys /8 synchronous clock edge: rising setting expample ld (pkfc), 0xf0 ; port setting pk4: spdi, pk5: spdo, pk6:spcs_b, pk7: spclk ld (pkcr), 0xe0 ; port setting pk4: spdi, pk5: spdo, pk6:spcs_b, pk7: spclk ldw (spict),0x0080 ; connection pin enable, spcs pin output ?0?, set data length to 8bit ldw (spimd),0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronous clock edge setting: set to rising ld (spiie),0x08 ; set to tend interrupt enable ld (intespi),0x10 ; set intspi interrupt level to 1 ei ; interrupt enable (iff = 0) loop ;confirm that transmission data regi ster doesn?t have no transmission data bit 1,(spist) ; = 1 ? jr z,loop ld (spitd),0x3a ; write transmission data and start transmission ? ? ? figure 3.11.28 example of unit transmission spclk output spdo output spitd write pulse intspi interrupt signal (internal clock)
tmp92ca25 2007-02-28 92ca25-234 (2) unit receiving this example show case of receiving is executed by following setting, and it is generated intspi interrupt by finish receiving. unit: 8bit lsb first baud rate selection : f sys /8 synchronous clock edge: rising setting example ld (pkfc),0xf0 ; port setting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ld (pkcr),0xe0 ; port setting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ldw (spict),0x0080 ; connection pin enable, spcs pin ?0? output, set data length to 8bit ldw (spimd),0x2c43 ; system clock enable, baud rate selection : f sys /8 ; lsb first, synchronous clock edge setting: set to rising ld (spiie),0x01 ; set to rfr interrupt enable ld (intespi),0x10 ; set intspi interrupt level to 1 ei ; interrupt enable (iff = 0) set 0x0,(spict) ; start unit receiving ? ? ? figure 3.11.29 example of unit receiving spclk output spdi input spict write pulse intspi interrupt signal spird data xx 0x3a
tmp92ca25 2007-02-28 92ca25-235 (3) sequential transmission this example show case of transmission is executed by following setting, and it is executed 2byte sequential transmission. unit: 8bit lsb first baud rate selection: f sys /8 synchronous clock edge: rising setting example ld (pkfc),0xf0 ; port setting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ld (pkcr),0xe0 ; port setting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ldw (spict),0x0080 ; connection pin enable, spcs pin ?0" output, set data length to 8bit ldw (spimd),0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronous clock edge setting: set to rising loop1: ; confirm that transmissi on data register doesn?t have no transmission data bit 1,(spist) ; = 1 ? jr z,loop1 ld (spitd),0x3a ; writ e transmission data of first byte and start transmission loop2 ; confirm that transmissi on data register doesn?t have no-transmission data bit 1,(spist) ; = 1 ? jr z,loop2 ld (spitd),0x55 ; write transmission data of second byte loop3: ; confirm that transmission data r egister doesn?t have no-transmission data bit 3,(spist) ; = 1 ? jr z,loop3 ? ; finish transmission ? note: timing of this figure is an example. there is also that transmission interbal between first byte and sescond byte generat e. (high baud rate etc.) figure 3.11.30 example of sequential transmission spclk output spdo output spitd write pulse intspi (rfw) interrupt signal
tmp92ca25 2007-02-28 92ca25-236 (4) sequential receiving this example show case of receiving is executed by following setting, and it is executed 2byte sequential receiving. unit: 8bit lsb first baud rate selection: f sys /8 synchronous clock edge: rising setting example ld (pkfc),0xf0 ; port setting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ld (pkcr),0xe0 ; port setting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ldw (spict),0x0080 ; connection pin enable, spcs pin output "0", set data length to 8bit ldw (spimd),0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronous clock edge setting: set to rising set 0x01,(spict) ; start sequential receiving loop1: ; confirm that receiving data register has receiving data of first byte bit 0,(spist) ; = 1 ? jr z,loop1 loop2: ; confirm that receiving data register has receiving data of second byte bit 2,(spist) ; = 1 ? jr z,loop2 res 0x01,(spict) ; sequential receiving disable ld a,(spird) ; read receiving data of first byte loop3: ; confirm that receiving data of second byte is shifted from receiving data shift register to receiving data register bit 0,(spist) ; = 1 ? jr z,loop3 ld w(spird) ; read receiving data of second byte figure 3.11.31 example of sequential receiving spclk output spdi input spird read pulse spirs data xx 0x3a spird data xx 0x55 0x55
tmp92ca25 2007-02-28 92ca25-237 (5) sequeintial transmission by using micro dma this example show case of sequential transmission of 4byte is executed at using micro dma by following setting. unit: 8bit lsb first baud rate : f sys /8 synchronous clock edge: rising setting example main routine ;-- micro dma setting -- ld (dma0v),0x2a ; set micro dma0 to intspi ld wa,0x0003 ; set number of micro dma transmission to that number -1 (third time) ldc dmac0,wa ld a,0x08 ; micro dma mode setting: source inc mode, 1 byte transfer ldc dmam0,a ld xwa,0x806000 ; set source address ldc dmas0,xwa ld xwa,0x830 ; set source address to spitd register ldc dmad0,xwa ;-- spic setting -- ld (pkfc),0xf0 ; port setting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ld (pkcr),0xe0 ; port setting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ldw (spict),0x0080 ; connection pin enable, spcs pin output "0", set data length to 8bit ldw (spimd),0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronous clock edge setting: set to rising ld (spiie),0x00 ;set to interrupt disable set 1,(spict + 1) ; set micro dma operation by rfw to enable ld (intetc01),0x01 ; set inttc0 interrupt level to 1 ei ; interrupt enable (iff = 0) loop1: ; confirm that transmission data register doesn?t have no transmission data bit 1,(spist) ; = 1 ? jr z,loop1 ld (spitd),0x3a ; write transmission data and start transmission interrupt routine (inttc0) loop2: bit 1,(spist) ; = 1 ? jr z,loop2 bit 3,(spist) ; = 1 ? jr z,loop2 nop
tmp92ca25 2007-02-28 92ca25-238 (6) unit receiving by using micro dma this example show case of unit receiving sequentially 4byte is executed at using micro dma by following setting. unit: 8bit lsb first baud rate : f sys /8 synchronous clock edge: rising setting example main routine ;-- micro dma setting -- ld (dma0v),0x2a ; set micro dma0 to intspi ld wa,0x0003 ; set number of micro dma transmission to that number -1 (third time) ldc dmac0,wa ld a,0x00 ; micro dma mode setting: source inc mode, 1 byte transfer ldc dmam0,a ld xwa,0x832 ; set source address to spird register ldc dmas0,xwa ld xwa,0x807000 ; set source address ldc dmad0,xwa ;-- spic setting -- ld (pkfc),0xf0 ; port se tting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ld (pkcr),0xe0 ; port setting pk4:spdi, pk5:spdo, pk6:spcs_b, pk7:spclk ldw (spict),0x0080 ; connection pin enable, spcs pin output ?0?, set data length to 8bit ldw (spimd),0x2c43 ; system clock enable, baud rate selection: f sys /8 ; lsb first, synchronous clock edge setting: set to rising ld (spiie),0x00 ; set to interrupt disable set 0,(spict + 1) ; set micro dma operation by rfr to enable ld (intetc01),0x01 ; set inttc0 interrupt level to 1 ei ; interrupt enable (iff = 0) set 0x0,(spict) ; start unit receiving interrupt routine (inttc0) loop2: ; wait receiving finish case of unit receiving bit 0,(spist) ; = 1 ? jr z,loop2 res 0,(spict) ; unit receiving disable ld a,(spird) ; read last receiving data nop
tmp92ca25 2007-02-28 92ca25-239 3.12 analog/digital converter the tmp92ca25 incorporates a 10-bit success ive approximation type analog/digital converter (ad converter) with 4-channel analog input. figure 3.12.1 is a block diagram of the ad conver ter. the 4-channel analog input pins (an0 to an3) are shared with the input only port g so they can be used as an input port. note: when idle2, idle1 or stop mode is select ed, in order to reduce power consumption, the system may enter a stand-by mode with some timings even though the internal comparator is still enabled. therefore be sure to check that ad converter operati ons are halted before a halt instruction is executed. figure 3.12.1 block diagram of ad converter internal data bus ad mode control register 0 admod0 ad mode control registers 1 and 2 admod1, 2 ad converter control circuit scan re p eat interru p t busy end start adtrg ad conversion result register adreg0l to adreg3l adreg0h to adreg3h da converter sample and hold multiplexer decoder com p arato r an3, adtrg (pg3) an2 (pg2) an1 (pg1) an0 (pg0) vrefh vrefl intad interrupt channel select analog input
tmp92ca25 2007-02-28 92ca25-240 3.12.1 analog/digital converter registers the ad converter is controlled by the three ad mode control registers: admod0, admod1 and admod2. the four ad conversion data result registers (adreg0h/l to adreg3h/l) store the results of ad conversion. figure 3.12.2 shows the registers related to the ad converter. ad mode control register 0 7 6 5 4 3 2 1 0 bit symbol eocf adbf ? ? itm0 repeat scan ads admod0 (12b8h) read/write r r/w after reset 0 0 0 0 0 0 0 0 function ad conversion end flag 0: conversion in progress 1: conversion complete ad conversion busy flag 0: conversion stopped 1: conversion in progress always write ?0? always write ?0? interrupt specification in conversion channel fixed repeat mode 0: every conversion 1: every fourth conversion repeat mode specification 0: single conversion 1: repeat conversion mode scan mode specification 0: conversion channel fixed mode 1: conversion channel scan mode ad conversion start 0: don?t care 1: start conversion always ?0? when read ad conversion start 0 don?t care 1 start ad conversion note: always read as ?0?. ad scan mode setting 0 ad conversion channel fixed mode 1 ad conversion channel scan mode ad repeat mode setting 0 ad single conversion mode 1 ad repeat conversion mode specify ad conversion interrupt for channel fixed repeat conversion mode channel fixed repeat conversion mode = ?0?, = ?1? 0 generates interrupt every conversion. 1 generates interrupt every fourth conversion. ad conversion busy flag 0 ad conversion stopped 1 ad conversion in progress ad conversion end flag 0 before or during ad conversion 1 ad conversion complete figure 3.12.2 ad converter related register
tmp92ca25 2007-02-28 92ca25-241 ad mode control register 1 7 6 5 4 3 2 1 0 bit symbol vrefon i2ad ? ? ? ? adch1 adch0 admod1 (12b9h) read/write r/w after reset 0 0 0 0 0 0 0 0 function vref application control 0: off 1: on idle2 0: stop 1: operate always write ?0? always write ?0? always write ?0? always write ?0? analog input channel selection analog input channel selection 0 channel fixed 1 channel scanned 00 an0 an0 01 an1 an0 an1 10 an2 an0 an1 an2 11 (note) an3 an0 an1 an2 an3 idle2 control 0 stopped 1 in operation control of application of reference voltage to ad converter 0 off 1on before starting conversion (before writing 1 to admod0), set the bit to 1. ad mode control register 2 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? ? ? adtrge admod2 (12bah) read/write r/w after reset 0 0 0 0 0 0 0 0 function always write ?0? always write ?0? always write ?0? always write ?0? always write ?0? always write ?0? always write ?0? ad external trigger start control 0: disable 1: enable ad conversion start control by external trigger ( adtrg input) 0 disabled 1 enabled note: as pin an3 also functions as the adtrg input pin, do not set = ?11? when using adtrg with < adtrge > set to ?1?. figure 3.12.3 ad converter related register
tmp92ca25 2007-02-28 92ca25-242 ad conversion result register 0 low 7 6 5 4 3 2 1 0 bit symbol adr01 adr00 adr0rf adreg0l (12a0h) read/write r r after reset undefined 0 function stores lower 2 bits of ad conversion result. ad conversion data storage flag 1: conversion result stored ad conversion result register 0 high 7 6 5 4 3 2 1 0 bit symbol adr09 adr08 adr07 adr06 adr05 adr04 adr03 adr02 adreg0h (12a1h) read/write r after reset undefined function stores upper 8 bits of ad conversion result. ad conversion result register 1 low 7 6 5 4 3 2 1 0 bit symbol adr11 adr10 adr1rf adreg1l (12a2h) read/write r r after reset undefined 0 function stores lower 2 bits of ad conversion result. ad conversion result flag 1: conversion result stored ad conversion result register 1 high 7 6 5 4 3 2 1 0 bit symbol adr19 adr18 adr17 adr16 adr15 adr14 adr13 adr12 adreg1h (12a3h) read/write r after reset undefined function stores upper 8 bits of ad conversion result. 9 8 76543210 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ? bits 5 to 1 are always read as 1. ? bit0 is the ad conversion data storage flag . when the ad conversion result is stored, the flag is set to 1. when either of the registers (adregxh, adregxl) is read, the flag is cleared to 0. figure 3.12.4 ad conver ter related registers a dregxh adregxl channel x conversion result
tmp92ca25 2007-02-28 92ca25-243 ad conversion result register 2 low 7 6 5 4 3 2 1 0 bit symbol adr21 adr20 adr2rf adreg2l (12a4h) read/write r r after reset undefined 0 function stores lower 2 bits of ad conversion result. ad conversion data storage flag 1: conversion result stored ad conversion result register 2 high 7 6 5 4 3 2 1 0 bit symbol adr29 adr28 adr27 adr26 adr25 adr24 adr23 adr22 adreg2h (12a5h) read/write r after reset undefined function stores upper 8 bits of ad conversion result. ad conversion result register 3 low 7 6 5 4 3 2 1 0 bit symbol adr31 adr30 adr3rf adreg3l (12a6h) read/write r r after reset undefined 0 function stores lower 2 bits of ad conversion result. ad conversion data storage flag 1: conversion result stored ad conversion result register 3 high 7 6 5 4 3 2 1 0 bit symbol adr39 adr38 adr37 adr36 adr35 adr34 adr33 adr32 adreg3h (12a7h) read/write r after reset undefined function stores upper 8 bits of ad conversion result. 9 8 76543210 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ? bits 5 to 1 are always read as 1. ? bit0 is the ad conversion data storage flag . when the ad conversion result is stored, the flag is set to 1. when either of the registers (adregxh, adregxl) is read, the flag is cleared to 0. figure 3.12.5 ad conver ter related registers a dregxh adregxl channel x conversion result
tmp92ca25 2007-02-28 92ca25-244 3.12.2 description of operation (1) analog reference voltage a high level analog reference voltage is applied to the vrefh pin; a low level analog reference voltage is applied to the vrefl pin. to perform ad conversion, the reference voltage, the difference between vrefh and vrefl, is divided by 1024 using string resistance. the result of the division is then compared with the analog input voltage. to turn off the switch between vrefh and vrefl, write a 0 to admod1 in ad mode control register 1. to start ad conversion in the off state, first write a 1 to admod1, wait 3 s until the internal reference voltage stabilizes (this is not related to fc), then set admod0 to 1. (2) analog input channel selection the analog input channel selection varies depending on the operation mode of the ad converter. ? in analog input channel fixed mode (admod0 = 0) setting admod1 selects one of the input pins an0 to an3 as the input channel. ? in analog input channel scan mode (admod0 = 1) setting admod1 selects one of the four scan modes. table 3.12.1 illustrates analog input channel selection in each operation mode. on a reset, admod0 is set to 0 and admod1 is initialized to 00. thus pin an0 is selected as the fixed in put channel. pins not used as analog input channels can be used as standard input port pins. table 3.12.1 analog input channel selection channel fixed = ?0? channel scan = ?1? 00 an0 an0 01 an1 an0 an1 10 an2 an0 an1 an2 11 an3 an0 an1 an2 an3
tmp92ca25 2007-02-28 92ca25-245 (3) starting ad conversion to start ad conversion, write a 1 to admod0 in ad mode control register ?0? or admod2 in ad mode control register 2, and input falling edge on adtrg pin. when ad conversion starts, the ad conversion busy flag admod0 will be set to 1, indicating that ad conversion is in progress. during ad conversion, a falling edge input on the adtrg pin will be ignored. (4) ad conversion modes and the ad conversion end interrupt the four ad conversion modes are: ? channel fixed single conversion mode ? channel scan single conversion mode ? channel fixed repeat conversion mode ? channel scan repeat conversion mode the admod0 and admod0 settings in ad mode control register 0 determine the ad mode setting. completion of ad conversion triggers an intad ad conversion end interrupt request. also, admod0 will be set to 1 to indicate that ad conversion has been completed. 1. channel fixed single conversion mode setting admod0 and admod0 to 00 selects conversion channel fixed single conversion mode. in this mode, data on one specified channel is converted once only. when the conversion has been completed, the admod0 flag is set to 1, admod0 is cleared to 0, and an intad interrupt request is generated. 2. channel scan single conversion mode setting admod0 and admod0 to 01 selects conversion channel scan single conversion mode. in this mode, data on the specified scan channels is converted once only. when scan conversion has be en completed, admod0 is set to 1, admod0 is cleared to 0, and an intad interrupt request is generated.
tmp92ca25 2007-02-28 92ca25-246 3. channel fixed repeat conversion mode setting admod0 and admod0 to 10 selects conversion channel fixed repeat conversion mode. in this mode, data on one specified channel is converted repeatedly. when conversion has been completed, admod0 is set to 1 and admod0 is not cleared to 0 but held at 1. intad interrupt request generation timing is determined by the setting of admod0. setting to 0 generates an interrupt request every time an ad conversion is completed. setting to 1 generates an inte rrupt request on completion of every fourth conversion. 4. channel scan repeat conversion mode setting admod0 and admod0 to 11 selects conversion channel scan repeat conversion mode. in this mode, data on the specified scan channels is converted repeatedly. when each scan conversion has been complete d, admod0 is set to 1 and an intad interrupt request is generated. admod0 is not cleared to 0 but held at 1. to stop conversion in a repeat conversion mode (e.g., in cases 3. and 4.), write a 0 to admod0. after the current conversion has been completed, the repeat conversion mode terminates and admod0 is cleared to 0. switching to a halt state (idle2 mode with admod1 cleared to 0, idle1 mode or stop mode) immediately stops operation of the ad converter even when ad conversion is still in progress. in repeat conversion modes (e.g., in cases 3. and 4.), when the halt is released, conversion restarts from the beginning. in single conversion modes (e.g., in cases 1. and 2.), conversion does not restart when the halt is released (the converter remains stopped). table 3.12.2 shows the relationship between the ad conversion modes and interrupt requests. table 3.12.2 relationship between ad conversion modes and interrupt requests admod0 mode interrupt request generation channel fixed single conversion mode after completion of conversion x 0 0 channel scan single conversion mode after completion of scan conversion x 0 1 every conversion 0 channel fixed repeat conversion mode every fourth conversion 1 1 0 channel scan repeat conversion mode after completion of every scan conversion x 1 1 x: don?t care
tmp92ca25 2007-02-28 92ca25-247 (5) ad conversion time 84 states (8.4 s at f sys = 20 mhz) are required for the ad conversion of one channel. (6) storing and reading the results of ad conversion the ad conversion data upper and lowe r registers (adreg0h /l to adreg3h/l) store the results of ad conversion. (adreg0h/l to adreg3h/l are read-only registers.) in channel fixed repeat conversion mo de, the conversion results are stored successively in registers adreg0h/l to adreg3h/l. in other modes the an0, an1, an2, an3 and an4 conversion results are stored in adreg0h/l, adreg1h/l, adreg2h/l and adreg3h/l respectively. table 3.12.3 shows the correspondence between the analog input channels and the registers which are used to hold the results of ad conversion. table 3.12.3 correspondence between analog inpu t channels and ad conversion result registers ad conversion result register analog input channel (port g) conversion modes other than at right channel fixed repeat conversion mode (admod0) an0 adreg0h/l adreg0h/l an1 adreg1h/l adreg1h/l an2 adreg2h/l adreg2h/l an3 adreg3h/l adreg3h/l , bit0 of the ad conversion data lower register, is used as the ad conversion data storage flag. the storage flag indicates whether the ad conversion result register has been read or not. when a conversion result is stored in the ad conversion result register, the flag is set to 1. when either of the ad conversion result registers (adregxh or adregxl) is read, the flag is cleared to 0. reading the ad conversion result also clears the ad conversion end flag admod0 to 0.
tmp92ca25 2007-02-28 92ca25-248 setting example: 1. convert the analog input voltage on the an3 pin and write the result to memory address 2800h using the ad interrupt (intad) processing routine. main routine: 7 6 5 4 3 2 1 0 inte0ad 1 1 0 0 ? ? ? ? enable intad and set it to interrupt level 4. admod1 1 1 0 0 0 0 1 1 set pin an3 to be the analog input channel. admod0 x x 0 0 0 0 0 1 start conversion in c hannel fixed single conversion mode. interrupt routine processing example: wa adreg3 read value of adreg3l and adreg3h into 16-bits general-purpose register wa. wa > > 6 shift contents read into wa six times to right and zero fill upper bits. (2800h) wa write contents of wa to memory address 2800h. 2. this example repeatedly converts the analog input voltages on the three pins an0, an1 and an2, using channel scan repeat conversion mode. inte0ad 1 0 0 0 ? ? ? ? disable intad. admod1 1 1 0 0 0 0 1 0 set pins an0 to an2 to be the analog input channels. admod0 x x 0 0 0 1 1 1 start conversion in channel scan repeat conversion mode. x : don't care, ?: no change
tmp92ca25 2007-02-28 92ca25-249 3.13 watchdog timer (runaway detection timer) the tmp92ca25 contains a watchdog timer of runaway detecting. the watchdog timer (wdt) is used to return the cpu to the normal state when it detects that the cpu has started to malfunction (runaway) due to causes such as noise. when the watchdog timer detects a malfunction, it generates a non-maskable interrupt intwd to notify the cpu of the malfunction. connecting the watchdog timer output to th e reset pin internally forces a reset. (the level of external reset pin is not changed.) 3.13.1 configuration figure 3.13.1 is a block diagram of the watchdog timer (wdt). figure 3.13.1 block diagram of watchdog timer note: care must be exercised in the overall design of the apparatus since the watch dog timer may fail to function correctly due to external noise, etc. wdmod reset pin selector 2 15 2 17 2 19 2 21 binary counter (22 stages) q r s wdt control register wdcr write b1h write 4eh reset control wdmod internal reset intwd interrupt internal reset f io wdmod internal data bus reset
tmp92ca25 2007-02-28 92ca25-250 3.13.2 operation the watchdog timer generates an intwd interrupt when the detection time set in the wdmod has elapsed. the watchdog time r must be cleared to zero in software before an intwd interrupt will be generated. if the cpu malfunctions (e.g., if runaway occurs) due to causes such as noise, but does not execute the instruction used to clear the binary counter, the binary counter will overflow and an intwd interrupt will be generated. the cpu will detect malfunction (runaway) due to the intwd interrupt, and in this case it is possible to return the cpu to normal operation by means of an anti-malfunction program. the watchdog timer begins operating immediately on release of the watchdog timer reset. the watchdog timer is reset and halted in idle1 or stop mode. the watchdog timer counter continues counting during bus release (when busak goes low). when the device is in idle2 mode, the operation of the wdt depends on the wdmod setting. ensure that wdmod is set before the device enters idle2 mode. the watchdog timer consists of a 22-stage binary counter which uses the clock (2/f io ) as the input clock. the binary counter can output 2 15 /f io , 2 17 /f io , 2 19 /f io and 2 21 /f io . figure 3.13.2 normal mode the runaway detection result can also be connected to the reset pin internally. in this case, the reset time will be betw een 22 and 29 system clocks (35.2 to 46.4 s at f osch = 40 mhz) as shown in figure 3.13.3. after a reset, the f io clock is f fph /4, where f fph is generated by dividing the high-speed oscillator clock (f osch ) by sixteen through the clock gear function. figure 3.13.3 reset mode overflow n 0 wdt counte r wdt interru p t wdt clea r (software) write clear code n wdt counte r wdt interru p t 22 to 29 clocks (35.2 to 46.4 s at f osch = 40 mhz) overflow internal reset
tmp92ca25 2007-02-28 92ca25-251 3.13.3 control registers the watchdog timer (wdt) is controlled by two control registers wdmod and wdcr. (1) watchdog timer mode register (wdmod) 1. setting the detection time for the watchdog timer in this 2-bit register is used for setting the watchdog timer interrupt time used when detecting runaway. on a reset this register is initialized to wdmod = 00. the detection time for wdt is 2 15 /f io [s]. (the number of system clocks is approximately 65,536.) 2. watchdog timer enable/disable control register at reset, the wdmod is initialized to 1, enabling the watchdog timer. to disable the watchdog timer, it is necessa ry to set this bit to 0 and to write the disable code (b1h) to the watchdog timer control register (wdcr). this makes it difficult for the watchdog timer to be disabled by runaway. however, it is possible to return the watchdog timer from the disabled state to the enabled state merely by setting to 1. 3. watchdog timer out reset connection this register is used to connect the output of the watchdog timer with the reset terminal internally. since wdmod is initialized to 0 at reset, a reset by the watchdog timer will not be performed. (2) watchdog timer control register (wdcr) this register is used to disable and clear the binary counter for the watchdog timer. ? disable control the watchdog timer can be disabled by clearing wdmod to 0 and then writing the disable code (b1h) to the wdcr register. wdcr 0 1 0 0 1 1 1 0 write the clear code (4eh). wdmod 0 ? ? ? 0 ? ? 0 clear wdmod to 0. wdcr 1 0 1 1 0 0 0 1 write the disable code (b1h). ? enable control set wdmod to 1. ? watchdog timer clear control to clear the binary counter and cause counting to resume, write the clear code (4eh) to the wdcr register. wdcr 0 1 0 0 1 1 1 0 write the clear code (4eh). note1: if the disable control is used, set the disable c ode (b1h) to wdcr after writing the clear code (4eh) once. (please refer to setting example.) note2: if the watchdog timer setting is changed, change setting after setting to di sable condition once.
tmp92ca25 2007-02-28 92ca25-252 7 6 5 4 3 2 1 0 bit symbol wdte wdtp1 wdtp0 ? i2wdt rescr ? wdmod (1300h) read/write r/w r/w after reset 1 0 0 0 0 0 0 function wdt control 1: enable select detecting time 00: 2 15 /f io 01: 2 17 /f io 10: 2 19 /f io 11: 2 21 /f io always write ?0? idle2 0: stop 1: operate 1: internally connects wdt out to the reset pin always write ?0? watchdog timer out control 0 ? 1 connects wdt out to a reset idle2 control 0 stop 1 operation watchdog timer detection time 00 2 15 /f io (approximately 3.28 ms at f io = 10 mhz) 01 2 17 /f io (approximately 13.1 ms at f io = 10 mhz) 10 2 19 /f io (approximately 52.4 ms at f io = 10 mhz) 11 2 21 /f io (approximately 210 ms at f io = 10 mhz) watchdog timer enable/disable control 0 disabled 1 enabled figure 3.13.4 watchdog timer mode register 7 6 5 4 3 2 1 0 bit symbol ? wdcr (1302h) read/write w after reset ? function b1h: wdt disable code 4eh: wdt clear code wdt disable/clear control b1h disable code 4eh clear code others don?t care figure 3.13.5 watchdog timer control register read -modify -write instruction is prohibited
tmp92ca25 2007-02-28 92ca25-253 3.14 real time clock (rtc) 3.14.1 function description for rtc 1) clock function (hour, minute, second) 2) calendar function (month and day, day of the week, and leap year) 3) 24- or 12-hour (a m/pm) clock function 4) + / ? 30 s adjustment function (by software) 5) alarm function (alarm output) 6) alarm interrupt generate 3.14.2 block diagram figure 3.14.1 rtc block diagram note 1: western calendar year column: this product uses only the final two digits of t he year. therefore, the year following 99 is 00 years. in use, please take into account the fi rst two digits when handling years in the western calendar. note 2: leap year: a leap year is divisible by 4, but the exception is any leap year whic h is divisible by 100; this is not considered a leap year. however, any year which is divisible by 400, is a leap year. this product does not take into account the above exc eptions . since this product accounts only for leap years divisible by 4, please adj ust the system for any problems. 32-khz clock divider comparator alarm register a djust read/write control carry hold (1s) a ddress bus clock alarm select alarm intrtc 16-hz clock 1-hz clock alarm data bus address d0 to d7 wr rd
tmp92ca25 2007-02-28 92ca25-254 3.14.3 control registers table 3.14.1 page 0 (clock function) registers symbol a ddress bit7 bit6 bit5 bit4 bit3 bi t2 bit1 bit0 function read/write secr 1320h 40 sec 20 sec 10 sec 8 sec 4 sec 2 sec 1 sec second column r/w minr 1321h 40 min 20 min 10 min 8 min 4 min 2 min 1 min minute column r/w hourr 1322h 20 hours/ pm/am 10 hours 8 hours 4 hours 2 hours 1 hour hour column r/w dayr 1323h w2 w1 w0 day of the week column r/w dater 1324h day 20 day 10 day 8 day 4 day 2 day 1 day column r/w monthr 1325h oct. aug. apr. feb. jan. month column r/w yearr 1326h year 80 year 40 year 20 year 10 year 8 year 4 year 2 year 1 year column (lower two columns) r/w pager 1327h interrupt enable a djustment function clock enable alarm enable page setting page register w, r/w restr 1328h 1hz enable 16hz enable clock reset alarm reset always write ?0? reset register w only note: when reading secr, minr, hourr, dayr, mont hr and yearr of page0, the current state is read. table 3.14.2 page 1 (ala rm function) registers symbol a ddress bit7 bit6 bit5 bit4 bit3 bi t2 bit1 bit0 function read/write secr 1320h r/w minr 1321h 40 min 20 min 10 min 8 min 4 min 2 min 1 min minute column r/w hourr 1322h 20 hours/ pm/am 10 hours 8 hours 4 hours 2 hours 1 hour hour column r/w dayr 1323h w2 w1 w0 day of the week column r/w dater 1324h day 20 day 10 day 8 day 4 day 2 day 1 day column r/w monthr 1325h 24/12 24-hour clock mode r/w yearr 1326h leap1 leap0 leap-year mode r/w pager 1327h interrupt enable a djustment function clock enable alarm enable page setting page register w, r/w restr 1328h 1hz enable 16hz enable clock reset alarm reset always write ?0? reset register w only note: when reading secr, minr, hourr, dayr, monthr, yearr of page1, the current state is read.
tmp92ca25 2007-02-28 92ca25-255 3.14.4 detailed explanation of control register rtc is not initialized by system reset. therefore, all registers must be initialized at the beginning of the program. (1) second column register (for page0 only) 7 6 5 4 3 2 1 0 bit symbol se6 se5 se4 se3 se2 se1 se0 secr (1320h) read/write r/w after reset undefined function "0" is read. 40 sec. column 20 sec. column 10 sec. column 8 sec. column 4 sec. column 2 sec. column 1 sec. column 0 0 0 0 0 0 0 0 sec 0 0 0 0 0 0 1 1 sec 0 0 0 0 0 1 0 2 sec 0 0 0 0 0 1 1 3 sec 0 0 0 0 1 0 0 4 sec 0 0 0 0 1 0 1 5 sec 0 0 0 0 1 1 0 6 sec 0 0 0 0 1 1 1 7 sec 0 0 0 1 0 0 0 8 sec 0 0 0 1 0 0 1 9 sec 0 0 1 0 0 0 0 10 sec : 0 0 1 1 0 0 1 19 sec 0 1 0 0 0 0 0 20 sec : 0 1 0 1 0 0 1 29 sec 0 1 1 0 0 0 0 30 sec : 0 1 1 1 0 0 1 39 sec 1 0 0 0 0 0 0 40 sec : 1 0 0 1 0 0 1 49 sec 1 0 1 0 0 0 0 50 sec : 1 0 1 1 0 0 1 59 sec note: do not set data other than as shown above.
tmp92ca25 2007-02-28 92ca25-256 (2) minute column register (for page0/1) 7 6 5 4 3 2 1 0 bit symbol mi6 mi5 mi4 mi3 mi2 mi1 mi0 minr (1321h) read/write r/w after reset undefined function ?0? is read. 40 min column 20 min column 10 min column 8 min column 4 min column 2 min column 1 min column 0 0 0 0 0 0 0 0 min 0 0 0 0 0 0 1 1 min 0 0 0 0 0 1 0 2 min 0 0 0 0 0 1 1 3 min 0 0 0 0 1 0 0 4 min 0 0 0 0 1 0 1 5 min 0 0 0 0 1 1 0 6 min 0 0 0 0 1 1 1 7 min 0 0 0 1 0 0 0 8 min 0 0 0 1 0 0 1 9 min 0 0 1 0 0 0 0 10 min : 0 0 1 1 0 0 1 19 min 0 1 0 0 0 0 0 20 min : 0 1 0 1 0 0 1 29 min 0 1 1 0 0 0 0 30 min : 0 1 1 1 0 0 1 39 min 1 0 0 0 0 0 0 40 min : 1 0 0 1 0 0 1 49 min 1 0 1 0 0 0 0 50 min : 1 0 1 1 0 0 1 59 min note: do not set data other than as shown above.
tmp92ca25 2007-02-28 92ca25-257 (3) hour column register (for page0/1) 1. in 24-hour clock mode (monthr = ?1?) 7 6 5 4 3 2 1 0 bit symbol ho5 ho4 ho3 ho2 ho1 ho0 hourr (1322h) read/write r/w after reset undefined function ?0? is read. 20 hours column 10 hours column 8 hours column 4 hours column 2 hours column 1 hour column 0 0 0 0 0 0 0 o?clock 0 0 0 0 0 1 1 o?clock 0 0 0 0 1 0 2 o?clock : 0 0 1 0 0 0 8 o?clock 0 0 1 0 0 1 9 o?clock 0 1 0 0 0 0 10 o?clock : 0 1 1 0 0 1 19 o?clock 1 0 0 0 0 0 20 o?clock : 1 0 0 0 1 1 23 o?clock note: do not set data other than as shown above. 2. in 12-hour clock mode (monthr = ?0?) 7 6 5 4 3 2 1 0 bit symbol ho5 ho4 ho3 ho2 ho1 ho0 hourr (1322h) read/write r/w after reset undefined function ?0? is read. pm/am 10 hours column 8 hours column 4 hours column 2 hours column 1 hour column 0 0 0 0 0 0 0 o?clock (am) 0 0 0 0 0 1 1 o?clock 0 0 0 0 1 0 2 o?clock : 0 0 1 0 0 1 9 o?clock 0 1 0 0 0 0 10 o?clock 0 1 0 0 0 1 11 o?clock 1 0 0 0 0 0 0 o?clock (pm) 1 0 0 0 0 1 1 o?clock note: do not set data other than as shown above.
tmp92ca25 2007-02-28 92ca25-258 (4) day of the week column register (for page0/1) 7 6 5 4 3 2 1 0 bit symbol we2 we1 we0 dayr (1323h) read/write r/w after reset undefined function ?0? is read. w2 w1 w0 0 0 0 sunday 0 0 1 monday 0 1 0 tuesday 0 1 1 wednesday 1 0 0 thursday 1 0 1 friday 1 1 0 saturday note: do not set data other than as shown above. (5) day column register (page0/1) 7 6 5 4 3 2 1 0 bit symbol da5 da4 da3 da2 da1 da0 dater (1324h) read/write r/w after reset undefined function ?0? is read. day 20 day 10 day 8 day 4 day 2 day 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1st day 0 0 0 0 1 0 2nd day 0 0 0 0 1 1 3rd day 0 0 0 1 0 0 4th day : 0 0 1 0 0 1 9th day 0 1 0 0 0 0 10th day 0 1 0 0 0 1 11th day : 0 1 1 0 0 1 19th day 1 0 0 0 0 0 20th day : 1 0 1 0 0 1 29th day 1 1 0 0 0 0 30th day 1 1 0 0 0 1 31st day note1: do not set data other than as shown above. note2: do not set for non-existent days (e.g.: 30th feb).
tmp92ca25 2007-02-28 92ca25-259 (6) month column register (for page0 only) 7 6 5 4 3 2 1 0 bit symbol mo4 mo4 mo2 mo1 mo0 monthr (1325h) read/write r/w after reset undefined function ?0? is read. 10 months 8 months 4 months 2 months 1 month 0 0 0 0 1 january 0 0 0 1 0 february 0 0 0 1 1 march 0 0 1 0 0 april 0 0 1 0 1 may 0 0 1 1 0 june 0 0 1 1 1 july 0 1 0 0 0 august 0 1 0 0 1 september 1 0 0 0 0 october 1 0 0 0 1 november 1 0 0 1 0 december note: do not set data other than as shown above. (7) select 24-hour clock or 12 -hour clock (for page1 only) 7 6 5 4 3 2 1 0 bit symbol mo0 monthr (1325h) read/write r/w after reset undefined function ?0? is read. 1: 24-hour 0: 12-hour
tmp92ca25 2007-02-28 92ca25-260 (8) year column register (for page0 only) 7 6 5 4 3 2 1 0 bit symbol ye7 ye6 ye5 ye4 ye3 ye2 ye1 ye0 yearr (1326h) read/write r/w after reset undefined function 80 years 40 years 20 years 10 years 8 years 4 years 2 years 1 year 0 0 0 0 0 0 0 0 00 years 0 0 0 0 0 0 0 1 01 years 0 0 0 0 0 0 1 0 02 years 0 0 0 0 0 0 1 1 03 years 0 0 0 0 0 1 0 0 04 years 0 0 0 0 0 1 0 1 05 years : 1 0 0 1 1 0 0 1 99 years note: do not set data other than as shown above. (9) leap year register (for page1 only) 7 6 5 4 3 2 1 0 bit symbol leap1 leap0 yearr (1326h) read/write r/w after reset undefined function ?0? is read. 00: leap year 01: one year after leap year 10: two years after leap year 11: three years after leap year 0 0 current year is a leap year 01 current year is the year following a leap year 10 current year is two years after a leap year 11 current year is three years after a leap year
tmp92ca25 2007-02-28 92ca25-261 (10) setting page register (for page0/1) 7 6 5 4 3 2 1 0 bit symbol intena adjust enatmr enaalm page pager (1327h) read/write r/w w r/w r/w after reset 0 undefined undefined undefined read-modify-write instruction is prohibited. function intrtc 0: disable 1: enable ?0? is read. 0: don?t care 1: adjust clock 0: disable 1: enable alarm 0: disable 1: enable ?0? is read. page selection note: please keep the setting order below of , and . set different times for clock/alarm setting and interrupt setting. (example) clock setting/alarm setting ld (pager), 0ch : clock, alarm enable ld (pager), 8ch : interrupt enable 0 select page0 page 1 select page1 0 don?t care adjust 1 adjust sec. counter. when this bit is set to ?1? the sec. counter becomes ?0? when the value of the sec. counter is 0 ? 29. when the value of the sec. counter is 30-59, the min. counter is carried and sec. counter becomes "0". output adjust signal during 1 cycle of f sys . after being adjusted once, adjust is released automatically. (page0 only) (11) setting reset register (for page0/1) 7 6 5 4 3 2 1 0 bit symbol dis1hz dis16hz rsttmr rstalm ? ? ? ? restr (1328h) read/write w after reset undefined read-modify write-instructio n is prohibited. function 1hz 0: enable 1: disable 16hz 0: enable 1: disable 1:clock reset 1: alarm reset always write ?0? 0 unused rstalm 1 reset alarm register 0 unused rsttmr 1 reset counter (pager) source signal 1 1 1 alarm 0 1 0 1hz 1 0 0 16hz others output ?0?
tmp92ca25 2007-02-28 92ca25-262 3.14.5 operational description (1) reading clock data 1. using 1hz interrupt 1hz interrupt and the count up of internal data synchronize. therefore, data can read correctly if reading da ta after 1hz interrupt occurred. 2. using two times reading there is a possibility of incorrect clock data reading when the internal counter carries over. to ensure correct data read ing, please read twice, as follows: figure 3.14.2 flowchart of clock data read start end pager = ?0? , select page0 read the clock data (1st) read the clock data (2nd) 1st data = 2nd data no yes
tmp92ca25 2007-02-28 92ca25-263 (2) writing clock data when a carry over occurs during a write operation, the data cannot be written correctly. please use the following method to ensure data is written correctly. 1. using 1hz interrupt 1hz interrupt and the count up of internal data synchronize. therefore, data can write correctly if writing data after 1hz interrupt occurred. 2. resetting a counter there are 15-stage counter inside the rtc, which generate a 1hz clock from 32,768 khz. the data is written after reset this counter. however, if clearing the counter, it is count ed up only first writing at half of the setting time, first writing only. therefore, if setting the clock counter correctly, after clearing the counter, set the 1hz-in terrupt to enable. and set the time after the first interrupt (occurs at 0.5hz) is occurred. figure 3.14.3 flowchart of data write start end pager = ?0? , select page0 restr = ?1? reset counter restr = ?0? enable 1hz interrupt first interrupts occu r ( after 0.5s ) no yes sets the time
tmp92ca25 2007-02-28 92ca25-264 2. disabling the clock a clock carry over is prohibited when ?0? is written to pager in order to prevent malfunction caused by the carry hold circuit. while the clock is prohibited, the carry hold circuit holds a one sec. carry signal from a divider. when the clock becomes enabled, the carry signal is output to the clock, the time is revised and operation continues. however, the clock is delayed when clock-disabled state continue s for one second or more. note that at this time system power is down while the clock is disabled. . in this case the clock is stopped and clock is delayed. figure 3.14.4 flowchart of clock disable start end disable the clock read the clock data enable the clock
tmp92ca25 2007-02-28 92ca25-265 3.14.6 explanation of the interrupt signal and alarm signal the alarm function used by setting the page1 register and outputting either of the following three signals from alarm pin by writing ?1? to pager. intrtc outputs a 1-shot pulse when the falling edge is detected. rtc is not initialized by reset. therefore, when the clock or alarm function is used, clear interrupt request flag in intc (interrupt controller). (1) when the alarm register and the clock correspond, output ?0?. (2) 1hz output clock . (3) 16hz output clock. (1) when the alarm register and the clock correspond, output ?0? when pager= ?1?, and the value of page0 clock corresponds with page1 alarm register , output ?0? to alarm pin and generate intrtc. the methods for using the alarm are as follows: initialization of alarm is done by writing ?1? to restr. all alarm settings become don?t care. in this case, th e alarm always corresponds with value of the clock, and if pager is ?1?, intrtc interrupt request is generated. setting alarm min., alarm hour, alarm date an d alarm day is done by writing data to the relevant page1 register. when all setting contents correspond, rtc generates an intrtc interrupt if pager is ?1?. however, contents which have not been set up (don't care state) are always considered to correspond. contents which have already been set up, cannot be returned independently to the don't care state. in this case, the alarm mu st be initialized and alarm register reset. the following is an example program for outputting an alarm from alarm -pin at noon (pm12:00) every day. ld (pager), 09h ; alarm disable, setting page1 ld (restr), d0h ; alarm initialize ld (dayr), 01h ; w0 ld (datar),01h 1 day ld (hourr), 12h ; setting 12 o?clock ld (minr), 00h ; setting 00 min ; set up time 31 s (note) ld (pager), 0ch ; alarm enable ( ld (pager), 8ch ; interrupt enable ) when the cpu is operating at high frequency oscillation, it may take a maximum of one clock at 32 khz (about 30us) for the time register setting to become valid. in the above example, it is necessary to set 31us of set up time between setting the time register and enabling the alarm register. note: this set up time is unnecessary w hen you use only internal interruption. (2) with 1hz output clock rtc outputs a clock of 1hz to alarm pin by setting up pager= ?0?, restr= ?0?, = ?1?. rtc also generates an intrc interrupt on the falling edge of the clock. (3) with 16hz output clock rtc outputs a clock of 16hz to alarm pin by setting up pager= ?0?, restr= ?1?, = ?0?. rtc also generates intrc an interrupt on the falling edge of the clock.
tmp92ca25 2007-02-28 92ca25-266 3.15 lcd controller this lsi incorporates two types of liquid crystal display driving circuit for controlling lcds. one circuit supports an internal ram lcd driver that can store display data in the lcd driver itself, and the other circuit supports a shift-register type (sr mode) lcd driver that must serially transfer the display data to th e lcd driver for each display picture. it is possible for sr type to use pan function which is shifted the display without rewriting display data. 1) shift register type lcd driver control mode (sr mode) before setting start register, set the mode of operation, the start address of source data save memory and lcd size to control register. after setting start register, the lcdc output s a bus release request to the cpu and reads data from source memory. the lcdc then transmits lcd si ze data to the external lc d driver through the special lcdc data bus (ld7to ld0). at this time, th e control signals connected to the lcd driver output the specified waveform which is synchronized with the data transmission. after display data reading from ram is completed, the lcdc cancels the bus release request and the cpu will re-start. it is possible to read th e data from display memory at high-speed by fifo buffer. and it is possible to transfer from lcd-driver-bus corresponded to the ac-standard of connected lcd driver. in the tmp92ca25, sram and sdram burst mode can be used for the display ram. 10-kbytes of internal ram are available for us e as display ram. as internal sram access is very fast (32-bit bus width, 1 sysclk read/w rite), it is possible to reduce cpu load to a minimum, enabling lcdc dma. in addition , it can decrease much power consumption during displaying by using internal sram. it is possible to display 320 240(qvga size at max size) using internal sram. 2) internal ram lcd driver control mode (ram mode) data transmission to the lcd driver is executed cpu command. after setting operation mode to control register, when cpu command is executed the lcdc outputs chip select signal to the lcd driver connected externally by control pin (lcp0 etc.). therefore control of data transmission numbers corresponding to lcd size is contro lled by cpu command. this mode supports random-acce ss-type and sequen tial-access-type.
tmp92ca25 2007-02-28 92ca25-267 3.15.1 lcdc features by mode the various features and pin operations of are as follows. table 3.15.1 lcdc features by mode (example: using toshiba lcd driver) shift register type lcd driver control mode lcd driver stn ram built-in type lcd driver control mode display color monochrome depends on lcd driver the number of picture elements which can be handled monochrome, 4-, 8- and16-level grayscale row (common): 64, 120, 128, 160, 200, 240, 320, 480 column (segment): 64, 128, 160, 240, 320, 480, 640 depends on lcd driver data bus width (sram, sdram) 16 bits, 32 bits (internal ram) data bus width (destination: lcd driver) 4 bits, 8 bits depends on cs/wait controller (same as normal memory access) maximum transmission rate (at f sys = 20 [mhz]) 12.5 ns/byte at internal ram 25 ns/byte at external sram, 50 ns/byte at external sram, ? pan function available to use depends on lcd driver lcd data bus ld7 to ld0 connect to data bus of lcd driver. ? 8-bit ld7 to ld0 ? 4-bit ld3 to ld0 not used d7 to d0 not used connect to data bus of lcd driver. bus state r/w not used connect to wr pin of lcd driver. address bus a0 not used connect to d/i pin of lcd driver for distinction of data or instruction. lcp0 shift clock 0 for column lcd driver connect to cp pin of column lcd driver. ld bus data is latched at falling edge of this signal. chip enable signal for column lcd driver connect to ce pin of 1st column lcd driver. llp latch pulse output for column and row lcd driver connect to lp pin of column and row lcd driver. display data is renewed to output buffer at rising edge of this signal. chip enable signal for column lcd driver connect to ce pin of 2nd column lcd driver. lfr alternating signal for lcd display control. connect to fr pin of lcd driver. chip enable signal for column lcd driver connect to ce pin of 3rd column lcd driver. external pins lbcd refresh rate signal chip enable signal for row lcd driver connect to le pin of row lcd driver.
tmp92ca25 2007-02-28 92ca25-268 3.15.2 sfrs lcdmode0 register 7 6 5 4 3 2 1 0 bit symbol ramtype1 ramtype0 scpw1 scpw0 lmode intmode ldo1 ldo0 lcdmode0 (0840h) read/write r/w after reset 0 0 1 0 0 0 0 0 function display ram 00: internal ram1 01: external sram 10: sdram 11: internal ram2 ld bus transmission speed 00: reserved 01: 2 f sys 10: 4 f sys 11: 8 f sys lcd driver type 0: sr 1: ram built-in interrupt 0: lp 1: bcd ld bus width control 00: 4bit a_type 01: 4bit b_type 10: 8bit type others: reserved note: only ?burst 1clk access? sdram access is supported lcd f fp register 7 6 5 4 3 2 1 0 bit symbol fp7 fp6 fp5 fp4 fp3 fp2 fp1 fp0 lcdffp (0282h) read/write r/w after reset 0 0 0 0 0 0 0 0 function setting bit7 to bit0 for f fp divide frm register 7 6 5 4 3 2 1 0 bit symbol fmn7 fmn6 fmn5 fmn4 fmn3 fmn2 fmn1 fmn0 lcddvm (0283h) read/write r/w after reset 0 0 0 0 0 0 0 0 function setting dvm bit7 to bit0
tmp92ca25 2007-02-28 92ca25-269 lcd size setting register 7 6 5 4 3 2 1 0 bit symbol com3 com2 com1 com0 seg3 seg2 seg1 seg0 lcdsize (0843h) read/write r/w after reset 0 0 0 0 0 0 0 0 common setting segment setting function 0000: reserved 0001: 64 0010: 120 0011: 128 0100: 160 0101: 200 0110: 240 0111: 320 1000: 480 others: reserved 0000: reserved 0001: 64 0010: 128 0011: 160 0100: 240 0101: 320 0110: 480 0111: 640 others: reserved lcd control-0 register 7 6 5 4 3 2 1 0 bit symbol all0 frmon ? fp9 mmulcd fp8 start lcdctl0 (0844h) read/write r/w r/w r/w after reset 0 0 0 0 0 0 0 function column data setting 0: normal 1: all display data ?0? frame divide 0: stop 1: operate always write ?0? f fp setting bit9 built-in ram type lcd driver 0: sequential access 1: random access f fp setting bit8 lcdc start 0: stop 1: start lcdc source clock counter register 7 6 5 4 3 2 1 0 bit symbol scc7 scc6 scc5 scc4 scc3 scc2 scc1 scc0 lcdscc (0846h) read/write r/w after reset 0 0 0 0 0 0 0 0 function lcdc source clock counter bit7 to bit0 start address register number of common register h (bit23 to 16) m (bit15 to 8) l (bit7 to 1) h (bit8) l (bit7 to 0) ? a area lsarah (0852h) lsaram (0851h) lsaral (0850h) cmnah (0855h) cmnal (0854h) ? after reset 40h 00h 00h 00h 00h b area lsarbh (0858h) lsarbm (0857h) lsarbl (0856h) cmnbh (085bh) cmnbl (085ah) ? after reset 40h 00h 00h 00h 00h c area lsarch (085eh) lsarcm (085dh) lsarcl (085ch) ? ? ? after reset 40h 00h 00h note: all registers can read-modify-write.
tmp92ca25 2007-02-28 92ca25-270 lcdc0l/lcdc0h/lcdc1l/lcdc1h/lcdc2l/ lcdc2h/lcdr0l/lcdr0h register 7 6 5 4 3 2 1 0 bit symbol d7 d6 d5 d4 d3 d2 d1 d0 read/write depends on external lcd driver specification. after reset depends on external lcd driver specification. function depends on external lcd driver specification. address function chip enable pin 3c0000h to 3cffffh built-in ram lcd driver1 lcp0 3d0000h to 3dffffh built-in ram lcd driver2 llp 3e0000h to 3effffh built-in ram lcd driver3 lfr 3f0000h to 3fffffh built-in ram lcd driver4 lbcd
tmp92ca25 2007-02-28 92ca25-271 3.15.3 shift register type lcd driver control mode (sr mode) 3.15.3.1 descriptio n of operation set the mode of operation, start address of display memory, grayscale level and lcd size to control re gisters before sett ing start register. after setting start register, the lcdc outp uts a bus release request to the cpu and reads data from source memory. after data re ading from source data is completed, the lcdc cancels the bus release request and the cpu will restart. the lcdc then transmits lcd size data to the external lc d driver through the ld bus (special data bus only for lcd driver). at this time, the control signals (lcp0 etc.) connected to the lcd driver output the specified waveform which is synchronized with the data transmission. the lcd controller generates control signal s (lfr, lbcd, llp etc.) from base clock lcdscc. lcdscc is the clock generator for the lcd controller, which is generated by system clock f sys . this lsi has a special clock generator for the lcdc. details of lcd frame refresh rate can be set using this special generato r. this generator is made from an 8-bit counter and 1/16 speed clock from the system clock. note 1: during display data read from source memory (during dma operation), the cpu is stopped by the internal busreq signal. when using sr mode lcdc, programmers must monitor cpu performance. note 2: this lsi has a 16-kbyte sram, this internal ram is available for use as display ram. internal ram access is very fast ( 32-bit bus width, 1 sysclk read/write), it is possible to reduce cpu load to a minimum. it can also be used 16bits access mode if using internal ram. this mode is for internal ram to use as display ram effectively. when using display ram as sdram, set sdram size by sdacr2 register of sdramc. data output width is selectable between 4 bits or 8 bits, and data output sequence selectable between 2 modes. sr type lcd control setting is described below.
tmp92ca25 2007-02-28 92ca25-272 3.15.3.2 memory space (common spec. sr mode and tft mode) the lcdc can display an lcd panel image which is divided horizontally into 3 parts; upper, middle and lower. each area is called a area, b area and c area with the characteristics shown below. the start/end address of each area in the physical memory space can be defined in the lcd start/end address registers. c area can be defined only in start address. a and b areas can be displayed by program and set to enable or not in start address register and row number register. when the row number registers of a and b areas are set to 0, c area takes over all panel space. when the size of a or b area is greater than the lcd panel, the area of the panel is all c area because the displaying priority is a > b > c. if the a area is set to enable while the panel area is defined as all c area (a and b areas are disabled), c area is shifted below the lcd panel and a area is inserted from the top of the lcd panel. similarly if the b area is set to enable while the panel area is defined as all c area, b area is inserted from the bottom of the c area overlapping. figure 3.15.1 memory mapping from physical memory to lcd panel logic address 400000h a area b area c area vertical pan column address horizontal pan 600000h row address ya yb memory map image lcd panel image a area c area b area ya yb yc reserved area for horizontal pan of c area * display data cannot input closely when pan function is not used (sdram). 2x yc x
tmp92ca25 2007-02-28 92ca25-273 3.15.3.3 display memory mapping and panning function (common spec. sr mode and tft mode) the lcdc can only change the panel window if you change each start address of a, b and c areas. the display area can be panned vertically and horizontally by changing the row address and column address. this lc dc can select many display modes: 1 bpp (monochrome), 2 bpp (4 grayscales), 3 bpp (8 grayscales), 4 bpp (16 grayscales), 8 bpp (256 colors) and 12 bpp (4096 colors) and 1-line (row). data volume is different for each display mode. when using the panning function, care must be exercised in calculating the address for each display mode. for deta ils, refer to figure 3.15.2, ?relation of memory map image and output data?. this lcdc can also suppor t external sdram, sram and internal sram for display ram. when using sdram for display ram, data from one line to the next line cannot be input continuously in display ram, even if the panning function is not used. one row address of display sdram corresponds to the first line of the display panel. second line display data cannot now be set within the first row address of the display ram even if the necessary data for the size you want to display does not fill the capacity of first row address of the display sdram. adding one line to the display panel is equal to adding one address to the row address of the display sdram. in other words, when using sdram for display ram, address calculation for panning is simple. when using sram for display ram, data from one line to the next line must be input continuously to the display ram. howe ver, address calculation for panning is complex and horizontal panning function is not supported. and when setting segment = 240 and select internal ram, the limitation is added under below. the last 16bits data in 8th access is thrown away. if using all data effectively, set internal sram2 mode (16bit access mode). and it is possible to allocate data tightly. 3.15.3.4 data transmission this lsi has an ld bus (ld7 to ld0): a special data bus for lcd driver. bus width of 4-bits_atype, 4-bits_b-type or 8-bits type can be supported. relation between memory mapping and output data is shown to figure 3.15.2. **00h 16bit data is thrown away **20h **20h 240 bit 1 common 2 common **24h **04h **08h **0ch **10h **14h **18h **1ch **28h **2ch **30h **34h **38h **3ch
tmp92ca25 2007-02-28 92ca25-274 ? monochrome: 1 bpp (bit per pixel) display memory image ld bus output sequence 4-bit width a type 4-bit width b type 8-bit width type ld0 0 4 8 12 ... ld0 4 0 12 8 ... ld0 0 8 ... ld1 1 5 9 13 ... ld1 5 1 13 9 ... ld1 1 9 ... ld2 2 6 10 14 ... ld2 6 2 14 10 ... ld2 2 10 ... ld3 3 7 11 15 ... ld3 7 3 15 11 ... ld3 3 11 ... ld4 not use ld4 not used ld4 4 12 ... ld5 not use ld5 not used ld5 5 13 ... ld6 not use ld6 not used ld6 6 14 ... ld7 not use ld7 not used ld7 7 15 ... figure 3.15.2 relation of memory map image and output data 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 address 0 address 1 address 2 address 3 lsb d0 msb d31
tmp92ca25 2007-02-28 92ca25-275 3.15.3.5 refresh rate setting frame cycle (refresh rate) is generated from setting of lscc (lcdscc) and fp [9:0] (lcdctl0, lcdffp). the lbcd terminal outputs one pulse every cycle and the lfr normally outputs an inverted signal every cycle. but when the divide frame function is used, the lfr signal changes to a special signal for high quality display. (1) basic clock setting this lsi has a special clock generator for basic source clock used in the lcd controller. this generator can set deta ils of the refresh rate for the lcdc. this generator is made by dividing the system clock by 16 and an 8-bit counter. the following shows the method of setting and calculation. f bcd [hz]: frame rate (refresh rate: frequency of lbcd signal) fp: fp [9:0] setting value of ffp register scc: setting value of lscc register f bcd [hz] = f sys [hz] / ((scc+1) 16 fp) example: f sys [hz] = 20mhz, 240com (fp = 240), target refresh rate = 70hz 70 [hz] = 20000000 [hz]/((scc+1) 16 240) (scc+1) = 20000000/(70 16 240) = 74.4 value of setting to register is only integer, scc = 73. the floating value is disregarded. in this case, the refresh rate comes to 70.3 [hz] lcdc source clock counter register 7 6 5 4 3 2 1 0 bit symbol scc7 scc6 scc5 scc4 scc3 scc2 scc1 scc0 lcdscc (0846h) read/write r/w after reset 0 0 0 0 0 0 0 0 function lcdc source clock counter bit7 to bit0 * data should be written from 1-hex to ffff-hex in the above register. it cancannot operate if set to ?0?. * if the refresh rate is set too fast, it ma y not be in time with the display data. t lp time is determined by scc. t lp [s] = (1/f sys [hz]) 16 (scc + 1) t lp is shown in 1-line (row) display time. 1-line data transmission must be completed during t lp cycle time. aboutrefer to ?data transmi ssion and bus occupation? for details of data transmission time.
tmp92ca25 2007-02-28 92ca25-276 (2) refresh rate adjust function (correct function) in this function, the lbcd frequency: refresh rate is generated by setting lcdscc and fp [9:0] register. the ffp value is normally set at the same value as the row number, but this value can be used for correction of bcd frequency: refresh rate. this function always uses a value greater than the row number, set to slower frequency. the lcdc cannot operate corre ctly if a value smaller than the row number is set. the following is an example of settings: example: f sys [hz] = 20 mhz, 240com ( fp = 240 ), target refresh rate = 70 hz 140 [hz] = 20000000 [hz]/((scc+1) 16 240) (scc+1) = 20000000/(70 16 240) = 74.4 value of setting to register is only integer, scc = 73. the floating value is disregarded. in this case, refresh rate comes to 70.3 [hz] f bcd [hz] = f sys [hz]/((scc+1) 16 fp) fp value is adjusted to set scc=73 in above equation again. 70 [hz] = 20000000/(74 16 fp) fp = 241.3 value of setting to register is only integer, fp = 241. in this case, refresh rate comes to 70.0 [hz] lcd f fp register 7 6 5 4 3 2 1 0 bit symbol fp7 fp6 fp5 fp4 fp3 fp2 fp1 fp0 lcdffp (0841h) read/write r/w after reset 0 0 0 0 0 0 0 0 function setting bit7 to bit0 for f fp reference) we recommend refresh rate values in the region of: monochrome: 70 [hz]
tmp92ca25 2007-02-28 92ca25-277 (3) divide frame adjust function the divide frame function allows for adjustments to reduce uneven display in large lcd panels. when this function is enabled by setting = 1, the lfr signal alternates between high and low level with each llp cycle for the lcddvm register values given below. when this function is disabled by setting lcdctl = 0, the lfr signal alternates between high and low level with each lbcd cycle. this function is not affected by the lbcd timing. note: availability of this function depends on the actual lcd driver or lcd panel used. we recommend checking that register?s value when used in the proposed environment. divide frame register 7 6 5 4 3 2 1 0 bit symbol fmn7 fmn6 fmn5 fmn4 fmn3 fmn2 fmn1 fmn0 lcddvm (0842h) read/write r/w after reset 0 0 0 0 0 0 0 0 function setting dvm bit7 to bit0 (reference) in general, prime numbe rs (3, 5, 7, 11, 13 ...) are best for the value of the lcddvm register.
tmp92ca25 2007-02-28 92ca25-278 figure 3.15.3 whole timing diagram of sr mode note: there is internal fi/fo_ram (160bits) for controlli ng the speed of transfering to lcd driver. if the size of segment is over 160, several bus request is generated at one t lp interval. (640segment: 5times max) figure 3.15.4 detailed timing diagram of sr mode condition: ffp [9:0] setting = 240 (com) + 63, lcddvm = 0bh figure 3.15.5 waveform of llp, lfr lfr lbcd llp lcp ld7 to ld0 (8-bit case) 1 2 3 1 2 3 1 2 120 120 use internal signal to cpu ( interru p t ) lfr lbcd llp use internal signal (internal) busrq lcp0 ld7 to ld0 (8 bits) n n + 1 n + 28 n + 29 t lp : llp cycle t stop : stop time t opr : cpu opration time t cp = 2 states t lph = f sys 4 llp lfr lp1 lp2 lp3 lp10 lp11 lp301 lp302 lp303 lp304 dvm disable dvm enable
tmp92ca25 2007-02-28 92ca25-279 3.15.3.6 lcd data transmission speed and data bus occupation rate after setting start register , the lcdc outputs a bus release request to the cpu and reads data from source memory. the lcdc then transmits lcd size data to the external lcd driver through the special lcdc data bus (ld11 to ld0). at this time, the control signals connected to the lcd driver output the specified waveform which is synchronized with the data transmission. after data reading from ram for display is completed, the lcdc cancels the bus release request and the cpu will restart. during data read from source memory (during dma operation), the cpu is stopped by the internal busreq signal. when using sr mode lcdc, programmers must monitor cpu performanc e. the occupation rate of the data bus depends on data size, transmission speed (cpu clock speed) and display ram type used. display ram bus width valid data reading time (f sys clock/byte) valid data reading time t lrd (ns/byte) at f sys = 20 mhz 16 bits 2/2 50 external sram 32 bits 2/4 25 internal ram 32 bits 1/4 12.5 external sdram 16 bits * 1/2 * 25 note: when using sdram for display ram, overhead time ( + 8 clocks) is required for every 1 row data reading. t stop refers to the cpu stoppage time during transmission of 1 row data. t stop is calculated by the equation below for each display mode. t stop = (segnum /8) t lrd segnum : number of segment when sdram is used, more overhead time is required. t stop = (segnum /8) t lrd + ((1/f sys ) 8) data bus occupation rate equals the percentage of t stop time in t lp time. data bus occupation rate = t stop /t lp note: for t lp time, refer to ?refresh rate setting?.
tmp92ca25 2007-02-28 92ca25-280 3.15.3.7 timing diagram of ld bus the tmp92ca25 can select to display ram for external sram : available to set wait, internal sram of 10kbyte and external sram: 64, 128, 256 and 512 mbits. as a 160-bit fifo buffer is built into this lcdc, the ld bus speed can be controlled. the speed can be selected from 3 kinds of lcp cycle: (f sys /2, f sys /4, and f sys /8) ld bus data: ld7 to ld0 is out at rising edge of lcp, lcd driver receives at falling edge of lcp. note: if the lcp cycle is too slow it may not transfer correctly. figure 3.15.6 selection of lcp cycle if lcp cycle is not set at a suitable spee d with respect to the refresh rate, ld bus data will not transfer correctly. t lp time is shown in the equation below. t lp [s] = (1/f sys [hz]) 16 (scc+1) data transmission must finish in t lp time. set scc clock and lcp0 speed to be less than t lp time. for setting of scc, refer to ?basic clock setting? of ?refresh rate setting?. f sys lcp0 ld7 to ld0 cp 2-clock lcp0 ld7 to ld0 lcp0 ld7 to ld0 cp 4-clock cp 8-clock
tmp92ca25 2007-02-28 92ca25-281 3.15.3.8 example of sr mode lcd driver connection note: other circuit is necessary for lcd dr ive power supply for lcd driver display. figure 3.15.7 interface example fo r shift register type lcd driver tmp92ca25 v dd v ss v dd o001 v ss dir test di7 to di0 dual scp s/c vccl/r, v0l/r, v1l/r, v4l/r, v5l/r o240 eio2 eio1 dspof fr lp open v ss lbcd lcp0 llp lfr port ld7 to ld0 scp lp fr dspof di7 to di0 eio1 eio2 dir v dd s/c v ss test dual vcclr v0lr,v2lr, vsslr,v3lr v5lr o001 o240 o p en v dd v ss com001 com240 seg001 seg240 240 commons 240 segments lcd ( monochrome ) t6c13b (240-row driver selection) t6c13b (240-column driver selection)
tmp92ca25 2007-02-28 92ca25-282 3.15.3.9 program example (4 k colors stn) ; lcdc condition ; panel = 320seg 240com, f bcd = 70hz(at f sys = 20mhz) ; ld bus = 8bit, 4clock display memory = internal ram(2000h-) ; ******** port settings ********* ld (pkfc),0x0f ; pk0-3: lcp0, llp, lfr, lbcd ldw (plcr),0xffff ; pl0-7: ld0-7 ; ******** lcd settings ********* ld xix,0x00002000 ; internal ram start address ld (lsarcl),xix ; only c-area ld (lcdmode0),0x22 ; display memory = internal ram, scp = 4clock, 8bit bus ld (lcdffp),240 ; ld (lcdsize),0x65 240com 320seg ld (lcdctl0),0x00 ; ld (lcdscc),74 ; scc = f sys / (f bcd 16 fp) ; = 20mhz/ (70 16 240) = 74.4 set 0,(lcdctl0) ; start lcdc display
tmp92ca25 2007-02-28 92ca25-283 3.15.4 built-in ram type lcd driver mode 3.15.4.1 descriptio n of operation data transmission to the lcd driver is ex ecuted by a transmit instruction from the cpu. after setting operation mode of to the control register, when a cpu transmits instruction is executed the lcdc outputs a chip select signal to the lcd driver connected externally by the control pi n (lcp0...). therefore control of data transmission numbers corresponding to lcd size is controlled by cpu instruction. there are 2 kinds of lcd driver address in this case, which are selected by the lcdctl register. 3.15.4.2 random access type this corresponds to address direct writing type lcd driver when = ?1?. the transmission address can also assign the memory area 3c0000h ? 3fffff, the four areas each being 64 kbytes. interface and access timing are the same as for normal memory. refer to the memory access timing section. table 3.15.2 random access type built-in ram type lcd driver address function chip enable terminal 3c0000h to 3cffffh built-in ram lcd driver 1 lcp0 3d0000h to 3dffffh built-in ram lcd driver 2 llp 3e0000h to 3effffh built-in ram lcd driver 3 lfr 3f0000h to 3fffffh built-in ram lcd driver 4 lbcd
tmp92ca25 2007-02-28 92ca25-284 3.15.4.3 sequential access type data transmission to the lcd driver is ex ecuted by a transmit instruction from the cpu. after setting operation mode to the control register, when a cpu transmit instruction is executed the lcdc outputs a chip select signal to the lcd driver connected externally by the control pi n (lcp0...). therefore control of data transmission numbers corresponding to lcd size is controlled by cpu instruction . there are 2 kinds of lcd driver address in this case, which are selected by the lcdctl register. this corresponds to a lcd driver which has each 1 byte of instruction register and display data register in lcd driver when = ?0?. please select the transmission address at this time from 1fe0h to 1fe7h. lcdc0l/lcdc0h/lcdc1l/lcdc1h/lcdc2l/ lcdc2h/lcdr0l/lcdr0h register 7 6 5 4 3 2 1 0 bit symbol d7 d6 d5 d4 d3 d2 d1 d0 read/write depends on external lcdd specification after reset depends on external lcdd specification function depends on exter nal lcdd specification note 1: this waveform is in the case of 3-state access. note 2: rising timing of chip enabl e signal (e.g lcp0) is different. figure 3.15.8 example of access timing for built-in ram type lcd driver (wait = 0) wait sampling d7 to d0 lcp0, llp, lfr, lbcd r/ w a23 to a0 system clock: f sys data out t1 tw t2 [write cycle] data in t1 tw t2 [read cycle]
tmp92ca25 2007-02-28 92ca25-285 3.15.4.4 example of built-in ram lcd driver connection note: other circuit is required for po wer supply for lcd driver display. figure 3.15.9 interface example for built-in ram and sequential access type lcd driver tmp92ca25 v dd v ss v dd com001 v ss vlc1, vlc2, vlc3, vlc4, vlc5 com065 le db0 to db5 wr lbcd lcp0 w / r a0 d0 to d7 ce wr d/i db0 to db7 eio1 eio2 v dd v ss vlc2, vlc3, vlc5 seg001 seg080 o p en v dd v ss com001 com065 seg001 seg080 65 com 80 seg lcd t6b66a (65-row driver) t6b65a (80-column driver)
tmp92ca25 2007-02-28 92ca25-286 3.15.4.5 program example ? setting example: when using 80 segments 65 commons lcd driver. assign external column driver to lcdc1 and row driver to lcdc4. this example uses ld instruction in se tting of instruction and micro dma burst function for soft start in setting of display data. when storing 650-byte transfer data to lcd driver. ; ******** setting for lcdc ********* ld (lcdmode0), 00h ; select ram mode ld (lcdctl0), 00h ; mmulcd = 0 (sequential access mode) ; ******** setting for mode of lcdc0/lcdr0 ********* ld (lcdc1l), xx ; setting instruction for lcdc1 ld (lcdc4l), xx ; setting instruction for lcdc4 ; ******** setting for micro dma and inttc (ch0) ********* ld a, 08h ; source address inc mode ldc dmam0, a ; ld wa, 650 ; count = 650 ldc dmac0, wa ; ld xwa, 002000h ; source address = 002000h ldc dmas0, xwa ; ld xwa, 1fe1h ; destination address = 1fe1h (lcdc0h) ldc dmad0, xwa ; ld (intetc01), 06h ; inttc0 level = 6 ei 6 ; ld (dmab), 01h ; burst mode ld (dmar), 01h ; soft start
tmp92ca25 2007-02-28 92ca25-287 3.16 melody/alarm generator (mld) the tmp92ca25 contains a melody function and alarm function, both of which are output from the mldalm pin. five kinds of fixed cycle interrupt are generated using a 15-bit counter for use as the alarm generator. the features are as follows. 1) melody generator the melody function generates signals of any frequency (4 hz to 5461 hz) based on a low-speed clock (32.768 khz), and output s the signals from the mldalm pin. the melody tone can easily be heard by connecting an external loudspeaker. 2) alarm generator the alarm function generates eight kinds of alarm waveform having a modulation frequency (4096 hz) determined by the low-spee d clock (32.768 khz). this waveform can be inverted by setting a value to a register. the alarm tone can easily be heard by connecting an external loudspeaker. five kinds of fixed cycle interrupts are ge nerated (1 hz, 2 hz, 64 hz, 512 hz, and 8192 hz) by using a counter which is used for the alarm generator. this section is constituted as follows. 3.16.1 block diagram 3.16.2 control registers 3.16.3 operational description 3.16.3.1 melody generator 3.16.3.2 alarm generator
tmp92ca25 2007-02-28 92ca25-288 3.16.1 block diagram figure 3.16.1 mld block diagram melfh, melfl register comparator (cp0) 12-bit counter (uc0) f/f [melody generator] edge detector a lmint 15-bit counter (uc1) 8-bit counter (uc2) alarm wave form generator alm register invert melalmc selector a lmout melout melalmc internal data bus reset melfh stop and clea r low-speed clock invert melout [alarm generator] internal data bus reset intalm0 (8192 hz) intalm1 (512 hz) intalm2 (64 hz) intalm3 (2 hz) intalm4 (1 hz) intalmh (halt release) mldalm pin 4096 hz clea r melalmc
tmp92ca25 2007-02-28 92ca25-289 3.16.2 control registers alm register 7 6 5 4 3 2 1 0 bit symbol al8 al7 al6 al5 al4 al3 al2 al1 alm (1330h) read/write r/w after reset 0 0 0 0 0 0 0 0 function setting alarm pattern melalmc register 7 6 5 4 3 2 1 0 bit symbol fc1 fc0 alminv ? ? ? ? melalm melalmc (1331h) read/write r/w after reset 0 0 0 0 0 0 0 0 function free-run counter control 00: hold 01: restart 10: clear 11: clear and start alarm waveform invert 1: invert always write ?0? output waveform select 0: alarm 1: melody note 1: melalmc is always read ?0?. note 2: when setting melalmc register except wh ile the free-run counter is running, is kept ?01?. melfl register 7 6 5 4 3 2 1 0 bit symbol ml7 ml6 ml5 ml4 ml3 ml2 ml1 ml0 melfl (1332h) read/write r/w after reset 0 0 0 0 0 0 0 0 function setting melody frequency (lower 8 bits) melfh register 7 6 5 4 3 2 1 0 bit symbol melon ml11 ml10 ml9 ml8 melfh (1333h) read/write r/w r/w after reset 0 0 0 0 0 function control melody counter 0: stop and clear 1: start setting melody frequency (upper 4 bits) almint register 7 6 5 4 3 2 1 0 bit symbol ? ialm4e ialm3e ialm2e ialm1e ialm0e almint (1334h) read/write r/w after reset 0 0 0 0 0 0 function always write ?0? 1: interrupt enable for intalm4 to intalm0
tmp92ca25 2007-02-28 92ca25-290 3.16.3 operational description 3.16.3.1 melody generator the melody function generates signals of any frequency (4 hz to 5461 hz) based on a low-speed clock (32.768 khz) and outputs the signals from the mldalm pin. the melody tone can easily be heard by connecting an external loud speaker. (operation) melalmc must first be set as 1 in order to select the melody waveform to be output from mldalm. the melody output frequency must then be set to 12-bit regi sters melfh and melfl. the following are examples of settings and calculations of melody output frequency. (formula for calculating melody waveform frequency) at fs = 32.768 [khz] melody output waveform f mld [hz] = 32768/(2 n + 4) setting value for melody n = (16384/ f mld ) ? 2 (note: n = 1 to 4095 (001h to fffh), 0 is not acceptable.) (example program) when outputting an ?a? musical note (440 hz) ld (melalmc), ? ? x x x x x 1 b ; select melody waveform ld (melfl), 23h ; n = 16384/440 ? 2 = 35.2 = 023h ld (melfh), 80h ; start to generate waveform reference) basic musical scale setting table scale frequency [hz] register value: n c 264 03ch d 297 035h e 330 030h f 352 02dh g 396 027h a 440 023h b 495 01fh c 528 01dh
tmp92ca25 2007-02-28 92ca25-291 3.16.3.2 alarm generator the alarm function generates eight kinds of alarm waveform having a modulation frequency of 4096 hz determined by the lo w-speed clock (32.768 khz). this waveform is reversible by setting a value to a register. the alarm tone can easily be heard by connecting an external loud speaker . five kinds of fixed cycle (interrupts can be generated 1 hz, 2 hz, 64 hz, 512 hz, 8 192 hz) by using a counter which is used for the alarm generator. (operation) melalmc must first be set as 0 in order to select the alarm waveform to be output from mldalmc. the ?10? must be set on the melalmc register, and clear internal counter. finally the alarm pattern must then be set on the 8-bit register of alm. if it is inverted output-data, set as invert. the following are examples of program, setting value of alarm pattern and waveform of each setting value. (setting value of alarm pattern) setting value for alm register alarm waveform 00h write ?0? 01h al1 pattern 02h al2 pattern 04h al3 pattern 08h al4 pattern 10h al5 pattern 20h al6 pattern 40h al7 pattern 80h al8 pattern others undefined (do not set) (example program) when outputting al2 pattern (31.25 ms/8 times/1 s) ld (melalmc), c0h ; set output alarm waveform ; free-run counter start ld (alm), 02h ; set al2 pattern, start
tmp92ca25 2007-02-28 92ca25-292 example: waveform of alarm pattern for each setting value (not inverted) 500 ms 1 a l3 pattern (once) 250 ms a l8 pattern (once) modulation frequenc y (4096 hz) a l1 pattern (continuous output) 31.25 ms 1 s 1 2 8 1 a l2 pattern (8 times/1 s) 62.5 ms 1 s 1 2 1 a l4 pattern (twice/1 s) 62.5 ms 1 s 1 2 1 3 a l5 pattern (3 times/1 s) 62.5 ms 1 a l6 pattern (once) 62.5 ms 1 2 a l7 pattern (twice)
tmp92ca25 2007-02-28 92ca25-293 3.17 sdram controller (sdramc) the tmp92ca25 includes an sdram controller which supports sdram access by cpu/lcdc. the features are as follows. (1) support sdram data rate type: only sdr (single data rate) type bulk of memory: 16/64/128/256/512 mbits number of banks: 2/4 banks width of data bus: 16 read burst length: 1 word/full page write mode: single/burst (2) initialize function all banks precharge command 8 times auto refresh command set the mode register command (3) access mode cpu access lcdc access read burst length 1 word/full page selectable full page addressing mode sequential sequential cas latency (clock) 2 2 write mode single/burst selectable ? (4) access cycle cpu access (read/write) read cycle: 1 word ? 4 states/full page ? 1 state write cycle: single ? 3 states/burst ? 1 state access data width: 1 byte/ 1 word/ 1 long word lcdc burst access (read only) read cycle: full page ? 1 state full page over head: 4 states (200 ns at f sys = 20 mhz) access data width: 1 word/ 1 long word (5) refresh cycle auto generate auto-refresh is generated while another area is being accessed. refresh interval is programmable. self-refresh is supported note 1: display data for lcdc must be set from the head of each page. note 2: condition of sdram?s area set by cs1 setting of memory controller.
tmp92ca25 2007-02-28 92ca25-294 3.17.1 control registers figure 3.17.1 shows the sdramc control regist ers. setting these registers controls the operation of sdramc. sdram access control register 1 7 6 5 4 3 2 1 0 bit symbol ? ? smrd swrc sbst sbl1 sbl0 smac sdacr1 (0250h) read/write r/w after reset 0 0 0 0 0 1 0 0 function always write ?0? always write ?0? mode register set delay time 0: 1 clock 1: 2 clocks write recover time 0: 1 clock 1: 2 clocks burst stop command 0: precharge all 1: burst stop selecting burst length (note 1) 00: reserved 01: full-page read, burst write 10: 1-word read, single write 11: full-page read, single write sdram controller 0: disable 1: enable note 1: issue mode register set command after changing . exercise care in settings when changing from ?full-page read? to ?1-word read?. please refer to ?limitations arising when using sdram?. sdram access control register 2 7 6 5 4 3 2 1 0 bit symbol sbs sdrs1 sdrs0 smuxw1 smuxw0 sdacr2 (0251h) read/write r/w after reset 0 0 0 0 0 function number of banks 0: 2 banks 1: 4 banks selecting row address size 00: 2048 rows (11 bits) 01: 4096 rows (12 bits) 10: 8192 rows (13 bits) 11: reserved selecting address multiplex type 00: typea (a9-) 01: typeb (a10-) 10: typec (a11-) 11: reserved sdram refresh control register 7 6 5 4 3 2 1 0 bit symbol ? ssae srs2 srs1 srs0 src sdrcr (0252h) read/write r/w r/w after reset 0 1 0 0 0 0 function always write ?0? sr auto exit function 0: disable 1: enable refresh interval 000: 47 states 100: 156 states 001: 78 states 101: 195 states 010: 97 states 110: 249 states 011: 124 states 111: 312 states auto refresh 0: disable 1: enable
tmp92ca25 2007-02-28 92ca25-295 sdram command register 7 6 5 4 3 2 1 0 bit symbol scmm2 scmm1 scmm0 sdcmm (0253h) read/write r/w after reset 0 0 0 function command issue (note 1) (note 2) 000: not execute 001: initialization sequence a. precharge all command b. eight auto refresh commands c. mode register set command 100: mode register set command 101: self refresh entry command 110: self refresh exit command others: reserved note 1: is automatically cleared to ?000? after the specified command is issued. before writing the next command, make sure that is ?000?. in the case of the self refresh entry command, however, is not cleared to ?000? by execution of th is command. thus, this regi ster can be used as a flag for checking whether or not self refresh is being performed. note 2: the self refresh exit command can only be specified while self refresh is being performed. figure 3.17.1 sdram control registers
tmp92ca25 2007-02-28 92ca25-296 3.17.2 operation description (1) memory access control sdram controller is enabled when sdacr1 = 1. and then sdram control signals ( sdcs , sdras , sdcas , sdwe , sdlldqm, sdludqm, sdclk and sdcke) are operating during the time cpu or lcdc accesses cs1 area. 1. address multiplex function in the access cycle, outputs row/column address through a0 to a15 pin. and multiplex width is decided by setting sd acr2 of use memory size. the relation between multiplex width and row/column address is shown in table 3.17.1 address multiplex. table 3.17.1 address multiplex address of sdram accessing cycle row address column address tmp92ca25 pin name typea ?00? typeb ?01? typec ?10? 16-bit data bus width b1csh = ?01? 32-bit data bus width b1csh = ?10? a0 a9 a10 a11 a1 a2 a1 a10 a11 a12 a2 a3 a2 a11 a12 a13 a3 a4 a3 a12 a13 a14 a4 a5 a4 a13 a14 a15 a5 a6 a5 a14 a15 a16 a6 a7 a6 a15 a16 a17 a7 a8 a7 a16 a17 a18 a8 a9 a8 a17 a18 a19 a9 a10 a9 a18 a19 a20 a10 a11 a10 a19 a20 a21 ap * ap * a11 a20 a21 a22 a12 a21 a22 a23 a13 a22 a23 ea24 a14 a23 ea24 ea25 a15 ea24 ea25 ea26 row address * ap: auto precharge burst length of sdram read/write by cpu can be select by setting sdacr1. burst length of accessing by lcdc is fixed to operation contents. sdram access cycle is shown in figure 3.17.2 and figure 3.17.3. sdram access cycle number does not depend on the settings of b1csl register. in the full page burst read cycle, a mode re gister set cycle and a precharge cycle are automatically inserted at the beginning and end of a cycle. (2) instruction executing on sdram the cpu can execute instructions on sdram. however, the following functions do not operate. a) executing halt instruction b) execute instructions that write to sdcmm register these operations must be executed by another memory such as the built-in ram.
tmp92ca25 2007-02-28 92ca25-297 figure 3.17.2 timing of burst read cycle figure 3.17.3 timing of cpu write cycle (structure of data bus: 16 bits 1, operand size: 2 bytes, address: 2n + 0) sdcs read (n + 318) (n + 316) ca (n + 6) ca (n + 4) ca (n + 2) d (n + 4) d (n + 6) d (n + 316) d (n + 318) d (n + 2) ra sdclk sdcke sdludqm sdlldqm a10 ra a15 to a0 d (n) d15 to d0 bank active all banks precharge 85 states (320-byte read) ca (n) sdras sdcas sdwe 3 states sdclk sdcke sdludqm sdlldqm a10 ra a15 to a0 d15 to d0 bank active internal precharge ca write with precharge ra ca out sdcs sdras sdcas sdwe
tmp92ca25 2007-02-28 92ca25-298 (3) refresh control this lsi supports two refresh command s: auto-refresh and self-refresh. (a) auto-refresh the auto-refresh command is automati cally generated at intervals set by sdrcr by setting sdrcr to ?1?. the generation interval can be set from between 47 to 312 states (2.4 s to 15.6 s at f sys = 20 mhz). cpu operation (instruction fetch and execution) stops while performing the auto-refresh command. the auto-refresh cycle is shown in figure 3.17.4 and the auto-refresh generation interval is shown in table 3.17.2. the auto-refresh function cannot be used in idle1 and stop modes. in these modes, use the self- refresh function to be explained next. note: a system reset disables the auto-refresh function. figure 3.17.4 timing of auto-refresh cycle table 3.17.2 refresh cycle insertion interval (unit: s) sdrcr f sys frequency (system clock) srs2 srs1 srs0 insertion interval (state) 6 mhz 10 mhz 12.5 mhz 15 mhz 17.5 mhz 20 mhz 0 0 0 47 7.8 4.7 3.8 3.1 2.7 2.4 0 0 1 78 13.0 7.8 6.2 5.2 4.5 3.9 0 1 0 97 16.2 9.7 7.8 6.5 5.5 4.9 0 1 1 124 20.7 12.4 9.9 8.3 7.1 6.2 1 0 0 156 26.0 15.6 12.5 10.4 8.9 7.8 1 0 1 195 32.5 19.5 15.6 13.0 11.1 9.8 1 1 0 249 41.5 24.9 19.9 16.6 14.2 12.4 1 1 1 312 52.0 31.2 25.0 20.8 17.8 15.6 sdclk sdcke sdludqm sdlldqm auto refresh 2 states sdcs sdras sdcas sdwe
tmp92ca25 2007-02-28 92ca25-299 (b) self-refresh the self-refresh entry command is generated by setting sdcmm to ?101?. the self-refresh cycle is shown in figure 3.17.5. during self-refresh entry, refresh is performed within the sdram (an auto-refresh command is not needed). note 1: when standby mode is released by a system reset, the i/o registers are initialized and the self refresh state is exited. note that the auto refresh func tion is also disabled at this time. note 2: the sdram cannot be accessed while it is in the self refresh state. note 3: to execute the halt instruction after the self refresh entry command, insert at least 10 bytes of nop or other instructions between the instruction to set sdcmm to ?101? and the halt instruction. figure 3.17.5 timing of self-refresh cycle sdclk sdcke sdludqm sdlldqm self refresh entry self refresh exit auto refresh sdcs sdras sdcas sdwe
tmp92ca25 2007-02-28 92ca25-300 self-refresh condition is released by executing serf-refresh command. way to execute self-refresh exit command is 2 ways: write ?110? to sdcmm, or execute exit automatically by synchronizing to releasing halt condition. both ways, after it executes auto-refresh at once just after self-refresh exit, it executes auto-refresh at setting condition. when it became exit by writing ?110? to , is cleared to ?000?. exit command that synchronize to rele ase halt condition can be prohibited by setting sdrcr to ?0?. if don?t se t to exit automatically, set to prohibit. if using condition of sdram is satisfied by operation clock frequency (clock gear down, slow mode condition and so on) is falling, set to prohibit. figure 3.17.6 shows execution flow in this case. figure 3.17.6 execution flow example (execute halt instruction at low-speed clock). gea r -down o r change to low clock sr exit change clk halt interrupt sr condition auto exit disable auto exit enable gea r -up or change to high clock f sys cpu sdram condition auto exit enable auto exit enable sr exit change clk ar condition ar condition auto exit enable 20mhz 32khz halt condition sdram controller internal condition
tmp92ca25 2007-02-28 92ca25-301 ; ******** sample program ********* loop1: ldb a, (sdcmm) ; check the command register clear andb a, 00000111b ; j nz, loop1 ; ldw (sdrcr), 0000010100000011b ; auto exit disable self-refresh entry nop 10 ; wait for execution of self-refresh entry ld halt (syscr1), 00001---b ; fs nop ; self-refresh exit (internal signal only) ld (syscr1), 00000---b ; fc ld (sdcmm), 00000110b ; self-refresh exit (command) ld (sdrcr), 0001---1b ; auto exit enable
tmp92ca25 2007-02-28 92ca25-302 (4) sdram initialize this lsi can generate the following sdram initialize routine after introduction of power supply to sdram. the command is shown in figure 3.17.7. 1. precharge all command 2. eight auto refresh commands 3. mode register set command the above commands are issued by setting sdcmm to ?001?. while these commands are issued, the cpu operation (an instruction fetch, command execution) is halted. before executing the initialization sequence, appropriate port settings must be made to enable the sdram control sign als and address signals (a0 to a15). after the initialization sequence is completed, sdcmm is automatically cleared to ?000?. figure 3.17.7 timing of initialization command 627 sdclk sdcke sdludqm sdlldqm a10 a15 to a0 precharge all banks auto refresh set mode register 8 times refresh cycle 227 auto refresh auto refresh auto refresh auto refresh sdcs sdras sdcas sdwe
tmp92ca25 2007-02-28 92ca25-303 (5) connection example figure 3.17.8 shows an example of connections between the tmp92ca25 and sdram table 3.17.3 connection with sdram sdram pin name data bus width: 16 bits tmp92ca25 pin name 16 m 64 m 128 m 256 m 512 m a0 a0 a0 a0 a0 a0 a1 a1 a1 a1 a1 a1 a2 a2 a2 a2 a2 a2 a3 a3 a3 a3 a3 a3 a4 a4 a4 a4 a4 a4 a5 a5 a5 a5 a5 a5 a6 a6 a6 a6 a6 a6 a7 a7 a7 a7 a7 a7 a8 a8 a8 a8 a8 a8 a9 a9 a9 a9 a9 a9 a10 a10 a10 a10 a10 a10 a11 bs a11 a11 a11 a11 a12 ? bs0 bs0 a12 a12 a13 ? bs1 bs1 bs0 bs0 a14 ? ? ? bs1 bs1 a15 ? ? ? ? ? sdcs cs cs cs cs cs sdludqm udqm udqm udqm udqm udqm sdlldqm ldqm ldqm ldqm ldqm ldqm sdras ras ras ras ras ras sdcas cas cas cas cas cas sdwe we we we we we sdcke cke cke cke cke cke sdclk clk clk clk clk clk sdacr 00: typea 00: typea 01: typeb 01: typeb 10: typec (an): row address : command address pin of sdram figure 3.17.8 connection with sdram (4 m word 16 bits) tmp92ca25 sdclk sdcke a13 to a12 a11 to a0 d15 to d0 sdras sdcas sdwe sdcs sdludqm sdlldqm clk cke bs1 to bs0 a11 to a0 d15 to d0 ras cas we cs udqm ldqm 1m word 4 banks 16 bits
tmp92ca25 2007-02-28 92ca25-304 3.17.3 limitations arising when using sdram take care to note the following points when using sdramc. 1. wait access when using sdram, some limitation is added when accessing memory other than sdram. in wait-pin input setting of the memory controller, if the setting time is inserted as an external wait, set a time less than the auto-refresh cycle 8190 (auto- refresh function controlled by sdram controller). 2. execution of sdram command before halt instruction (sr (self refresh)-entry, initialize, mode-set) when a sdram controller command (sr-entry, initialize and mode-set) is issued, several states are required for execution time after the sdcmm register is set. therefore, when a halt instruction is executed after the sdram command, please insert a nop of more than 10 bytes or 10 other instructions before executing the halt instruction. 3. ar (auto-refresh) interval time when using sdram, set the system clock frequency to satisfy the minimum operation frequency for the sdram and minimum refresh cycle. in a system in which sdram is used and the clock is geared up and down exercise care in ar cycle for sdram. 4. note when changing access mode if changing access mode from ?full page read? to ?1 word read?, execute the following program. this program must not be executed on the sdram. di ; interrupt disable (added) ld a,(optional external memory address) ; dummy read instruction (added) ld (sdacr1),00001101b ; change to ?1-word read? ld (sdcmm),0x04 ; execute mrs (mode register setting) ei ; interrupt enable (added)
tmp92ca25 2007-02-28 92ca25-305 3.18 nand-flash controller 3.18.1 characteristics the nand-flash controller (ndfc) is provided with dedicated pins for connecting with nand-flash memory. the ndfc also has an ecc calculation function for error correction. although the ndfc has two channels (channel 0, channel 1), all pins except for chip enable are shared between the two channels. these signals are controlled by ndcr. only the operation of channel 0 is explained here. the ndfc has the following features: 1) controlled nand-flash interface by setting registers. 2) ecc calculating circuits. (for scl-type) note 1: the wp (write protect) pin of nand flash is not supported. if this function is needed, prepare it on an external circuit. note 2: the two channels cannot be accessed simultaneously . it is necessary to switch between the two channels.
tmp92ca25 2007-02-28 92ca25-306 3.18.2 block diagram figure 3.18.1 nand-flash controller block diagram internal bus bus i/f register address host i/f timing control registers nand-flash i/f timing control nd_ce * nd_ale nd_cle nd_re * nd_we * nd_rb * data_out [7:0] data_in [7:0] ce 0 nd a b s ndcle, ndale, ndre , ndwe , d7 to d0 d7 to d0, ndr/ b ce 1 nd nand - fl as h c ontro ll er ch anne l 0 (ndfc0) nand - fl as h c ontro ll er ch anne l 1 (ndfc1) (same as ndfc0 ) d q ndcr registe r
tmp92ca25 2007-02-28 92ca25-307 3.18.3 operation description 3.18.3.1 accessing nand-flash memory the ndfc accesses data on nand flash me mory indirectly through its internal registers. it also contains the ec c calculating circuits. please see 3.18.3.2 for details of the ecc. this section explains the operations for accessing the nand flash. basically, set the command in nd0fmcr and then read or write to nd0fdtr. the read cycle for nd0fdtr is completed af ter the external read cycle for the nand-flash is finished. likewise, the wr ite cycle for nd0fdtr is completed after the external write cycle for the nand-flash is finished. 1) initialize the initialize sequence is as follows. (1) nd0fspr: set the low pulse width. (2) nd0fimr: set 0x81 if interrupt is required. (release interrupt mask) 2) write the write sequence is as follows. (1) nd0fmcr: set 0x7c for ecc data reset. (2) write 512 bytes nd0fmcr: set 0x9d for ndcle signal enable and command mode. nd0fdtr: set 0x80 for the serial data input command. nd0fmcr: set 0x9e for ndale si gnal enable and address mode. nd0fdtr: write address. set a [7:0], a [16:9], and a [24:17]. if it is required, set a [25]. nd0fmcr: set 0xbc for the data mode. nd0fdtr: write 512 bytes data. (3) read ecc data nd0fmcr: set 0xdc for the ecc data read mode. ndeccrd: read 6 bytes ecc data. first data: lpr [7:0] second data: lpr [15:8] third data: cpr [5:0], 2?b11 fourth data: lpr [23:16] fifth data: lpr [31:24] sixth data: cpr [11:6], 2?b11
tmp92ca25 2007-02-28 92ca25-308 (4) write 16-byte redundant data nd0fmcr: set 0x9c for the data mode without ecc calculation. nd0fdtr: write 16-byte redundant data. d520: lpr [23:16] d521: lpr [31:24] d522: cpr [11:6], 2?b11 d525: lpr [7:0] d526: lpr [15:8] d527: cpr [5:0], 2?b11 (5) run page program nd0fmcr: set 0x9d for ndcle signal enable and command mode. nd0fdtr: set 0x10 for the page program command. nd0fmcr: set 0x1c for ndale signal disable. wait several states (e.g., ?nop? 10) nd0fsr: check busy flag. if it is 0, go to the next. if it is 1, wait until it becomes 0. (6) read status nd0fmcr: set 0x1d for ndcle signal and command mode. nd0fdtr: set 0x70 for status read command. nd0fmcr: set 0x1c for ndcle signal disable. nd0fdtr: read the status data from the nand-flash. (7) repeat 1 to 6 for all other pages if required.
tmp92ca25 2007-02-28 92ca25-309 3) read the read sequence is as follows. (1) nd0fmcr: set 0x7c for ecc data reset. (2) read 512 bytes nd0fmcr: set 0x1d for ndcle signal enable and command mode. nd0fdtr: set 0x00 for the read command. nd0fmcr: set 0x1e for ndale sign al enable and address mode. nd0fdtr: set a [7:0], a [16:9], and a [24:17]. if it is required, set a [25]. nd0fmcr: set 0x1c for ndale signal disable. wait several states (e.g., ?nop? 10) nd0fsr: check busy flag. if it is 0, go to the next. if it is 1, wait until it becomes 0. nd0fmcr: set 0x3c for the data mode with ecc calculation. nd0fdtr: read 512-byte data. nd0fmcr: set 0x1c for the data mode without ecc calculation. nd0fdtr: read 16-byte redundant data. (3) read ecc data nd0fmcr: set 0x5c for the ecc data read mode. ndeccrd: read 6-byte ecc data. first data: lpr [7:0] second data: lpr [15:8] third data: cpr [5:0], 2?b11 fourth data: lpr [23:16] fifth data: lpr [31:24] sixth data: cpr [11:6], 2?b11 (4) software routine: compare ecc data and redundant data, run the error routine if error is generated. (5) read other pages nd0fmcr: set 0x1c. nd0fsr: check busy flag. if it is 0, go to the next. if it is 1, wait until it becomes 0.
tmp92ca25 2007-02-28 92ca25-310 4) id read the id read sequence is as follows. (1) nd0fmcr: set 0x1d for ndcle signal enable and command mode. (2) nd0fdtr: set 0x90 for the id read command. (3) nd0fmcr: set 0x1e for ndale signal enable and the address mode. (4) nd0fdtr: set 0x00. (5) nd0fmcr: set 0x1c for the data mode without ecc calculation. (6) nd0fdtr: read maker code. (7) nd0fdtr: read device code. 3.18.3.2 ecc control the ndfc contains the ecc calculating circuits. the circuits are controlled by nd0fmcr. this circuit executes ecc data calculation. however, ecc comparison and error correction is not executed. this must be executed using software. the calculated ecc data can be read from the ndeccrd register when nd0fmcr is 0xd0 (write mode) or 0x50 (read mode). this is 6-byte data, and six ndeccrd read operations are required. the order of the data is as follows. first data: lpr [7:0] second data: lpr [15:8] third data: cpr [5:0], 2?b11 fourth data: lpr [23:16] fifth data: lpr [31:24] sixth data: cpr [11:6], 2?b11
tmp92ca25 2007-02-28 92ca25-311 3.18.4 registers table 3.18.1 nand-flash control registers for channel 0 address register register name 1d00h (1d00h to 1effh) nd0fdtr nand-flash data transfer register 1cb0h (1cb0h to 1cb5h) nd0eccrd nand-flash ecc-code read register 1cc4h nd0fmcr nand-flash mode control register 1cc8h nd0fsr nand-flash status register 1ccch nd0fisr nand-flash interrupt status register 1cd0h nd0fimr nand-flash interrupt mask register 1cd4h nd0fspr nand-flash strobe pulse width register 1cd8h nd0frstr nand-flash reset register table 3.18.2 nand-flash control registers for channel 1 address register register name 1d00h (1d00h to 1effh) nd1fdtr nand-flash data transfer register 1cb0h (1cb0h to 1cb5h) nd1eccrd nand-flash ecc-code read register 1ce4h nd1fmcr nand-flash mode control register 1ce8h nd1fsr nand-flash status register 1cech nd1fisr nand-flash interrupt status register 1cf0h nd1fimr nand-flash interrupt mask register 1cf4h nd1fspr nand-flash strobe pulse width register 1cf8h nd1frstr nand-flash reset register table 3.18.3 nand-flash control registers address register register name 01c0h ndcr nand-flash control register
tmp92ca25 2007-02-28 92ca25-312 3.18.4.1 nand-flash data transfer register (nd0fdtr and nd1fdtr) 7 0 data r/w ? : type : default bit (s) mnemonic field name description 7:0 data data nand-flash data. read: read the data that was read from the nand-flash. write: write data to the nand-flash. note 1: this register has a 512-address window from 1d00 h to 1effh since a nand-flas h page size is either 256 or 512 bytes. when the cpu reads from or writes to the nand-fla sh , and if the block transfer instruction (?ldir? instruction) is used, the following restriction applies to the 900/h1 cpu. [restriction for using the block transfer instruction] 1) the source address for ?ldir? instruction should be set to (1f00h ? read (or write) byte number) example 1) in case of 512-byte read ld bc, 512 ; 512 bytes ld xix, 2000h ; dst = 2000h ld xiy, 1d00h ; src = (1f00h ? 512) = 1d00h ldir (xix + ), (xiy + ) ; block transfer instruction example 2) in case of 16-byte read ld bc, 16 ; 16 bytes ld xix, 2000h ; dst = 2000h ld xiy, 1ef0h ; src = (1f00h ? 16) = 1ef0h ldir (xix + ), (xiy + ) ; block transfer instruction note 2: both nd0fdtr and nd1fdtr are assigned to the same address. the ndcr register determines which channel is accessed. figure 3.18.2 nand-flash data transf er register (nd0fdtr and nd1fdtr)
tmp92ca25 2007-02-28 92ca25-313 3.18.4.2 nand-flash ecc-code read register (nd0eccrd and nd1eccrd) 7 0 ecc-code r : type ? : default bit (s) mnemonic field name description 7:0 ecc-code ecc-code read calculated ecc data. note 1: both nd0eccrd and nd1eccrd are assigned to the same address. the ndcr register determines which channel is accessed. figure 3.18.3 nand-flash ecc-code re ad register (nd0eccrd and nd1eccrd)
tmp92ca25 2007-02-28 92ca25-314 3.18.4.3 nand-flash mode control register (nd0fmcr and nd1fmcr) 7 6 5 4 3 5 1 0 we ecc1 ecc0 ce pcnt1 pcnt0 ale cle r/w r/w r/w r/w r/w r/w r/w r/w : type 0 0 0 0 0 0 0 0 : default bits mnemonic field name description 7 we write enable write enable (default: 0) this bit enables the data write operation. when writing the data to the nand-flash, set this bit to ?1?. when writing command or address, this bit need not be set to ?1?. 0: disable write operation 1: enable write operation 6 ecc1 5 ecc0 ecc control ecc control (default: 00) control the ecc calculating circuits with (bit4) register. 11 (at = x): reset ecc circuits 00 (at = 1): ecc circuits are disabled. 01 (at = 1): ecc circuits are enabled. 10 (at = 1): read ecc data calculated by ndfc 10 (at = 0): read id data 4 ce chip enable chip enable (default: 0) enable nand-flash access. set ?1? to th is bit when accessing the nand-flash. 0: disable ( ndce is high.) 1: enable ( ndce is low.) 3 pcnt1 2 pcnt0 power control power control (default: 00) always write ?11? 1 ale address latch enable address latch enable (default: 0) this bit specifies the value of the ndale signal. 0: low 1: high 0 cle command latch enable command latch enable (default: 0) this bit specifies the value of the ndcle signal. 0: low 1: high figure 3.18.4 nand-flash mode contro l register (nd0fmcr and nd1fmcr)
tmp92ca25 2007-02-28 92ca25-315 3.18.4.4 nand-flash status register (nd0fsr and nd1fsr) 7 6 0 busy r : type ? : default bits mnemonic field name description 7 busy busy busy (default: undefined) this bit shows the status of the nand-flash. 0: ready 1: busy 6:0 ? ? reserved note: a noise-filter for some states is built into the ndfc, so when the ndr/ b pin changes, a flag is not renewed at the same time. therefore, insert several delays (e.g., ?nop? instruction 10) using software before starting this flag check. figure 3.18.5 nand-flash status register (nd0fsr and nd1fsr) ndwe pin read command a ddress input delay time sensing flag ndcle pin ndale pin ndr/ b pin flag
tmp92ca25 2007-02-28 92ca25-316 3.18.4.5 nand-flash interrupt status register (nd0fisr and nd1fisr) 7 6 5 4 3 2 1 0 rdy : type : default bits mnemonic field name description 7:1 ? ? reserved 0 rdy ready ready (default: 0) when ndr/ b signal changes from low (busy) to high (ready) and ndfimr is ?1?, this bit is set to ?1?. by writing ?1?, this bit is cleared to 0. read: 0: none 1: change ndr/ b signal from busy to ready. write: 0: no change 1: clear to ?0? figure 3.18.6 nand-flash interrupt stat us register (nd0fisr and nd1fisr) 3.18.4.6 nand-flash interrupt mask register (nd0fimr and nd1fimr) 7 6 4 3 2 1 0 inten 0 mrdy r/w r/w : type 0 0 : default bits mnemonic field name description 7 inten interrupt enable interrupt enable (default: 0) when and are set ?1? and ndfisr becomes ?1?, intndfc occurs. 0: disable 1: enable 6:1 ? ? reserved 0 mrdy mask rdy interrupt mask rdy interrupt (default: 0) this bit masks the ndfisr. if is ?1? and ndr/ b signal changes from low to high, ndfisr is set to ?1?. 0: disable to set ndfisr 1: enable to set ndfisr figure 3.18.7 nand-flash interrupt ma sk register (nd0fimr and nd1fimr)
tmp92ca25 2007-02-28 92ca25-317 3.18.4.7 nand-flash strobe pulse width register (nd0fspr and nd1fspr) 7 6 5 4 3 2 1 0 spw r/w : type 0000 : default bits mnemonic field name description 7:4 ? ? reserved 3:0 spw strobe pulse width strobe pulse width (default: 0000) these bits set the low pulse width of the ndre and ndwe signals. the low pulse width is ((value set to spw) +1 ) f sys clock figure 3.18.8 nand-flash strobe pulse width register (nd0fspr and nd1fspr)
tmp92ca25 2007-02-28 92ca25-318 3.18.4.8 nand-flash reset regi ster (nd0frstr and nd1frstr) 7 6 5 4 3 2 1 0 rst r/w : type 0 : default bits mnemonic field name description 7:1 ? ? reserved 0 rst reset reset (default: 0) by setting this bit, reset the ndfc (except ndcr register). by reset, this bit is automatically cleared to ?0?. 0: don?t care 1: reset note: after writing register, several waits ar e required (about 10 states) before accessing the ndfc. figure 3.18.9 nand-flash reset register (nd0frstr and nd1frstr) 3.18.4.9 nand-flash control register (ndcr) 7 6 5 4 3 2 1 0 bit symbol chsel ndcr (01c0h) read/write r/w after reset 0 function 0: channel 0 1: channel 1
tmp92ca25 2007-02-28 92ca25-319 3.18.5 timing diagrams 3.18.5.1 command and address cycle figure 3.18.10 command and address cycle ndcle ndce d7 to d0 ndr/b ndale ndre ndwe nd0fmcr = 0 nd0fmcr = 1 nd0fmcr = 1 nd0fmcr = 1 nd0fmcr = 0
tmp92ca25 2007-02-28 92ca25-320 3.18.5.2 data read cycle figure 3.18.11 shows a timing chart example for a data read cycle from the nand-flash at nd0fspr = 02h. figure 3.18.11 data read cycle example (nd0fspr = 02h) in (program) in (nand-flash) in (program) ndce d15 to d0 ndr/b ndale ndre ndwe ff1234h 001d00h ff1238h sdcl k a23 to a0 cs2 rd srwr program memory read (1 wait) nand-flash read program memory read (1 wait) ndcle
tmp92ca25 2007-02-28 92ca25-321 3.18.5.3 data write cycle figure 3.18.12 shows a timing chart ex ample for a data write cycle to the nand-flash at nd0fspr = 02h. figure 3.18.12 data write cycle (nd0fspr = 02h) in (program) out (nand-flash) in (program) ndce d15 to d0 ndr/b ndale ndre ndwe ff1234h 001d00h ff1238h sdcl k a23 to a0 cs2 rd srwr program memory read (1 wait) nand-flash write program memory read (1 wait) ndcle
tmp92ca25 2007-02-28 92ca25-322 3.18.6 example of nand-flash use note 1: by reset, both ndre and ndwe pins become input ports (port 71 and port 72) and so require pull-up resistors. note 2: use the nand-flash memory and board capacitance to set the correct value for the ndr/ b pin pull-up resistor . 2 k is a typical value. note 3: the nand-flash wp (write protect) pin is not supported by the tmp92ca25. it must be provided by an external circuit if required. figure 3.18.13 example of nand-flash connection tmp92ca25 ndcle ndale ndre ndwe ndr/ b d [7:0] ce 0 nd ce 1 nd external circuits for write protect nand-flash 0 nand-flash 1 cle ale re we r/b (open drain) i/o [7:0] ce wp cle ale re we r/b (open drain) i/o [7:0] ce wp 2 k 100 k
tmp92ca25 2007-02-28 92ca25-323 3.19 16-bit timer/event counters (tmrb0) the tmp92ca25 incorporates one multifunctional 16-bit timer/event counter (tmrb0) which has the following operation modes: ? 16-bit interval timer mode ? 16-bit event counter mode ? 16-bit programmable pulse generation (ppg) mode the timer/event counter consists of a 16-bit up counter, two 16-bit timer registers (one of them with a double buffer structure), a 16-bit capture register, two comparators, a capture input controller, a timer flip -flop and a control circuit. the timer/event counter is controlled by an 11-byte control sfr. this chapter includes the following sections: 3.19.1 block diagrams 3.19.2 operation of each block 3.19.3 sfrs 3.19.4 operation in each mode (1) 16-bit interval timer mode (2) 16-bit programmable pulse generation (ppg) output mode table 3.19.1 pins and sfr of tmrb0 channel spec. tmrb0 external clock/capture trigger input pins none external pins timer flip-flop output pins tb0out0 (also used as pc2) timer run register tb0run (1180h) timer mode register tb0mod (1182h) timer flip-flop control register tb0ffcr (1183h) tb0rg0l (1188h) tb0rg0h (1189h) tb0rg1l (118ah) timer register tb0rg1h (118bh) tb0cp0l (118ch) tb0cp0h (118dh) tb0cp1l (118eh) sfr (address) capture register tb0cp1h (118fh)
tmp92ca25 2007-02-28 92ca25-324 3.19.1 block diagrams figure 3.19.1 block diagram of tmrb0 internal data bus slelector 16-bit comparator (cp10) tb0mod t1 t4 t16 timer flip-flop control tb0ff0 tb0out0 match detection 16-bit timer register tb0rg0h/l register buffer 10 ta1out tb1mod 16-bit time register tb0rg1h/l tb0mod 16-bit comparator (cp11) capture, external interrupt input control tb0run caputure register 1 tb0cp1h/l capture register 0 tb0cp0h/l run/ clea r internal data bus match detection 16-bit up counter (uc10) count clock (from tmra01 ) prescaler clock: t0 32 16 8 4 2 t1 t4 t16 tb0run internal data bus tb0mod intenal data bus overflow interrupt inttbof0 time r flip-flop timer flip-flop output interrupt output inttb00 inttb01 tb0run
tmp92ca25 2007-02-28 92ca25-325 3.19.2 operation of each block (1) prescaler the 5-bit prescaler generates the source clock for timer 0. the prescaler clock ( t0) is a divided clock (divided by 8) from the f fph . this prescaler can be started or stopped using tb0run. counting starts when is set to ?1?; the prescaler is cleared to 0 and stops operation when is cleared to ?0?. table 3.19.2 prescaler clock resolution timer counter input clock tmrb prescaler tb0mod system clock selection syscr1 clock gear selection syscr1 ? t1(1/2) t4 (1/8) t16 (1/32) 1 (fs) ? fs/16 fs/64 fs/256 000 (1/1) fc/16 fc/64 fc/256 001 (1/2) fc/32 fc/128 fc/512 010 (1/4) fc/64 fc/256 fc/1024 011 (1/8) fc/128 fc/512 fc/2048 0 (fc) 100 (1/16) 1/8 fc/256 fc/1024 fc/4096 xxx: don't care (2) up counter (uc10) uc10 is a 16-bit binary counter which counts up pulses input from the clock specified by tb0mod. any one of the prescaler internal clocks t1, t4 and t16 can be selected as the input clock. counting or stopping and clearing of the counter is controlled by tb0run. when clearing is enabled, the up counter uc10 will be cleared to ?0? each time its value matches the value in the timer register tb0rg1h/l. if clearing is disabled, the counter operates as a free-running counter. clearing can be enabled or disabled using tb0mod. a timer overflow interrupt (inttbof0) is generated when uc10 overflow occurs.
tmp92ca25 2007-02-28 92ca25-326 (3) timer registers (tb0 rg0h/l and tb0rg1h/l) these 16-bit registers are used to set the interval time. when the value in the up counter uc10 matches the value set in th is timer register, the comparator match detect signal will go active. setting data for both upper and lower timer registers is always needed. for example, either using a 2-byte data transfer instruction or using a 1-byte data transfer instruction twice for the lower 8 bits and upper 8 bits in order. the tb0rg0h/l timer register has a double-b uffer structure, which is paired with a register buffer. the value set in tb0run determines whether the double-buffer structure is enabled or di sabled: it is disabled when = ?0?, and enabled when = ?1?. when the double buffer is enabled, data is transferred from the register buffer to the timer register when the values in the up counter (uc10) and the timer register tb0rg1h/l match. after a reset, tb0rg0h/l and tb0rg1h/l are undefined. if the 16-bit timer is to be used after a reset, data should be written to it beforehand. on a reset is initialized to ?0?, disabling the double buffer. to use the double buffer, write data to the timer register, set to 1, then write data to the register buffer as shown below. tb0rg0h/l and the register buffer both have the same memory addresses (001188h and 001189h) allocated to them. if = ?0?, the value is written to both the timer register and the register buffer. if = ?1?, the value is written to the register buffer only. the addresses of the timer registers are as follows: the timer registers are write-only registers and thus cannot be read. tmrb0 tb0rg0h/l upper 8 bits (tb0rg0h) lower 8 bits (tb0rg0l) 001189h 001188h tb0rg1h/l upper 8 bits (tb0rg1h) lower 8 bits (tb0rg1l) 00118bh 00118ah
tmp92ca25 2007-02-28 92ca25-327 (4) capture registers (tb0 cp0h/l and tb0cp1h/l) these 16-bit registers are used to latch the values in the up counters. all 16 bits of data in the capture regist ers should be read. for example, using a 2-byte data load instruction or two 1-byte data load instructions. the least significant byte is read first, followed by the most significant byte. the addresses of the capture registers are as follows: the capture registers are read-only r egisters and thus cannot be written to. (5) capture input control this circuit controls the timing to latch the value of the up counter uc10 into tb0cp0h/l and tb0cp1h/l. the value in the up counter can be loaded into a capture register by software. whenever ?0? is programmed to tb0mod, the current value in the up counter is loaded into capture register tb0cp0h/l. it is necessary to keep the prescaler in run mode (i.e ., tb0run must be held at a value of 1). (6) comparators (cp10 and cp11) cp10 and cp11 are 16-bit comparators which compare the value in the up counter uc10 with the value set in tb0rg0h/l or tb0rg1h/l respectively, in order to detect a match. if a match is detected, the comparator generates an interrupt (inttb00 or inttb01 respectively). (7) timer flip-flops (tb0ff0) these flip-flops are inverted by the match detect signals from the comparators and the latch signals to the capture registers. inversion can be enabled and disabled for each element using tb0ffcr. after a reset the value of tb0ff0 is undefined. if ?00? is programmed to tb0ffcr , tb0ff0 will be inverted. if ?01? is programmed to the capture registers, the value of tb0ff0 will be set to ?1?. if ?10? is programmed to the capture registers, the value of tb0ff0 will be cleared to ?0?. the values of tb0ff0 can be output via the timer output pin tb0out0 (which is shared with pc6). timer output should be specified using the port b function register. tmrb0 tb0cp0h/l uppe r 8 bits (tb0cph) lowe r 8 bits (tb0cp0l) 00118dh 00118ch tb0cp1h/l uppe r 8 bits (tb0cp1h) lowe r 8 bits (tb0cp1l) 00118fh 00118eh
tmp92ca25 2007-02-28 92ca25-328 3.19.3 sfrs tmrb0 run register 7 6 5 4 3 2 1 0 bit symbol tb0rde ? i2tb0 tb0prun tb0run tb0run (1180h) read/write r/w r/w r/w after reset 0 0 0 0 0 tmrb0 prescaler up counter uc10 function double buffer 0: disable 1: enable always write ?0? idle2 0: stop 1: operate 0: stop and clear 1: run (count up) count operation 0 stop and clear 1 count note: 1, 4 and 5 of tb0run are read as undefined values. figure 3.19.2 the registers for tmrb
tmp92ca25 2007-02-28 92ca25-329 tmrb0 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb0cp0i tb0cpm1 tb0cpm0 tb0cle tb0clk1 tb0clk0 tb0mod (1182h) read/write r/w w * r/w after reset 0 0 1 0 0 0 0 0 function always write ?0? execute software capture 0: software capture 1: undefined capture timing 00: disable 01: reserved 10: reserved 11: ta1out ta1out control up counter 0: disable clearing 1: enable clearing tmrb0 source clock 00: reserved 01: t1 10: t4 11: t16 tmrb0 source clock 00 reserved 01 t1 10 t4 11 t16 up counter clear control 0 disable 1 enable clearing on match with tb0rg1h/l capture/interrupt timing 00 disable 01 reserved 10 reserved 11 capture to tb0cp0h/l at rising edge of ta1out capture to tb0cp1h/l at falling edge of ta1out software capture 0 the value in the up counter is captured to tb0cp0h/l. 1 undefined figure 3.19.3 the registers for tmrb0 read-modify -write instruction is prohibited.
tmp92ca25 2007-02-28 92ca25-330 tmrb0 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb0c1t1 tb0c0t1 tb0e1t1 tb0e0t1 tb0ff0c1 tb0ff0c0 tb0ffcr (1183h) read/write w * r/w w * after reset 1 1 0 0 0 0 1 1 tb0ff0 inversion trigger 0: disable trigger 1: enable trigger function always write ?11?. invert when the uc value is loaded into tb0cp1h/l. invert when the uc value is loaded into tb0cp0h/l. invert when the uc value matches the value in tb0rg1h/l. invert when the uc value matches the value in tb0rg0h/l. control tb0ff0 00: invert 01: set 10: clear 11: don?t care * always read as 11. timer flip-flop control (tb0ff0) 00 invert 01 set to 1 10 clear to 0 11 don?t care inverted when the uc10 value matches the value in tb0rg0h/l. 0 disable trigger 1 enable trigger inverted when the uc10 value matches the value in tb0rg1h/l. 0 disable trigger 1 enable trigger inverted when the uc10 value is loaded into tb0cp0. 0 disable trigger 1 enable trigger inverted when the uc10 value is loaded into tb0cp1h/l. 0 disable trigger 1 enable trigger figure 3.19.4 the registers for tmrb read-modify -write instruction is prohibited.
tmp92ca25 2007-02-28 92ca25-331 tmrb0 register 7 6 5 4 3 2 1 0 bit symbol read/write w tb0rg0l (1188h) after reset undefined bit symbol read/write w tb0rg0h (1189h) after reset undefined bit symbol read/write w tb0rg1l (118ah) after reset undefined bit symbol read/write w tb0rg1h (118bh) after reset undefined bit symbol read/write w tb0cp0l (118ch) after reset undefined bit symbol read/write w tb0cp0h (118dh) after reset undefined bit symbol read/write w tb0cp1l (118eh) after reset undefined bit symbol read/write w tb0cp1h (118fh) after reset undefined note: all registers are prohibited to ex ecute read-modify-write instruction. figure 3.19.5 the registers for tmrb
tmp92ca25 2007-02-28 92ca25-332 3.19.4 operation in each mode (1) 16-bit interval timer mode generating interrupts at fixed intervals. in this example, the interrupt inttb01 is se t to be generated at fixed intervals. the interval time is set in th e timer register tb0rg1h/l. 7 6 5 4 3 2 1 0 tb0run 0 0 x x ? 0 x 0 stop tmrb0. intetb01 x 1 0 0 x 0 0 0 enable inttb01 and set interrupt level 4. disable inttb00. tb0ffcr 1 1 0 0 0 0 1 1 disable the trigger. tb0mod 0 0 1 0 0 1 ** select internal clock for input and disable the capture function. ( ** = 01, 10, 11) tb0rg1 * * * * * * * * * * * * * * * * set the interval time (16 bits). tb0run 0 0 x x ? 1x1 start tmrb0. x : don't care, ?: no change (2) 16-bit programmable pulse generation (ppg) output mode square wave pulses can be generated at any frequency and duty ratio. the output pulse may be either low active or high active. the ppg mode is obtained by inversion of the timer flip-flop tb0ff0 that is enabled by the match of the up counter uc10 with timer register tb0rg0h/l or tb0rg1h/l and is output to tb0out0. in this mode th e following conditions must be satisfied. (value set in tb0rg0h/l) < (value set in tb0rg1h/l) figure 3.19.6 programmable pulse ge neration (ppg) output waveforms when the tb0rg0h/l double buffer is enabled in this mode, the value of register buffer 10 will be shifted into tb0rg0h/l at match with tb0rg1h/l. this feature facilitates the handling of low duty waves. figure 3.19.7 operation of register buffer match with tb0rg0h/l (inttb00 inerrupt) match with tb0rg1h/l (inttb01 interrupt) tb0out0 p in q 2 q 1 match with tb0rg0h/l q 3 q 2 up counter = q 1 up counter = q 2 shift into tb0rg1h/l tb0rg0h/l ( value to be com p ared ) register buffe r match with tb0rg1h/l write tb0rg0h/l
tmp92ca25 2007-02-28 92ca25-333 the following block diag ram illustrates this mode. figure 3.19.8 block diagram of 16-bit mode the following example shows how to set 16-bit ppg output mode: 7 6 5 4 3 2 1 0 tb0run 0 0 x x ? 0 x 0 disable the tb0rg0h/l double buffer and stop tmrb0. * * * * * * * * tb0rg0h/l * * * * * * * * set the duty ratio (16 bits). * * * * * * * * tb0rg1h/l * * * * * * * * set the frequency (16 bits). tb0run 1 0 x x ? 0 x 0 enable the tb0rg0h/l double buffer. (the duty and frequency are changed on an inttb01 interrupt.) tb0ffcr 1 1 0 0 1 1 1 0 set the mode to invert tb0ff0 at the match with tb0rg0h/l/tb0rg1h/l. set tb0ff0 to ?0?. tb0mod 0 0 1 0 0 1 ** select the prescaler output clock as the input clock and disable ( ** = 01, 10, 11) the capture function. pccr ? 1 x x ? ? ? ? pcfc ? 1 x x ? ? ? ? set pc6 to function as tb0out0. tb0run 1 0 x x ? 1x1 start tmrb0. x : don't care, ?: no change selecto r 16-bit up counter uc10 16-bit comparator 16-bit comparator t1 t4 t16 f/f (tb0ff0) tb0rg0h/l register buffer 10 tb0rg1h/l tb0run tb0rg0-wr tb0run tb0out0 (ppg output) internal data bus clear match selecto r
tmp92ca25 2007-02-28 92ca25-334 3.20 touch screen interface (tsi) the tmp92ca25 has an interface for a 4-te rminal resistor network touch screen. this interface supports two procedures: an x/ y position measurement and touch detection. each procedure is executed by setting the tsi control register (tsicr0 and tsicr1) and using an internal ad converter. 3.20.1 touch screen interface module internal/external connection figure 3.20.1 external connection of tsi figure 3.20.2 internal block diagram of tsi touch screen y + y ? x ? x + my mx py px tmp92ca25 e xterna l capac i tors pxen pyen mxen int4 myen ptst tsi7 touch screen control an3 an2 avcc avss vrefh vrefl ad converter dec. spx sp y sm y smx pxd ( t yp .200 k ) internal data bus avcc avss p97 ( py ) p96/int4 ( px ) pg3/an3 ( my ) pg2/an2 ( mx ) vrefh vrefl
tmp92ca25 2007-02-28 92ca25-335 3.20.2 touch screen interface (tsi) control register tsi control register 7 6 5 4 3 2 1 0 bit symbol tsi7 ptst twien pyen pxen myen mxen tsicr0 (01f0h) read/write r/w r r/w after reset 0 0 0 0 0 0 0 function 0: disable 1: enable detection condition 0: no touch 1: touch int4 interrupt control 0: disable 1: enable spy 0 : off 1 : on spx 0 : off 1 : on smy 0 : off 1 : on smx 0 : off 1 : on pxd (internal pull-down resistance) on/off setting 0 1 0 off off 1 on off debounce time setting register 7 6 5 4 3 2 1 0 bit symbol dbc7 db1024 db256 db64 db8 db4 db2 db1 tsicr1 (01f1h) read/write r/w after reset 0 0 0 0 0 0 0 0 1024 256 64 8 4 2 1 function 0: disable 1: enable debounce time is set by the formula ?(n 64 ? 16)/f sys ?. ?n? is the number of bits between bit6 and bit0 which are set to ?1?. note2) note1: since an internal clock is used for the debounce circuit, when idle1, stop mode, the de-bounce circuit don?t operate and also interrupt which through this circ uit is not generated. when idle1, stop mode, set this circuit to disable (write ?0? to tsicr1) before entering halt state. note2: ex: tsicr1=95h n = 64 + 4 + 1 = 69
tmp92ca25 2007-02-28 92ca25-336 3.20.3 touch detection procedure the touch detection procedure shows procedure until a pen is touched by the screen and it is detected. by touching, tsi generates interrupt (int4) and this procedure terminates. after an x/y position measuring procedure is terminated, return to this procedure and wait for the next touch. when the waiting state, make on only the spy switch on and off the other 3 switches (smy, spx and smx). the pull-down resistor that is connected to the p96/int4/px pin is on when the spx switch is off. during this waiting state, p96/int4/px pin? s level is l because the internal pull-down resistors (pxd) between the x and y directions in the touch screen are not connected and int4 is not generated. when the pen touches the screen, p96/int4/p x pin?s level is h because the internal resistors between the x and y di rections in the touch screen are connected and int4 is generated. in order to avoid the generation of several interrupts from one touch, a debounce circuit is used, as below. this can ignore the pulse under the time which is set to tsicr1 register. the circuit detects the rising of signal, counts-up the time of the counter which is set, after count, receive the signal internal. during counting, when the signal is set to low, counter is cleared. and the state become to state of waiting a rising edge. figure 3.20.3 block diagram of debounce circuit debounce circuit tsicr1 enables int4 and selects the rising edge o r falling edge of int4 int4 tsicr0 f/f tsicr0, iimc, p9fc p96/int4/px pin
tmp92ca25 2007-02-28 92ca25-337 figure 3.20.4 timing diagram of debounce circuit debounce time debounce time debounce time int4 int4 is generated by matching counter and specified debounce time. iint4 is not generated by matchi ng counter and specified debounce period because it is an edge-type interrupt. a fter pen is released, int4 can be issued again. reset counter for debounce time start counter for debounce time
tmp92ca25 2007-02-28 92ca25-338 3.20.4 x/y position measuring procedure during the int4 routine, execute an x/y position measuring procedure as below. make both the spx and smx switches on, and the spy and smy switches off. with this setting, an analog voltage which shows the x position will be input to the pg3/my/an3 pin. the x position can be measur ed by converting this voltage to digital code using the ad converter. next, make both the spy and smy switches on and the spx and smx switches off. with this setting, an analog voltage which shows the y position will be input to the pg2/mx/an2 pin. the y position can be measur ed by converting this voltage to digital code using the ad converter. the above analog voltage which is inputted to an3 or an2 pin can be calculated as follows. it is the ratio between the resistance value in the tmp92ca25f and the resistance value in the touch screen as shown in figure 3.20.5. therefore, if the pen touches an area on the touch screen, the analog voltage will be neither 3.3 v nor 0.0 v. please remember to take into consideration the variation in the rate of resistance. it is also recommended that an average taken from several ad conversions be adopted as the correct code. figure 3.20.5 calculation analog voltage r2 r1 a n2 (an3) pin touch point touch screen resistor: rty (rtx) the value depends on the touch screen. smy (smx) on resistor: rmy (rmx) 20 (typ.) sp y (spx) on resistor: rpy (rpx) 20 (typ.) a vcc = 3.3 v [formula to calculate analog voltage (e1) to an2 or an3 pin] e1 = ((r2 + rmy)/(rpy + rty + rmy)) avcc [v] example: when avcc = 3.3 v, rpy = rmy = 20 , r1 = 400 and r2 = 100 e1 = ((100 + 20)/(20 + 400 + 100 + 20)) 3.3 = 0.733 v note 1: an x position can be calculated in the same way though the above formula is for y position. note 2: rty = r1 + r2.
tmp92ca25 2007-02-28 92ca25-339 3.20.5 flow chart for tsi figure 3.20.6 flow chart for tsi following pages explain each circuit condition of (a), (b) and (c) in above flow chart. main routine: execute main routine tsicr0 98h tsicr1 xxh (voluntary) int4 routine: ? tsicr0 85h ? ad conversion for an3 ? store the result ? tsicr0 8ah ? ad conversion for an2 ? store the result execute an operation by using x/y position still touched ? tsicr0 = 1? return to main routine no yes (1) touch detection procedure (2) x/y position measurement procedure
tmp92ca25 2007-02-28 92ca25-340 (a) main routine (condition of waiting int4 interrupt) (pbfc),= ?1? : p96: int4/px , p97:py (inte34) : set interrupts level of int4 (tsicr0)=98h : pull down resister on, spy on, interrupt-set ei : enable interrupt a vss ( px/p96/int4 ) (py/p97) vrefh vrefl pxen pyen mxen myen a n3 a n2 (my/pg3) a vcc (mx/pg2) vrefh vrefl a vcc a vss a d converter touch screen control tsi7 sp y spx smx smy pxd (typ.200k ) dec. int2 ptst internal data bus y + y ? touch screen x + x ? tmp92ca25 on on
tmp92ca25 2007-02-28 92ca25-341 (b) x position measurement (start a/d conversion) (tsicr0)=85h : smx, spx on (admod1)=83h : an3 measure (admod0)=01h : a/d start a vss ( px/p96/int4 ) (py/p97) vrefh vrefl pxen pyen mxen myen a n3 a n2 (my/pg3) a vcc (mx/pg2) vrefh vrefl a vcc a vss a d converter touch screen control tsi7 sp y spx smx smy pxd (typ.200k ) dec int2 ptst internal data bus y + y ? touch screen x + x ? tmp92ca25 on on
tmp92ca25 2007-02-28 92ca25-342 (c) y position measurement (start a/d conversion) (tsicr0)=8ah : smy, spy on (admod1)=82h : an2 measure (admod0)=01h : a/d start a vss ( px/p96/int4 ) (py/p97) vrefh vrefl pxen pyen mxen myen a n3 a n2 (my/pg3) a vcc (mx/pg2) vrefh vrefl a vcc a vss a d converter touch screen control tsi7 sp y spx smx smy pxd (typ.200k ) dec. int2 ptst internal data bus y + y ? touch screen x + x ? tmp92ca25 on on
tmp92ca25 2007-02-28 92ca25-343 3.21 i 2 s (inter-ic sound) an i 2 s format compatible serial output circuit is built-in. this product can be used in digital audio syst em applications by connecting lsi for sound generation (e.g., a da converter). this circuit has both i 2 s mode and general sio mode. but both modes have only clock output and data transmitting functions. table 3.21.1 shows an outline for each mode. table 3.21.1 outline for each mode i 2 s mode sio mode 1) format i 2 s-format compatible (only master and transmitting) general (only master and transmitting) 2) used pin 1. i2scko (clock output) 2. i2sdo (clock output) 3. i2sws (word select output) 1. i2scko (clock output) 2. i2sdo (data output) 3) ws frequency selectable either fs/4 or ta1out (tmra1 output) ? 4) baud rate (at fc = 40 mhz) selectable either 20, 10, 5, or 2.5 mbps 5) transmittion buffer 16 bytes 2 channels (right, left) 32 bytes 6) direction of data selectable either msb first or lsb first 7) data length selectable either 8 bits or 16 bits 8) edge of clock selectable either rising edge or falling edge 9) interrupt inti2s (fifo empty interrupt)
tmp92ca25 2007-02-28 92ca25-344 3.21.1 block diagram figure 3.21.1 i 2 s block diagram 2 4 8 prescaler f s y s selector i2scko control i2scko selector i2sws control i2sws 4 f s ta1out data selector, interrupt control fifo control fifo control i2sbufr i2sbufl write pointer read pointer write pointer read pointer i2sctl0 16 bits 16 bits 16 bits internal data bus shifter i2sdo inti2s 0 1 7 16-byte fifo (left) (2 bytes 8) 0 1 7 16-byte fifo (right) (2 bytes 8)
tmp92ca25 2007-02-28 92ca25-345 3.21.2 sfr the following tables show the sfr for i 2 s. this i 2 s is connected to the cpu by the 16-bit data bus. when the cpu accesses the sfr, use a 2- byte load instruction. i2sctl0 register 7 6 5 4 3 2 1 0 bit symbol txe fmt busy dir bit mck1 mck0 i2swck i2sctl0 (080eh) read/write r/w r r/w after reset 0 0 0 0 0 0 0 0 function transmit 0: stop 1: start mode 0: i 2 s 1: sio status 0: stop 1: under transmitting first bit 0: msb 1: lsb bit number 0: 8 bits 1: 16 bits baud rate 00: f sys 10: f sys /4 01: f sys /2 11: f sys /8 ws clock 0: fs/4 1: ta1out note: is effective only for i 2 s mode. 15 14 13 12 11 10 9 8 bit symbol i2swlvl edge i2sfsel i2sclke syscke (080fh) read/write r/w r/w after reset 0 0 0 0 0 function ws level 0: low left 1: high left clock edge for data out 0: falling 1: rising select for stereo 0: stereo (2 channels) 1: monaural (1 channel) clock enable (after transmit) 0: operation 1: stop system clock 0: disable 1: enable note: , and are effective only in i 2 s mode. i2sbufr register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit symbol r15 r14 r13 r12 r11 r10 r9 r8 r7 r6 r5 r4 r3 r2 r1 r0 i2sbufr (0800h) read/write w after reset undefined function register for transmitti ng buffer (fifo) (right channel) i2sbufl register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit symbol l15 l14 l13 l12 l11 l10 l9 l8 l7 l6 l5 l4 l3 l2 l1 l0 i2sbufl (0808h) read/write w after reset undefined function register for transmitting buffer (fifo) (left channel) figure 3.21.2 i 2 s sfr read-modify- write instruction is prohibited read-modify- write instruction is prohibited
tmp92ca25 2007-02-28 92ca25-346 3.21.3 explanation of i 2 s mode (1) connection example figure 3.21.3 shows an example with external lsi. note: after reset, p90 to p92 are placed in a high-impedance stat e. connect each pin with a pull-up or pull-down resistor as necessary. figure 3.21.3 example with external lsi (2) procedure a 32-byte fifo is built-in. if the fifo?s data becomes empty, an inti2s interrupt is generated. in the interrupt routine, write the next transmission data to the fifo. the following shows a setting example and timing diagram. (setting example) transmitting by i 2 s mode, i2sws = 8.192 khz, i2scko = 10 mhz, synchronous with rising edge (at f sys = 20 mhz) (main routine) 7 6 5 4 3 2 1 0 inte5i2s x 0 0 1 x ? ? ? set interrupts level. p9cr ? ? ? ? ? 0 0 0 set pins to p90 (i2scko), p91 (i2sdo), and p92 (i2sws). p9fc ? ? ? ? ? 111 i2sctl0 0 0 ? 0 0010 set i 2 s mode, msb first, 8 bits, f sys /2 clocks. 0 1 0 1 0 0 0 1 set rising edge, clock stop. i2sbufr ** ** ** ** ** ** ** ** write 16-byte data to fifo for right (8 times). i2sbufl ** ** ** ** ** ** ** ** write 16-byte data to fifo for left (8 times). i2sctl0 1 0 ? 0 0 0 1 0 start transmitting. 0 1 0 1 0 0 0 1 (inti2s interrupt routine) i2sbufr ** ** ** ** ** ** ** ** write 16-byte data to fifo for right (8 times). i2sbufl ** ** ** ** ** ** ** ** write 16-byte data to fifo for left (8 times). x: don't care, ?: no change (transmitter) p92/i2sws p90/i2scko p91/i2sdo (receiver) ws ck data tmp92ca25 example: da converter
tmp92ca25 2007-02-28 92ca25-347 figure 3.21.4 whole timing diagram figure 3.21.5 detail timing diagram (3) notes 1) inti2s timing inti2s is generated after the last data of fifo is loaded to the internal shifter. fifo is now empty and it is possible to write the next data. 2) i2sctl0 a transmission is started by programming ?1? to the register and stopped by writing ?0?. after is programmed ?1? once, the transmission is repeated automatically from right to left in order, alternately. if a transmission should be stopped, program ?0? to after changes to ?0? in the inti2s interrupt routine. when is programmed ?0? during transmitting, transmitting stops immediately. 3) fifo size a 16-byte fifo is provided for both righ t and left channels. it is not necessary to use all data, but please use the even numbers (2, 4 ... 16). 4) i2sctl0 write ?1? to and use the right channel fifo for monaural. it is not necessary to write data to the left channel fifo. channel transmission data is fixed at ?0?. 5) address for i2sbufr and i2sbufl if writing data to i2sbufr or i2sbufl, use ?word or long word data load instruction?. a ?byte data load instruction? cannot be used. the address of i2sbufr selectable from 0800h to 0803h, and i2sbufl is selectable from 0808h to 080bh. write to fifo inti2s i2sdo pin i2scko pin i2sws pin 1 2 16 1 i2scko pin i2sdo pin lsb msb lsb msb lsb msb i2sws pin bit7 bit6 bit0 bit7 bit6 bit0 bit7 10 mhz
tmp92ca25 2007-02-28 92ca25-348 3.21.4 explanation of sio mode (1) connection example figure 3.21.6 shows an example with external lsi. note: since p90 to p91 become high impedance by reset, c onnect a pull-up or pull-down resistor if necessary. figure 3.21.6 example with external lsi (2) procedure a 32-byte fifo is built-in. if the fifo?s data becomes empty, an inti2s interrupt is generated. in the interrupt routine, write the next transmission data to the fifo. the following shows a setting example and timing diagram. (setting example) transmitting by sio mode, i2scko = 10 mhz, synchronous with rising edge (at f sys = 20 mhz) (main routine) 7 6 5 4 3 2 1 0 inte5i2s x 0 0 1 x ? ? ? set interrupts level. p9cr ? ? ? ? ? ? 0 0 set pins to p90 (i2scko) and p91 (i2sdo). p9fc ? ? ? ? ? ? 11 i2sctl0 0 1 ? 1 0 0 1 ? set sio mode, lsb first, 8 bits, f sys /2 clocks. ? 1 ? 1 0 0 0 1 set rising edge. i2sbufr ** ** ** ** ** ** ** ** write 32-byte data to fifo (16 times). i2sctl0 1 1 ? 1 0 0 1 ? start transmitting. ? 1 ? 1 0001 (inti2s interrupt routine) i2sbufr ** ** ** ** ** ** ** ** write 32-byte data to fifo (16 times). if = ?1? then wait else next confirm termination of the 32-byte data transfer. i2sctl0 1 1 ? 1 0 0 1 ? start transmitting. ? 1 ? 1 0001 x: don't care, ?: no change (transmitter) p90/i2scko p91/i2sdo port (receiver) sck si rck tmp92ca25 example: shift register
tmp92ca25 2007-02-28 92ca25-349 figure 3.21.7 whole timing figure 3.21.8 detail timing (3) notes 1) inti2s timing inti2s is generated after the last data of fifo is loaded to the internal shifter. fifo is now empty and it is possible to write the next data. 2) i2sctl0 a transmission is started by programming ?1? to the register and stopped by programming ?0?. register is cleared to ?0? when changes from ?1? to ?0?. when is programmed ?0? during transmitting, transmitting stops immediately. 3) fifo size a 32-byte fifo is provided for sio mode. it is not necessary to use all data but please use even numbers ( 2, 4 ... 32). the will be changed to ?0? and will be cleared to ?0? automatically after transmitting all pr ogrammed data to fifo. in case of continuous transmitting, program ?1? to after programmi ng data to fifo. the number of data programmed to fifo is counted automatically and held by programming ?1? to . 4) address for i2sbufr and i2sbufl if writing data to i2sbufr (i2sbufl cannot be written), use ?word or long word data load instruction?. a ?byte da ta load instruction? cannot be used. the address of i2sbufr is selectable from 0800h to 0803h. i2scko pin i2sdo pin lsb bit0 bit1 10 mhz msb bit7 bit0 lsb bit1 bit7 msb write to fifo inti2s i2sdo pin i2scko pin 1 2 31 32 1 2
tmp92ca25 2007-02-28 92ca25-350 3.22 power supply backup (power supply backup) tmp92ca25 includes three ty pe power supply systems. analog power supply input (avcc - avss) digital power suppy input (dvcc - dvss) power supply input for rtc (rtcvcc - dvss) each power supply is independent. figure 3.22.1 power supply input system figure 3.22.2 outside circuit example for psb xt2 xt1 be dvss1 dvss4 avss cpu control & other logic adc control rtc control high-osc low-osc avcc dvcc1 dvcc3 rtcvcc tmp92ca25 port m pm1(mldalm) pm2( alarm , mldalm ) be rtc 32k_osc tmp92ca25 sub battery for rtc main power suorce & other device dvcc rtcvcc dvss
tmp92ca25 2007-02-28 92ca25-351 tmp92ca25 has the power supply backup mode which is desighed to work for only low-speed oscillator, rtc and port m under su b battery supply. tmp92ca25 is set to the power supply backup mode by using the be pin (backup enable) and the reset pin. figure 3.22.3 and figure 3.22.4 shows the timing diagram of be pin and reset pin. figure 3.22.3 shift from normal mode to psb mode figure 3.22.4 shift from psb mode to normal mode reset power source (dvcc) be rtcvcc is always supplied. over 20 system clocks after oscillator becomes stable reset power source (dvcc) rtcvcc is always supplied. 10 s be
tmp92ca25 2007-02-28 92ca25-352 backup enable pin ( be ) low frequency oscillator, rtc and port m can work also if be = ?l?. if be = ?l?, low frequency oscillator, rtc an d port mare separated from cpu and so on in internal. therefore, it is prohibited accessing to rtc register and port m. in addition, low frequency oscillator (fs) isn?t provided except rtc circuit (melody alarm generator etc.). so, alarm ( = output function of rtc) can output from pm2 pin, if port is set before set to be = ?l?. note: 1: if ?h? level signal was inputted to general purpo se port with power off condition, current is used more than always. therefore, set to ?l? level or high-impedance condition. if this back up function is used, set be pin to ?l? level when dvcc power off. 2: when be pin is set to ?l?, low frequency oscillator operation become same with emccr0 = ?0?, forcibly. therefore, don?t set to be = ?l?, when it is not operated low frequency oscillator. 3: when be pin is set to ?l?, pm2, pm1 pins condition change according to setting value of pmdr. if keep output pm2, pm1 pins write ?11? to before set to be = ?l?. 4: if release reset , release reset after be = ?h?.
tmp92ca25 2007-02-28 92ca25-353 3.23 external bus release function tmp92ca25 have external bus release function that can connect bus master to external. bus release request ( busrq ), bus release answer ( busak ) pin is assigned to port l6 and l7. and, it become effectiv e by setting to plcr and plfc. figure 3.23.1 shows operation timing. time that from busrq pin inputted ?0? until busis released ( busak is set to ?0?) depend on instruction that cpu execute at that time. figure 3.23.1 bus release function operation timing 3.23.1 non release pin if it received bus releas e request, cpu release bus to external by setting busak pin to ?0? without start next bus. in this case, pin that is released have 3 types (a, b and c). eve operation that set to high impedance (hz) is different in 3 types. table 3.23.1 shows support pin for 3 types. any pin become non release pin only case of setting to that function by setting port. therefore, if pin set to output port and so on, it is not set non relase pin, and it hold previous condition. table 3.23.1 non release pin type eve operation that set to hz support function (pin name) a drive ?1? a23-a16(p67-p60), a15-a0, rd (p70), wrll (p71), wrlu (p72), ea24(p73), ea25(p74), r/ w (p75), 0 cs (p80), 1 cs (p81), sdcs (p81), 2 cs (p82), csza (p82), 3 cs (p83), cszb (p84), cszc (p85), cszd (p86), csze (p87), ea24(pc6), ea25(pc7), cszf (pc7), srllb , sdras (pj0), srlub , sdcas (pj1), srwr , sdwe (pj2), sdclk(pf7), sdlldqm(pj3), sdludqm(pj4) b drive ?0? sdcke(pj7) c none operation d15-d8(p17-p10), d7-d0 f sys busrq (pl6) busak (pl7) external bus pin (a type) external bus pin (b type) external bus pin (c type) external bus release cycle
tmp92ca25 2007-02-28 92ca25-354 3.23.2 connection example figure 3.23.2 show connection example. figure 3.23.2 connection example 3.23.3 note if use bus release function, be careful following notes. 1) prohibit using this function together lcd controller and, sdram controller if use this function, prohibit use lcd controller in sr mode. and, prohibitalso sdramc basically, but if external bus master use sdram, set sdram to sr (self refresh) condition before bus release request. and, when finish bus release, release sr co ndition. in this case, confirm each condition by handshake of general purpose port. 2) support standby mode the condition that can receive this function is only cpu operationg condition and during idle2 mode. during idle1 and stop condition don?t receive. (bus release function is ignored). 3) internal resource access disable external bus master cannnot access to internal memory and interhal i/o of tmp92ca25. internal i/o operation during bus releasing. 4) internal i/o operation during bus releasing internal i/o continue operation during bus releasing, please be careful. and, if set the watchdog timer, set runaway time by consider bus release time. 5) non release pin control output pin for nand-flash ( ce 0 nd , ce 1 nd , ndale, ndcle, ndre , ndwe ) are not non release pins. cle ale tmp92ca25 cle ale busrq busak external bus pin (a type) external bus pin (b type) external bus pin (c type) memory external bus master
tmp92ca25 2007-02-28 92ca25-355 4. electrical characteristics 4.1 absolute maximum ratings parameter symbol rating unit power supply voltage v cc ? 0.5 to 4.0 v input voltage v in ? 0.5 to vcc + 0.5 v output current i ol 2 ma output current (mx, my pin) i ol 15 ma output current i oh ? 2 ma output current (px, py pin) i oh ? 15 ma output current (total) i ol 80 ma output current (total) i oh ? 80 ma power dissipation (ta = 85 c) p d 600 mw soldering temperature (10 s) t solder 260 c storage temperature t stg ? 65 to 150 c operation temperature t opr ? 20 to 70 c note: the absolute maximum ratings are rated values which must not be exceeded during operation, even for an instant. any one of the ratings must not be exceeded. if any absolute maximum rati ng is exceeded, the device may break down or its performance may be degraded, ca using it to catch fire or explode resulting in injury to the user. thus, when designing products which include this device, ensure that no absolute maximu m rating value will ever be exceeded. solderability of lead free products te s t parameter test condition note (1) use of sn-37pb solder bath solder bath temperature = 230 c, dipping time = 5 seconds the number of times = one, use of r-type flux solderability (2) use of sn-3.0ag-0.5cu solder bath solder bath temperature = 245 c, dipping time = 5 seconds the number of times = one, use of r-type flux (use of lead-free) pass: solderability rate until forming 95%
tmp92ca25 2007-02-28 92ca25-356 4.2 dc electrical characteristics (1/2) v cc = 3.3 0.3v/x1 = 6 to 40 mhz/ta = ? 20 to 70 c v cc = 2.7 ? 3.6v/x1 = 6 to 27 mhz/ta = ? 20 to 70 c parameter symbol min typ. max unit condition 3.0 x1 = 6 to 40 mhz power supply voltage (dvcc = avcc) (dvss = avss = 0 v) v cc 2.7 3.6 v x1 = 6 to 27 mhz xt1 = 30 to 34 khz input low voltage for d0 to d7 p10 to p17 (d8 to d15) v il0 0.6 input low voltage for p40 to p47, p50 to p57, p60 to p67, p71 to p76, p90, p93 to p94, pc4 to pc7, pf3 to pf6, pg0 to pg3, pj5 to pj6, pk4 to pk7, pl4 to pl7 v il1 0.3 v cc input low voltage for p91 to p92, p96 to p97, pa0 to pa7, pc0 to pc3, pf0 to pf2, be , reset v il2 0.25 v cc input low voltage for am0 to am1 v il3 0.3 input low voltage for x1, xt1 v il4 ? 0.3 0.2 v cc v input high voltage for d0 to d7 p10 to p17 (d8 to d15) v ih0 2.0 input high voltage for p40 to p47, p50 to p57, p60 to p67, p71 to p76, p90, p93 to p94, pc4 to pc7, pf3 to pf6, pg0 to pg3, pj5 to pj6, pk4 to pk7, pl4 to pl7 v ih1 0.7 v cc input high voltage for p91 to p92, p96 to p97, pa0 to pa7, pc0 to pc3, pf0 to pf2, be , reset v ih2 0.75 v cc input high voltage for am0 to am1 v ih3 v cc ? 0.3 input high voltage for x1, xt1 v ih4 0.8 v cc v cc + 0.3 v
tmp92ca25 2007-02-28 92ca25-357 dc electrical characteristics (2/2) parameter symbol min typ. max unit condition output low voltage v ol 0.45 i ol = 1.6 ma v oh1 2.4 i oh = ? 400 a output high voltage v oh2 0.9 v cc v i oh = ? 20 a internal resistor (on) mx, my pins imon 30 v ol = 0.2v internal resistor (on) px, py pins imon 30 v oh = v cc ? 0.2v v cc = 3.0 to 3.6 v input leakage current i li 0.02 5 a 0.0 v in v cc output leakage current i lo 0.05 10 a 0.2 v in v cc ? 0.2 v power down voltage at stop (for internal ram backup) v stop 1.8 3.6 v v il2 = 0.2 v cc , v ih2 = 0.8 v cc pull-up resistor for reset , pa0 to pa7 r rst programmable pull down resistor for p96 r kh 80 500 k pin capacitance c io 10 pf fc = 1 mhz schmitt width for p91 to p92, p96 to p97, pa0 to pa7,pc0 to pc3, pf0 to pf2, be , reset v th 0.4 1.0 v normal (note 2) 42 65 idle2 13 26 idle1 3.1 8.7 ma v cc = 3.6 v, fc = 40 mhz 110 ta 70 c slow (note 2) 41 70 ta 50 c 80 ta 70 c idle2 15 30 ta 50 c 60 ta 70 c idle1 4 20 ta 50 c v cc = 3.6 v, fs = 32 khz 50 ta 70 c stop i cc 0.2 15 a ta 50 c v cc = 3.6 v note 1: typical values are for when ta = 25c and vcc = 3.3 v unless otherwise noted. note 2: icc measurement conditions (normal, slow): all functions are operational; output pins except the bus pin are o pened, and input pins are fixed. bus pin c l = 30 pf
tmp92ca25 2007-02-28 92ca25-358 4.3 ac characteristics 4.3.1 basic bus cycle read cycle variable no. parameter symbol min max 40 mhz 36 mhz 27 mhz unit 1 osc period (x1/x2) t osc 25 166.7 25 27.7 37.0 2 system clock period ( = t) t cyc 50 333.3 50 55.5 74.0 3 sdclk low width t cl 0.5 t ? 15 10 12.7 22 4 sdclk high width t ch 0.5 t ? 15 10 12.7 22 t ad (3.0 v) 2.0 t ? 30 70 81 ? 5-1 a0 to a23 valid d0 to d15 input at 0 waits t ad (2.7 v) 2.0 t ? 35 ? ? 113 t ad3 (3.0 v) 3.0 t ? 30 120 136.5 ? 5-2 a0 to a23 valid d0 to d15 input at 1 wait t ad3 (2.7 v) 3.0 t ? 35 ? ? 187 t rd(a) 1.5 t ? 30 45 53.3 81 t rd(b) 1.25 t ? 30 32.5 39.5 62.5 6-1 rd falling d0 to d15 input at 0 waits t rd(c) 1.0 t ? 30 20 25.7 44 t rd3(a) 2.5 t ? 30 95 108.8 155 t rd3(b) 2.25 t ? 30 82.5 95 136.5 6-2 rd falling d0 to d15 input at 1 wait t rd3(c) 2.0t ? 30 70 312 118 t rr(a) 1.5 t ? 20 55 63.2 91 t rr(b) 1.25 t ? 20 42.5 49.4 72.5 7-1 rd low width at 0 waits t rr(c) 1.0 t ? 20 30 35.6 54 t rr3(a) 2.5 t ? 20 105 118.8 165 t rr3(b) 2.25 t ? 20 92.5 105 146.5 7-2 rd low width at 1 wait t rr3(c) 2.0 t ? 20 80 91.2 128 t ar(a) 0.5 t ? 20 5 7.7 17 t ar(a) 0.75 t ? 20 17.5 21.5 35.5 8 a0 to a23 valid rd falling t ar(a) 1.0 t ? 20 30 35.3 54 t rk(a) 0.5 t ? 20 5 7.7 17 t rk(b) 0.25 t ? 20 ? 7.5 ? 6.1 ? 1.5 9 rd falling sdclk rising t rk(c) 0 t ? 20 ? 20 ? 20 ? 20 10 a0 to a23 valid d0 to d15 hold t ha 0 0 0 0 11 rd rising d0 to d15 hold t hr 0 0 0 0 12 wait setup time t tk 15 15 15 15 13 wait hold time t kt 5 5 5 5 14 data byte control access time for sram t sba 1.5 t ? 30 45 53.3 81 t rrh(a) 0.5 t ? 15 10 12.7 22 t rrh(b) 0.75 t ? 15 22.5 26.5 40.5 15 rd high width t rrh(c) 1.0 t ? 15 35 40.3 59 ns ac measuring condition ? output: high = 0.7 vcc, low = 0.3 vcc, c l = 50 pf ? input: high = 0.9 vcc, low = 0.1 vcc note1: the figures in the ?variable? column cover the whole vcc range (2.7 v to 3.6 v). exceptions are shown by the vcc (min), ?(3.0 v)? or ?(2.7 v)?, added to the ?symbol? column. note2: the figures in the (a), (b) and (c) of ?symbol? column shows difference of falling timing of rd pin. falling timing of rd pin is set by memecr0. if memcr0 is ?00?, it correspond with (a) in above table, and ?01? is (b), ?10? is (c).
tmp92ca25 2007-02-28 92ca25-359 write cycle variable no. parameter symbol min max 40 mhz 36 mhz 27 mhz unit 16-1 d0 to d15 valid wrxx rising at 0 waits t dw 1.25t ? 35 27.5 34.3 57.5 16-2 d0 to d15 valid wrxx rising at 1 wait t dw3 2.25t ? 35 77.5 89.8 131.5 17-1 wrxx low width at 0 waits t ww 1.25t ? 30 32.5 34.3 62.5 17-2 wrxx low width at 1 wait t ww3 2.25t ? 30 82.5 89.8 136.5 18 a0 to a23 valid wr falling t aw 0.5t ? 20 5 7.7 17 19 wrxx falling sdclk rising t wk 0.5t ? 20 5 7.7 17 20 wrxx rising a0 to a23 hold t wa 0.25t ? 5 7.5 8.8 13.5 21 wrxx rising d0 to d15 hold t wd 0.25t ? 5 7.5 8.8 13.5 t rdo (3.0 v) 0.5t ? 5 20 22.7 ? 22 rd rising d0 to d15 output t rdo (2.7 v) 0.5t ? 7 ? ? 30 23 write pulse width for sram t swp 1.25t ? 30 32.5 39.3 62.5 24 data byte control to end of write for sram t sbw 1.25t ? 30 32.5 39.3 62.5 25 address setup time for sram t sas 0.5t ? 20 5 7.7 17 26 write recovery time for sram t swr 0.25t ? 5 7.5 8.8 13.5 27 data setup time for sram t sds 1.25t ? 35 27.5 34.3 57.5 28 data hold time for sram t sdh 0.25t ? 5 7.5 8.8 13.5 ns ac measuring condition ? output: high = 0.7 vcc, low = 0.3 vcc, c l = 50 pf ? input: high = 0.9 vcc, low = 0.1 vcc note: the figures in the ?variable? column cover the whole vcc range (2.7 v to 3.6 v). exceptions are shown by the vcc (min), ?(3.0 v)? or ?(2.7 v)?, added to the ?symbol? column.
tmp92ca25 2007-02-28 92ca25-360 (1) read cycle (0 waits) note1: the phase relation between x1 input signal and the other signals is undefined. the above timing chart is an example . note2: rd pin falling timing depends on memcr0 setting in memory controller . t osc sdclk wait a0~a23 d0~d15 srxxb x1 csn rd srwr t ch t cyc t cl t tk t kt t ad t rr t rd t rrh t ar t rk t sb a data in p ut t h a t hr r/ w note2
tmp92ca25 2007-02-28 92ca25-361 (2) write cycle (0 waits) note: the phase relation between x1 input signal and the other signals is undefined. the above timing chart is an example. t osc sdclk wait a0~a23 d0~d15 srxxb x1 csn wrxx srwr t ch t cyc t cl t tk t kt t ww t dw t aw t wk t sbw data out p ut t w a t swr t wd rd t rdo t sdh t sas t swp t sds r/ w
tmp92ca25 2007-02-28 92ca25-362 (3) read cycle (1 wait) (4) write cycle (1 wait) sdclk data out p ut t ww3 t dw3 wait a0 to a23 csn wrxx d0 to d15 rd r/ w sdclk data in p ut t rr3 t ad3 t rd3 wait a0 to a23 csn rd d0 to d15 r/ w
tmp92ca25 2007-02-28 92ca25-363 4.3.2 page rom read cycle (1) 3-2-2-2 mode variable no. parameter symbol min max 40 mhz 36 mhz 27 mhz unit 1 system clock period ( = t) t cyc 50 166.7 50 55.5 74 2 a0, a1 d0 to d15 input t ad2 2.0t ? 50 50 61 98 3 a2 to a23 d0 to d15 input t ad3 3.0t ? 50 100 116.5 172 t rd3(a) 2.5t ? 45 80 93.8 140 t rd3(b) 2.25t ? 45 67.5 79.6 121.5 4 rd falling d0 to d15 input t rd3(c) 2.0t ? 45 55 66 103 5 a0 to a23 invalid d0 to d15 hold t ha 0 0 0 0 6 rd rising d0 to d15 hold t hr 0 0 0 0 ns ac measuring condition ? output: high = 0.7 vcc, low = 0.3 vcc, c l = 50 pf ? input: high = 0.9 vcc, low = 0.1 vcc note: the figures in the (a), (b) and (c) of ?sym bol? column shows difference of falling timing of rd pin. falling timing of rd pin is set by memecr0. if memcr0 is ?00?, it correspond with (a) in above table, and ?01? is (b), ?10? is (c). timing pulse (8-byte setting) sdclk a0 to a 23 2 cs rd d0 to d15 + 0 + 1 + 2 + 3 data input data input data input data input t ad3 t ad2 t ad2 t ad2 t h a t hr t rd3 t h a t h a t h a t cyc
tmp92ca25 2007-02-28 92ca25-364 4.3.3 sdram controller ac characteristics variable no. parameter symbol min max 40 mhz 36 mhz 27 mhz unit 1 ref/active to ref/active command period t rc 2t 100 111 148 2 active to precharge command period t ras 2t 12210 100 111 148 3 active to read/write command delay time t rcd t 50 55.5 74 4 precharge to active command period t rp t 50 55.5 74 5 active to active command period t rrd 3t 150 166.5 222 6 write recovery time (cl * = 2) t wr t 50 55.5 74 7 clock cycle time (cl * = 2) t ck t 50 55.5 74 8 clock high level width t ch 0.5t ? 15 10 12.7 22 9 clock low level width t cl 0.5t ? 15 10 12.7 22 10 access time from clock (cl * = 2) t ac t ? 30 20 25.5 44 11 output data hold time t oh 0 0 0 0 12 data in setup time t ds 0.5t ? 10 15 17 27 13 data in hold time t dh t ? 15 35 40.5 59 14 address setup time t as 0.75t ? 30 7.5 11.6 25.5 15 address hold time t ah 0.25t ? 9 3.5 4.8 9.5 16 cke setup time t cks 0.5t ? 15 10 12.7 22 17 command setup time t cms 0.5t ? 15 10 12.7 22 18 command hold time t cmh 0.5t ? 15 10 12.7 22 19 mode register set cycle time t rsc t 50 55.5 74 ns cl * : cas latency. ac measuring conditions ? output level: high = 0.7 vcc, low = 0.3 vcc, c l = 50 pf ? input level: high = 0.9 vcc, low = 0.1 vcc
tmp92ca25 2007-02-28 92ca25-365 (1) sdram read timing (cpu a ccess or lcdc no rmal access) sdclk sdxxdqm sdcs sdras sdcas sdwe t ch t cl t ck t rcd t rp t ras t rp t cms t cmh t cms t cmh t rrd column row a 1 to a10 d0 to d15 16-bit data bus a 11 a 12 to a15 t ah t as t as t ah column row column row data input t ac t oh
tmp92ca25 2007-02-28 92ca25-366 (2) sdram write timing (cpu access) sdclk sdxxdqm sdcs sdras sdcas sdwe t ch t cl t ck t wr t rp t rcd t rp t cms t rrd t cms t cmh t ras t cmh column row a 1 to a12 d0 to d15 16-bit data bus a 11 a 12 to a15 t ah t as t as t ah column row column row data output t ds t dh
tmp92ca25 2007-02-28 92ca25-367 (3) sdram burst read timing (start of burst cycle) column row sdclk sdxxdqm sdcs sdras sdcas a 1 to a11 o r a 1 to a10 d0 to d15 sdwe a 12 or a11 a 13 to a15 or a 12 to a15 t ck t rcd t rp t cms t cmh t cmh t ah t as column row row data input t ac t cmh t cms t cms 227 t ah t as t as 0 t ac t ac data input data input t oh t oh
tmp92ca25 2007-02-28 92ca25-368 (4) sdram burst read timing (end of burst cycle) column column 220 sdclk sdxxdqm sdcs sdras sdcas a 1 to a11 o r a 1 to a10 d0 to d15 sdwe a 12 or a11 a 13 to a15 or a 12 to a15 t ck t rc t rsc t cms t cmh column data input t cmh t cms t cms column t as t ac t ac data input t oh t oh t cmh column 0 row data input t oh
tmp92ca25 2007-02-28 92ca25-369 (5) sdram initialize timing 220 sdclk sdxxdqm sdcs sdras sdcas a 1 to a12 sdwe a 20 to a23 ( bs0 and bs1 ) t ch t cl t ck t rsc t rc t cms t cmh t cms t cmh t ah t as t cmh t cms t as
tmp92ca25 2007-02-28 92ca25-370 (6) sdram refresh timing (7) sdram self refresh timing sdclk sdxxdqm sdcs sdras sdcas sdwe t ck t rc t rc t cmh t cms sdclk sdcke sdcs sdras sdcas sdwe t c k t rc t cmh t cms t cks t cks sdxxdqm
tmp92ca25 2007-02-28 92ca25-371 4.3.4 nand flash controller ac characteristics variable no. parameter symbol min max 40 mhz 36 mhz 27 mhz unit 1 ndre low width t rp (1 + n) t ? 12 38 43.5 62 t rea (3.0 v) (1 + n) t ? 25 25 30.5 ? 2 ndre data access time t rea (2.7 v) (1 + n) t ? 30 ? ? 44 3 read data hold time t oh 0 0 0 0 4 ndwe low width t wp (0.75 + n) t ? 20 17.5 21.6 35.5 5 write data setup time t ds (3.25 + n) t ? 30 132.5 150.3 210.5 6 write data hold time t dh 0.25 t ? 2 10.5 11.8 16.5 ns ac measuring conditions ? output level: high = 0.7 vcc, low = 0.3 vcc, c l = 50 pf ? input level: high = 0.9 vcc, low = 0.1 vcc note 1: the ?n? shown in ?variable? refers to the wait number which is set to ndnfspr register. example: when ndnfspr = ?0001?, t rp = (1 + n) t ? 12 = 2t ? 12 note 2: the figures in the ?variable? column cover the whole vcc range (2.7 v to 3.6 v). exceptions are shown by the vcc (min), ?(3.0 v)? or ?(2.7 v)?, added to the ?symbol? column. example: (3.0v) : vcc range = 3.0v to 3.6v data input sdclk a 0 to a23 ndre ndwe d0 to d7 t rp t re a t oh read cycle data output ndre ndwe d0 to d7 t wp t dh write cycle t ds
tmp92ca25 2007-02-28 92ca25-372 4.3.5 serial channel timing (1) sclk input mode (i/o interface mode) variable parameter symbol min max 40 mhz 36 mhz 27 mhz unit sclk cycle t scy 16t 0.8 0.888 1.184 s output data sclk rising/falling t oss t scy /2 ? 4t ? 110 90 114 186 sclk rising/falling output data hold t ohs t scy /2 + 2t + 0 500 554 740 sclk rising/falling input data hold t hsr 3 t + 10 160 175 232 sclk rising/falling input data valid t srd t scy ? 0 800 888 1184 input data valid sclk rising/falling t rds 0 0 0 0 ns (2) sclk output mode (i/o interface mode) variable parameter symbol min max 40 mhz 36 mhz 27 mhz unit sclk cycle (programmable) t scy 16 t 8192t 0.8 0.888 1.184 s output data sclk rising/falling t oss t scy /2 ? 40 360 404 552 sclk rising/falling output data hold t ohs t scy /2 ? 40 360 404 552 sclk rising/falling input data hold t hsr 0 0 0 0 sclk rising/falling input data valid t srd t scy ? 1t ? 180 570 654 967 input data valid sclk rising/falling t rds 1 t + 180 230 233 253 ns 4.3.6 interrupt operation variable parameter symbol min max 40 mhz 36 mhz 27 mhz unit int0 to int5 low width t intal 4 t + 40 240 262 336 int0 to int5 high width t intah 4 t + 40 240 262 336 ns t sc y 0 sclk output mode/ input rising mode sclk (input falling mode) output data txd 1 2 3 t oss t ohs input data rxd 0 1 2 3 t srd t rds t hsr valid valid valid valid
tmp92ca25 2007-02-28 92ca25-373 4.3.7 lcd controller (sr mode) variable parameter symbol min max 40 mhz 36 mhz 27 mhz unit lcp0 clock period ( = tm) t cw 2 t 100 111 148 lcp0 high width t cwh 0.5 tm ? 12 38 43.5 62 lcp0 low width t cwl 0.5 tm ? 12 38 43.5 62 data valid lcp0 falling t dsu 0.5 tm ? 20 30 35.5 54 lcp0 falling data hold t dhd 0.5 tm ? 5 45 50.5 69 ns 4.3.8 i 2 s timing (i 2 s, sio mode) variable parameter symbol min max 40 mhz 36 mhz 27 mhz unit i2scko clock period t cr t 50 55 74 i2scko high width t hb 0.5 t cr ? 15 10 12 22 i2scko low width t lb 0.5 t cr ? 15 10 12 22 i2sdo, i2sws setup time t sd 0.5 t cr ? 15 10 12 22 i2sdo, i2sws hold time t hd 0.5 t cr ? 5 20 22 32 ns ac measuring conditions ? output level: high = 0.7 vcc, low = 0.3 vcc, c l = 10 pf lcp0 t cwh t cwl t cw ld0 to ld7 t dhd t dsu ld0 to ld7 output i2scko t cr t lb t hb i2sdo t hd t hd t sd i2sws
tmp92ca25 2007-02-28 92ca25-374 4.3.9 spi control timing variable parameter symbol min max 40 mhz 36 mhz 27 mhz unit spclk frequency ( = 1/s) t cr 20 20 18 13.5 mhz spclk rising time t hb 6 6 6 6 spclk falling time t lb 6 6 6 6 spclk low pulse width t sd 0.5s ? 6 19 21 31 spclk high pulse width t hd 0.5s ? 13 12 14 24 output data valid spclk rise 0.5s ? 18 7 9 19 output data valid spclk fall 0.5s ? 21 4 6 16 spclk rise output data hold 0.5s ? 10 15 17 27 input data valid spclk rise 0s + 5 5 5 5 spclk rise input data hold 0s + 5 5 5 5 ns ac measuring conditions ? output level: high = 0.7 vcc, low = 0.3 vcc, c l = 25 pf ? input level: high = 0.9 vcc, low = 0.1 vcc spclk output (when spimd = ?11?) spdo output f pp t r tf 0.2vcc 0.7vcc t wl t wh t ods t odh t ids t idh spdi intput spclk output (when spimd = ?00?)
tmp92ca25 2007-02-28 92ca25-375 4.3.10 external bus release function note: this line show only that output buffer is off. th is line does not show that signal level is middle. variable parameter symbol min max 40 mhz 36 mhz 27 mhz unit floating time until busrq falling t aba 0 30 0 30 0 30 0 30 mhz floating time until busak rising t baa 0 30 0 30 0 30 0 30 ns release pin t ab a t baa (note) busrq busak
tmp92ca25 2007-02-28 92ca25-376 4.4 ad conversion characteristics parameter symbol min typ. max unit analog reference voltage ( + ) v refh v cc ? 0.2 v cc v cc analog reference voltage ( ? ) v refl v ss v ss v ss + 0.2 ad converter power supply voltage av cc v cc v cc v cc ad converter ground av ss v ss v ss v ss analog input voltage av in v refl v refh v analog current for analog reference voltage = 1 0.8 1.35 ma analog current for analog reference voltage = 0 i ref 0.02 5.0 a total error (quantize error of 0.5 lsb is included.) e t 1.0 4.0 lsb note 1: 1lsb = (vrefh ? vrefl) / 1024 [v] note 2: minimum frequency for operation ad converter operation is guaranteed only when usi ng fc (high-frequency oscillator). fs is not guaranteed. however, operation is guaranteed if the clock fr equency selected by the clock gear is over 4mhz. note 3: the value for icc includes the current which flows through the av cc pin.
tmp92ca25 2007-02-28 92ca25-377 4.5 recommended oscillation circuit the tmp92ca25 has been evaluated by the oscillator vender below. use this information when selecting external parts. note: the total load value of the oscillator is the sum of external loads (c1 and c2) and the floating load of the actual assembled board. there is a possibility of operating error when using c1 and c2 values in the table below. when designing the board, design the minimum length pattern around the oscilla tor. we also recommend that oscillator evaluation be carried out using the actual board. (1) connection example (2) recommended ceramic oscillator : murata manufacturing co., ltd. note 1: the figure in parentheses ( ) under c1 and c2 is the built-in condenser type. note 2: the product numbers and specifications of the oscillators made by murata manufacturing co., ltd. are subject to change. for up-to-date inform ation, please refer to the following url: http://www.murata.co.jp parameter of elements running condition mcu oscillation frequency [mhz] oscillator product number c1 [pf] c2 [pf] rf [ ] rd [ ] voltage of power [v] ta [ c] 6.00 cstcr6m00g55-r0 (39) (39) 10.00 cstce10m0g55-r0 (33) (33) tmp92ca25fg 20.00 cstce20m0v53-r0 (15) (15) open 0 2.7 3.6 -20 + 80 x1 x2 rd rf c2 c1 high-frequency oscillato r xt1 xt2 rd c2 c1 low-frequency oscillato r
tmp92ca25 2007-02-28 92ca25-378 5. table of special function registers (sfrs) the sfrs include the i/o ports and peripheral control registers allocated to the 4-kbyte address space from 000000h to 001fffh. (1) i/o port (11) uart/serial channel (2) interrupt control (12) sbi (3) memory controller (13) spi controller (4) mmu (14) ad converter (5) clock gear, pll (15) watchdog timer (6) lcd controller (16) rtc (real time clock) (7) touch screen i/f (17) melody/alarm generator (8) sdram controller (18) nand flash controller (9) 8-bit timer (19) i 2 s (10) 16-bit timer table layout symbol name address 7 6 1 0 bit symbol read/write initial value after reset remarks note: ?prohibit rmw? in the table means that yo u cannot use rmw instructions on these register. example: when setting bit0 only of the register pxcr, the inst ruction ?set 0, (pxcr)? cannot be used. the ld (transfer) instruction must be used to write all eight bits. read/write r/w: both read and write are possible. r: only read is possible. w: only write is possible. w * : both read and write are possible (when this bit is read as ?1?.) prohibit rmw: read-modify-write instructio ns are prohibited. (the ex, add, adc, bus, sbc, inc, dec, and, or, xo r, stcf, res, set, chg, tset, rlc, rrc, rl, rr, sla, sra, sll, srl, rld and rrd instruction are read-modify-write instructions.) r/w *: read-modify-write is prohibited when controlling the pull-up resistor.
tmp92ca25 2007-02-28 92ca25-379 table 5.1 i/o register address map [1] port address name address name address name address name 0000h 0010h 0020h p8 0030h pc 1h 1h 1h p8fc2 1h 2h 2h 2h 2h pccr 3h 3h 3h p8fc 3h pcfc 4h p1 4h 4h p9 4h 5h 5h 5h p9fc2 5h 6h p1cr 6h 6h p9cr 6h 7h p1fc 7h 7h p9fc 7h 8h 8h p6 8h pa 8h 9h 9h 9h 9h ah ah p6cr ah ah bh bh p6fc bh pafc bh ch ch p7 ch ch pf dh dh dh dh pffc2 eh eh p7cr eh eh pfcr fh fh p7fc fh fh pffc address name address name address name address name 0040h pg 0050h pk 0080h 0090h pgdr 1h 1h 1h p1dr 1h 2h 2h pkcr 2h 2h 3h 3h pkfc 3h 3h pjdr 4h 4h pl 4h p4dr 4h pkdr 5h 5h 5h p5dr 5h pldr 6h 6h plcr 6h p6dr 6h pmdr 7h 7h plfc 7h p7dr 7h pndr 8h 8h pm 8h p8dr 8h 9h 9h 9h p9dr 9h ah ah ah padr ah bh bh pmfc bh bh ch pj ch pn ch pcdr ch dh dh dh dh eh pjcr eh pncr eh eh fh pjfc fh pnfc fh pfdr fh note: do not access un-named addresses.
tmp92ca25 2007-02-28 92ca25-380 [2] intc address name address name address name address name 00d0h inte12 00e0h intespi 00f0h inte0ad 0100h dma0v 1h inte34 1h intesbi 1h intetc01 1h dma1v 2h 2h reserved 2h intetc23 2h dma2v 3h 3h reserved 3h intetc45 3h dma3v 4h inteta01 4h reserved 4h intetc67 4h dma4v 5h inteta23 5h intalm01 5h simc 5h dma5v 6h 6h intalm23 6h iimc 6h dma6v 7h 7h intalm4 7h intwdt 7h dma7v 8h intetb01 8h intertc 8h intclr 8h dmab 9h 9h intekey 9h 9h dmar ah intetbo0 ah intelcd ah ah reserved bh intes0 bh inte5i2s bh bh ch ch intend01 ch ch dh dh reserved dh dh eh eh intep0 eh eh fh fh reserved fh fh [3] memc [4] mmu address name address name address name address name 0140h b0csl 0150h 0160h 01d0h localpx 1h b0csh 1h 1h 1h localpy 2h mamr0 2h 2h 2h 3h msar0 3h 3h 3h localpz 4h b1csl 4h 4h 4h locallx 5h b1csh 5h 5h 5h locally 6h mamr1 6h 6h pmemcr 6h 7h msar1 7h 7h 7h locallz 8h b2csl 8h bexcsl 8h memcr0 8h localrx 9h b2csh 9h bexcsh 9h 9h localry ah mamr2 ah ah ah bh msar2 bh bh bh localrz ch b3csl ch ch ch localwx dh b3csh dh dh dh localwy eh mamr3 eh eh eh fh msar3 fh fh fh localwz note: do not access un-named addresses.
tmp92ca25 2007-02-28 92ca25-381 [5] cgear, pll address name 10e0h syscr0 1h syscr1 2h syscr2 3h emccr0 4h emccr1 5h emccr2 6h reserved 7h 8h pllcr0 9h pllcr1 ah bh ch dh eh fh [6] lcdc address name address name 0840h lcdmode0 0850h lsaral 1h lcdffp 1h lsaram 2h lcddvm 2h lsarah 3h lcdsize 3h cmnal 4h lcdctl0 4h cmnah 5h 5h 6h lcdscc 6h lsarbl 7h 7h lsarbm 8h 8h lsarbh 9h 9h cmnbl ah ah cmnbh bh bh ch ch lsarcl dh dh lsarcm eh eh lsarch fh fh note: do not access un-named addresses.
tmp92ca25 2007-02-28 92ca25-382 [7] tsi [8] sdramc [9] 8-bit timer [10] 16-bit timer address name address name address name address name 01f0h tsicr0 0250h sdacr1 1100h ta01run 1180h tb0run 1h tsicr1 1h sdacr2 1h 1h 2h 2h sdrcr 2h ta0reg 2h tb0mod 3h 3h sdcmm 3h ta1reg 3h tb0ffcr 4h 4h 4h ta01mod 4h 5h 5h 5h ta01ffcr 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h 8h 8h ta23run 8h tb0rg0l 9h 9h 9h 9h tb0rg0h ah ah ah ta2reg ah tb0rg1l bh bh bh ta3reg bh tb0rg1h ch ch ch ta23mod ch tb0cp0l dh dh dh ta3ffcr dh tb0cp0h eh eh eh eh tb0cp1l fh fh fh fh tb0cp1h [11] sio [12] sbi address name address name 1200h sc0buf 1240h sbi0cr1 1h sc0cr 1h sbi0dbr 2h sc0mod0 2h i2c0ar 3h br0cr 3h sbi0cr2/sbi0sr 4h br0add 4h sbi0br0 5h sc0mod1 5h sbi0br1 6h 6h 7h 7h 8h 8h 9h 9h ah ah bh bh ch ch dh dh eh eh fh fh note: do not access un-named addresses.
tmp92ca25 2007-02-28 92ca25-383 [13] spi controller address name address name 0820h spimd 0830h spitd 1h spimd 1h spitd 2h spict 2h spird 3h spict 3h spird 4h spist 4h spits 5h spist 5h spits 6h spicr 6h spirs 7h spicr 7h spirs 8h spiis 8h 9h spiis 9h ah spiwe ah bh spiwe bh ch spiie ch dh spiie dh eh spiir eh fh spiir fh note: do not access un-named addresses.
tmp92ca25 2007-02-28 92ca25-384 [14] 10-bit adc [15] wdt address name address name address name 12a0h adreg0l 12b0h 1300h wdmod 1h adreg0h 1h 1h wdcr 2h adreg1l 2h 2h 3h adreg1h 3h 3h 4h adreg2l 4h 4h 5h adreg2h 5h 5h 6h adreg3l 6h 6h 7h adreg3h 7h 7h 8h reserved 8h admod0 8h 9h reserved 9h admod1 9h ah reserved ah admod2 ah bh reserved bh reserved bh ch reserved ch ch dh reserved dh dh eh reserved eh eh fh reserved fh fh [16] rtc [17] mld address name address name 1320h secr 1330h alm 1h minr 1h melalmc 2h hourr 2h melfl 3h dayr 3h melfh 4h dater 4h almint 5h monthr 5h 6h yearr 6h 7h pager 7h 8h restr 8h 9h 9h ah ah bh bh ch ch dh dh eh eh fh fh note: do not access un-named addresses.
tmp92ca25 2007-02-28 92ca25-385 [18] nand flash controller address name address name address name address name 1cc0h 1cd0h nd0fimr 1ce0h 1cf0h nd1fimr 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h nd0fmcr 4h nd0fspr 4h nd1fmcr 4h nd1fspr 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h nd0fsr 8h nd0frstr 8h nd1fsr 8h nd1frstr 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch nd0fisr ch ch nd1fisr ch dh dh dh dh eh eh eh eh fh fh fh fh address name address name address name 1d00h nd0fdtr, 1cb0h nd0eccrd 01c0h ndcr to nd1fdtr to nd1eccrd 1h 1effh 1cb5h 2h 3h 4h 5h 6h 7h 8h 9h ah bh ch dh eh fh note: do not access un-named addresses.
tmp92ca25 2007-02-28 92ca25-386 [19] i 2 s address name 0800h i2sbufr 1h 2h 3h 4h 5h 6h 7h 8h i2sbufl 9h ah bh ch dh eh i2sctl0 fh i2sctl0 note: do not access un-named addresses.
tmp92ca25 2007-02-28 92ca25-387 (1) i/o ports (1/7) symbol name address 7 6 5 4 3 2 1 0 p17 p16 p15 p14 p13 p12 p11 p10 r/w p1 port 1 0004h data from external port (output latch register is cleared to ?0?) p67 p66 p65 p64 p63 p62 p61 p60 r/w p6 port 6 0018h data from external port (output latch register is cleared to ?0?) p76 p75 p74 p73 p72 p71 p70 r/w p7 port 7 001ch data from external port (output latch register is set to ?1?) data from external port (output latch register is cleared to ?0?) data from external port (output latch register is set to ?1?) 1 p87 p86 p85 p84 p83 p82 p81 p80 r/w p8 port 8 0020h 1 1 1 1 1 0 1 1 p97 p96 p95 p94 p93 p92 p91 p90 r r/w p9 port 9 0024h data from external port 0 data from external port (output latch register is set to ?1?) pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 r pa port a 0028h data from external port pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 r/w pc port c 0030h data from external port (output latch register is set to ?1?) pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 r/w pf port f 003ch 1 data from external port (output latch register is set to ?1?) pg3 pg2 pg1 pg0 r pg port g 0040h data from external port pj7 pj6 pj5 pj4 pj3 pj2 pj1 pj0 r/w pj port j 004ch 1 data from external port (output latch register is set to ?1?) 1 1 1 1 1 pk7 pk6 pk5 pk4 pk3 pk2 pk1 pk0 r/w pk port k 0050h data from external port (output latch register is cleared to ?0?) 0 0 0 0 pl7 pl6 pl5 pl4 pl3 pl2 pl1 pl0 r/w pl port l 0054h data from external port (output latch register is cleared to ?0?) 0 0 0 0 pm2 pm1 r/w pm port m 0058h 1 1 pn7 pn6 pn5 pn4 pn3 pn2 pn1 pn0 r/w pn port n 005ch data from external port (output latch register is set to ?1?)
tmp92ca25 2007-02-28 92ca25-388 (1) i/o ports (2/7) symbol name address 7 6 5 4 3 2 1 0 p17c p16c p15c p14c p13c p12c p11c p10c w 0 0 0 0 0 0 0 0 p1cr port 1 control register 0006h (prohibit rmw) 0: input 1: output p1f w 0/1 p1fc port 1 function register 0007h (prohibit rmw) 0:port 1:data bus (d8 to d15) p67c p66c p65c p64c p63c p62c p61c p60c w 0 0 0 0 0 0 0 0 p6cr port 6 control register 001ah (prohibit rmw) 0: input 1: output p67f p66f p65f p64f p63f p62f p61f p60f w 1 1 1 1 1 1 1 1 p6fc port 6 function register 001bh (prohibit rmw) 0: port 1: address bus (a16 to a23) p76c p75c p75c p74c p72c p71c w 0 0 0 0 0 0 p7cr port 7 control register 001eh (prohibit rmw) 0: input 1: output p76f p75f p74f p73f p72f p71f p70f w 0 0 0 0 0 0 1 p7fc port 7 function register 001fh (prohibit rmw) 0: port 1: wait 0: port 1: ndr/ b at = 1, r/ w 0: port 1: ea25 0: port 1: ea24 0: port 1: ndwe at = 0, wrlu at = 1 0: port 1: ndre at = 0, wrll at=1 0: port 1: rd p87f p86f p85f p84f p83f p82f p81f p80f w 0 0 0 0 0 0 0 0 p8fc port 8 function register 0023h (prohibit rmw) 0: port 1: csze 0: port 1: cszd 0: port 1: cszc , ce 1 nd 0: port 1: cszb , ce 0 nd 0: port 1: 3 cs 0: port, csza 1: 2 cs 0: port 1: 1 cs 0: port 1: 0 cs p87f2 p86f2 p85f2 p84f2 ? p82f2 p81f2 ? w 0 0 0 0 0 0 0 0 p8fc2 port 8 function register2 0021h (prohibit rmw) 0: 1: reserved 0: 1: reserved 0: port, cszc 1: ce 1 nd 0: port, cszb 1: ce 0 nd always write ?0? 0: port 2 cs 1: csza 0: 1: sdcs always write ?0?
tmp92ca25 2007-02-28 92ca25-389 (1) i/o ports (3/7) symbol name address 7 6 5 4 3 2 1 0 p95c p94c p93c p92c p91c p90c w 0 0 0 0 0 0 p9cr port 9 control register 0026h (prohibit rmw) 0: port 1: clk32ko 0: port 1: port, scl 0:port 1: port, sda 0:port, sclk0, 0 cts i2sws 1:port, sclk0 0: port, rxd0 i2sdo 1: port 0:port, i2scko 1: port, txd0 p97f p96f p95f p94f p93f p92f p91f p90f w 0 0 0 0 0 0 0 0 p9fc port 9 function register 0027h (prohibit rmw) 0: port 1: int5 0: port 1: int4 0:port, clk32ko 1: reserved 0: port 1: scl 0: port 1: sda 0: port, sclk0, 0 cts 1: i2sws, sclk0 0: port, rxd0 1: i2sdo 0: port 1: i2scko, txd0 p94f2 p93f2 p90fc2 w w 0 0 0 p9fc2 port 9 function register2 0025h (prohibit rmw) 0: cmos 1: open drain 0: cmos 1: open drain 0: cmos 1: open drain pa7f pa6f pa5f pa4f pa3f pa2f pa1f pa0f w 0 0 0 0 0 0 0 0 pafc port a function register 002bh (prohibit rmw) 0: key-in disable 1: key-in enable pc7c pc6c pc5c pc4c pc3c pc2c pc1c pc0c w 0 0 0 0 0 0 0 0 pccr port c control register 0032h (prohibit rmw) 0: input 1: output pc7f pc6f pc5f pc4f pc3f pc2f pc1f pc0f w 0 0 0 0 0 0 0 0 pcfc port c function register 0033h (prohibit rmw) 0: port 1: cszf , ea25 at = 0 0: port 1:ko8 (open -drain) ea24 at = 0 0: port 1:reserved 0: port 1:reserved 0: port 1: int3 0: port 1: int2, tb0out0 0: port 1: int1, ta3out 0: port 1: int0, ta1out
tmp92ca25 2007-02-28 92ca25-390 (1) i/o ports (4/7) symbol name address 7 6 5 4 3 2 1 0 pf6c pf5c pf4c pf3c pf2c pf1c pf0c w 0 0 0 0 0 0 0 pfcr port f control register 003eh (prohibit rmw) 0: port 1: port 0: port 1: port 0: port 1: port 0: port 1: port 0: port, sclk0, 0 cts , (from pf2 at = 0) (from p92 at = 1) 1: port, sclk0 0: port, rxd0 1: port 0: port 1: port, txd0 pf7f pf6f pf5f pf4f pf3f pf2f pf1f pf0f w 0 0 0 0 0 0 0 0 pffc port f function register 003fh (prohibit rmw) 0: port 1: sdclk 0: port 1: reserved 0: port 1:reserved 0: port 1:reserved 0: port 1:reserved 0: port, sclk0, 0 cts (from pf2 at = 0) (from p92 at = 1) 1:sclk0 0: port rxd0 (from pf1 pin) 1: rxd0 (from p91 pin) 0: port 1: txd0 ? ? pf0f2 w w w 0 0 0 pffc2 port f function register2 003dh (prohibit rmw) always write ?0? always write ?0? output buffer 0: cmos 1: open-drain pj6c pj5c w 0 0 pjcr port j control register 004eh (prohibit rmw) 0:input 1: output pj7f pj6f pj5f pj4f pj3f pj2f pj1f pj0f w 0 0 0 0 0 0 0 0 pjfc port j function register 004fh (prohibit rmw) 0: port 1: sdcke at = 1 0: port 1: ndcle at = 0 0: port 1: ndale at = 0 0: port 1: sdludqm at = 1 0: port 1: sdlldqm at = 1 0: port 1: sdwe , sdwr 0: port 1: sdcas , srlub 0: port 1: sdras , srllb pk7c pk7c pk7c pk7c w 0 0 0 0 pkcr port k control register 0052h (prohibit rmw) 0:input 1: output pk7f pk6f pk5f pk4f pk3f pk2f pk1f pk0f w 0 0 0 0 0 0 0 0 pkfc port k function register 0053h (prohibit rmw) 0: port 1: spclk 0: port 1: spcs 0: port 1: spdo 0: port 1: spdi 0: port 1: lbcd 0: port 1: lfr 0: port 1: llp 0: port 1: lcp0
tmp92ca25 2007-02-28 92ca25-391 (1) i/o ports (5/7) symbol name address 7 6 5 4 3 2 1 0 pl7c pl6c pl5c pl4c w 0 0 0 0 plcr port l control register 0056h (prohibit rmw) 0: input 1: output pl7f pl6f pl5f pl4f pl3f pl2f pl1f pl0f w 0 0 0 0 0 0 0 0 plfc port l function register 0057h (prohibit rmw) 0: port 1: ld7, busak 0: port 1: ld6, busrq 0: port 1: ld5 0: port 1: ld4 0: port 1: data bus for lcdc (ld3 to ld0) pm2f pm1f w 0 0 pmfc port m function register 005bh (prohibit rmw) 0: port 1: alarm mldalm 0: port 1: mldalm output pn7c pn6c pn5c pn4c pn3c pn2c pn1c pn0c w 0 0 0 0 0 0 0 0 pncr port n control register 005eh (prohibit rmw) 0:input 1: output pn7f pn6f pn5f pn4f pn3f pn2f pn1f pn0f w 0 0 0 0 0 0 0 0 pnfc port n function register 005fh (prohibit rmw) 0: cmos output 1: open drain output
tmp92ca25 2007-02-28 92ca25-392 (1) i/o ports (6/7) symbol name address 7 6 5 4 3 2 1 0 p17d p16d p15d p14d p13d p12d p11d p10d r/w 1 1 1 1 1 1 1 1 p1dr port 1 drive register 0081h input/output buffer drive register for standby mode p47d p46d p45d p44d p43d p42d p41d p40d r/w 1 1 1 1 1 1 1 1 p4dr port 4 drive register 0084h input/output buffer drive register for standby mode p57d p56d p55d p54d p53d p52d p51d p50d r/w 1 1 1 1 1 1 1 1 p5dr port 5 drive register 0085h input/output buffer drive register for standby mode p67d p66d p65d p64d p63d p62d p61d p60d r/w 1 1 1 1 1 1 1 1 p6dr port 6 drive register 0086h input/output buffer drive register for standby mode p76d p75d p74d p73d p72d p71d p70d r/w 1 1 1 1 1 1 1 p7dr port 7 drive register 0087h input/output buffer drive register for standby mode p87d p86d p85d p84d p83d p82d p81d p80d r/w 1 1 1 1 1 1 1 1 p8dr port 8 drive register 0088h input/output buffer drive register for standby mode p97d p96d p95d p94d p93d p92d p91d p90d r/w 1 1 1 1 1 1 1 1 p9dr port 9 drive register 0089h input/output buffer drive register for standby mode pa7d pa6d pa5d pa4d pa3d pa2d pa1d pa0d r/w 1 1 1 1 1 1 1 1 padr port a drive register 008ah input/output buffer drive register for standby mode pc7d pc6d pc5d pc4d pc3d pc2d pc1d pc0d r/w 1 1 1 1 1 1 1 1 pcdr port c drive register 008ch input/output buffer drive register for standby mode pf7d pf6d pf5d pf4d pf3d pf2d pf1d pf0d r/w 1 1 1 1 1 1 1 1 pfdr port f drive register 008fh input/output buffer drive register for standby mode pg3d pg2d r/w 1 1 pgdr port g drive register 0090h input/output buffer drive register for standby mode
tmp92ca25 2007-02-28 92ca25-393 (1) i/o ports (7/7) symbol name address 7 6 5 4 3 2 1 0 pj7d pj6d pj5d pj4d pj3d pj2d pj1d pj0d r/w 1 1 1 1 1 1 1 1 pjdr port j drive register 0093h input/output buffer drive register for standby mode pk7d pk6d pk5d pk4d pk3d pk2d pk1d pk0d r/w 1 1 1 1 1 1 1 1 pkdr port k drive register 0094h input/output buffer drive register for standby mode pl7d pl6d pl5d pl4d pl3d pl2d pl1d pl0d r/w 1 1 1 1 1 1 1 1 pldr port l drive register 0095h input/output buffer drive register for standby mode pm2d pm1d r/w 1 1 pmdr port m drive register 0096h input/output buffer drive register for standby mode pn7d pn6d pn5d pn4d pn3d pn2d pn1d pn0d r/w 1 1 1 1 1 1 1 1 pndr port n drive register 0097h input/output buffer drive register for standby mode
tmp92ca25 2007-02-28 92ca25-394 (2) interrupt control (1/4) symbol name address 7 6 5 4 3 2 1 0 int2 int1 i2c i2m2 i2m1 i2m0 i1c i1m2 i1m1 i1m0 r r/w r r/w inte12 int1 & int2 enable 00d0h 0 0 0 0 0 0 0 0 int4 int3 i4c i4m2 i4m1 i4m0 i3c i3m2 i3m1 i3m0 r r/w r r/w inte34 int3 & int4 enable 00d1h 0 0 0 0 0 0 0 0 intta1 (tmra1) intta0 (tmra0) ita1c ita1m2 ita1m1 ita1m0 it a0c ita0m2 ita0m1 ita0m0 r r/w r r/w inteta01 intta0 & intta1 enable 00d4h 0 0 0 0 0 0 0 0 intta3 (tmra3) intta2 (tmra2) ita3c ita3m2 ita3m1 ita3m0 it a2c ita2m2 ita2m1 ita2m0 r r/w r r/w inteta23 intta2 & intta3 enable 00d5h 0 0 0 0 0 0 0 0 inttb1 (tmrb1) inttb0 (tmrb0) itb1c itb1m2 itb1m1 itb1m0 it b0c itb0m2 itb0m1 itb0m0 r r/w r r/w intetb01 inttb0 & inttb1 enable 00d8h 0 0 0 0 0 0 0 0 ? inttbo0 (tmrb0) ? ? ? ? itbo0c itbo0m2 itbo0m1 itbo0m0 ? ? r r/w intetbo0 inttbo0 (overflow) enable 00dah always write ?0? 0 0 0 0 inttx0 intrx0 itx0c itx0m2 itx0m1 itx0m0 irx0c irx0m2 irx0m1 irx0m0 r r/w r r/w intes0 intrx0 & inttx0 enable 00dbh 0 0 0 0 0 0 0 0 intspi ? ispic ispim2 ispim1 ispim0 ? ? ? ? r r/w ? ? intespi intspi enable 00e0h 0 0 0 0 always write ?0? ? intsbi ? ? ? ? isbic isbim2 isbim1 isbim0 ? ? r r/w intesbi intsbi enable 00e1h always write ?0? 0 0 0 0 intalm1 intalm0 ia1c ia1m2 ia1m1 ia1m0 ia0c ia0m2 ia0m1 ia0m0 r r/w r r/w intealm01 intalm0 & intalm1 enable 00e5h 0 0 0 0 0 0 0 0 intalm3 intalm2 ia3c ia3m2 ia3m1 ia3m0 ia2c ia2m2 ia2m1 ia2m0 r r/w r r/w intealm23 intalm2 & intalm3 enable 00e6h 0 0 0 0 0 0 0 0
tmp92ca25 2007-02-28 92ca25-395 (2) interrupt control (2/4) symbol name address 7 6 5 4 3 2 1 0 ? intalm4 ? ? ? ? ia4c ia4m2 ia4m1 ia4m0 ? ? r r/w intealm4 intalm4 enable 00e7h always write ?0? 0 0 0 0 ? intrtc ? ? ? ? irc irm2 irm1 irm0 ? ? r r/w intertc intrtc enable 00e8h always write ?0? 0 0 0 0 ? intkey ? ? ? ? ikc ikm2 ikm1 ikm0 ? ? r r/w intekey intkey enable 00e9h always write ?0? 0 0 0 0 ? intlcd ? ? ? ? ilcd1c ilcdm2 ilcdm1 ilcdm0 ? ? r r/w intelcd intlcd enable 00eah always write ?0? 0 0 0 0 inti2s int5 ii2sc ii2sm2 ii2sm1 ii2sm0 i5c i5m2 i5m1 i5m0 r r/w r r/w inte5i2s int5 & inti2s enable 00ebh 0 0 0 0 0 0 0 0 intndf1 intndf0 in1c in1m2 in1m1 in1m0 in0c in0m2 in0m1 in0m0 r r/w r r/w intend01 intndf0 & intndf1 enable 00ech 0 0 0 0 0 0 0 0 ? intp0 ? ? ? ? ip0c ip0m2 ip0m1 ip0m0 ? ? r r/w intep0 intp0 enable 00eeh always write ?0? 0 0 0 0
tmp92ca25 2007-02-28 92ca25-396 (2) interrupt control (3/4) symbol name address 7 6 5 4 3 2 1 0 intad int0 iadc iadm2 iadm1 iadm0 i0c i0m2 i0m1 i0m0 r r/w r r/w inte0ad int0 & intad enable 00f0h 0 0 0 0 0 0 0 0 inttc1 (dma1) inttc0 (dma0) itc1c itc1m2 itc1m1 itc1m0 itc0c itc0m2 itc0m1 itc0m0 r r/w r r/w intetc01 inttc0 & inttc1 enable 00f1h 0 0 0 0 0 0 0 0 inttc3 (dma3) inttc2 (dma2) itc3c itc3m2 itc3m1 itc3m0 itc2c itc2m2 itc2m1 itc2m0 r r/w r r/w intetc23 inttc2 & inttc3 enable 00f2h 0 0 0 0 0 0 0 0 inttc5 (dma5) inttc4 (dma4) itc5c itc5m2 itc5m1 itc5m0 itc4c itc4m2 itc4m1 itc4m0 r r/w r r/w intetc45 inttc4 & inttc5 enable 00f3h 0 0 0 0 0 0 0 0 inttc7 (dma7) inttc6 (dma6) itc7c itc7m2 itc7m1 itc7m0 itc6c itc6m2 itc6m1 itc6m0 r r/w r r/w intetc67 inttc6 & inttc7 enable 00f4h 0 0 0 0 0 0 0 0 ? ? ir0le w w 0 1 1 simc sio interrupt mode control 00f5h (prohibit rmw) always write ?0?. always write ?1?. 0: intrx0 edge mode 1: intrx0 level mode i5edge i4edge i3edge i2edge i1edge i0edge i0le ? w r/w 0 0 0 0 0 0 0 0 iimc interrupt input mode control 00f6h (prohibit rmw) int5 edge 0: rising 1: falling int4 edge 0: rising 1: falling int3 edge 0: rising 1: falling int2 edge 0: rising 1: falling int1 edge 0: rising 1: falling int0 edge 0: rising 1: falling 0: int0 edge mode 1:int0 level mode always write ?0?. ? intwd ? ? ? ? itcwd ? ? ? ? ? r intwdt intwd enable 00f7h always write ?0? 0 ? ? ? clrv7 clrv6 clrv5 clrv4 clrv3 clrv2 clrv1 clrv0 w 0 0 0 0 0 0 0 0 intclr interrupt clear control 00f8h (prohibit rmw) interrupt vector
tmp92ca25 2007-02-28 92ca25-397 (2) interrupt control (4/4) symbol name address 7 6 5 4 3 2 1 0 dma0v5 dma0v4 dma0v3 dma0v2 dma0v1 dma0v0 r/w 0 0 0 0 0 0 dma0v dma0 start vector 0100h dma0 start vector dma1v5 dma1v4 dma1v3 dma1v2 dma1v1 dma1v0 r/w 0 0 0 0 0 0 dma1v dma1 start vector 0101h dma1 start vector dma2v5 dma2v4 dma2v3 dma2v2 dma2v1 dma2v0 r/w 0 0 0 0 0 0 dma2v dma2 start vector 0102h dma2 start vector dma3v5 dma3v4 dma3v3 dma3v2 dma3v1 dma3v0 r/w 0 0 0 0 0 0 dma3v dma3 start vector 0103h dma3 start vector dma4v5 dma4v4 dma4v3 dma4v2 dma4v1 dma4v0 r/w 0 0 0 0 0 0 dma4v dma4 start vector 0104h dma4 start vector dma5v5 dma5v4 dma5v3 dma5v2 dma5v1 dma5v0 r/w 0 0 0 0 0 0 dma5v dma5 start vector 0105h dma5 start vector dma6v5 dma6v4 dma6v3 dma6v2 dma6v1 dma6v0 r/w 0 0 0 0 0 0 dma6v dma6 start vector 0106h dma6 start vector dma7v5 dma7v4 dma7v3 dma7v2 dma7v1 dma7v0 r/w 0 0 0 0 0 0 dma7v dma7 start vector 0107h dma7 start vector dbst7 dbst6 dbst5 dbst4 d bst3 dbst2 dbst1 dbst0 r/w 0 0 0 0 0 0 0 0 dmab dma burst 0108h 1: dma request on burst mode dreq7 dreq6 dreq5 dreq4 dre q3 dreq2 dreq1 dreq0 r/w 0 0 0 0 0 0 0 0 dmar dma request 0109h (prohibit rmw) 1: dma request in software
tmp92ca25 2007-02-28 92ca25-398 (3) memory controller (1/3) symbol name address 7 6 5 4 3 2 1 0 b0ww2 b0ww1 b0ww0 b0wr2 b0wr1 b0wr0 w w 0 1 0 0 1 0 b0csl block0 cs/wait control register low 0140h (prohibit rmw) write waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 011: (1 + n) waits 111: 4 waits others: reserved read waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 011: (1 + n) waits 111: 4 waits others: reserved b0e ? ? b0rec b0om1 b0om0 b0bus1 b0bus0 w 0 0 0 0 0 0 0/1 0/1 b0csh block0 cs/wait control register high 0141h (prohibit rmw) cs select 0: disable 1: enable always write ?0?. always write ?0?. dummy cycle 0:no insert 1: insert 00: rom/sram 01: reserved 10: reserved 11: reserved data bus width 00: 8 bits 01: 16 bits 10: 32 bits 11: reserved b1ww2 b1ww1 b1ww0 b1wr2 b1wr1 b1wr0 w w 0 1 0 0 1 0 b1csl block1 cs/wait control register low 0144h (prohibit rmw) write waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 011: (1 + n) waits 111: 4 waits others: reserved read waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 011: (1 + n) waits 111: 4 waits others: reserved b1e ? ? b1rec b1om1 b1om0 b1bus1 b1bus0 w 0 0 0 0 0 0 0/1 0/1 b1csh block1 cs/wait control register high 0145h (prohibit rmw) cs select 0: disable 1: enable always write ?0?. always write ?0?. dummy cycle 0:no insert 1: insert 00: rom/sram 01: reserved 10: reserved 11: sdram data bus width 00: 8 bits 01: 16 bits 10: 32 bits 11: reserved b2ww2 b2ww1 b2ww0 b2wr2 b2wr1 b2wr0 w w 0 1 0 0 1 0 b2csl block2 cs/wait control register low 0148h (prohibit rmw) write waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 011: (1 + n) waits 111: 4 waits others: reserved read waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 011: (1 + n) waits 111: 4 waits others: reserved b2e b2m ? b2rec b2om1 b2om0 b2bus1 b2bus0 w 1 0 0 0 0 0 0/1 0/1 b2csh block2 cs/wait control register high 0149h (prohibit rmw) cs select 0: disable 1: enable 0: 16 mb 1: sets area always write ?0?. dummy cycle 0:no insert 1: insert 00: rom/sram 01: reserved 10: reserved 11: sdram data bus width 00: 8 bits 01: 16 bits 10: 32 bits 11: reserved
tmp92ca25 2007-02-28 92ca25-399 (3) memory controller (2/3) symbol name address 7 6 5 4 3 2 1 0 b3ww2 b3ww1 b3ww0 b3wr2 b3wr1 b3wr0 w w 0 1 0 0 1 0 b3csl block3 cs/wait control register low 014ch (prohibit rmw) write waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 011: (1 + n) waits 111: 4 waits others: reserved read waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 011: (1 + n) waits 111: 4 waits others: reserved b3e ? ? b3rec b3om1 b3om0 b3bus1 b3bus0 w 0 0 0 0 0 0 0/1 0/1 b3csh block3 cs/wait control register high 014dh (prohibit rmw) cs select 0: disable 1: enable always write ?0?. always write ?0?. dummy cycle 0:no insert 1: insert 00: rom/sram 01: reserved 10: reserved 11: reserved data bus width 00: 8 bits 01: 16 bits 10: 32 bits 11: reserved bexww2 bexww1 bexww0 bexwr2 bexwr1 bexwr0 w w 0 1 0 0 1 0 bexcsl block ex cs/wait control register low 0158h (prohibit rmw) write waits 001: 2 waits 010: 1 wait 101: 2 waits 110: 2 waits 011: (1 + n) waits others: reserved read waits 001: 2 waits 010: 1 wait 101: 2 waits 110: 2 waits 011: (1 + n) waits others: reserved bexom1 bexom0 bexbus1 bexbus0 w 0 0 0/1 0/1 bexcsh block ex cs/wait control register high 0159h (prohibit rmw) 00: rom/sram 01: reserved 10: reserved 11: reserved 00: 8 bits 01: 16 bits 10: 32 bits 11: reserved opge opwr1 opwr0 pr1 pr0 r/w 0 0 0 1 0 pmemcr page rom control register 0166h rom page access 0: disable 1: enable wait number on page 00: 1 clk (n-1-1-1 mode) 01: 2 clk (n-2-2-2 mode) 10: 3 clk (n-3-3-3 mode) 11: reserved byte number in a page 00: 64 bytes 01: 32 bytes 10: 16 bytes 11: 8 bytes
tmp92ca25 2007-02-28 92ca25-400 (3) memory controller (3/3) symbol name address 7 6 5 4 3 2 1 0 m0v20 m0v19 m0v18 m0v17 m0v16 m0v15 m0v14-9 m0v8 r/w 1 1 1 1 1 1 1 1 mamr0 memory address mask register 0 0142h 0: compare enable 1: compare disable m0s23 m0s22 m0s21 m0s20 m0s19 m0s18 m0s17 m0s16 r/w 1 1 1 1 1 1 1 1 msar0 memory start address register 0 0143h set start address a23 to a16 m1v21 m1v20 m1v19 m1v18 m1v17 m1v16 mv15-9 m1v8 r/w 1 1 1 1 1 1 1 1 mamr1 memory address mask register 1 0146h 0: compare enable 1: compare disable m1s23 m1s22 m1s21 m1s20 m1s19 m1s18 m1s17 m1s16 r/w 1 1 1 1 1 1 1 1 msar1 memory start address register 1 0147h set start address a23 to a16 m2v22 m2v21 m2v20 m2v19 m2v18 m2v17 m2v16 m2v15 r/w 1 1 1 1 1 1 1 1 mamr2 memory address mask register 2 014ah 0: compare enable 1: compare disable m2s23 m2s22 m2s21 m2s20 m2s19 m2s18 m2s17 m2s16 r/w 1 1 1 1 1 1 1 1 msar2 memory start address register 2 014bh set start address a23 to a16 m3v22 m3v21 m3v20 m3v19 m3v18 m3v17 m3v16 m3v15 r/w 1 1 1 1 1 1 1 1 mamr3 memory address mask register 3 014eh 0:compare enable 1:compare disable m3s23 m3s22 m3s21 m3s20 m3s19 m3s18 m3s17 m3s16 r/w 1 1 1 1 1 1 1 1 msar3 memory start address register 3 014fh set start address a23 to a16 csdis rdtmg1 rdtmg0 r/w 0 0 0 memcr0 memory control register 0 0168h 0: disable 1: enable 00: rd ?h? pulse width = 0.5t (default) 01: rd ?h? pulse width = 0.75t 10: rd ?h? pulse width = 1.0t 11: reserved
tmp92ca25 2007-02-28 92ca25-401 (4) mmu symbol name address 7 6 5 4 3 2 1 0 lxe x4 x3 x2 x1 x0 r/w r/w 0 0 0 0 0 0 localpx localx register for program 01d0h localx 1: enable bank number for localx setting lye y4 y3 y2 y1 y0 r/w r/w 0 0 0 0 0 0 localpy localy register for program 01d1h localy 1: enable bank number for localy setting lze z6 z5 z4 z3 z2 z1 z0 r/w r/w 0 0 0 0 0 0 0 0 localpz localz register for program 01d3h localz 1: enable bank number for localz setting lxe x4 x3 x2 x1 x0 r/w r/w 0 0 0 0 0 0 locallx localx register for lcdc 01d4h localx 1: enable bank number for localx setting lye y4 y3 y2 y1 y0 r/w r/w 0 0 0 0 0 0 locally localy register for lcdc 01d5h localy 1: enable bank number for localy setting lze z6 z5 z4 z3 z2 z1 z0 r/w r/w 0 0 0 0 0 0 0 0 locallz localz register for lcdc 01d7h localz 1: enable bank number for localz setting lxe x4 x3 x2 x1 x0 r/w r/w 0 0 0 0 0 0 localrx localx register for read 01d8h localx 1: enable bank number for localx setting lye y4 y3 y2 y1 y0 r/w r/w 0 0 0 0 0 0 localry localy register for read 01d9h localy 1: enable bank number for localy setting lze z6 z5 z4 z3 z2 z1 z0 r/w r/w 0 0 0 0 0 0 0 0 localrz localz register for read 01dbh localz 1: enable bank number for localz setting lxe x4 x3 x2 x1 x0 r/w r/w 0 0 0 0 0 0 localwx localx register for write 01dch localx 1: enable bank number for localx setting lye y4 y3 y2 y1 y0 r/w r/w 0 0 0 0 0 0 localwy localy register for write 01ddh localy 1: enable bank number for localy setting lze z6 z5 z4 z3 z2 z1 z0 r/w r/w 0 0 0 0 0 0 0 0 localwz localz register for write 01dfh localz 1: enable bank number for localz setting
tmp92ca25 2007-02-28 92ca25-402 (5) clock gear, pll symbol name address 7 6 5 4 3 2 1 0 xen xten wuef r/w r/w 1 1 0 syscr0 system clock control register 0 10e0h h-osc (fc) 0: stop 1: oscillation l-osc (fs) 0: stop 1: oscillation warm-up timer sysck gear2 gear1 gear0 r/w 0 1 0 0 syscr1 system clock control register 1 10e1h select system clock 0: fc 1: fs select gear value of high frequency (fc) 000: fc 101: (reserved) 001: fc/2 110: (reserved) 010: fc/4 111: (reserved) 011: fc/8 100: fc/16 ? wuptm1 wuptm0 haltm1 haltm0 r/w r/w 0 1 0 1 1 syscr2 system clock control register 2 10e2h always write ?0? warm-up timer 00: reserved 01: 2 8 /inputted frequency 10: 2 14 /inputted frequency 11: 2 16 /inputted frequency halt mode 00: reserved 01: stop mode 10: idle1 mode 11: idle2 mode protect extin drvosch drvoscl r r/w 0 0 1 1 emccr0 emc control register 0 10e3h protect flag 0: off 1: on 1: external clock high frequency oscillator driver ability 1: normal 0: weak low frequency oscillator driver ability 1: normal 0: weak emccr1 emc control register 1 10e4h emccr2 emc control register 2 10e5h switching the protect on/off by write to following 1st key, 2nd key 1st key: emccr1=5ah, emccr2=a5h in succession write 2nd key: emccr1=a5h, emccr2=5ah in succession write fcsel lupfg r/w r 0 0 pllcr0 pll control register 0 10e8h select fc clock 0: f osch 1: f pll lock up timer status flag pllon r/w 0 pllcr1 pll control register 1 10e9h control on/off 0: off 1: on
tmp92ca25 2007-02-28 92ca25-403 (6) lcd controller (1/2) symbol name address 7 6 5 4 3 2 1 0 ramtype1 ramtype0 scpw1 scpw0 lmode intmode ldo1 ldo0 r/w 0 0 1 0 0 0 0 0 lcdmode0 lcd mode 0 register 0840h display ram 00: internal sram1 01: external sram 10: sdram 11: internal sram2 ld bus transmission speed 00: reserved 01: 2 f sys 10: 4 f sys 11: 8 f sys lcdd type 0: sr 1: built-in ram type select interrupt 0: lp 1: bcd ld bus width control 00: 4bit width a_type 01: 4bit width b_type 10: 8bit width type others: reserved fp7 fp6 fp5 fp4 fp3 fp2 fp1 fp0 r/w 0 0 0 0 0 0 0 0 lcdffp lcd frame frequency register 0841h bit7 to bit0 f fp setting fmn7 fmn6 fmn5 fmn4 fmn3 fmn2 fmn1 fmn0 r/w 0 0 0 0 0 0 0 0 lcddvm lcd divide frm register 0283h dvm bit7 to bit0 setting com3 com2 com1 com0 seg3 seg2 seg1 seg0 r/w 0 0 0 0 0 0 0 0 lcdsize lcd size register 0843h common setting 0000: reserved 0101: 200 0001: 64 0110: 240 0010: 120 0111: 320 0011: 128 1000: 480 0100: 160 others: reserved segment setting 0000: reserved 0101: 320 0001: 64 0110: 480 0010: 128 0111: 640 0011: 160 0100: 240 others: reserved all0 frmon ? fp9 mmulcd fp8 start r/w 0 0 0 0 0 0 0 lcdctl0 lcd control 0 register 0844h segment data setting 0: normal 1: all display data ?0? fr divide setting 0: disable 1: enable always write ?0? f fp setting bit 9 built-in ram lcdd setting 0: sequential access 1: random access f fp setting bit 8 lcdc start 0: stop 1: start scc7 scc6 scc5 scc4 scc3 scc2 scc1 scc0 r/w 0 0 0 0 0 0 0 0 lcdscc lcd source clock counter register 0846h lcdc source clock counter bit7 to bit0
tmp92ca25 2007-02-28 92ca25-404 (6) lcd controller (2/2) symbol name address 7 6 5 4 3 2 1 0 sa7 sa6 sa5 sa4 sa3 sa2 sa1 sa0 r/w 0 0 0 0 0 0 0 0 lsaral start address register a area (l) 0850h start address for a area (bit7 to bit0) sa15 sa14 sa13 sa12 sa11 sa10 sa9 sa8 r/w 0 0 0 0 0 0 0 0 lsaram start address register a area (m) 0851h start address for a area (bit15 to bit8) sa23 sa22 sa21 sa20 sa19 sa18 sa17 sa16 r/w 0 1 0 0 0 0 0 0 lsarah start address register a area (h) 0852h start address for a area (bit23 to bit16) ca7 ca6 ca5 ca4 ca3 ca2 ca1 ca0 r/w 0 0 0 0 0 0 0 0 cmnal common number register a area (l) 0853h common number setting for a area (bit7 to bit0) ca8 r/w 0 cmnah common number register a area (h) 0854h a area (bit8) sb7 sb6 sb5 sb4 sb3 sb2 sb1 sb0 r/w 0 0 0 0 0 0 0 0 lsarbl start address register b area (l) 0856h start address for b area (bit7 to bit0) sb15 sb14 sb13 sb12 sb11 sb10 sb9 sb8 r/w 0 0 0 0 0 0 0 0 lsarbm start address register b area (m) 0857h start address for b area (bit15 to bit8) sb23 sb22 sb21 sb20 sb19 sb18 sb17 sb16 r/w 0 1 0 0 0 0 0 0 lsarbh start address register b area (h) 0858h start address for b area (bit23 to bit16) cb7 cb6 cb5 cb4 cb3 cb2 cb1 cb0 r/w 0 0 0 0 0 0 0 0 cmnbl common number register b area (l) 0859h common number setting for b area (bit7 to bit0) cb8 r/w 0 cmnbh common number register b area (h) 085ah b area (bit8) sc7 sc6 sc5 sc4 sc3 sc2 sc1 sc0 r/w 0 0 0 0 0 0 0 0 lsarcl start address register c area (l) 085ch start address for c area (bit7 to bit0) sc15 sc14 sc13 sc12 sc11 sc10 sc9 sc8 r/w 0 0 0 0 0 0 0 0 lsarcm start address register c area (m) 085dh start address for c area (bit15 to bit8) sc23 sc22 sc21 sc20 sc19 sc18 sc17 sc16 r/w 0 1 0 0 0 0 0 0 lsarch start address register c area (h) 085eh start address for c area (bit23 to bit16)
tmp92ca25 2007-02-28 92ca25-405 (7) touch screen i/f symbol name address 7 6 5 4 3 2 1 0 tsi7 ptst twien pyen pxen myen mxen r/w r r/w 0 0 0 0 0 0 0 tsicr0 touch screen i/f control register 0 01f0h 0: disable 1: enable detection condition 0: no touch 1: touch int4 interrupt control 0: disable 1: enable spy 0 : off 1 : on spx 0 : off 1 : on smy 0 : off 1 : on smx 0 : off 1 : on dbc7 db1024 db256 db64 db8 db4 db2 db1 r/w 0 0 0 0 0 0 0 0 1024 256 64 8 4 2 1 tsicr1 touch screen i/f control register 1 01f1h 0: disable 1: enable debounce time is set by the formula ?(n 64 ? 16)/f sys ? ? formula. ?n? is sum ofthe number of bits between bit6 and bit0 which is are set to ?1? (8) sdram controller symbol name address 7 6 5 4 3 2 1 0 ? ? smrd swrc sbst sbl1 sbl0 smac r/w 0 0 0 0 0 1 0 0 sdacr1 sdram access control register 1 0250h always write ?0? always write ?0? mode register set delay time write recovery time burst stop command select read burst length 00: reserved 01: full page read, burst write 10: 1 word read, single write 11: full page read single write 0: disable 1: enable sbs sdrs1 sdrs0 smuxw1 smuxw0 r/w 0 0 0 0 0 sdacr2 sdram access control register 2 0251h number of banks selecting row address size selecting address multiplex type ? ssae srs2 srs1 srs0 src r/w r/w 0 1 0 0 0 0 sdrcr sdram refresh control register 0252h always write ?0? sr auto exit function 0: disable 1: enable refresh interval 000: 47 states 100: 156 states 001: 78 states 101: 295 states 010: 97 states 110: 249 states 011: 124 states 111: 312 states auto refresh 0: disable 1: enable scmm2 scmm1 scmm0 r/w 0 0 0 sdcmm sdram command register 0253h issuing command
tmp92ca25 2007-02-28 92ca25-406 (9) 8-bit timer symbol name address 7 6 5 4 3 2 1 0 ta0rde i2ta01 ta01prun ta1run ta0run r/w r/w 0 0 0 0 0 tmra01 prescaler up counter (uc1) up counter (uc0) ta01run tmra01 run register 1100h double buffer 0: disable 1: enable idle2 0: stop 1: operate 0: stop and clear 1: run (count up) ? w ta0reg 8-bit timer register 0 1102h (prohibit rmw) undefined ? w ta1reg 8-bit timer register 1 1103h (prohibit rmw) undefined ta01m1 ta01m0 pwm01 pwm00 ta1clk1 ta1clk0 ta0clk1 ta0clk0 r/w 0 0 0 0 0 0 0 0 ta01mod tmra01 mode register 1104h operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra1 00: ta0trg 01: t1 10: t16 11: t256 source clock for tmra0 00: reserved 01: t1 10: t4 11: t16 ta1ffc1 ta1ffc0 ta1ffie ta1ffis w r/w 1 1 0 0 ta1ffcr tmra1 flip-flop control register 1105h (prohibit rmw) 00: invert ta1ff 01: set ta1ff 10: clear ta1ff 11: don?t care ta1ff control for inversion 0: disable 1: enable ta1ff inversion select 0: tmra0 1: tmra1 ta1rde i2ta23 ta23prun ta3run ta2run r/w r/w 0 0 0 0 0 tmra23 prescaler up counter (uc3) up counter (uc4) ta23run tmra23 run register 1108h double buffer 0: disable 1: enable idle2 0: stop 1: operate 0: stop and clear 1: run (count up) ? w ta2reg 8-bit timer register 2 110ah (prohibit rmw) undefined ? w ta3reg 8-bit timer register 3 110bh (prohibit rmw) undefined ta23m1 ta23m0 pwm21 pwm20 ta3clk1 ta3clk0 ta2clk1 ta2clk0 r/w 0 0 0 0 0 0 0 0 ta23mod tmra23 mode register 110ch operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit ppg mode 11: 8-bit pwm mode pwm cycle 00: reserved 01: 2 6 10: 2 7 11: 2 8 source clock for tmra3 00: ta2trg 01: t1 10: t16 11: t256 source clock for tmra2 00: reserved 01: t1 10: t4 11: t16 ta3ffc1 ta3ffc0 ta3ffie ta3ffis w r/w 1 1 0 0 ta3ffcr tmra3 flip-flop control register 110dh (prohibit rmw) 00: invert ta3ff 01: set ta3ff 10: clear ta3ff 11: don?t care ta3ff control for inversion 0: disable 1: enable ta3ff inversion select 0: tmra2 1: tmra3
tmp92ca25 2007-02-28 92ca25-407 (10) 16-bit timer symbol name address 7 6 5 4 3 2 1 0 tb0rde ? i2tb0 tb0prun tb0run r/w r/w r/w 0 0 0 0 0 tmrb0 prescaler up counter uc10 tb0run tmrb0 run register 1180h double buffer 0: disable 1: enable always write ?0? idle2 0: stop 1: operate 0: stop and clear 1: run (count up) ? ? tb0cp0i tb0cpm1 tb0cpm0 tb0cle tb0clk1 tb0clk0 r/w w * r/w 0 0 1 0 0 0 0 0 tb0mod tmrb0 mode register 1182h (prohibit rmw) always write ?00?. execute software capture 0: software capture 1: undefined capture timing 00: disable 01: reserved 10: reserved 11: ta1out ta1out control up counter 0: disable clearing 1: enable clearing tmrb0 source clock 00: reserved 01: t1 10: t4 11: t16 ? ? tb0ct1 tb0c0t1 tb0e1t1 tb0e0t1 tb0ff0c1 tb0ff0c0 w * r/w w * 1 1 0 0 0 0 1 1 tb0ff0 inversion trigger 0: disable trigger 1: enable trigger tb0ffcr tmrb0 flip-flop control register 1183h (prohibit rmw) always write ?11?. invert when the uc value is loaded into tb0cp1. invert when the uc value is loaded into tb0cp0. invert when the uc value matches the value in tb0rg1. invert when the uc value matches the value in tb0rg0. control tb0ff0 00: invert 01: set 10: clear 11: don?t care * always read as ?11? ? w tb0rg0l 16-bit timer register 0 low 1188h (prohibit rmw) undefined ? w tb0rg0h 16-bit timer register 0 high 1189h (prohibit rmw) undefined ? w tb0rg1l 16-bit timer register 1 low 118ah (prohibit rmw) undefined ? w tb0rg1h 16-bit timer register 1 high 118bh (prohibit rmw) undefined ? r tb0cp0l capture register 0 low 118ch undefined ? r tb0cp0h capture register 0 high 118dh undefined ? r tb0cp1l capture register 1 low 118eh undefined ? r tb0cp1h capture register 1 high 118fh undefined
tmp92ca25 2007-02-28 92ca25-408 (11) uart/serial channel symbol name address 7 6 5 4 3 2 1 0 rb7 tb7 rb6 tb6 rb5 tb5 rb4 tb4 rb3 tb3 rb2 tb2 rb1 tb1 rb0 tb0 r (receiving)/w (transmission) sc0buf serial channel 0 buffer register 1200h (prohibit rmw) undefined rb8 even pe oerr perr ferr sclks ioc r r/w r (clear 0 after reading) r/w undefined 0 0 0 0 0 0 0 1: error sc0cr serial channel 0 control register 1201h receive data bit8 parity 0: odd 1: even parity 0: disable 1: enable overrun parity framing 0: sclk0 1: sclk0 0: baud rate generator 1: sclk0 pin input tb8 ctse rxe wu sm1 sm0 sc1 sc0 r/w 0 0 0 0 0 0 0 0 sc0mod0 serial channel 0 mode 0 register 1202h trans- mission data bit8 0: cts disable 1: cts enable 0: receive disable 1: receive enable wake-up 0: disable 1: enable 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode 00: ta0trg 01: baud rate generator 10: internal clock f io 11: external clock (sclk0 input) ? br0adde br0ck1 br0ck0 br0s3 br0s2 br0s1 br0s0 r/w 0 0 0 0 0 0 0 0 br0cr serial channel 0 baud rate control register 1203h always write ?0? (16-k)/16 divided 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 set the frequency divisor ?n? (0 to f) br0k3 br0k2 br0k1 br0k0 r/w 0 0 0 0 br0add serial channel 0 k setting register 1204h set the frequency divisor ?k? (1 to f) i2s0 fdpx0 r/w 0 0 sc0mod1 serial channel 0 mode 1 register 1205h idle2 0: stop 1: operate i/o interface mode 0: half duplex 1: full duplex plsel rxsel txen rxen sirwd3 sirwd2 sirwd1 sirwd0 r/w 0 0 0 0 0 0 0 0 sircr irda control register 1207h select transmit pulse width 0: 3/16 1: 1/16 receive data 0: ?h? pulse 1: ?l? pulse transmit 0: disable 1: enable receive 0: disable 1: enable select receive pulse width set effective pulse width for equal or more than 2x (value + 1) + 100ns can be set: 1 to 14 can not be set: 0,15
tmp92ca25 2007-02-28 92ca25-409 (12) serial bus interface (sbi) symbol name address 7 6 5 4 3 2 1 0 bc2 bc1 bc0 ack sck2 sck1 sck0/ swrmon w r/w w r/w 0 0 0 0 0 0 0/1 sbi0cr1 serial bus interface 0 control register 1 1240h (i 2 c mode) (prohibit rmw) number of transfer bits 000: 8 001: 1 010: 2 011: 3 100: 4 101: 5 110: 6 111: 7 acknowle -dge mode 0: disable 1: enable setting for the devisor value ?n? 000: 5 001: 6 010: 7 011: 8 100: 9 101: 10 110: 11 111: reserved db7 db6 db5 db4 db3 db2 db1 db0 r (receiving )/w (transmission) sbi0dbr serial bus interface buffer register 1241h (prohibit rmw) undefined sa6 sa5 sa4 sa3 sa2 sa1 sa0 als w 0 0 0 0 0 0 0 0 i2c0ar i2cbus0 address register 1242h (prohibit rmw) slave address setting address recognition 0: disable 1: enable mst trx bb pin sbim1 sbim0 swrst1 swrst0 w 0 0 0 1 0 0 0 0 sbi0cr2 serial bus interface interface control register 2 1243h (i 2 c mode) (prohibit rmw) 0: slave 1: master 0: receiver 1: transmit start/stop condition generation 0: stop condition 1: start condition (case of mst, trx, pin are ?1?) intsbi interrupt monitor 0: request 1: cancel sbi operation mode selection 00: port mode 01: reserved 10: i 2 c mode 11: reserved software reset generate write ?10? and ?01?, then an internal reset signal is generated. mst trx bb pin al aas ad0 lrb r 0 0 0 1 0 0 0 0 sbi0sr serial bus interface status register 1243h (i 2 c mode) (prohibit rmw) 0: slave 1: master 0: receiver 1: transmit bus status monitor 0:free 1:busy intsbi interrupt 0: request 1: cancel arbitration lost detection monitor 0: ? 1: detected slave address match detection monitor 0: undetected 1: detected general call detection monitor 0: undetected 1: detected last received bit monitor 0: 0 1: 1 ? i2sbi0 w r/w 0 0 sbi0br0 serial bus interface baud rate register 0 1244h (prohibit rmw) always write ?0? idle2 0: stop 1: run p4en ? w 0 0 sbi0br1 serial bus interface baud rate register 1 1245h (prohibit rmw) internal clock 0: stop 1: run always write ?0?
tmp92ca25 2007-02-28 92ca25-410 (13)spi controller (1/4) symbol name address 7 6 5 4 3 2 1 0 xen clksel2 clksel1 clksel0 r/w r/w 0 1 0 0 baud rate selection 0820h sysck 0: disable 1: enable 000: f sys 001: f sys /2 010: f sys /4 011: f sys /8 100: f sys /16 101: f sys /32 110: f sys /64 111: reserved loopback msb1st dostat tcpol rcpol tdinv rdinv r/w r/w 0 1 1 0 0 0 0 spimd spi mode setting register 0821h loopback test mode 0: disable 1: enable start bit for transmit 0: lsb 1: msb spdo pin (no transmit) 0: fixed to ?0? 1: fixed to ?1? synchronous clock edge during transmitting 0: falling 1: rising synchronous clock edge during receiving 0: falling 1: rising invert data during transmitting 0: disable 1: enable invert data during receiving 0: disable 1: enable cen spcs_b unit16 algnen rxwen rxuen r/w r/w 0 1 0 0 0 0 0822h communic ation control 0: disable 1: enable spcs pin 0: output ?0? 1:output ?1? data length 0: 8bit 1: 16bit full duplex a lignment 0: disable 1: enable sequential receive 0: disable 1: enable receive unit 0: disable 1: enable crc16_7_b crcrx_tx_b crcreset_b dmaerfw dmaerfr r/w r/w 0 0 0 0 0 spict spi control register 0823h crc selection 0: crc7 1: crc16 crc data 0: transmit 1: receive crc calculation register 0:reset 1:relese reset micro dma 0: disable 1: enable micro dma 0: disable 1: enable tend rend rfw rfr r 1 0 1 0 0824h receiving 0: operation 1: no operation receive shift t register 0: no data 1: exist data transmit buffer 0: exist un-transmit ted data 1: no un-transmit ted data receive buffer 0: no valid data 1: exist valid data spist spi status register 0825h
tmp92ca25 2007-02-28 92ca25-411 (13)spi controller (2/4) symbol name address 7 6 5 4 3 2 1 0 crcd7 crcd6 crcd5 crcd4 crcd3 crcd2 crcd1 crcd0 r 0 0 0 0 0 0 0 0 0826h crc calculation result load register [7:0] crcd15 crcd14 crcd13 crcd12 crcd11 crcd10 crcd9 crcd8 r 0 0 0 0 0 0 0 0 spicr spi crc register 0827h crc calculation result load register [15:8] tendis rendis rfwis rfris r/w 0 0 0 0 0828h read 0:no interrupt 1:interrupt write 0:don?t care 1:clear read 0:no interrupt 1:interrupt write 0:don?t care 1:clear read 0:no interrupt 1:interrupt write 0:don?t care 1:clear read 0:no interrupt 1:interrupt write 0:don?t care 1:clear spiis spi interrupt status register 0829h tendwe rendwe rfwwe rfrwe r 0 0 0 0 082ah clear spiis 0: disable 1: enable clear spiis 0: disable 1: enable clear spiis 0: disable 1: enable clear spiis 0: disable 1: enable spiwe spi interrupt status write enable register 082bh
tmp92ca25 2007-02-28 92ca25-412 (13) spi controller (3/4) symbol name address 7 6 5 4 3 2 1 0 tendie rendie rfwie rfrie r/w 0 0 0 0 082ch tend interrupt 0: disable 1: enable rend interrupt 0: disable 1: enable rfw interrupt 0: disable 1: enable rfr interrupt 0: disable 1: enable spiie spi interrupt enable register 082dh tendir rendir rfwir rfrir r 0 0 0 0 082eh tend interrupt 0: none 1: generate rend interrupt 0: none 1: generate rfw interrupt 0: none 1: generate rfr interrupt 0: none 1: generate spiir spi interrupt request register 082fh txd7 txd6 txd5 txd4 txd3 txd2 txd1 txd0 r/w 0 0 0 0 0 0 0 0 0830h transmission data register [7:0] txd15 txd14 txd13 txd12 txd11 txd10 txd9 txd8 r/w 0 0 0 0 0 0 0 0 spitd spi transmissio n data register 0831h transmission data register [15:8]
tmp92ca25 2007-02-28 92ca25-413 (13) spi controller (4/4) symbol name address 7 6 5 4 3 2 1 0 rxd7 rxd6 rxd5 rxd4 rxd3 rxd2 rxd1 rxd0 r 0 0 0 0 0 0 0 0 0832h receive data register [7:0] rxd15 rxd14 rxd13 rxd12 rxd11 rxd10 rxd9 rxd8 r 0 0 0 0 0 0 0 0 spird spi receive register 0833h receive data register [15:8] tsd7 tsd6 tsd5 tsd4 tsd3 tsd2 tsd1 tsd0 r 0 0 0 0 0 0 0 0 0834h transmission data shift register [7:0] tsd15 tsd14 tsd13 tsd12 tsd11 tsd10 tsd9 tsd8 r 0 0 0 0 0 0 0 0 spits spi transmission data shift register 0835h transmission data register [15:8] rsd7 rsd6 rsd5 rsd4 rsd3 rsd2 rsd1 rsd0 r 0 0 0 0 0 0 0 0 0836h rsd15 rsd14 rsd13 rsd12 rsd11 rsd10 rsd9 rsd8 r/w 0 0 0 0 0 0 0 0 spirs spi receive data register 0837h
tmp92ca25 2007-02-28 92ca25-414 (14) ad converter (1/2) symbol name address 7 6 5 4 3 2 1 0 eocf adbf ? ? itm0 repeat scan ads r r/w 0 0 0 0 0 0 0 0 admod0 ad mode control register 0 12b8h ad conversion end flag 1:end ad conversion busy flag 1: busy always write ?0? always write ?0? 0: every 1 time 1: every 4 times repeat mode 0: single mode 1: repeat mode scan mode 0: fixed channel mode 1: channel scan mode ad conversion start 1: start always read as ?0? vrefon i2ad ? ? ? ? adch1 adch0 r/w r/w r/w 0 0 0 0 0 0 0 0 admod1 ad mode control register 1 12b9h ladder resistance 0: off 1: on idle2 0: stop 1: operate always write ?0? always write ?0? always write ?0? always write ?0? input channel 000: an0 001: an1 010: an2 011: an3 ? ? ? ? ? ? ? adtrg r/w 0 0 0 0 0 0 0 0 admod2 ad mode control register 1 12bah always write ?0? always write ?0? always write ?0? always write ?0? always write ?0? always write ?0? always write ?0? ad external trigger start control 0: disable 1: enable adr01 adr00 adr0rf r r adreg0l ad result register 0 low 12a0h undefined 0 adr09 adr08 adr07 adr06 adr05 adr04 adr03 adr02 r adreg0h ad result register 0 high 12a1h undefined adr11 adr10 adr1rf r r adreg1l ad result register 1 low 12a2h undefined 0 adr19 adr18 adr17 adr16 adr15 adr14 adr13 adr12 r adreg1h ad result register 1 high 12a3h undefined adr21 adr20 adr2rf r r adreg2l ad result register 2 low 12a4h undefined 0 adr29 adr28 adr27 adr26 adr25 adr24 adr23 adr22 r adreg2h ad result register 2 high 12a5h undefined adr31 adr30 adr3rf r r adreg3l ad result register 3 low 12a6h undefined 0 adr39 adr38 adr37 adr36 adr35 adr34 adr33 adr32 r adreg3h ad result register 3 high 12a7h undefined
tmp92ca25 2007-02-28 92ca25-415 (15) watchdog timer symbol name address 7 6 5 4 3 2 1 0 wdte wdtp1 wdtp0 ? i2wdt rescr ? r/w r/w 1 0 0 0 0 0 0 wdmod wdt mode register 1300h wdt control 1: enable select detecting time 00: 2 15 /f io 01: 2 17 /f io 10: 2 19 /f io 11: 2 21 /f io always write ?0? idle2 0: stop 1: operate 1: internally connects wdt out to the reset pin always write ?0? ? w ? wdcr wdt control register 1301h (prohibit rmw) b1h: wdt disable code 4e: wdt clear code
tmp92ca25 2007-02-28 92ca25-416 (16) rtc (real time clock) symbol name address 7 6 5 4 3 2 1 0 se6 se5 se4 se3 se2 se1 se0 r/w undefined secr second register 1320h ?0? is read 40 sec. 20 sec. 10 sec. 8 sec. 4 sec. 2 sec. 1 sec. mi6 mi5 mi4 mi3 mi2 mi1 mi0 r/w undefined minr minute register 1321h ?0? is read 40 min. 20 min. 10 min. 8 min. 4 min. 2 min. 1 min. ho5 ho4 ho3 ho2 ho1 ho0 r/w undefined hourr hour register 1322h ?0? is read 20 hours (pm/am) 10 hours 8 hours 4 hours 2 hours 1 hour we2 we1 we0 r/w undefined dayr day register 1323h ?0? is read w2 w1 w0 da5 da4 da3 da2 da1 da0 r/w undefined dater date register 1324h ?0? is read 20 days 10 days 8 days 4 days 2 days 1 day mo4 mo3 mo2 mo1 mo0 r/w 1325h undefined page0 ?0? is read 10 month 8 month 4 month 2 month 1 month monthr month register page1 ?0? is read 0: indicator for 12 hours 1: indicator for 24 hours ye7 ye6 ye5 ye4 ye3 ye2 ye1 ye0 r/w 1326h undefined page0 80 years 40 years 20 years 10 years 8 years 4 years 2 years 1 year yearr year register page1 ?0? is read leap year setting 00: leap year 01: one year after 10: two years after 11: three years after intena adjust enatmr enaalm page r/w w r/w r/w 0 undefined undefined undefined pager page register 1327h (prohibit rmw) intrtc 0: disable 1: enable ?0? is read 0: don?t care 1: adjust clock enable alarm / enable ?0? is read page setting dis1hz dis16hz rsttmr rstalm ? ? ? ? w undefined restr reset register 1328h (prohibit rmw) 1hz 0: enable 1: disable 16hz 0: enable 1: disable 1: reset clock 1: reset alarm always write ?0?
tmp92ca25 2007-02-28 92ca25-417 (17) melody/alarm generator symbol name address 7 6 5 4 3 2 1 0 al8 al7 al6 al5 al4 al3 al2 al1 r/w 0 0 0 0 0 0 0 0 alm alarm pattern register 1330h alarm pattern set fc1 fc0 alminv ? ? ? ? melalm r/w 0 0 0 0 0 0 0 0 melalmc melody/ alarm control register 1331h free run counter control 00: hold 01: restart 10: clear 11: clear and start alarm frequency invert 1: invert always write ?0? output frequency 0: alarm 1: melody ml7 ml6 ml5 ml4 ml3 ml2 ml1 ml0 r/w 0 0 0 0 0 0 0 0 melfl melody frequency l-register 1332h melody frequency set (low 8bit) melon ml11 ml10 ml9 ml8 r/w r/w 0 0 0 0 0 melfh melody frequency h-register 1333h melody counter control 0: stop and clear 1: start melody frequency set (upper 4 bits) ? ialm4e ialm3e ialm2e ialm1e ialm0e r/w 0 0 0 0 0 0 almint alarm interrupt enable register 1334h always write ?0? intalm4 to intalm0 alarm interrupt enable
tmp92ca25 2007-02-28 92ca25-418 (18) nand flash controller (1/2) symbol name address 7 6 5 4 3 2 1 0 d7 d6 d5 d4 d3 d2 d1 d0 r/w undefined nd0fdtr nand flash data transfer register 1d00h data window to read/write nand flash we ecc1 ecc0 ce pcnt1 pcnt0 ale cle r/w 0 0 0 0 0 0 0 0 nd0fmcr nand flash mode control register 1cc4h 0: disable write operation 1: enable write operation ecc circuit 11 (at = x): reset 00 (at = 1): disable 01 (at = 1): enable 10 (at = 1): read ecc data calculated by ndfc 10 (at = 0): read id data chip enable 0: disable ( ndce is high) 1: enable ( ndce is low) power control always write ?11? address latch enable 0: low 1: high command latch enable 0: low 1: high busy r undefined nd0fsr nand flash status register 1cc8h 0: ready 1: busy rdy r/w 0 nd0fisr nand flash interrupt status register 1ccch read: 0: none 1: change ndr/ b signal from busy to ready. write: 0: no change 1: clear to ?0? inten mrdy r/w r/w 0 0 nd0fimr nand flash interrupt mask register 1cd0h 0: disable 1: enable mask for rdy spw3 spw2 spw1 spw0 r/w 0 0 0 0 nd0fspr nand flash strobe pulse width register 1cd4h pulse width for ndre , ndwe = f sys (this register?s value + 1) rst r/w 0 nd0frstr nand flash reset register 1cd8h reset controller chsel r/w 0 ndcr nand flash control register 01c0h channel selection 0: channel 0 1: channel 1 d7 d6 d5 d4 d3 d2 d1 d0 r nd0eccrd nand flash ecc code register 1cb0h data window to read ecc code
tmp92ca25 2007-02-28 92ca25-419 (17) nand flash controller (2/2) symbol name address 7 6 5 4 3 2 1 0 d7 d6 d5 d4 d3 d2 d1 d0 r/w undefined nd1fdtr nand flash data transfer register 1d00h data window to read/write nand flash we ecc1 ecc0 ce pcnt1 pcnt0 ale cle r/w 0 0 0 0 0 0 0 0 nd1fmcr nand flash mode control register 1ce4h 0: disable write operation 1: enable write operation ecc circuit 11 (at = x): reset 00 (at = 1): disable 01 (at = 1): enable 10 (at = 1): read ecc data calculated by ndfc 10 (at = 0): read id data chip enable 0: disable ( ndce is high) 1: enable ( ndce is low) power control always write ?11? address latch enable 0: low 1: high command latch enable 0: low 1: high busy r undefined nd1fsr nand flash status register 1ce8h 0: ready 1: busy rdy r/w 0 nd1fisr nand flash interrupt status register 1cech read: 0: none 1: change ndr/ b signal from busy to ready. write: 0: no change 1: clear to ?0? inten mrdy r/w r/w 0 0 nd1fimr nand flash interrupt mask register 1cf0h 0: disable 1: enable mask for rdy spw3 spw2 spw1 spw0 r/w 0 0 0 0 nd1fspr nand flash strobe pulse width register 1cf4h pulse width for ndre , ndwe = f sys (this register?s value + 1) rst r/w 0 nd1frstr nand flash reset register 1cf8h reset controller d7 d6 d5 d4 d3 d2 d1 d0 r nd1eccrd nand flash ecc code register 1cb0h data window to read ecc code
tmp92ca25 2007-02-28 92ca25-420 (19) i 2 s symbol name address 7 6 5 4 3 2 1 0 r15/r7 r14/r6 r13/r5 r12/r4 r11/r3 r10/r2 r9/r1 r8/r0 w undefined i2sbufr i 2 s fifo buffer (r) 0800h (prohibit rmw) register for transmitting buffer (fifo) (right channel) l15/l7 l14/l6 l13/l5 l12/l4 l11/l3 l10/l2 l9/l1 l8/l0 w undefined i2sbufl i 2 s fifo buffer (l) 0808h (prohibit rmw) register for transmitting buffe r (fifo) (left channel) txe fmt busy dir bit mck1 mck0 i2swck r/w r r/w 0 0 0 0 0 0 0 0 080eh transmit 0: stop 1: start mode 0: i 2 s 1: sio status 0: stop 1: under transmitting first bit 0: msb 1: lsb bit number 0: 8 bits 1: 16 bits baud rate 00: f sys 10: f sys /4 01: f sys /2 11: f sys /8 ws clock 0: fs/4 1: ta1out i2swlvl edge i2sfsel i2scke syscke r/w r/w 0 0 0 0 0 i2sctl0 i 2 s control register 0 080fh ws level 0: low left 1: high left clock edge 0: falling 1: rising select for stereo 0: stereo (2 channel) 1: monaural (1 channel) clock enable (after transmit) 0: operation 1: stop system clock 0: disable 1: enable
tmp92ca25 2007-02-28 92ca25-421 6. notes and restrictions 6.1 notation (1) the notation for built-in i/o registers is as follows: register symbol example: ta01run denotes bit ta0run of register ta01run. (2) read-modify-write instructions (rmw) an instruction in which the cpu reads data from memory and writes the data to the same memory location in one instruction. example 1: set 3, (ta01run ); set bit3 of ta01run. example 2: inc 1, (100h); increment the data at 100h. ? examples of read-modify-write instructions on the tlcs-900 exchange instruction ex (mem), r arithmetic operations add (mem), r/# adc (mem), r/# sub (mem), r/# sbc (mem), r/# inc #3, (mem) dec #3, (mem) logic operations and (mem), r/# or (mem), r/# xor (mem), r/# bit manipulation operations stcf #3/a, (mem) res #3, (mem) set #3, (mem) chg #3, (mem) tset #3, (mem) rotate and shift operations rlc (mem) rrc (mem) rl (mem) rr (mem) sla (mem) sra (mem) sll (mem) srl (mem) rld (mem) rrd (mem) (3) f osch , fc, f fph , f sys , f io and one state the clock frequency input on pins x1 and 2 is referred to as f osch . the clock selected by pllcr0 is referred as fc. the clock selected by syscr1 is refer to as f fph . the clock frequency give by f fph divided by 2 is referred to as system clock f sys . the clock frequency give by f sys divided by 2 is referred to as f io . one cycle of f sys is referred to as one state.
tmp92ca25 2007-02-28 92ca25-422 6.2 notes (1) am0 and am1 pins these pins are connected to the v cc (power supply level) or the v ss (grand level) pin. do not alter the level when the pin is active. (2) reserved address areas the 16 bytes area (fffff0h ffffffh) cannot be used since it is reserved for use as internal area. if using an emulator, an optional 64 kbytes of the 16m bytes area is used for emulator control. therefore, if using an emulator, this area cannot be used. (3) standby mode (idle1) when the halt instruction is executed in idle1 mode (in which only the oscillator operates), the internal rtc (real-time-clock) and mld (melody-alarm-generator) operate. when necessity, stop the circuit before the halt instruction is executed. (4) warm-up counter the warm-up counter operates when stop mode is released, even if the system is using an external oscillator. as a result, a time eq uivalent to the warm-up time elapses between input of the release request and output of the system clock. (5) watchdog timer the watchdog timer starts operation immediat ely after a reset is released. disable the watchdog timer when is not to be used. (6) ad converter the string resistor between the vrefh and v refl pins can be cut by program so as to reduce power consumption. when stop mode is used, disable the resistor using the program before the halt instruction is executed. (7) cpu (micro dma) only the ?ldc cr, r? and ?ldc r, cr? inst ructions can be used to access the control registers in the cpu. (e.g., the transf er source address register (dmasn).) (8) undefined sfr the value of an undefined bit in an sfr is undefined when read. (9) pop sr instruction please execute the pop sr instruction during di condition.
tmp92ca25 2007-02-28 92ca25-423 7. package dimensions package name: p-lqfp144-1616-0.40c unit: mm note: palladium plating
tmp92ca25 2007-02-28 92ca25-424


▲Up To Search▲   

 
Price & Availability of JTMP92CA25

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