|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
toshiba original cmos 16-bit microcontroller tlcs-900/h1 series TMP92C820FG 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?. especially, take care below cautions. ** caution ** how to release the halt mode usually, interrupts can release all halts status. however, the interrupts = (int0 to int3, intkey, intrtc, intalm0 to intalm4), which can release the halt mode may not be able to do so if they are input during t he period cpu is shifting to the halt mode (for about 3 clocks of f fph ) with idle1 or stop mode (idle2 is not applicable to this case). (in this case, an interrupt request is kept on hold internally.) if another interrupt is generated after it has shifted to halt mode completely, halt status can be released without difficultly. the priority of this interrupt is compare with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first fo llowed by the other interrupt. tmp92c820 2007-02-16 92c820-1 cmos 32-bit microcontrollers TMP92C820FG/jtmp92c820 1. outline and device characteristics tmp92c820 is high-speed advanced 32-bit micro controller developed for controlling equipment which processes mass data. tmp92c820 is a microcontroller which has a high -performance cpu (900/h1 cpu) and various built-in i/os. TMP92C820FG is housed in a 144-pin flat package. jtmp92c820 is a 144-pad chip product. device characteristics are as follows: (1) cpu: 32-bit cpu (900/h1 cpu) ? compatible with tlcs-900, 900/l, 900/l1, 900/h?s 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 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 tmp92c820 2007-02-16 92c820-2 (3) internal memory ? internal ram: 8 kbytes (can use for code section) ? internal rom: none (4) external memory expansion ? expandable up to 136 mbytes (shared with program/data area) ? can simultaneously support 8-/16-/32-bit width external data bus .... dynamic data bus sizing ? separate bus system (5) memory controller ? chip select outputs: 4 channels (6) 8-bit timers: 4 channels (7) 16-bit timer/event counter: 1 channel (8) general-purpose serial interface: 3 channels ? uart/synchronous mode ? irda (9) serial bus interface: 1 channel ? i 2 c bus mode ? clock synchronous select mode (10) lcd controller ? shift register/built-in ram lcd driver ? supported 16, 8 and 4 gray-levels and black and white ? hardware blinking cursor (11) sdram controller ? supported 16-m, 64-m and 128-mbit sdram with 16-/32-bit data bus (12) timer for real-time clock (rtc) ? based on tc8521a ? separate the power supply (13) key-on wakeup (interrupt key input) (14) 10-bit ad converter: 5 channels (15) watchdog timer (16) melody/alarm generator ? melody: output of clock 4 to 5461 hz ? alarm: output of the 8 kinds of alarm pattern ? output of the 5 kinds of interval interrupt (17) mmu ? expandable up to 136 mbytes (4 local areas/8 bank methods) (18) interrupts: 45 interrupts ? 9 cpu interrupts: software interrupt instruction and illegal instruction ? 31 internal interrupts: seven selectable priority levels ? 5 external interrupts: seven selectable priority levels (4-edge selectable) tmp92c820 2007-02-16 92c820-3 (19) input/output ports: 83 pins (except data bus (16bit), address bus (24bit) and rd pin) (20) standby function ? three halt modes: idle2 (programmable), idle1, stop (21) triple-clock controller ? clock gear function: select a high-frequency clock fc to fc/16 ? rtc (fs = 32.768 khz) (22) operating voltage ? dvcc = 3.0 to 3.6 v ? rtcvcc = 2.0 to 3.6 v (23) package ? 144-pin qfp (p-lqfp144-1616-0.40c) ? chip form supply also available. for de tails, contact your local toshiba sales representative tmp92c820 2007-02-16 92c820-4 figure 1.1 tmp92c820 block diagram ix iy iz sp l h e d c b a w xsp xiz xi y xix xhl xde xbc xwa 900/h1 cpu f sr 32 bits pc 8-kbyte ram serial i/o sio0 (txd0) pf0 (rxd0) pf1 (sclk0/ cts0 ) pf2 (txd1) pf3 (rxd1) pf4 (sclk1/ cts1 ) pf5 ( cs2g /txd2) p95 ( csexa rxd2) p96 (sck) p90 (so/sda) p91 (si/scl) p92 serial i/o sio1 dvss [4] dvcc [3] x1 x2 xt1 xt2 h-osc mode controller port 0 10-bit 5-channel ad converter pg0 to pg4 (an0 to an4) ( adtrg ) pg3 avcc avss vrefh vrefl port 9 ( cs2e ) p93 ( cs2f ) p94 8-bit timer (timer 1) 8-bit timer (timer 2) (ta0in) pc0 8-bit timer (timer 3) 16-bit timer (ta3out/int2) pc5 (tb0out0/int3) pc6 (ta1out/int1) pc1 serial bus i/f sbi0 interrupt controller d0 to d7 p10 to p17 (d8 to d15) p20 to p27 (d16 to d23) p30 to p37 (d24 to d31) p40 to p47 (a0 to a7) p50 to p57 (a8 to a15) p60 to p67 (a16 to a23) p70 ( rd ) p71 ( wrll ) p72 ( wrlu ) p73 ( wrul ) p74 ( wruu ) p75 (r/ w ) p76 ( wait ) p80 ( cs0 / sdcsh ) p81 ( cs1 / sdcsl ) p82 ( cs2 / cs2a ) p83 ( cs3 ) p84 ( cs2b /ea24) p85 ( cs2c /ea25) p86 ( cs2d ) watchdog timer (d1bscp) pk0 (d2blp) pk1 (d3bfr) pk2 (dlebcd) pk3 (doffb) pk4 pl0 to pl7 (ld0 to ld7) ( sdras ) pj0 ( sdcas ) pj1 ( srwr / sdwe ) pj2 ( srllb /sdlldom) pj3 ( srlub /sdludom) pj4 ( srulb /sduldom) pj5 ( sruub /sduudom) pj6 (sdcke) pj7 (sdclk) p87 keyboard i/f pa0 to pa7 (ki0 to ki7) rtcvcc xt1/xt2/ be ( alarm / mldalm /pk6) rtc port 8 reset a m0 a m1 pc3 (int0) serial i/o sio2 sdram controller lcd controller 8-bit timer (timer 0) mmu clock gear l-osc port 1 port 2 port 3 port 4 port 5 port 6 port 7 melody/ alarm out tmp92c820 2007-02-16 92c820-5 2. pin assignment and functions the assignment of input/output pins for the tmp92c820, their names and functions are as follows: 2.1 pin assignment 0h figure 2.1.1 shows the pin assignment of the TMP92C820FG. figure 2.1.1 pin assignment diagram (144-pin qfp) TMP92C820FG qfp144 top view p67/a23 p66/a22 p65/a21 p64/a20 dvcc3 p63/a19 p62/a18 p61/a17 p60/a16 p57/a15 p56/a14 p55/a13 a 54/a12 p53/a11 p52/a10 p51/a9 p50/a8 p47/a7 p46/a6 p45/a5 p44/a4 p43/a3 p42/a2 p41/a1 p40/a0 p37/d31 p36/d30 dvss3 p35/d29 p34/d28 p33/d27 p32/d26 p31/d25 p30/d24 p27/d23 p26/d22 vrefl vrefh pg0/an0 pg1/an1 pg2/an2 pg3/an3/ adtrg pg4/an4 pa3/ki3 pa4/ki4 pa5/ki5 pa6/ki6 pa7/ai7 pc0/ta0in pc1/ta1out/int1 pc5/ta3out/int2 pc6/tb0out0/int3 pf0/txd0 pf1/rxd0 pf2/sclk0/ cts0 pf3/txd1 pf4/rxd1 pf5/sclk1/ cts1 pl0/ld0 pl1/ld1 pl2/ld2 pl3/ld3 pl4/ld4 pl5/ld5 pl6/ld6 pl7/ld7 pk0/d1bscp pk1/d2blp pk2/d3bfr pk3/dlebcd pk4/doffb pk6/ alarm / mldalm rtcvcc xt1 xt2 be dvcc1 x1 dvss1 x2 am0 am1 reset pc3/int0 dvss2 dvcc2 p00/d0 p01/d1 p02/d2 p03/d3 p04/d4 p05/d5 p06/d6 p07/d7 p10/d8 p11/d9 p12/d10 p13/d11 p14/d12 p15/d13 p16/d14 p17/d15 p20/d16 p21/d17 p22/d18 p23/d19 p24/d20 p2 5/ d21 a vcc a vss pa2/ki2 pa1/ki1 pa0/ki0 pj7/sdcke pj6/sduudqm/ sruub pj5/sduldqm/ srulb pj4/sdludqm/ srlub pj3/sdlldqm/ srllb pj2/ sdwe / srwr pj1/ sdcas pj0/ sdras p96/ csexa /rxd2 p95/ cs2g /txd2 p94/ cs2f p93/ cs2e p92/si/scl p91/so/sd a p90/sck p87/sdclk p86/ cs2d p85/ea25/ cs2c p84/ea24/ cs2b p83/ cs3 p82/ cs2 / cs2a p81/ cs1 / sdcsl dvss4 p80/ cs0 / sdcsh p76/ wait p75/rw p74/ wruu p73/ wrul p72/ wrlu p71/ wrll p7 0/ 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 tmp92c820 2007-02-16 92c820-6 2.2 pad layout table 2.2.1 pad layout (144-pin chip) (chip size 4.68 mm 4.68 mm) 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 ? 2213 1945 49 dvss2 ? 440 ? 2213 97 p55 2211 685 2 vrefh ? 2213 1820 50 dvcc2 ? 340 ? 2213 98 p56 2211 789 3 pg0 ? 2213 1694 51 p00 ? 240 ? 2213 99 p57 2211 894 4 pg1 ? 2213 1568 52 p01 ? 140 ? 2213 100 p60 2211 1000 5 pg2 ? 2213 1460 53 p02 ? 40 ? 2213 101 p61 2211 1107 6 pg3 ? 2213 1353 54 p03 59 ? 2213 102 p62 2211 1213 7 pg4 ? 2213 1249 55 p04 160 ? 2213 103 p63 2211 1321 8 pa3 ? 2213 1050 56 p05 260 ? 2213 104 dvcc3 2211 1430 9 pa4 ? 2213 946 57 p06 360 ? 2213 105 p64 2211 1546 10 pa5 ? 2213 842 58 p07 460 ? 2213 106 p65 2211 1672 11 pa6 ? 2213 739 59 p10 561 ? 2213 107 p66 2211 1798 12 pa7 ? 2213 635 60 p11 661 ? 2213 108 p67 2211 1924 13 pc0 ? 2213 531 61 p12 761 ? 2213 109 p70 1925 2211 14 pc1 ? 2213 427 62 p13 861 ? 2213 110 p71 1800 2211 15 pc5 ? 2213 326 63 p14 961 ? 2213 111 p72 1675 2211 16 pc6 ? 2213 224 64 p15 1062 ? 2213 112 p73 1558 2211 17 pf0 ? 2213 123 65 p16 1162 ? 2213 113 p74 1448 2211 18 pf1 ? 2213 23 66 p17 1263 ? 2213 114 p75 1346 2211 19 pf2 ? 2213 ? 77 67 p20 1363 ? 2213 115 p76 1243 2211 20 pf3 ? 2213 ? 179 68 p21 1474 ? 2213 116 p80 1141 2211 21 pf4 ? 2213 ? 284 69 p22 1589 ? 2213 117 dvss4 1038 2211 22 pf5 ? 2213 ? 388 70 p23 1702 ? 2213 118 p81 937 2211 23 pl0 ? 2213 ? 493 71 p24 1814 ? 2213 119 p82 835 2211 24 pl1 ? 2213 ? 598 72 p25 1926 ? 2213 120 p83 734 2211 25 pl2 ? 2213 ? 704 73 p26 2211 ? 1924 121 p84 633 2211 26 pl3 ? 2213 ? 809 74 p27 2211 ? 1799 122 p85 532 2211 27 pl4 ? 2213 ? 914 75 p30 2211 ? 1674 123 p86 431 2211 28 pl5 ? 2213 ? 1024 76 p31 2211 ? 1548 124 p87 330 2211 29 pl6 ? 2213 ? 1132 77 p32 2211 ? 1426 125 p90 229 2211 30 pl7 ? 2213 ? 1243 78 p33 2211 ? 1311 126 p91 128 2211 31 pk0 ? 2213 ? 1354 79 p34 2211 ? 1199 127 p92 28 2211 32 pk1 ? 2213 ? 1464 80 p35 2211 ? 1087 128 p93 ? 72 2211 33 pk2 ? 2213 ? 1576 81 dvss3 2211 ? 975 129 p94 ? 173 2211 34 pk3 ? 2213 ? 1701 82 p36 2211 ? 864 130 p95 ? 274 2211 35 pk4 ? 2213 ? 1826 83 p37 2211 ? 757 131 p96 ? 375 2211 36 pk6 ? 2213 ? 1953 84 p40 2211 ? 648 132 pj0 ? 477 2211 37 rtcvcc ? 1962 ? 2213 85 p41 2211 ? 541 133 pj1 ? 580 2211 38 xt1 ? 1851 ? 2213 86 p42 2211 ? 435 134 pj2 ? 684 2211 39 xt2 ? 1574 ? 2213 87 p43 2211 ? 332 135 pj3 ? 788 2211 40 be ? 1466 ? 2213 88 p44 2211 ? 228 136 pj4 ? 892 2211 41 dvcc1 ? 1360 ? 2213 89 p45 2211 ? 128 137 pj5 ? 996 2211 42 x1 ? 1257 ? 2213 90 p46 2211 ? 28 138 pj6 ? 1101 2211 43 dvss1 ? 1057 ? 2213 91 p47 2211 71 139 pj7 ? 1208 2211 44 x2 ? 957 ? 2213 92 p50 2211 171 140 pa0 ? 1319 2211 45 am0 ? 840 ? 2213 93 p51 2211 272 141 pa1 ? 1430 2211 46 am1 ? 740 ? 2213 94 p52 2211 374 142 pa2 ? 1555 2211 47 reset ? 640 ? 2213 95 p53 2211 477 143 avss ? 1828 2211 48 pc3 ? 540 ? 2213 96 p54 2211 581 144 avcc ? 1955 2211 tmp92c820 2007-02-16 92c820-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/3) pin names number of pins i/o functions 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. p20 to p27 d16 to d23 8 i/o i/o port 2: i/o port. input or output specifiable in units of bits. data: data bus 16 to 23. p30 to p37 d24 to d31 8 i/o i/o port 3: i/o port. input or output specifiable in units of bits. data: data bus 24 to 31. p40 to p47 a0 to a7 8 i/o output port 4: i/o port. input or output specifiable in units of bits. address: address bus 0 to 7. p50 to p57 a8 to a15 8 i/o output port 5: i/o port. input or output specifiable in units of bits. 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 port 70: output port read: outputs strobe signal to read external memory. p71 wrll 1 output output port 71: output port write: output strobe signal for writing data on pins d0 to d7. p72 wrlu 1 output output port 72: output port write: output strobe signal for writing data on pins d8 to d15. p73 wrul 1 output output port 73: output port write: output strobe signal for writing data on pins d16 to d23. p74 wruu 1 output output port 74: output port write: output strobe signal for writing data on pins d24 to d31. p75 r/ w 1 output output port 75: output port read/write: 1 represents read or dummy cycle; 0 represents write cycle. p76 wait 1 i/o input port 76: i/o port wait: signal used to request cpu bus wait. p80 cs0 sdcsh 1 output output output port 80: output port chip select 0: outputs ?low? when address is within specified address area. chip select for sdram: outputs ?0? when address is within sdram upper-address area. p81 cs1 sdcsl 1 output output output port 81: 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 lower-address area. p82 cs2 cs2a 1 output output output port 82: output port chip select 2: outputs ?low? when address is within specified address area. expand chip select 2a: outputs ?0? when ad dress is within specified address area. p83 cs3 1 output output port 83: output port chip select 3: outputs ?low? when address is within specified address area. p84 ea24 cs2b 1 output output output port 84: output port chip select 24: outputs ?0? when addre ss is within specified address area. expand chip select 2b: outputs ?0? when ad dress is within specified address area. p85 ea25 cs2c 1 output output output port 85: output port chip select 25: outputs ?0? when addre ss is within specified address area. expand chip select 2c: outputs ?0? when ad dress is within specified address area. p86 cs2d 1 output output port 86: output port expand chip select 2d: outputs ?0? when ad dress is within specified address area. p87 sdclk 1 output output port 87: output port clock for sdram tmp92c820 2007-02-16 92c820-8 table 2.3.1 pin names and functions (2/3) pin names number of pins i/o functions p90 sck 1 i/o i/o port 90: i/o port serial bus interface clock i/o data at sio mode. p91 so sda 1 i/o output i/o port 91: i/o port serial bus interface send data at sio mode. serial bus interface send/receive data at i 2 c mode. (open drain/output mode by programmable.) p92 si scl 1 i/o input i/o port 92: i/o port serial bus interface receive data at sio mode. serial bus interface clock i/o data at i 2 c mode. (open drain/output mode by programmable.) p93 cs2e 1 i/o output port 93: i/o port expand chip select 2e: outputs ?0? when ad dress is within specified address area. p94 cs2f 1 i/o output port 94: i/o port expand chip select 2f: outputs ?0? when ad dress is within specified address area. p95 cs2g txd2 1 i/o output output port 95: output port expand chip select 2g: outputs ?0? when ad dress is within specified address area. serial transmission data 2. open drain/output pin by programmable. p96 rxd2 csexa 1 i/o input output port 96: output port serial receive data 2. expand chip select exa: outputs ?0? when addr ess is within specified address area. pa0 to pa7 ki0 to ki7 8 input input a0 to a7 port: pin used to input ports. key input 0 to 7: pin used of key-on wakeup 0 to 7. (schmitt input, with pull-up resistor.) pc0 ta0in 1 i/o input port c0: i/o port 8-bit timer 0 input: timer 0 input. pc1 int1 ta1out 1 i/o input output port c1: i/o port interrupt request pin1 : interrupt request pin with programmable rising /falling edge. 8-bit timer 1 output: timer 1 output. pc3 int0 1 i/o input port c3: i/o port interrupt request pin 0: interrupt request pin with programmable level/rising/falling edge. pc5 int2 ta3out 1 i/o input output port c5: i/o port interrupt request pin 2 : interrupt request pin with programmable rising /falling edge. 8-bit timer 3 output: timer 3 output. pc6 int3 tb0out0 1 i/o input output port c6: i/o port interrupt request pin 3: interrupt request pin with programmable rising /falling edge. timer b0 output. pf0 txd0 1 i/o output port f0: i/o port serial 0 send data: open drain/output pin by programmable. pf1 rxd0 1 i/o input port f1: i/o port serial 0 receive data. pf2 sclk0 0 cts 1 i/o i/o input port f2: i/o port serial 0 clock i/o. serial 0 data send enable (clear to send). pf3 txd1 1 i/o output port f3: i/o port serial 1 send data: open drain/output pin by programmable. pf4 rxd1 1 i/o input port f4: i/o port serial 1 receive data. pf5 sclk1 1 cts 1 i/o i/o input port f5: i/o port serial 1 clock i/o. serial 1 data send enable (clear to send). pg0 to pg4 an0 to an4 adtrg 5 input input input port g0 to g4 port: pin used to input ports. analog input 0 to 4: pin used to input to ad conveter. ad trigger: signal used to request ad start (with used to pg3). tmp92c820 2007-02-16 92c820-9 table 2.3.1 pin names and functions (3/3) pin names number of pins i/o functions pj0 sdras 1 output output port j0: output port row address strobe for sdram: outputs ?0? when address is within sdram address area. pj1 sdcas 1 output output port j1: output port column address strobe for sdram: outputs ?0? when address is within sdram address area. 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 srllb 1 output output output port j3: output port data enable for sdram on pins d0 to d7. data enable for sram on pins d0 to d7. pj4 sdludqm srlub 1 output output output port j4: output port data enable for sdram on pins d8 to d15. data enable for sram on pins d8 to d15. pj5 sduldqm srulb 1 output output output port j5: output port data enable for sdram on pins d16 to d23. data enable for sram on pins d16 to d23. pj6 sduudqm sruub 1 output output output port j6: output port data enable for sdram on pins d24 to d32. data enable for sram on pins d24 to d32. pj7 sdcke 1 output output port j7: output port clock enable for sdram. pk0 d1bscp 1 output output port k0: output port lcd driver output pin. pk1 d2blp 1 output output port k1: output port lcd driver output pin. pk2 d3bfr 1 output output port k2: output port lcd driver output pin. pk3 dlebcd 1 output output port k3: output port lcd driver output pin. pk4 doffb 1 output output port k4: output port lcd driver output pin. pk6 alarm mldalm 1 output output output port k6: output port rtc alarm output pin. melody/alarm output pin (inverted). pl0 to pl7 ld0 to ld7 8 i/o output port l0 to l7: i/o port data bus for lcd driver. be 1 input backup enable. am0, am1 2 input operation mode: fix to am1 = ?0?, am0 = ?1?: 16-bit external bus or 8-/16-/32-bit dynamic sizing. fix to am1 = ?1?, am0 = ?0?: 32-bit external bus or 8-/16-/32-bit dynamic sizing. x1/x2 2 i/o high-frequency o scillator connection pins. xt1/xt2 2 i/o low-frequency oscillator connection pins. reset 1 input reset: initializes tmp92c820 (with pull-up resistor). vrefh 1 input pin for reference voltage input to ad converter (h). vrefl 1 input pin for reference voltage input to ad converter (l). avcc 1 ? power supply pin for ad converter. avss 1 ? gnd pin for ad converter (0 v). dvcc 3 ? power supply pins (all dvcc pins should be connected with the power supply pin). dvss 4 ? gnd pins (0 v) (all dvss pins should be connected with gnd (0v)). rtcvcc 1 ? power supply pin for rtc and low-frequency oscillator. tmp92c820 2007-02-16 92c820-10 3. operation this section describes the bas ic components, functions and operation of the tmp92c820. 3.1 cpu the tmp92c820 contains an advanced high-speed 32-bit cpu (900/h1 cpu). for cpu operation, see the tlcs-900/h1 cpu. the following describe the unique function of the cpu used in the tmp92c820; these functions are not covered in the tlcs-900/h1 cpu section. 3.1.1 cpu outline 900/h1 cpu is high-speed and high-perfo rmance cpu based on 900/l1 cpu. 900/h1 cpu has expanded 32-bit internal data bus to process instructions more quickly. outline of 900/h1 cpu are as follows: table 3.1.1 cpu outline 900/h1 cpu width of cpu address bus 24 bits width of cpu data bus 32 bits internal operating frequency 20 mhz minimum bus cycle 1-clock access (50 ns at 20 mhz) data bus sizing 8/16/32 bits internal ram 32 bits 1-clock access internal i/o 8-/16-bit 8-/16-bit 2-clock access 5 to 6-clock access 900/h1 i/o 900/l1 i/o external device 8 bits 2-clock access (can insert some waits.) minimum instruction execution cycle 1 clock (50 ns at 20 mhz) conditional jump 2 clocks (100 ns at 20 mhz) instruction queue buffer 12 bytes instruction set compatible with tlcs-900, 900/l, 900/h, 900/l1 and 900/h2 (normal, max, min and ldx instruction is deleted.) cpu mode only maximum mode micro dma 8 channels tmp92c820 2007-02-16 92c820-11 3.1.2 reset operation when resetting the tmp92c820 microcontroller, 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 40 mhz). when the reset has been accepted, the cpu performs the following: ? sets the program counter (pc) as follow s 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 tmp92c820 2007-02-16 92c820-12 figure 3.1.1 power on reset timing example 3.1.3 setting of am0 and am1 set am1 and am0 pins to ?10? to use 32-bit external bus, or set it to ?01? to use 16-bit external bus. table 3.1.2 operation mode setup table mode setup input pin operation mode reset am1 am0 16-bit external bus or 8-/16-/32-bit dynamic bus sizing 0 1 32-bit external bus or 8-/16-/32-bit dynamic bus sizing 1 0 osc warm-up time + 20 system clock 0 s (min) v cc 3.3 v reset 10 ms (min) tmp92c820 2007-02-16 92c820-13 3.2 memory map 1h figure 3.2.1 is a memory map of the tmp92c820. 000000h 002000h 16-mbyte area (r) ( ? r) (r + ) (r + r8/16) (r + d8/16) (nnn) direct area (n) 64-kbyte area (nn) internal i/o (8 kbytes) internal ram (8 kbytes) 004000h 010000h ( = internal area) ffff00h ffffffh vector table (256 bytes) external memory 000100h provisional emulator control area (64 kbytes) f00000h f10000h external memory 0 01fe0h (note 1) (note 2) note 1: provisional emulator control area is for em ulator, it is mapped f00000h to f10000h address after reset. note 2: don?t use the last 16-byte area (fffff0h to ffffffh). this area is reserved. note 3: on emulator wr signal and rd signal are asserted, when provis ional emulator control area is accessed. be careful to use external memory. figure 3.2.1 memory map tmp92c820 2007-02-16 92c820-14 3.3 clock function and standby function tmp92c820 contains (1) clock gear, (2) standby controller, and (3) noise reduction circuit. it is used for low-power, low-noise systems. this chapter is organized as follows: 2h 3.3.1 3h block diagram of system clock 4h 3.3.2 5h sfr 6h 3.3.3 7h system clock controller 8h 3.3.4 9h noise reduction circuits 10h 3.3.5 11h standby controller tmp92c820 2007-02-16 92c820-15 the clock operating modes are as follows: (a) single clock mode (x1, x2 pins only) and (b) dual clock mode (x1, x2, xt1, and xt2 pins). 12h figure 3.3.1 shows a transition figure. interrupt interrupt instruction instruction interrupt interrupt instruction reset (f osch /32) release reset instruction interrupt stop mode (stops all circuits) idle2 mode (i/o operate) idle1 mode (operate only oscillator) (a) single clock mode transition figure (b) dual clock mode transition figure stop mode (stops all circuits) instruction 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) interrupt instruction instruction instruction normal mode (f osch /gear value/2) interrupt interrupt instruction instruction slow mode (fs/2) 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 called fs. the clock fr equency selected by syscr1 tmp92c820 2007-02-16 92c820-16 3.3.1 block diagram of system clock clock gear syscr1 tmp92c820 2007-02-16 92c820-17 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 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: 110: reserved 111: bit symbol ? wuptm1 wuptm0 haltm1 haltm0 seldrv drve read/write r/w r/w after reset 0 1 0 1 1 0 0 function 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 tmp92c820 2007-02-16 92c820-18 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: fc external clock fc oscillator drive ability 1: normal 0: weak fs oscillator drive ability 1: normal 0: weak bit symbol read/write after reset function 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 figure 3.3.4 sfr for noise-reduction note: in casewhen restarting the oscillator in from the stop oscillation state (e.g. restart restarting the oscillator in stop mode), set emccr0 tmp92c820 2007-02-16 92c820-19 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 tmp92c820 2007-02-16 92c820-20 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), 0x11 - - - - 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 frequenc y clears and starts warm-up time r chages f sys from fc to fs end of warm-up time r disables high frequenc y fc tmp92c820 2007-02-16 92c820-21 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), 0x10 - - - - 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 timer chages f sys from fs to fc end of warm-up timer tmp92c820 2007-02-16 92c820-22 (2) clock gear controller f fph is set according to the contents of the clock gear select register syscr1 tmp92c820 2007-02-16 92c820-23 3.3.4 noise reduction circuits noise reduction circuits are built in, allowing implementation of the following features. (1) reduced drivability for hi gh-frequency oscillator (2) reduced drivability for low-frequency oscillator (3) single drive for high-frequency oscillator (4) runaway provision with sfr protection register (1) reduced drivability for hi gh-frequency oscillator (purpose) reduces noise and power for oscillator when a resonator is used. (block diagram) (setting method) the drivability of the oscillator is reduced by writing ?0? to emccr0 tmp92c820 2007-02-16 92c820-24 (2) reduced drivability for low-frequency oscillator (purpose) reduces noise and power for oscillator when a resonator is used. (block diagram) (setting method) the drivability of the oscillator is reduced by writing 0 to the emccr0 tmp92c820 2007-02-16 92c820-25 (4) runaway provision with sfr protection register (purpose) provision in runaway of program by noise mixing. write operation to specified sfr is prohibited so that provision program in runaway prevents that it is it in the state which is fetch impossibility by stopping of clock, memory control register (memory controller, mmu) is changed. and error handling in runaway beco mes easy 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 2. mmu local 0/1/2/3 3. clock gear syscr0, syscr1, syscr2, emccr0 ( operation explanation) execute and release of protection (write operation to specified sfr) become possible by setting up a double ke y to emccr1 and emccr2 register. (double key) 1st-key: succession writes in 5ah at emccr1 and a5h at emccr2 2nd-key: succession writes in a5h at emccr1 and 5ah at emccr2 a state of protection can be confirmed by reading emccr0 tmp92c820 2007-02-16 92c820-26 3.3.5 standby controller (1) halt modes when the halt instruction is executed, the operating mode switches to idle2, idle1 or stop mode, depending on the contents of the syscr2 tmp92c820 2007-02-16 92c820-27 (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 comb ination between the states of interrupt mask register tmp92c820 2007-02-16 92c820-28 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 intwdt ? ? ? ? int0 to 3 (note1) ? ? ? * 1 * 1 intalm0 to 4 ? ? intta0 to 3, inttb00 to 01 ? intrx0 to 2, tx0 to 2 ? intss0 to 2 ? intad ? intkey ? ? ? * 1 * 1 intrtc ? ? intsbe0 ? 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 execut ing starting from instruction following the halt instruction. : it can not be used to release the halt mode. ? : the priority level (interrupt request level) of non-ma skable interrupts is fixed to 7, the highest priority level. there is not this combination type. * 1: releasing the halt mode is executed after passing the warm-up time. note 1: when the halt mode is cleared by an int0 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 stat e when the device is in idle1 mode. address 8200h ld (pcfc), 04h ; sets pc3f 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 tmp92c820 2007-02-16 92c820-29 (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. 21h figure 3.3.5 illustrates an example of the timing for clearance of the idle2 mode halt state by an interrupt. interrupt o f releasing halt idle2 mode data data x1 a0 to a23 d0 to d15 rd wr figure 3.3.5 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 in the mcu stops. the pin status in the idle1 mode is depended on setting the register syscr2 tmp92c820 2007-02-16 92c820-30 3. stop mode when stop mode is selected, all internal circuits stop, including the internal oscillator pin status in stop mode depends on the settings in the syscr2 tmp92c820 2007-02-16 92c820-31 table 3.3.6 input buffer state table input buffer state in halt mode (idle1/stop) when the cpu is operating in halt mode (idle2) condition a (note) condition b (note) 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 when used as function pin when used as input pin d0-d7 d0-d7 ? ? ? ? p10-p17 d8-d15 off p20-p27 d16-d23 p30-p37 d24-d31 16-bit start :on 32-bit start :off on upon external read on upon external read of lcdc off off p40-p47 ? p50-p57 ? p60-p67 ? off ? ? ? ? p76 wait off p90 sck p91 sda p92 si, scl on on off off p93 ? p94 ? p95 ? ? ? off ? ? p96 rxd2 off off off off pa0-pa7 (*1) ki0-7 on on on on on pc0 ta0in off off pc1 int1 off off off pc3 int0 on on on pc5 int2 pc6 int3 on on on on pf0 ? ? ? off ? ? pf1 rxd0 pf2 sclk0, cts0 on on on off off pf3 ? ? ? off ? ? pf4 rxd1 pf5 sclk1, cts1 on on on on on off off pg0-pg2, pg4 (*2) ? ? ? ? ? pg3 (*2) adtrg off on on upon port read on on on pl0-pl7 ? ? on ? off ? off ? off be ? reset (*1) ? am0, am1 ? on ? on ? x1, xt1 on on ? on ? idle1 : on , stop : off on: the buffer is always turned on. a current flows the input buffer if the input pin is not driven. *1: port having a pull-up/pull-down resistor. off: the buffer is always turned off. *2: ain input does not cause a current to flow through the buffer. -: no applicable note: condition a/b are as follows. syscr2 register setting halt mode tmp92c820 2007-02-16 92c820-32 table 3.3.7 output buffer state table (1/2) output buffer state in halt mode (idle1/stop) when the cpu is operating in halt mode (idle2) condition a (note) condition b (note) port name output function name during reset when used as function pin when used as output port when used as function pin when used as output port when used as function pin when used as output port when used as function pin when used as output port d0-d7 d0-d7 ? ? ? ? p10-p17 d8-d15 p20-p27 d16-d23 p30-p37 d24-d31 off on upon external write off on off p40-p47 a0-a7 p50-p57 a8-a15 p60-p67 a16-a23 p70 rd p71 wrll p72 wrlu p73 wrul p74 wruu p75 r/w on on on off on p76 ? off ? ? ? ? p80 cs0, sdcsh p81 cs1, sdcsl p82 cs2, cs2a p83 cs3 p84 ea24, cs2b p85 ea25, cs2c p86 cs2d p87 sdclk on p90 sck p91 so p92 scl p93 cs2e p94 cs2f p95 cs2g txd2 p96 csexa on on off on pc0 ? ? ? ? ? pc1 ta1out on on off on pc3 ? ? ? ? ? pc5 ta3out pc6 tb0out off on on on on off off on on tmp92c820 2007-02-16 92c820-33 table 3.3.8 output buffer state table (2/2) output buffer state in halt mode (idle1/stop) when the cpu is operating in halt mode (idle2) condition a (note) condition b (note) port name output function name during reset when used as function pin when used as output port when used as function pin when used as output port when used as function pin when used as output port when used as function pin when used as output port pf0 txd0 on on off pf1 ? ? ? ? ? pf2 sclk0 pf3 txd1 on on off on pf4 ? ? ? ? ? pf5 sclk1 pj0 sdras pj1 sdcas pj2 sdwe srwr pj3 sdlldqm srllb pj4 sdludqm srlub pj5 sduldqm srulb pj6 sduudqm sruub off pj7 sdcke on in self refresh cycle pk0 d1bscp pk1 d2blp pk2 d3bfr pk3 dlebcd pk4 doffb pk6 alarm mldalm pl0-pl7 ld0-ld7 off on on off off on on x2 ? idle1: on, stop: output ?h? level xt2 ? on on ? on ? idle1: on, stop: high-z on: the buffer is always turned on. when the bus is released, however, output buffers for some pins are turned off. *1: port having a pull-up/pull-down resistor. off: the buffer is always turned off. -: no applicable note: condition a/b are as follos. syscr2 register setting halt mode tmp92c820 2007-02-16 92c820-34 3.4 interrupts interrupts are controlled by the cpu interrupt mask register tmp92c820 2007-02-16 92c820-35 figure 3.4.1 interrupt and micro dma processing sequence yes push pc push sr sr tmp92c820 2007-02-16 92c820-36 3.4.1 general-purpose interrupt processing when the cpu accepts an interrupt, it us ually 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 generates 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 tmp92c820 2007-02-16 92c820-37 table 3.4.1 tmp92c820 interrupt vect ors and micro dma start vectors (1/2) 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 ? ? ? (note 1) 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 (reserved) 0038h ffff38h 0eh 16 intalm0: alm0 (8 khz) 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: protect 0 (wr to 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 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 intrx1: serial receive (channel 1) 0088h ffff88h 22h (note 2) 36 inttx1: serial transmission (channel 1) 008ch ffff8ch 23h 37 intrx2: serial receive (channel 2) 0090h ffff90h 24h (note 2) 38 inttx2: serial transmission (channel 2) 0094h ffff94h 25h 39 (reserved) 0098h ffff98h 26h 40 (reserved) 009ch ffff9ch 27h 41 (reserved) 00a0h ffffa0h 28h 42 (reserved) 00a4h ffffa4h 29h 43 (reserved) 00a8h ffffa8h 2ah 44 (reserved) 00ach ffffach 2bh 45 (reserved) 00b0h ffffb0h 2ch 46 (reserved) 00b4h ffffb4h 2dh 47 (reserved) 00b8h ffffb8h 2eh 48 intsbe0: sbi i 2 c bus transfer end (channel 0) 00bch ffffbch 2fh 49 (reserved) 00c0h ffffc0h 30h 50 maskable (reserved) 00c4h ffffc4h 31h tmp92c820 2007-02-16 92c820-38 table 3.4.1 tmp92c820 interrupt vect ors and micro dma start vectors (2/2) 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 ? ? note 1: micro dma default priority. micro dma initiation ta kes priority over other maskable interrupt. note 2: when initiating micro dma, set at edge detect mode. tmp92c820 2007-02-16 92c820-39 3.4.2 micro dma processing in addition to general-purpose interrupt processing, the tmp92c820 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 though the cpu, when the cpu is placed in a state of standby by halt instruction, 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. (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 proce ssing to be set for up to 8 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 start 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 (j.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 2h 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 tmp92c820 2007-02-16 92c820-40 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 8 bits of a 32-bit address are not valid). three micro dma transfer modes are supported: one-byte transfer, two-byte (one word) transfers and four-byte transfers. after a transfer in any mode, the transfer source and transfer destinatio n addresses will either be incremented or decremented, or will remain unchanged. this simplifies th e transfer of data 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 (4) ?detailed descriptio n 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 so urce (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 3h table 3.4.1 and a micro dma soft start. 4h 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: external 8-bit bus, 0 waits, and even-numbered transfer source and transfer destination addresses). note: in fact, src and dst address are not output to a23 to a0 pins because they are internal ram address states 1 and 2: instruction fetch cycle (prefetches the next instruction code) if the instruction queue buffer is full, this cycle becomes a dummy cycle. state 3: micro dma read cycle. state 4: micro dma write cycle. state 5: (the same as in state 1, 2.) figure 3.4.2 timing for micro dma cycle src dst clk a0 to a23 one state 1 2 3 4 5 tmp92c820 2007-02-16 92c820-41 (2) soft start function the tmp92c820 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 re gister, 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 use 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 addre ss and the transfer destination address are set in the following registers. an instruction of the form ldc cr,r can be used to set these registers. 8 bits 16 bits 32 bits channel 0 dmas0 dmad0 dmac0 dmam0 channel 7 dmas7 dmad7 dmac7 dmam7 dma source address register 0: using only lower 24 bits. dma destination address register 0: using only lower 24 bits. dma counter register 0: 1 to 65536. dma mode register 0. dma source address register 7. dma destination address register 7. dma counter register 7. dma mode register 7. tmp92c820 2007-02-16 92c820-42 (4) detailed description of the transfer mode register dmam [4:0] mode description execution time 000zz destination inc mode (dmadn + ) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 001zz destination dec mode (dmadn ? ) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 010zz source inc mode (dmadn) (dmasn + ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 011zz source dec mode (dmadn) (dmasn ? ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 100zz source and destination inc mode (dmadn + ) (dmasn + ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 6 states 101zz source and destination dec mode (dmadn ? ) (dmasn ? ) dmacn dmacn ? 1 if dmacn = 0 then inttcn 6 states 110zz destination and fixed mode (dmadn) (dmasn) dmacn dmacn ? 1 if dmacn = 0 then inttcn 5 states 11100 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 note 1: the execution time is measured at 1 states = 50 ns (operation at internal 20 mhz). note 2: 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. 0 0 0 mode dmam0 to dmam7 tmp92c820 2007-02-16 92c820-43 3.4.3 interrupt controller operation the block diagram in 5h figure 3.4.3 shows the interrupt circuits. the left-hand side of the diagram shows the interrupt controller ci rcuit. the right-hand side shows the cpu interrupt request signal circuit and the halt release circuit. for each of the 52 interrupt 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 dm a 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 regi ster (e.g., inte0ad or inte12). six interrupt priorities levels (1 to 6) are provided. setting an interrupt sour ce?s priority level to 0 (or 7) disables interrupt requests from that source. the priority of non-maskable interrupt (watchdo g timer interrupts) is fixed at 7. if more than one interrupt request with a given priority level are generated simultaneously, the 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 bits 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 generated simultan eously, 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 tmp92c820 2007-02-16 92c820-44 figure 3.4.3 block diagram of interrupt controller interrupt request signal to cpu micro dma start vector setting registe r during idle1 during stop 36 3 3 3 1 6 2 2 4 6 34 4-input or int0, 1, 2, 3, int key, intrtc, intalm micro dma channel priority encoder priority encode r dma0v dma1v dma2v dma3v reset interrupt request f/f reset reset priority setting registe r v = 20h v = 24h interrupt controlle r cpu s q r v = 28h v = 2ch v = 30h v = 34h v = 3ch v = 40h v = 44h v = 48h v = 4ch v = 58h v = d0h v = d4h v = d8h v = dch v = e0h v = e4h v = e8h v = ech d q clr a b c dn dn + 1 dn + 2 interrupt request f/f interrupt vector read micro dma acknowled g e interrupt request f/f dn + 3 a b c interrupt vector read d2 d3 d4 d5 d6 d7 0 1 2 3 a b d0 d1 interrupt mask f/f micro dma request halt release if intrq2 to 0 iff 2 to 0 then 1. intrq2 to 0 iff2:0 reset ei1 to 7 di interrupt request signal micro dma channel specification reset (reserved) intwd int0 int1 int2 int3 intalm0 intalm1 intalm2 intalm3 intalm4 intta0 inttc0 inttc1 inttc2 inttc3 inttc4 inttc5 inttc6 inttc7 interrupt vector generator highest priority interrupt level select 1 2 3 4 5 6 7 d5 d4 d3 d2 d1 d0 decode r y1 y2 y3 y4 y5 y6 s q r 7 1 6 interrupt level detect d q clr s selector interrupt vector read inttc0 soft start if iff = 7 then 0 micro dma counter 0 interrupt tmp92c820 2007-02-16 92c820-45 (1) interrupt priority setting 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 ? int3 ? ? ? ? i3c i3m2 i3m1 i3m0 ? ? r r/w inte3 int3 enable d1h always write ?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 intat3 (tmra3) intat2 (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 r r/w intetbo0 inttbo0 (overflow) enable dah 0 0 0 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 intrx1 itx1c itx1m2 itx1m1 itx1m0 irx1c irx1m2 irx1m1 irx1m0 r r/w r r/w intes1 intrx1& inttx1 enable dch 0 0 0 0 0 0 0 0 ? intsbe0 ? ? ? ? isbe0c isbe0m2 isbe0m1 isbe0m0 ? ? r r/w intesb0 intsbe0 enable e3h always write ?0?. 0 0 0 0 intalm1 intalm0 ia1c ia1m2 ia1m1 ia1m0 ia0c ia0m2 ia0m1 ia0m0 r r/w r r/w intealm 01 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 intealm 23 intalm2& intalm3 enable e6h 0 0 0 0 0 0 0 0 tmp92c820 2007-02-16 92c820-46 symbol name address 7 6 5 4 3 2 1 0 ? intalm4 ? ? ? ? ia4c ia4m2 ia4m1 ia4m0 ? ? r r/w intealm4 intalm4 enable e7h always write ?0?. 0 0 0 0 ? intrtc ? ? ? ? irc irm2 irm1 irm0 ? ? r r/w intertc intrtc enable e8h always write ?0?. 0 0 0 0 ? intkey ? ? ? ? ikc ikm2 ikm1 ikm0 ? ? r r/w inteckey intkey enable e9h always write ?0?. 0 0 0 0 ? intlcd ? ? ? ? ilcd1c ilcdm2 ilcdm1 ilcdm0 ? ? r r/w intlcd intlcd enable eah always write ?0?. 0 0 0 0 inttx2 intrx2 itx2c itx2m2 itx2m1 itx2m0 irx2c irx2m2 irx2m1 irx2m0 r r/w r r/w intes2 intrx2& inttx2 enable edh 0 0 0 0 0 0 0 0 ? intp0 ? ? ? ? ip0c ip0m2 ip0m1 ip0m0 ? ? r r/w intep0 intp0 enable eeh always write ?0?. 0 0 0 0 ixxm2 ixxm1 ixxm0 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 tmp92c820 2007-02-16 92c820-47 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 f7h always write ?0?. 0 ? ? ? ixxm2 ixxm1 ixxm0 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 tmp92c820 2007-02-16 92c820-48 (2) external interrupt control symbol name address 7 6 5 4 3 2 1 0 i3edge i2edge i1edge i0edge i0le ? w w w w r/w r/w 0 0 0 0 0 0 iimc interrupt input mode control f6h (prohibit rmw) int3edge 0: rising 1: falling int2edge 0: rising 1: falling int1edge 0: rising 1: falling int0edge 0: rising 1: falling int0 0: edge mode 1: 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), xxxxxx0 - b ; switches from level to edge. ld (intclr), 0ah ; clears interrupt request flag. ei note 2: x: don?t care, ?: no change note 3: 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 iimc tmp92c820 2007-02-16 92c820-49 (3) sio receive interrupt control symbol name address 7 6 5 4 3 2 1 0 ir2le ir1le ir0le w w w 1 1 1 simc sio interrupt mode control f5h (prohibit rmw) 0: intrx2 edge mode 1: intrx2 level mode 0: intrx1 edge mode 1: intrx1 level mode 0: intrx0 edge mode 1: intrx0 level mode intrx0 rising edge enable 0 rising edge detect intrx0 1 ?h? level intrx0 intrx1 level enable 0 rising edge detect intrx1 1 ?h? level intrx1 intrx2 level enable 0 rising edge detect intrx2 1 ?h? level intrx2 tmp92c820 2007-02-16 92c820-50 (4) interrupt request flag clear register the interrupt request flag is cleared by writing the appropriate micro dma start vector, as given in 8h 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 an 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 value 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.) tmp92c820 2007-02-16 92c820-51 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 tmp92c820 2007-02-16 92c820-52 (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 co rrespond 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 request on burst mode tmp92c820 2007-02-16 92c820-53 (7) notes the instruction execution unit and the bus interface unit in this cpu operate independently. therefore, if immediately before an interrupt is generated, 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 defaul t vector 0004h and jump to interrupt vector address ffff04h. to avoid this, an instruction which clears an interrupt request flag should always be preceded by 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 placed ei instruction without waiting nop instruction after executio n of clearing instruction, interrupt will be enable before request flag is cleared. in the case of changing the value of the interrupt mask register tmp92c820 2007-02-16 92c820-54 3.5 function of ports tmp92c820 has i/o port pins that are shown in 0h table 3.5.1. in addition to functioning as general-purpose i/o ports, these pins are also used by internal cpu and i/o functions. 1h table 3.5.2 lists i/o registers and their specifications. table 3.5.1 port functions (1/2) (r: pu = with programmable pull-up 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 2 p20 to p27 8 i/o ? bit d16 to d23 port 3 p30 to p37 8 i/o ? bit d24 to d31 port 4 p40 to p47 8 i/o* ? bit* a0 to a7 port 5 p50 to p57 8 i/o* ? bit* a8 to a15 port 6 p60 to p67 8 i/o* ? bit* a16 to a23 p70 1 output ? (fixed) rd p71 1 output ? (fixed) wrll p72 1 output ? (fixed) wrlu p73 1 output ? (fixed) wrul p74 1 output ? (fixed) wruu p75 1 output ? (fixed) r/ w port 7 p76 1 i/o ? bit wait p80 1 output ? (fixed) cs0 , sdcsh p81 1 output ? (fixed) cs1 , sdcsl p82 1 output ? (fixed) cs2 , cs2a p83 1 output ? (fixed) cs3 p84 1 output ? (fixed) ea24, cs2b p85 1 output ? (fixed) ea25, cs2c p86 1 output ? (fixed) cs2d port 8 p87 1 output ? (fixed) sdclk p90 1 i/o ? bit sck p91 1 i/o ? bit so, sda p92 1 i/o ? bit si, scl p93 1 i/o ? bit cs2e p94 1 i/o ? bit cs2f p95 1 i/o ? bit cs2g , txd2 port 9 p96 1 i/o ? bit csexa , rxd2 port a pa0 to pa7 8 input u (fixed) ki0 to ki7 pc0 1 i/o ? bit ta0in pc1 1 i/o ? bit int1, ta1out pc3 1 i/o ? bit int0 pc5 1 i/o ? bit int2, ta3out port c pc6 1 i/o ? bit int3, tb0out0 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 txd1 pf4 1 i/o ? bit rxd1 port f pf5 1 i/o ? bit sclk1, 1 cts *: when these ports are used as general-purpose i/o por t, each bit can be set individually for input or output. however, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. all of general-purpose i/o ports except for port that used as address bus are operated as output port. please be careful when using this setting. tmp92c820 2007-02-16 92c820-55 table 3.5.1 port functions (2/2) (r: pu = with programmable pull-up 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 g pg0 to pg4 5 input ? (fixed) an0 to an4, adtrg (pg3) pj0 1 output ? (fixed) sdras pj1 1 output ? (fixed) sdcas pj2 1 output ? (fixed) sdwe , srwr pj3 1 output ? (fixed) sdlldqm , srllb pj4 1 output ? (fixed) sdludqm , srlub pj5 1 output ? (fixed) sduldqm , srulb pj6 1 output ? (fixed) sduudqm , sruub port j pj7 1 output ? (fixed) sdcke pk0 1 output ? (fixed) d1bscp pk1 1 output ? (fixed) d2blp pk2 1 output ? (fixed) d3bfr pk3 1 output ? (fixed) dlebcd pk4 1 output ? (fixed) doffb port k pk6 1 output ? (fixed) alarm , mldalm port l pl0 to pl7 8 i/o ? bit ld0 to ld7 tmp92c820 2007-02-16 92c820-56 table 3.5.2 i/o registers and specifications (1/3) i/o register port pin name specification pn pncr pnfc pnfc2 pnode input port x 0 output port x 1 0 port 1 p10 to p17 d8 to d15 bus x x 1 none none input port x 0 output port x 1 0 port 2 p20 to p27 d16 to d23 bus x x 1 none none input port x 0 output port x 1 0 port 3 p30 to p37 d24 to d31 bus x x 1 none none input port* x 0* output port* x 1* 0 port 4 p40 to p47 a0 to a7 output x 0 1 none none input port* x 0* output port* x 1* 0 port 5 p50 to p57 a8 to a15 output x 0 1 none none input port* x 0* output port* x 1* 0 port 6 p60 to p67 a16 to a23 output x 0 1 none none p70 to p75 output port x none 0 p70 rd output p71 wrll output p72 wrlu output p73 wrul output p74 wruu output p75 r/ w output x none 1 input port x 0 0 output port x 1 0 port 7 p76 wait input x 0 1 none none p80 to p87 output port x 0 0 p80 cs0 output x 1 0 cs1 output x 1 0 p81 sdcs output x x 1 cs2 output x 1 0 p82 cs2a output x x 1 p83 cs3 output x 1 0 ea24 output x 1 0 p84 cs2b output x x 1 ea25 output x 1 0 p85 cs2c output x x 1 p86 cs2d output x x 1 port 8 p87 sdclk output x none 1 0 none x: don?t care *: when these ports are used as general-purpose i/o por t, each bit can be set individually for input or output. however, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. all of general-purpose i/o ports except for port that used as address bus are operated as output port. please be careful when using this setting. tmp92c820 2007-02-16 92c820-57 table 3.5.2 i/o registers and specifications (2/3) i/o register port pin name specification pn pncr pnfc pnfc2 pnode input port x 0 0 0 p90 to p96 output port x 1 0 0 sck input x 0 0 0 p90 sck output x x 1 0/1 so output x 1 1 0/1 p91 sda x x 1 1 si input x 0 0 0 p92 scl x x 1 1 cs2e output x 1 1 x sscmd input x 0 1 x sscmd output x 0 1 0 p93 sscmd (open drain) x 0 1 1 cs2f output x 1 1 x ssdat input x 0 1 x ssdat output x 0 1 0 p94 ssdat (open drain) x 0 1 1 cs2g output x 1 1 x txd2 output x 0 1 0 p95 txd2 (open drain) x 0 1 1 csexa output x 1 1 x port 9 p96 rxd2 input x 0 1 none x input port x 0 port a pa0 to pa7 ki0 to ki7 input x none 1 none none input port x 0 0 pc0, pc1, pc3 pc5, pc6 output port x 1 0 pc0 ta0in input x x 1 ta1out output x 1 1 pc1 int1 input 0 0 1 pc3 int0 input x 0 1 int2 input 0 0 1 pc5 ta3out 1 1 1 int3 input 0 0 1 port c pc6 tb0out0 1 1 1 none none input port x 0 0 pf0 to pf5 output port x 1 0 txd0 1 0 1 pf0 txd0 (open drain) 1 1 1 pf1 rxd0 input x 0 none sclk0 input/output 1 0/1 1 pf2 0 cts input 1 0 1 txd1 1 0 1 pf3 txd1 (open drain) 1 1 1 pf4 rxd1 input x 0 none sclk1 input/output 1 0/1 1 port f pf5 1 cts input 1 0 1 none none input port x pg0 to pg4 an0 to an4 input x port g pg3 adtrg input x none none none none x: don?t care tmp92c820 2007-02-16 92c820-58 table 3.5.2 i/o registers and specifications (3/3) i/o register port pin name specification pn pncr pnfc pnfc2 pnode pj0 to pj7 output port x 0 0 pj0 sdras output x 1 0 pj1 sdcas output x 1 0 sdwe output x 1 0 pj2 srwr output x x 1 sdlldqm output x 1 0 pj3 srllb output x x 1 sdludqm output x 1 0 pj4 srlub output x x 1 sduldqm output x 1 0 pj5 srulb output x x 1 sduudqm output x 1 0 pj6 sruub output x x 1 port j pj7 sdcke output x none 1 0 none pk0 to pk6 output port x 0 pk0 d1bscp output x 1 pk1 d2blp output x 1 pk2 d3bfr output x 1 pk3 dlebcd output x 1 pk4 doffb output x 1 alarm output 1 1 port k pk6 mldalm output 0 none 1 none none input port x 0 0 output port x 1 0 port l pl0 to pl7 ld0 to ld7 output x x 1 none none x: don?t care after a reset the port pins listed below function as general-purpose i/o port pins. a reset sets i/o pins, which can be programmed for either input, or output to be input ports pins. setting the port pins for internal function use must be done in software. tmp92c820 2007-02-16 92c820-59 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 p1cr and function register p1fc. in addition to functioning as a general-purpose i/o port, port 1 can also function as a data bus (d8 to d15). am1 am0 function setting after reset is released 0 0 1 1 0 1 0 1 don?t use this setting data bus (d8 to d15) data bus (d8 to d15) don?t use this setting figure 3.5.1 port 1 external access (data write) internal data bus reset p1cr write output latch p1 write s a selector b p1 read port 1 p10 to p17 (d8 to d15) function control (on bit basis) p1fc write d8 to d15 external access (data read) output buffer direction control (on bit basis) tmp92c820 2007-02-16 92c820-60 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 refer to port 1 function setting port 1 function register 7 6 5 4 3 2 1 0 bit symbol p1f read/write w after reset 1 function refer to port 1 function setting port 1 function register note 1:read-modify-write is prohibited for the registers p1cr and p1fc. note 2: tmp92c820 2007-02-16 92c820-61 3.5.2 port 2 (p20 to p27) port 2 is an 8-bit general-purpose i/o port. bits can be individually set as either inputs or outputs by control register p2cr and function register p2fc. in addition to functioning as a general-purpose i/o port, port 2 can also function as a data bus (d16 to d23). am1 am0 function setting after reset is released 0 0 1 1 0 1 0 1 don?t use this setting input port data bus (d16 to d23) don?t use this setting figure 3.5.3 port 2 external access (data write) internal data bus reset p2cr write output latch p2 write s a selector b p2 read port 2 p20 to p27 (d16 to d23) function control (on bit basis) p2fc write d16 to d23 external access (data read) output buffer direction control (on bit basis) tmp92c820 2007-02-16 92c820-62 port 2 register 7 6 5 4 3 2 1 0 bit symbol p27 p26 p25 p24 p23 p22 p21 p20 read/write r/w after reset data from external port (output latch register is cleared to 0) port 2 control register 7 6 5 4 3 2 1 0 bit symbol p27c p26c p25c p24c p23c p22c p21c p20c read/write w after reset 0 0 0 0 0 0 0 0 function 0: input 1: output port 2 function register 7 6 5 4 3 2 1 0 bit symbol p2f read/write w after reset 0/1 note2 function 0: port 1: data bus (d16 to d23) port 2 function register note 1:read-modify-write is prohibited for the registers p2cr and p2fc. note 2: it is set to ?port? or ?data bus? by am pin setting. note 3: tmp92c820 2007-02-16 92c820-63 3.5.3 port 3 (p30 to p37) port 3 is an 8-bit general-purpose i/o port. bits can be individually set as either inputs or outputs by control register p3cr and function register p3fc. in addition to functioning as a general-purpose i/o port, port 3 can also function as a data bus (d24 to d31). am1 am0 function setting after reset is released 0 0 1 1 0 1 0 1 don?t use this setting input port data bus (d24 to d31) don?t use this setting figure 3.5.5 port 3 external access (data write) internal data bus reset p3cr write output latch p3 write s a selector b p3 read port 3 p30 to p37 (d24 to d31) function control (on bit basis) p3fc write d24 to d31 external access (data read) output buffer direction control (on bit basis) tmp92c820 2007-02-16 92c820-64 port 3 register 7 6 5 4 3 2 1 0 bit symbol p37 p36 p35 p34 p33 p32 p31 p30 read/write r/w after reset data from external port (output latch register is cleared to 0) port 3 control register 7 6 5 4 3 2 1 0 bit symbol p37c p36c p35c p34c p33c p32c p31c p30c read/write w after reset 0 0 0 0 0 0 0 0 function 0: input 1: output port 3 function register 7 6 5 4 3 2 1 0 bit symbol p3f read/write w after reset 0/1 note2 function 0: port 1: data bus (d24 to d31) port 3 function register note 1:read-modify-write is prohibited for the registers p3cr and p3fc. note 2: it is set to ?port? or ?data bus? by am pin setting. note 3: tmp92c820 2007-02-16 92c820-65 3.5.4 port 4 (p40 to p47) port 4 is an 8-bit general-purpose i/o ports*. bits can be individually set as either inputs or outputs by control register p4cr and function register p4fc*. in addition to functioning as a general-purpose i/o port, port 4 can also function as an address bus (a0 to a7). am1 am0 function setting after reset is released 0 0 1 1 0 1 0 1 don?t use this setting address bus (a0 to a7) address bus (a0 to a7) don?t use this setting *: when these ports are used as general-purpose i/o port, each bit can be set individually for input or output. however, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. all of general-purpose i/o ports except for port that used as address bus are operated as output port. please be careful when using this setting. figure 3.5.7 port 4 internal data bus direction control (on bit basis)* reset p4cr write output latch p4 write s b selector a p4 read port 4 p40 to p47 (a0 to a7) function control (on bit basis) p4fc write output buffer internal address bus a 0 to a7 tmp92c820 2007-02-16 92c820-66 port 4 register 7 6 5 4 3 2 1 0 bit symbol p47 p46 p45 p44 p43 p42 p41 p40 read/write r/w after reset data from external port (output latch register is cleared to 0) port 4 control register 7 6 5 4 3 2 1 0 bit symbol p47c p46c p45c p44c p43c p42c p41c p40c read/write w after reset 0 0 0 0 0 0 0 0 function 0: input 1: output (note2) port 4 function register 7 6 5 4 3 2 1 0 bit symbol p47f p46f p45f p44f p43f p42f p41f p40f read/write w after reset 1 1 1 1 1 1 1 1 function 0: port 1: address bus (a0 to a7) (note2) note1: read-modify-write is prohibited for the registers p4cr and p4fc. note2: when these ports are used as general-purpose i/o port, each bit can be set individually for input or output. however, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. all of general-purpose i/o ports except for port that used as address bus are operated as output port. please be careful when using this setting. figure 3.5.8 port 4 registers p4 (0010h) p4cr (0012h) p4fc (0013h) tmp92c820 2007-02-16 92c820-67 3.5.5 port 5 (p50 to p57) port 5 is an 8-bit general-purpose i/o ports*. bits can be individually set as either inputs or outputs by control register p5cr and function register p5fc*. in addition to functioning as a general-purpose i/o port, port 5 can also function as an address bus (a8 to a15). am1 am0 function setting after reset is released 0 0 1 1 0 1 0 1 don?t use this setting address bus (a8 to a15) address bus (a8 to a15) don?t use this setting *: when these ports are used as general-purpose i/o port, each bit can be set individually for input or output. however, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. all of general-purpose i/o ports except for port that used as address bus are operated as output port. please be careful when using this setting. figure 3.5.9 port 5 internal data bus direction control (on bit basis)* reset p5cr write output latch p5 write s b selector a p5 read port 5 p50 to p57 (a8 to a15) function control (on bit basis) p5fc write output buffer internal address bus a 8 to a15 tmp92c820 2007-02-16 92c820-68 port 5 register 7 6 5 4 3 2 1 0 bit symbol p57 p56 p55 p54 p53 p52 p51 p50 read/write r/w after reset data from external port (output latch register is cleared to 0) port 5 control register 7 6 5 4 3 2 1 0 bit symbol p57c p56c p55c p54c p53c p52c p51c p50c read/write w after reset 0 0 0 0 0 0 0 0 function 0: input 1: output (note2) port 5 function register 7 6 5 4 3 2 1 0 bit symbol p57f p56f p55f p54f p53f p52f p51f p50f read/write w after reset 1 1 1 1 1 1 1 1 function 0: port 1: address bus (a8 to a15) (note2) note1: read-modify-write is prohibited for the registers p5cr and p5fc. note2: when these ports are used as general-purpose i/o port, each bit can be set individually for input or output. however, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. all of general-purpose i/o ports except for port that used as address bus are operated as output port. please be careful when using this setting. figure 3.5.10 register for port 5 p5 (0014h) p5cr (0016h) p5fc (0017h) tmp92c820 2007-02-16 92c820-69 3.5.6 port 6 (p60 to p67) port 6 is an 8-bit general-purpose i/o ports*. bits can be individually set as either inputs or outputs by control register p6cr and function register p6fc*. in addition to functioning as a general-purpose 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 1 1 0 1 0 1 don?t use this setting address bus (a16 to a23) address bus (a16 to a23) don?t use this setting *: when these ports are used as general-purpose i/o port, each bit can be set individually for input or output. however, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. all of general-purpose i/o ports except for port that used as address bus are operated as output port. please be careful when using this setting. figure 3.5.11 port 6 internal data bus direction control (on bit basis)* reset p6cr write output latch p6 write s b selector a p6 read port 6 p60 to p67 (a16 to a23) function control (on bit basis) p6fc write output buffer internal address bus a 16 to a23 tmp92c820 2007-02-16 92c820-70 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 (note2) 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 1 1 1 1 1 1 1 1 function 0: port 1: address bus (a16 to a23) (note2) note1: read-modify-write is prohibited for the registers p6cr and p6fc. note2: when these ports are used as general-purpose i/o port, each bit can be set individually for input or output. however, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. all of general-purpose i/o ports except for port that used as address bus are operated as output port. please be careful when using this setting. figure 3.5.12 port 6 registers p6 (0018h) p6cr (001ah) p6fc (001bh) tmp92c820 2007-02-16 92c820-71 3.5.7 port 7 (p70 to p76) port 7 is a 7-bit general-purpose i/o port (p70 to p75 are 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 p75 pins can also function as read/write strobe signals to connect with an external memory. p76 pin can also function as wait input. a reset initializes p70 to p75 pins to output port mode, and p76 pin to input port mode. am1 am0 function setting after reset is released 0 0 1 1 0 1 0 1 don?t use this setting rd pin rd pin don?t use this setting figure 3.5.13 port 7 (p70) internal data bus reset output latch p7 write s a selector b p7 read p70 ( rd ) function control (on bit basis) p7fc write output buffer rd tmp92c820 2007-02-16 92c820-72 figure 3.5.14 port 7 (p71 to p74) figure 3.5.15 port 7 (p75) internal data bus reset output latch p7 write s a selector b p7 read p75 (r/ w ) function control (on bit basis) p7fc write output buffer r/ w internal data bus reset output latch p7 write s a selector b p7 read p71 ( wrll ) p72 ( wrlu ) p73 ( wrul ) p74 ( wruu ) function control (on bit basis) p7fc write output buffer wrll , wrlu , wrul , wruu tmp92c820 2007-02-16 92c820-73 figure 3.5.16 port 7 (p76) internal data bus function control (on bit basis) reset p7cr write p7 read p76 ( wait ) p7 write output buffer s output latch internal wait signal direction control (on bit basis) p7fc write tmp92c820 2007-02-16 92c820-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 (note) 1 1 1 1 1 1 note: output latch register is cleared to 0. port 7 control register 7 6 5 4 3 2 1 0 bit symbol p76c read/write w after reset 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 1 function 0: port 1: wait 0: port 1: r/ w 0: port 1: wruu 0: port 1: wrul 0: port 1: wrlu 0: port 1: wrll 0: port 1: rd note: read-modify-write is prohibited for the registers p7cr and p7fc. figure 3.5.17 register for port 7 p7 (001ch) p7cr (001eh) p7fc (001fh) tmp92c820 2007-02-16 92c820-75 3.5.8 port 8 (p80 to p87) ports 80 to 87 are 8-bit output ports. resetting sets output latch of p82 to ?0? and output latches of p80 to p81, p83 to p87 to ?1?. port 8 also function as chip-select output ( cs0 to cs3 ), extend address output (ea24, ea25), extend chip-select output ( cs2a , cs2b , cs2c , cs2d ), port 8 also function as output pin for sdram controller ( sdcsl , sdcsh , sdclk), above setting is used the function register p8fc. writing ?1? in the corresponding bit of p8 fc, p8fc2 enables the respective functions. resetting resets p87f of p8fc to ?1?, p80f to p86f of p8fc to ?0?, and p8fc2 to ?0?, sets all bits to output ports. figure 3.5.18 port 8 internal data bus function control 2 (on bit basis) reset p8fc2 write output lacth p8 write s a selector b c p8 read p80 ( cs0 , sdcsh ) p81 ( cs1 , sdcsl ) p82 ( cs2 , cs2a ) p83 ( cs3 ) p84 (ea24, cs2b ) p85 (ea25, cs2c ) p86 ( cs2d ) p87 (sdclk) function control (on bit basis) p8fc write sdcsh , sdcsl , cs2a , ?1?, cs2b , cs2c , cs2d , ?1? cs0 , cs1 , cs2 , cs3 , ea24, ea25, ?1?, sdclk tmp92c820 2007-02-16 92c820-76 port 8 register 7 6 5 4 3 2 1 0 bit symbol p87 p86 p85 p84 p83 p82 p81 p80 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 ? p85f p84f p83f p82f p81f p80f read/write w after reset 1 0 0 0 0 0 0 0 function 0: port 1: sdclk always write ?0?. 0: port 1: ea25 0: port 1: ea24 0: port 1: cs3 0: port 1: cs2 0: port 1: cs1 0: port 1: cs0 port 8 function register 2 7 6 5 4 3 2 1 0 bit symbol ? p86f2 p85f2 p84f2 ? p82f2 p81f2 p80f2 read/write w after reset 0 0 0 0 0 0 0 0 function always write ?0?. 0: tmp92c820 2007-02-16 92c820-77 3.5.9 port 9 (p90 to p96) p90 to p96 are 7-bit general-purpose i/o port. i/o can be set on bit basis using the control register. resetting sets port 9 to input port and all bits of output latch to ?1?. writing in the corresponding bit of p9fc enables the respective functions. resetting resets the p9fc to ?0?, and sets all bits to input ports. (1) port 90 (sck), port 91 (so/sda), and port 92 (si/scl) ports 90 to 92 are general-purpose i/o port. it is also used as sck (clock signal for sio mode), so (data output for sio mode), sda (data input for i 2 c mode), si (data input for sio mode), and scl (clock input/output for i 2 c mode) for serial bus interface. figure 3.5.20 port 9 (p90 to p92) internal data bus direction control (on bit basis) reset p9cr write p9 write p9 read p90 (sck) p91 (so/sda) p92 (si/scl) function control (on bit basis) p9fc write sck output so output sda output scl output s output latch s b selector a s a selector b sck input sda input si/scl input open-drain possible p9ode tmp92c820 2007-02-16 92c820-78 (2) ports 93 ( cs2e ), 94 ( cs2f ), 95 (txd2, cs2g ), and 96 (rxd2, csexa ) ports 93 to 96 are general-purpose i/o ports. figure 3.5.21 port 9 (p93 to p95) figure 3.5.22 port 9 (p96) internal data bus direction control (on bit basis) reset p9cr write p9 write p9 read p96 (rxd2, csexa ) function control (on bit basis) p9fc write csexa s output latch s b selector a s a selector b rxd2 internal data bus direction control (on bit basis) reset p9cr write p9 write p9 read p93 ( cs2e ) p94 ( cs2f ) p95 (txd2, cs2g ) function control (on bit basis) p9fc write txd2 s output latch s b selector a s a selector b c open-drain possible p9ode tmp92c820 2007-02-16 92c820-79 port 9 register 7 6 5 4 3 2 1 0 bit symbol p96 p95 p94 p93 p92 p91 p90 read/write r/w after reset data from external port (output latch register is set to 1) port 9 control register 7 6 5 4 3 2 1 0 bit symbol p96c p95c p94c p93c p92c p91c p90c read/write w after reset 0 0 0 0 0 0 0 function 0: input 1: output port 9 function register 7 6 5 4 3 2 1 0 bit symbol p96f p95f p94f p93f p92f p91f p90f read/write w after reset 0 0 0 0 0 0 0 function 0: port 1: rxd2, csexa 0: port 1: txd2, cs2g 0: port 1: cs2f 0: port 1: cs2e 0: port, si, 1: scl note 2 0: port 1: so, sda 0: port, sck input 1: sck output note 2 cs2e setting tmp92c820 2007-02-16 92c820-80 3.5.10 port a (pa0 to pa7) ports a0 to a7 are 8-bit input ports with pull-up resistor. in addition to functioning as general-purpose i/o ports, ports a0 to a7 ca n also key-on wakeup function as keyboard interface. 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.24 port a when pafc = ?1?, if either of input of ki0 to ki 7 pins falls down, intkey interrupt is generated. intkey interrupt can be used release all halt mode. internal data bus pa0 to pa7 (ki0 to ki7) intkey start edge detection key-on enable (on bit basis) pafc write pa read pull-up resistor reset pa0 to pa7 8-input or tmp92c820 2007-02-16 92c820-81 port a register 7 6 5 4 3 2 1 0 bit symbol pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 read/write r 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-in disable 1: key-in enable key-in of port a 0 disable 1 enable note: read-modify-write is prohibited for the registers pafc. figure 3.5.25 register for port a pa (0028h) pafc (002bh) tmp92c820 2007-02-16 92c820-82 3.5.11 port c (pc0, pc1, pc3, pc5 and pc6) port c is 5-bit general-purpose i/o port. each bit can be set individually for input or output. resetting sets port c to be an input port. in addition to functioning as a general-purpose i/o port, port c can also functions as i/o pin for timers (ta0in, ta1out, ta3out, tb0o ut0), input pin for external interruption (int0 to int3). above setting is used the function register pcfc and pccr register. edge select of external interruption establishes it with iimc register, which there is in interruption controller. resetting resets bits of the register pccr and pcfc to ?0? and sets all pins to be input port. (1) pc0 (ta0in) in addition to function as i/o port, port 0 can also function as input pin ta0in of timer channel 0. figure 3.5.26 port c (pc0) note: cannot read the output latch data when output mode. internal data bus direction control (on bit basis) reset pccr write pc read pc0 (ta0in) pc write s output latch s b selector a function control (on bit basis) pcfc write ta0in tmp92c820 2007-02-16 92c820-83 (2) pc1 (int1, ta1out), pc5 (int2, ta3out) and pc6 (int3, tb0out0) figure 3.5.27 port c (pc1, pc5, pc6) note: cannot read the output latch data when output mode. internal data bus direction control (on bit basis) reset pccr write pc write pc read pc1 (int1, ta1out) pc5 (int2, ta3out) pc6 (int3, tb0out0) function control (on bit basis) pcfc write s output latch rising/falling edge detection iimc tmp92c820 2007-02-16 92c820-84 (3) pc3 (int0) figure 3.5.28 port c (pc3) internal data bus direction control (on bit basis) reset pccr write pc write pc read pc3 (int0) function control (on bit basis) pcfc write s output latch s b selector a level/edge select and rising/falling select iimc tmp92c820 2007-02-16 92c820-85 port c register 7 6 5 4 3 2 1 0 bit symbol pc6 pc5 pc3 pc1 pc0 read/write r/w r/w 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 1) data from external port (output latch register is set to 1) port c control register 7 6 5 4 3 2 1 0 bit symbol pc6c pc5c pc3c pc1c pc0c read/write w w w after reset 0 0 0 0 0 function 0: input 1: output 0: input 1: output 0: input 1: output port c function register 7 6 5 4 3 2 1 0 bit symbol pc6f pc5f pc3f pc1f pc0f read/write w w w after reset 0 0 1 0 0 function 0: port 1: int3 tb0out0 0: port 1: int2 ta3out 0: port 1: int0 0: port 1: int1 ta1out 0: port 1: ta0in int1, ta1out setting tmp92c820 2007-02-16 92c820-86 3.5.12 port f (pf0 to pf5) ports f0 to f5 are 6-bit general-purpose i/o ports. each bit can be set individually for input or output. resetting sets pf0 to pf5 to be an 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 pf5 can also 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). by resetting, clears all bits of the register s pfcr and pffc to 0 and sets all pins to be input ports. (1) ports pf0 (txd0) and pf3 (txd1) as well as functioning as i/o port pins, port pf0 and pf3 can also function as serial channel txd output pins. figure 3.5.30 port f (pf0 and pf3) internal data bus direction control (on bit basis) reset pfcr write pf write pf read pf0 (txd0) pf3 ( txd1 ) function control (on bit basis) pffc write s output latch s b selector a s a selector b txd0, txd1 open-drain set possible tmp92c820 2007-02-16 92c820-87 (2) ports pf1 and pf4 (rxd0, rxd1) ports pf1 and pf4 are i/o port pins and can also is used as rxd input for the serial channels. figure 3.5.31 port f (pf1 and pf4) internal data bus direction control (on bit basis) reset pfcr write pf write pf read pf1 (rxd0) pf4 (rxd1) s output latch s b selector a rxd0, rxd1 tmp92c820 2007-02-16 92c820-88 (3) ports pf2 ( cts0 , sclk0) and pf5 ( cts1 , sclk1) ports pf2 and pf5 are i/o port pins and can also be used as cts input or sclk input/output for the serial channels. figure 3.5.32 port f (pf2 and pf5) internal data bus direction control (on bit basis) reset pfcr write pf write pf read pf2 (sclk0, cts0 ) pf5 (sclk1, cts1 ) function control (on bit basis) pffc write s output latch s b selector a s a selector b sclk0, sclk1 output cts0 , cts1 sclk0, sclk1 input tmp92c820 2007-02-16 92c820-89 port f register 7 6 5 4 3 2 1 0 bit symbol pf5 pf4 pf3 pf2 pf1 pf0 read/write r/w after reset 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 pf5c pf4c pf3c pf2c pf1c pf0c read/write w after reset 0 0 0 0 0 0 function 0: input 1: output port f function register 7 6 5 4 3 2 1 0 bit symbol pf5f pf3f pf2f pf0f read/write w w w after reset 0 0 0 0 function 0: port 1: sclk1 output 0: port 1: txd1 0: port 1: sclk0 output 0: port 1: txd0 3 states, open-drain setting tmp92c820 2007-02-16 92c820-90 3.5.13 port g (pg0 to pg4) pg0 to pg4 are 5-bit input port and can also be used as the analog input pins for the internal ad converter. pg3 can also be used as adtrg pin for the ad converter. figure 3.5.34 port g port g register 7 6 5 4 3 2 1 0 bit symbol pg4 pg3 pg2 pg1 pg0 read/write r after reset data from external port note: the input channel selection of ad converte r and the permission of adtrg input are set by ad converter mode register admod1. figure 3.5.35 register for port g internal data bus adtrg (only pg3) pg read port g pg0 to pg4 (an0 to an4) ad convertor channel selector ad read convertion result register pg (0040h) tmp92c820 2007-02-16 92c820-91 3.5.14 port j (pj0 to pj7) pj0 to pj7 are 8-bit output port. resetting sets the output latch pj to ?1? and pj0 to pj7 pins output ?1?. in addition to functioning as output port, port j also functions as output pins for sdram ( sdras , sdcas , sdwe , sdlldqm, sdludqm, sduldq m, sduudqm, sdcke) and sram ( srwr , srllb , srlub , srulb , sruub ). above setting is used the function register pjfc. figure 3.5.36 port j internal data bus function control2 (on bit basis) reset pjfc2 write pj write pj read pj0 ( sdras ) pj1 ( sdcas ) pj2 ( sdwe , srwr ) pj3 (sdlldqm, srllb ) pj4 (sdludqm, srlub ) pj5 (sduldqm, srulb ) pj6 (sduudqm, sruub ) pj7 (sdcke) function control (on bit basis) pjfc write output latch s a selector b c ?1?, ?1?, srwr , srllb , srlub , srulb , sruub , ?1? sdras , sdcas , sdwe , sdlldqm, sdludqm, sduldqm, sduudqm, sdcke outpt buffer tmp92c820 2007-02-16 92c820-92 port j register 7 6 5 4 3 2 1 0 bit symbol pj7 pj6 pj 5 pj4 pj3 pj2 pj1 pj0 read/write r/w after reset 1 1 1 1 1 1 1 1 port j function register 7 6 5 4 3 2 1 0 bit symbol pj7f pj6f pj5f pj4f pj3f pj2f pj1f pj0f read/write w after reset 0 0 0 0 0 0 0 0 function 0: port 1: sdcke 0: port 1: sduudqm 0: port 1: sduldqm 0: port 1: sdludqm 0: port 1: sdlldqm 0: port 1: sdwe 0: port 1: sdcas 0: port 1: sdras port j function register 2 7 6 5 4 3 2 1 0 bit symbol ? pj6f2 pj5f2 pj4f2 pj3f2 pj2f2 ? ? read/write w after reset 0 0 0 0 0 0 0 0 function always write ?0?. 0: tmp92c820 2007-02-16 92c820-93 3.5.15 port k (pk0 to pk4, pk6) port k is 6-bit output port. resetting sets th e output latch pk to ?1?, and port k pins output to ?1?. in addition to functioning as output ports, port k also functions as output pins for lcd controller (d1bscp, d2blp, d3bfr, dlebcd and doffb), output pins for rtc alarm ( alarm ) and output pin for melody/alarm generator (mldalm, mldalm ). above setting is used the function register pkfc. only pk6 has two output function which alarm and mldalm . this selection is used pk tmp92c820 2007-02-16 92c820-94 figure 3.5.39 port k (pk6) port k register 7 6 5 4 3 2 1 0 bit symbol pk6 pk4 pk3 pk2 pk1 pk0 read/write r/w r/w after reset 1 1 1 1 1 1 port k function register 7 6 5 4 3 2 1 0 bit symbol pk6f pk4f pk3f pk2f pk1f pk0f read/write w w after reset 0 0 0 0 0 0 function 0: port 1: alarm at tmp92c820 2007-02-16 92c820-95 3.5.16 port l (pl0 to pl7) pl0 to pl7 are 8-bit general-purpose i/o ports. each bit can be set individually for input or output using the control register plcr. resetting, the control register plcr to ?0? and sets port l to input ports. it also sets all bits of the output latch regi ster to ?1?. in additi on to functioning as a general-purpose i/o port, port l can also function as a data bu s for lcd controller (ld0 to ld7). above setting is used the function register plfc. figure 3.5.41 port l internal data bus direction control (on bit basis) reset plcr write pl write pl read port e pl0 to pl7 (ld0 to ld7) function control (on bit basis) plfc write s output latch s b selector a s a selector b ld7 to ld0 tmp92c820 2007-02-16 92c820-96 port l register 7 6 5 4 3 2 1 0 bit symbol pl7 pl6 pl5 pl4 pl3 pl2 pl1 pl0 read/write r/w after reset data from external port (output latch register is set to 1) port l control register 7 6 5 4 3 2 1 0 bit symbol pl7c pl6c pl5c pl4c pl3c pl2c pl1c pl0c read/write w after reset 0 0 0 0 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 read/write w after reset 0 0 0 0 0 0 0 0 function 0: port 1: data bus for lcdc (ld7 to ld0) figure 3.5.42 register for port l pl (0054h) plcr (0056h) plfc (0057h) tmp92c820 2007-02-16 92c820-97 3.6 memory controller 3.6.1 functions tmp92c820 has a memory contro ller 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 for 4-block address area (block 0 to block 5). (2) connecting memory specifications specifies sram, rom as memories to connect with the selected address areas. (3) data bus size selection whether 8 bits, 16 bits or 32 bits is selected as the data bus size 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 five mode mentioned below. 0 waits, 1 wait, 2 waits, 3 waits n waits (control with wait pin) tmp92c820 2007-02-16 92c820-98 3.6.2 control register and operation after reset release this section describes the regi sters to control the memory controller, the state after reset release and nece ssary settings. (1) control register the control registers of the memory controller are as follows. ? control register: bncsh/bncsl (n = 0 to 3, ex) sets the basic functions of the memory co ntroller, that is th e connecting memory type, the number of waits to be 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. in addition to setting of the above-mentioned registers, it is necessary to set the following registers to control rom page mode access. ? page rom control register: pmemcr sets to executed rom page mode accessing. (2) operation after reset release the start data bus size is determined depending on the state of am1/am0 pins just after reset release. then, the extern al memory is acce ssed as follows: am1 am0 start mode 0 0 don?t use this setting 0 1 start with 16-bit data bus 1 0 start with 32-bit data bus 1 1 don?t use this setting am1/am0 pins are valid only just after reset release. in the other cases, the data bus width is set to the value set to bnbus bit of the control register. after reset, only control register (b2csh/b2csl) of the block address area 2 is automatically valid. the data bus width which is specified by am1/am0 pin is loaded to the bit to specify the bus width of the control register in the block address area 2. the block address area 2 is set to address 000000h to ffffffh after reset. after reset release, the block address areas are specified by the memory start address register (msarn) and the memory address mask register (mamrn). then the control register (bncs) is set. set the enable bit (bne) of the control register to ?1? to enable the setting. tmp92c820 2007-02-16 92c820-99 3.6.3 basic functions and register setting in this section, setting of the block address area, the connecting memory, and the number of waits out of the memory controller?s functions are described. (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 between the register value and the address every bus cycles. the address bit which is masked by the memory address mask register (mamrn) is no t compared by the memory controller. the block address area size is determined by setting the memory address mask register. the set value in the register is compared with the block address area on the bus. if the compared result is a match, the memory controller sets the chip select signal ( csn ) to ?low?. (i) setting memory st art address register the ms23 to ms16 bits of the memory start address register respectively correspond with addresses a23 to a16. the lower start address a15 to a0 are always set to address 0000h. therefore the start address of the block address area are set to addresses 000000h to ff0000h every 64 kbytes. (ii) setting memory a ddress mask registers the memory address mask re gister sets whether an a ddress bit is compared or not. set the register to ?0? to co mpare, or to ?1? not to compare. the address bit to be set is depended 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 above-mentioned bits are always compared. the block address area size is determined by the compared result. 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 the block address area 2 has bit. setting tmp92c820 2007-02-16 92c820-100 (iii) example of register setting to set the block address area 512 bytes from address 110000h, set the register as follows. msar1 register 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 st art address register msar1 correspond with address a23 to a16. a15 to a0 are se t to ?0?. therefore setting msar1 to the above-mentioned value specifies the start address of the block address area to address 110000h. the start address is set as it is in the other block address areas. mamr1 register 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 set whether address a21 to a16 and a8 are co mpared or not. set the register to ?0? to compare, or to ?1? not to compare. m1 v15 to m1v9 bits set whether address a15 to a9 are compared or not with 1 bit. a23 and a22 are always compared. setting the above-mentioned compares a23 to a9 with the values set as the start addresses. therefore 512 bytes of addresses 110000h to 1101ffh are set as the block address area 1, and compared with the addresses on the bus. if the compared result is a match, the chip select signal cs1 is set to ?low?. the other block address area sizes are specified like this. similarly, a23 is always compared in bl ock address areas 2 to 3. whether a22 to a15 are compared or not is set to register. note: when the set block address area over laps with the built-in memory area, or both two address areas overlap, t he block address area is processed according to priority as follows. built-in i/o > built-in memory > block address area 0 > 1 > 2 > 3 > csex also that any accessed areas out side the address spaces set by cs0 to cs3 are processed as the csex space. ther efore, settings of csex apply for the control of wait cycles, data bus width, etc,. tmp92c820 2007-02-16 92c820-101 (2) connection memory specification setting the bnom1 to 0 bit of the control register (bncsh) specifies the memory type to be connected with the block address areas. the interface signal is output according to the set memory as follows bnom1, bnom0 bit (bncsh register) bnom1 bnom0 function 0 0 sram/rom (default) 0 1 (reserved) 1 0 (reserved) 1 1 sdram sdram is set only in block address are 1. (3) data bus width specification the data bus width is set for every block address area. the bus size is set by the bnbus1 and bnbus0 bits of the control register (bncsh) as follows. bnbus bit (bncsh register) bnbus1 bnbus0 function 0 0 8-bit bus mode (default) 0 1 16-bit bus mode 1 0 32-bit bus mode 1 1 (reserved) this way of changing the data bus size depending on the address being accessed is called ?dynamic bus sizing?. the part where the data is output to is depended on the data size, the bus width and the start address. note: since there is a possibility of abnormal writing/reading of the data if two memories with different bus width are put in consec utive address, do not execute a access to both memories with one command. tmp92c820 2007-02-16 92c820-102 cpu data operand data size (bit) operand start address memory data size (bit) cpu address d32 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 t he bus is ignored. at write, the bus is at high impedance and the write strobe signal remains to non active. tmp92c820 2007-02-16 92c820-103 (4) wait control the external bus cycle completes a wait of two states at least (100 ns at 20 mhz). setting the bnww2 to bnww0 and bnwr2 to bnwr0 of the control register (bncsl) specifies the number of waits in the read cycle and the write cycle. bnww is set with the same method as bnwr. bnww/bnwr bit (bncsl register) bnww2 bnwr2 bnww1 bnwr1 bnww0 bnwr0 function 0 0 1 2states (0 waits) access fixed mode 0 1 0 3states (1 wait) access fixed mode (default) 1 0 1 4states (2 waits) access fixed mode 1 1 0 5states (3 waits) access fixed mode 1 1 1 6states (4 waits) access fixed mode 0 1 1 wait pin input mode others (reserved) note: when sdram is specified as a connecting memory, setting should be 4 states (2 waits) in rd cycle and 3 states (1 wait) in wr cycle. (i) waits number fixed mode the bus cycle is completed with the set states. the number of states is selected from 2 states (0 waits) to 5 states (3 waits). (ii) wait pin input mode this mode samples the wait input pins. it continuously samples the wait pin state and inserts a wait if the pin is active. the bus cycle is minimum 2 states. the bus cycle is completed when the wait signal is non active (?high? level) at 2 states. the bus cycle extends if the wait signal is active at 2 states and more. (5) insert recovery cycle if a lot of connected pertain rom and et c. (much data output floating time (t df )), each other?s data-bus-output-recovery-time is trouble. however, by setting bnrec of control register (bncsh), can insert dummy cycl e of 1 state just before first bus cycle of starting access another block address. bnrec bit (bncsh register) 0 no dummy cycle is inserted (default). 1 dummy cycle is inserted. note: when use mmu, built-in ram type lcdd, this function cannot use. tmp92c820 2007-02-16 92c820-104 ? when not inserting a dummy cycle (0 waits) ? when inserting a dummy cycle (0 waits) (6) basic bus timing ? external read/write bus cycle (0 waits) ? external read/write bus cycle (1 wait) sdclk address csm csn rd sdclk address csm csn rd dumm y cs wrxx rd address in p ut out p ut read write sdclk (20 mhz) d31 to d0 d31 to d0 t1 t2 cs rd address output sdclk (20 mhz) d31 to d0 d31 to d0 t1 tw in p ut read write t2 wrxx tmp92c820 2007-02-16 92c820-105 ? external read/write bus cycle (0 waits at wait pin input mode) ? external read/write bus cycle (n waits at wait pin input mode) cs rd address in p ut out p ut read write sdclk (20 mhz) d31 to d0 d31 to d0 t1 t2 wait sam p lin g wrxx cs rd address output sdclk (20 mhz) d31 to d0 d31 to d0 t1 tw in p ut read w t2 wait sam p lin g sam p lin g wrxx tmp92c820 2007-02-16 92c820-106 ? example of wait input cycle (5 waits) csn wr 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) 12 3 4 5 6 7 csn rd wait ff _ res ff0 _ d ff0 _ q ff1 _ q ff2 _ q ff3 _ q tmp92c820 2007-02-16 92c820-107 3.6.4 rom control (page mode) this section describes rom pa ge mode accessing and how to set registers. rom page mode is set by the page rom control register. (1) operation and how to set the registers tmp92c820 supports rom access of the pa ge mode. the rom access of the page mode is specified only in the block address area 2. rom page mode is set by the page rom control register (pmemcr). setting opge bit 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 opwr1 and opwr0 bits of the pmemcr register. opwr1/opwr0 bit (pmemcr register) opwr1 opwr0 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? to the control register (bncsl) in each block address area. the page size (the number of bytes) of rom in the cpu size is set to the pr1 and 0 bit of the pmcme register. when data is read out until a 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. pr1/pr0 bit (pmemcr register) pr1 pr0 rom page size 0 0 64 bytes 0 1 32 bytes 1 0 16 bytes (default) 1 1 8 bytes (2) signal timing pulse t h a data in p ut data in p ut data in p ut data in p ut t cyc a 0~a23 sdclk d0~d31 rd cs2 + 0 + 1 + 2 + 3 t ad3 t ad2 t ad2 t ad2 t hr t h a t h a t h a t rd3 tmp92c820 2007-02-16 92c820-108 3.6.5 list of registers the memory control registers and the settings are described as follows. for the addresses of the registers, see section 5 ?table of special function registers (sfrs)?. (1) control registers the control register is a pair of bncsl and bncsh. (n is a number of the block address area.) bncsl has the same configuration regardless of the block address areas. in bncsh, only b2csh which is corresponded to the block address area 2 has a different configuration from the others. bncsl 7 6 5 4 3 2 1 0 bit symbol bnww2 bnww1 bnww0 bnwr2 bnwr1 bnwr0 read/write w w after reset 0 1 0 0 1 0 bnww<2:0> specifies the number of write waits. 001 = 2 states (0 waits) access 010 = 3 states (1 wait) access 101 = 4 states (2 waits) access 110 = 5 states (3 waits) access 111 = 6 states (4 waits) access 011 = wait pin input mode others = (reserved) bnwr<2:0> specifies the number of read waits. 001 = 2 states (0 waits) access 010 = 3 states (1 wait) access 101 = 4 states (2 waits) access 110 = 5 states (3 waits) access 111 = 6 states (4 waits) access 011 = wait pin input mode others = (reserved) b2csh 7 6 5 4 3 2 1 0 bit symbol b2e b2m b2rec b2om1 b2om0 b2bus1 b2bus0 read/write w w after reset 1 0 0 0 0 0/1 0/1 b2e: enable bit 0 = no chip select signal output. 1 = chip select signal output (default). note: after reset release, only the enable bit b2e of b2cs register is valid (?1?). b2m: block address area specification 0 = sets the block address area of cs2 to addresses 000000h to ffffffh (default). 1 = sets the block address area of cs2 to programmable. note: after reset release, the block address area 2 is set to addresses 000000h to ffffffh. tmp92c820 2007-02-16 92c820-109 b2rec: sets the dummy cycle for data output recovery time. 0 = not insert a dummy cycle (default). 1 = insert a dummy cycle. note: when using mmu, lcd of built-in ram type, this function cannot use. b2om<1:0> 00 = sram or rom (default) others = (reserved) b2bus<1:0> sets the data bus width. 00 = 8 bits (default) 01 = 16 bits 10 = 32 bits 11 = (reserved) note: the value of b2bus bit is set according to the state of am<1:0> pin after reset release. bncsh (n = 0, 1, 3) 7 6 5 4 3 2 1 0 bit symbol bne bnrec bnom1 bnom0 bnbus1 bnbus0 read/write w w after reset 0 0 0 0 0 0 bne: enable bit 0 = no chip select signal output (default). 1 = chip select signal output. note: after reset release, only the enable bit b2e of b2cs register is valid (?1?). bnrec: sets the dummy cycle for data output. 0 = not insert a dummy cycle (default). 1 = insert a dummy cycle. note: when using mmu, lcd of built-in ram type, this function cannot use. bnom<1:0> 00 = sram or rom (default) 01 = (reserved) 10 = (reserved) 11 = sdram note: sdram is set only by b1csh. bnbus<1:0> sets the data bus width. 00 = 8 bits (default) 01 = 16 bits 10 = 32 bits 11 = (reserved) tmp92c820 2007-02-16 92c820-110 bexcsl 7 6 5 4 3 2 1 0 bit symbol bexww2 bexww1 bexww0 bexwr2 bexwr1 bexwr0 read/write w w after reset 0 1 0 0 1 0 bexww<2:0> specifies the number of write waits. 001 = 2 states (0 waits) access 010 = 3 states (1 wait) access 101 = 4 states (2 waits) access 110 = 5 states (3 waits) access 111 = 6 states (4 waits) access 011 = wait pin input mode others = (reserved) bexwr<2:0> specifies the number of read waits. 001 = 2 states (0 waits) access 010 = 3 states (1 wait) access 101 = 4 states (2 waits) access 110 = 5 states (3 waits) access 111 = 6 states (4 waits) access 011 = wait pin input mode others = (reserved) bexcsh 7 6 5 4 3 2 1 0 bit symbol bexom1 bexom0 bexbus1 bexbus0 read/write w after reset 0 0 0 0 bexom<1:0> 00 = sram or rom (default) 01 = (reserved) 10 = (reserved) 11 = (reserved) bexbus<1:0> sets the data bus width. 00 = 8 bits (default) 01 = 16 bits 10 = 32 bits 11 = (reserved) tmp92c820 2007-02-16 92c820-111 (2) block address register a start address and an address area of the block address are specified by the memory start address register (msarn) and the memo ry address mask register (mamrn). the memory start address re gister sets all start address si milarly regardless of the block address areas. the bit to be set by the memory address mask register is depended on the block address area. msarn (n = 0 to 3) 7 6 5 4 3 2 1 0 bit symbol mns23 mns22 mns21 mns20 mns19 mns18 mns17 mns16 read/write r/w after reset 1 1 1 1 1 1 1 1 mns<23:16> sets a start address. sets the start address of the block address areas. t he bits are corresponding to the address a23 to a16. mamr0 7 6 5 4 3 2 1 0 bit symbol m0v20 m0v19 m0v18 m0v17 m0v16 m0v15 m0v14 to m0v9 m0v8 read/write r/w after reset 1 1 1 1 1 1 1 1 m0v<20:8> enables or masks comparison of the addresses. m0v20 to m0v8 are corresponding to addresses a20 to a8. the bits of m0v14 to m0v9 are corresponding to address a14 to a9 by 1 bit. if ?0? is set, the comparison between the value of the address bus and the start address is enabled. if ?1? is set, the comparison is masked. mamr1 7 6 5 4 3 2 1 0 bit symbol m1v21 m1v20 m1v19 m1v18 m1v17 m1v16 m1v15 to m1v9 m1v8 read/write r/w after reset 1 1 1 1 1 1 1 1 m1v<21:8> enables or masks comparison of the addresses. m1v21 to m1v8 are corresponding to addresses a21 to a8. the bits of m1v15 to m1v9 are corresponding to address a15 to a9 by 1 bit. if ?0? is set, the comparison between the value of the address bus and the start address is enabled. if ?1? is set, the comparison is masked. mamrn (n = 2 to 3) 7 6 5 4 3 2 1 0 bit symbol mnv22 mnv21 mnv20 mnv19 mnv18 mnv17 mnv16 mnv15 read/write r/w after reset 1 1 1 1 1 1 1 1 mnv<22:15> enables or masks comparison of the addresses. mnv22 to mnv1 5 are corresponding to addresses a22 to a15. if ?0? is set, the comparison between the value of the address bus and t he start address is enabled. if ?1? is set, the comparison is masked. after a reset, masr0 to masr3 and mamr0 to mamr3 are set to ?ffh?. b0csh tmp92c820 2007-02-16 92c820-112 (3) page rom control register (pmemcr) the page rom control register sets page rom accessing. rom page accessing is executed only in block address area 2. pmemcr 7 6 5 4 3 2 1 0 bit symbol opge opwr1 opwr0 pr1 pr0 read/write r/w after reset 0 0 0 1 0 opge enable bit 0 = no rom page mode accessing (default) 1 = rom page mode accessing opwr<1:0> specifies the number of waits. 00 = 1 state (n-1-1-1 mode) (n 2) (default) 01 = 2 states (n-2-2-2 mode) (n 3) 10 = 3 states (n-3-3-3 mode) (n 4) 11 = (reserved) note: set the number of waits ?n? to the control register (bncsl) in each block address area. pr<1:0> rom page size 00 = 64 bytes 01 = 32 bytes 10 = 16 bytes (default) 11 = 8 bytes tmp92c820 2007-02-16 92c820-113 table 3.6.1 control register 7 6 5 4 3 2 1 0 bit symbol b0ww2 b0ww1 b0ww0 b0wr2 b0wr1 b0wr0 read/write w w after reset 0 1 0 0 1 0 bit symbol b0e ? ? b0rec b0om1 b0om0 b0bus1 b0bus0 read/write w after reset 0 0 (note) 0 (note) 0 0 0 0/1 0/1 bit symbol m0v20 m0v19 m0v18 m0v17 m0v16 m0v15 m0v14-v9 m0v8 read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol m0s23 m0s22 m0s21 m0s20 m0s19 m0s18 m0s17 m0s16 read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol b1ww2 b1ww1 b1ww0 b1wr2 b1wr1 b1wr0 read/write w w after reset 0 1 0 0 1 0 bit symbol b1e ? ? b1rec b1om1 b1om0 b1bus1 b1bus0 read/write w after reset 0 0 (note) 0 (note) 0 0 0 0/1 0/1 bit symbol m1v21 m1v20 m1v19 m1v18 m1v17 m1v16 m1v15-v9 m1v8 read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol m1s23 m1s22 m1s21 m1s20 m1s19 m1s18 m1s17 m1s16 read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol b2ww2 b2ww1 b2ww0 b2wr2 b2wr1 b2wr0 read/write w w after reset 0 1 0 0 1 0 bit symbol b2e b2m ? b2rec b2om1 b2om0 b2bus1 b2bus0 read/write w after reset 1 0 0 (note) 0 0 0 0/1 0/1 bit symbol m2v22 m2v21 m2v20 m2v19 m2v18 m2v17 m2v16 m2v15 read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol m2s23 m2s22 m2s21 m2s20 m2s19 m2s18 m2s17 m2s16 read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol b3ww2 b3ww1 b3ww0 b3wr2 b3wr1 b3wr0 read/write w w after reset 0 1 0 0 1 0 bit symbol b3e ? ? b3rec b3om1 b3om0 b3bus1 b3bus0 read/write w after reset 0 0 (note) 0 (note) 0 0 0 0/1 0/1 bit symbol m3v22 m3v21 m3v20 m3v19 m3v18 m3v17 m3v16 m3v15 read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol m3s23 m3s22 m3s21 m3s20 m3s19 m3s18 m3s17 m3s16 read/write r/w after reset 1 1 1 1 1 1 1 1 bit symbol bexom1 bexom0 bexbus1 bexbus0 read/write w after reset 0 0 0 0 bit symbol bexww2 bexww1 bexww0 bexwr2 bexwr1 bexwr0 read/write w w after reset 0 1 0 0 1 0 bit symbol opge opwr1 opwr0 pr1 pr0 read/write r/w after reset 0 0 0 1 0 note: always write ?0?. b0csl (0140h) b0csh (0141h) mamr0 (0142h) msar0 (0143h) b1csl (0144h) b1csh (0145h) mamr1 (0146h) msar1 (0147h) b2csl (0148h) b2csh (0149h) mamr2 (014ah) msar2 (014bh) b3csl (014ch) b3csh (014dh) mamr3 (014eh) msar3 (014fh) bexcsh (0159h) bexcsl (0158h) pmemcr (0166h) tmp92c820 2007-02-16 92c820-114 3.6.6 cautions (1) note on timing between cs and rd if the parasitic capacitance of the read signal (output enable signal) is greater than that of the chip select signal, it is possible that an unintended read cycle occurs due to a delay in the read signal. such an unintended read cycle may cause a trouble as in the case of (a) in 0h figure 3.6.1 figure 3.6.1 read signal delay read cycle example: when using an externally co nnected flash eeprom which users jedec standard commands, note that the toggle bit may not be read out correctly. if the read signal in the cycle immediately preceding the access to the flash eeprom does not go high in time, as shown in 1h figure 3.6.2 an unintended read cycle like the one shown in (b) may occur. figure 3.6.2 flash eeprom toggle bit read cycle when the toggle bit reverse with this unexp ected read cycle, tm p92c820 always reads same value of the toggle bit, and cann ot read the toggle bit correctly. to avoid this phenomena, the data polling control recommended. rd address sdclk (20 mhz) memory 1cs memory 2cs (a) address sdclk (20 mhz) flash eeprom chip select read (b) toggle bit memor y access toggle bit rd c y cle 1 tmp92c820 2007-02-16 92c820-115 (2) 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 tmp92c820 2007-02-16 92c820-116 3.7 8-bit timers (tmra) the tmp92c820 features 4 built-in 8-bit timers. these timers are paired into four 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 cycle with variable period) ? 8-bit pulse width modulation output mode (pwm : variable duty cycle with constant period) 0h figure 3.7.1 to 1h figure 3.7.2 show block diag rams 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 controlled by five controls 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 sfrs 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 output mode (5) mode setting table 3.7.1 registers and pins for each module module tmra01 tmra23 input pin for external clock ta0in (shared with pc0) no external pin output pin for timer flip-flop ta1out (shared with pc1) ta3out (shared with pc5) 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) tmp92c820 2007-02-16 92c820-117 3.7.1 block diagrams figure 3.7.1 tmra01 block diagram t1 t16 t256 8-bit comparator (cp1) 8-bit comparator (cp0) 8-bit up counter (uc0) 2 n overflow 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 external input clock: ta0in ta01mod tmp92c820 2007-02-16 92c820-118 figure 3.7.2 tmra23 block diagram t1 t16 t256 8-bit comparator register (cp3) 8-bit comparator (cp2) 8-bit up counter (uc2) 2 n overflow 8-bit up counter (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 tmp92c820 2007-02-16 92c820-119 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 tmp92c820 2007-02-16 92c820-120 (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. the ta0reg are double buffer structure, each of which makes a pair with register buffer. the setting of the bit ta01run tmp92c820 2007-02-16 92c820-121 (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 zero 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 signal (8-bit comparator output) of each interval timer. whether inversion is enabled or disabled is determined by the setting of the bit ta 1ffcr tmp92c820 2007-02-16 92c820-122 3.7.3 sfrs tmra01 run register 7 6 5 4 3 2 1 0 bit symbol ta0rde i2ta01 ta01prun ta1run ta0run read/write r/w 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) timer run/stop control 0 stop and clear 1 run (count up) ta0reg double buffer control 0 disable 1 enable 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 read/write r/w 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) timer run/stop control 0 stop and clear 1 run (count up) ta2reg double buffer control 0 disable 1 enable note: the values of bits 4 to 6 of ta23run are undefined when read. figure 3.7.4 tmra registers (1) ta01run (1100h) ta23run (1108h) tmp92c820 2007-02-16 92c820-123 tmra01 mode register 7 6 5 4 3 2 1 0 bit symbol ta01m1 ta01m0 pwm01 pwm 00 ta1clk1 ta1clk0 ta0clk1 ta0clk0 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: ta0in pin (note) 01: t1 10: t4 11: t16 tmra0 source clock selection 00 ta0in (external input) 01 t1 10 t4 11 t16 tmra1 source clock selection ta01mod tmp92c820 2007-02-16 92c820-124 tmra23 mode register 7 6 5 4 3 2 1 0 bit symbol ta23m1 ta23m0 pwm21 pwm 20 ta3clk1 ta3clk0 ta2clk1 ta2clk0 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 tmra3 clock for tmra3 00: ta2trg 01: t1 10: t16 11: t256 tmra2 clock for tmra2 00: reserved 01: t1 10: t4 11: t16 tmra2 source clock selection 00 do not set 01 t1 10 t4 11 t16 tmra3 source clock selection ta23mod tmp92c820 2007-02-16 92c820-125 tmra1 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ta1ffc1 ta1ffc0 ta1ffie ta1ffis read/write r/w r/w after reset 1 1 0 0 function 00: invert ta1ff 01: set ta1ff 10: clear ta1ff 11: don?t care ta1ff control for inversion 0: disable 1: enable ta1ff1 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 bits 4 to 7 of ta1ffcr are undefined when read. figure 3.7.7 tmra registers (4) ta1ffcr (1105h) read-modify -write instructions are prohibited. tmp92c820 2007-02-16 92c820-126 tmra3 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ta3ffc1 ta3ffc0 ta3ffie ta3ffis read/write r/w r/w after reset 1 1 0 0 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 bits 4 to 7 of ta3ffcr are undefined when read. figure 3.7.8 tmra register ta3ffcr (110dh) read-modify -write instructions are prohibited. tmp92c820 2007-02-16 92c820-127 tmra register (ta0reg to ta3reg) 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 for above registers. figure 3.7.9 register for 8-bit timers tmp92c820 2007-02-16 92c820-128 3.7.4 operation in each mode (1) 8-bit timer mode both timer 0 and timer 1 can be used in dependently as 8-bit interval timers. 1. generating interrupts at a fixed interval (using tmra1) to generate interrupts at constant inte rvals using timer 1 (intta1), first stop tmra1 then set the operation mode, input clock and a cycle to ta01mod and ta1reg register, respectively. 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 210 ta01run ? x x x ? ? 0 ? stop tmra1 and clear it to 0. ta01mod 0 0 ? ? 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 ta1reg 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 4h 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 ) t4 (32/f sys ) t16 (128/f sys ) t256 (2048/f sys ) 0.4 s to 102.4 s 1.6 s to 409.6 s 6.4 s to 1.638 ms 102.4 s to 26.21 ms 0.4 s 1.6 s 6.4 s 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: match output of tmra0 (t a0trg) and can be selected from t1, t16, t256 tmp92c820 2007-02-16 92c820-129 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 the appropriate register settings. this example uses timer 1; however, either timer 0 or timer 1 may be used. 7 6 5 4 3 210 ta01run ? x x x ? ? 0 ? stop tmra1 and clear it to 0. ta01mod 0 0 ? ? 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 timer 1. pccr x ? ? x ? x1 ? pcfc x ? ? x ? x1 ? set pc1 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) 1.2 s at f c = 40 mhz 0 1 2 3 0 1 2 3 0 1 2 3 0 t1 ta01run tmp92c820 2007-02-16 92c820-130 3. making tmra1 count up on the match signal from the tmra0 comparator select 8-bit timer mode and set the comp arator 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 time r in which tmra0 and tmra1 are cascaded together, set ta01mod tmp92c820 2007-02-16 92c820-131 the comparator match signal is output from tmra0 each time the up counter uc0 matches ta0reg, though the up counter uc0 is not be 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 ac tive high. in this mode tmra1 cannot be used. tmra0 outputs pulses on the ta1out pin (which can also be used as pc1). 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 timer out p ut ta1out tmra1 comparator match detect signal interru p t intta0 0080h t ta0reg ta1reg example: tmp92c820 2007-02-16 92c820-132 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 (uc1) is not used in this mode, ta01run tmp92c820 2007-02-16 92c820-133 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)) (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 3 210 ta01run 0 x x x ? 0 0 0 stop tmra0 and tmra1 and clear it to ?0?. ta01mod 1 0 ? ? ? ? 0 1 set the 8-bit ppg mode, and select t1 as input clock. ta0reg 0 0 0 0 1 0 1 0 write 0ah ta1reg 0 0 1 0 1 0 0 0 write 28h ta1ffcr x x x x 0 1 1 ? set ta1ff, enabling both inversion and the double buffer. 10 generates a negative logic pulse. pccr x ? ? x ? x1 ? pcfc x ? ? x ? x1 ? set pc1 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 tmp92c820 2007-02-16 92c820-134 (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 tmp92c820 2007-02-16 92c820-135 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 to 0.4 s (at 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 3 210 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 1 0 1 0 write 5ah. ta1ffcr x x x x 1 0 1 ? clear ta1ff to 0, enable the inversion and double buffer. pccr x ? ? x ? x1 ? pcfc x ? ? x ? x1 ? set pc1 and 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 com p ared ) re g ister buffe r 2 n overflow 36.0 s 51.2 s tmp92c820 2007-02-16 92c820-136 table 3.7.4 pwm cycle pwm cycle taxxmod tmp92c820 2007-02-16 92c820-137 3.8 external memory extension function (mmu) this is mmu function which can expand program/ data area to 136 mbytes by having 4 local area. address pins to external memory are 2 exte nded address bus pins (ea24, ea25) and 8 extended chip select pins ( cs2a to cs2g and csexa ) in addition to 24 address bus pins (a0 to a23) which are common specification of tlcs-900/h1 and 4 chip select pins ( cs0 to cs3 ) output from memc. the feature and the recommendation setting method of two types are shown below. in addition, ah in the table is the value which number address 23 to 16 displayed as hex. purpose item for standard extended memory for many kinds class extended memory maximum memory size 2 mbytes: common2 + 14 mbytes: bank (16 mbytes 1 pcs) used local area, bank number local2 (ah = c0 to df: 2 mbytes 7 bank) setting memc setup ah = ?80 to ff? to cs2 program rom used cs pin cs2a maximum memory size 96 mbytes (16 mbytes 6 pcs) used local area, bank number local3 (ah = 80 to bf: 4 mbytes 24 bank) setting memc setup ah = ?80 to ff? to cs2 data rom used cs pin cs2b , cs2c , cs2d , cs2e , cs2f , cs2g maximum memory size 2 mbytes: common1 + 14 mbytes: bank (16 mbytes 1 pcs) used local area, bank number local1 (ah = 40 to 5f: 2 mbytes 7 bank) setting memc setup ah = ?40 to 7f? to cs1 data sdram * used cs pin cs1 maximum memory size 1 mbyte: common0 + 7 mbytes: bank (8 mbytes 1 pcs) used local area, bank number local0 (ah = 10 to 1f: 1 mbyte 7 bank) setting memc setup ah = ?00 to 1f? to cs3 data ram used cs pin cs3 maximum memory size 1 mbyte (1 mbyte 1 pcs) used local area, bank number none setting memc setup ah = ?20 to 2f? to cs0 extended memory 1 used cs pin cs0 maximum memory size 256 kbytes (256 kbytes 1 pcs) used local area, bank number none setting memc setup ah = ?30 to 3f? to csex extended memory 2 used cs pin csexa maximum memory size 256 kbytes (64 kbytes 4 pcs) used local area, bank number none setting memc setup ah = ?30 to 3f? to csex extended memory 3 (direct address assigned built-in type lcd driver) used cs pin d1bscp, d2blp, d3bfr, dlebcd maximum memory size 512 kbytes used local area, bank number none setting memc setup ah = ?30 to 3f? to csex extended memory 4 used cs pin none * note: sdram must be mapped in local1 area. it can?t use other area. tmp92c820 2007-02-16 92c820-138 3.8.1 recommendable memory map the recommendation logic address memory map at the time of variety extension memory correspondence is shown in 0h figure 3.8.1. and, a physical-address map is shown in 1h figure 3.8.2. however, when memory area is less than 16 mb ytes and is not expanded, please refer to section of memc. setting of regi ster in mmu is not necessary. since it is being fixed, the address of a local-area cannot be changed. when sdram is used, must locate to local1 area. figure 3.8.1 logical address map 256 bytes 64 kbytes 64 kbytes 512 kbytes 1 mbyte 1 mbyte common0 local0 local1 common1 local3 local2 common2 vector area 1 mbyte 256 kbytes 64 kbytes 64 kbytes 2 mbytes 2 mbytes 4 mbytes 2 mbytes 2 mbytes 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 22 23 0 1 2 3 4 5 6 7 000000h 100000h 200000h 300000h 380000h 3c0000h 3d0000h 3e0000h 3f0000h 400000h 600000h 800000h c00000h e00000h ffff00h ffffffh a ddress size memory map bank cs3 cs0 csex csex csex csex csex csex cs1 cs2 cs2 cs/wait cs pin cs3 cs0 to csexa d1bscp d2blp d3bfr dlebcd cs1 cs2b (bank0 to bank3) cs2c (bank4 to bank7) cs2d (bank8 to bank11) cs2e (bank12 to bank15) cs2f (bank16 to bank19) cs2g (bank20 to bank23) cs2a : internal area : overlapped with common area tmp92c820 2007-02-16 92c820-139 figure 3.8.2 physical address map bank3 bank2 bank0 bank1 bank0 bank1 bank2 bank3 bank4 bank5 bank6 bank7 bank0 bank1 bank2 bank3 bank4 bank5 bank6 bank7 bank0 bank1 bank2 bank3 bank4 bank5 bank6 bank7 bank15 bank14 bank12 bank13 000000h internal-i/o and ram 800000h 1000000h local0 cs3 for data ram (sdram non support) (8 mbytes) local1 cs1 for option program rom (sdram support) (16 mbytes) local2 cs2a for program rom (16 mbytes) local3 cs2b cs2e for data rom (16 mbytes 6) bank7 bank6 bank4 bank5 bank19 bank18 bank16 bank17 cs2f cs2c 1000000h 000000h reset and interrupt vector area bank11 bank10 bank8 bank9 bank23 bank22 bank20 bank21 cs2g cs2d 1000000h 000000h : internal area : overlapped with common area tmp92c820 tmp92c820 2007-02-16 92c820-140 3.8.2 block diagram figure 3.8.3 block diagram of mmu l0e l1e l2e l3e decoder ea22 to ea20 ea23 to ea21 ea23 to ea21 ea26 to ea22 selector a 23 to a20 cpu out address a23 to a8 local0 register local1 register local2 register local3 register internal data bus selector physical address va26 to va20 a23 to a16 physical address wa26 to wa7 (to external address bus pins) cpu out address a19 to a7 decoder cs2a cs2b cs2c cs2d cs2e cs2f cs2g csexa cpu out address a23 to a16 local3 area detect signal local3 register local3 area detect signal tmp92c820 2007-02-16 92c820-141 3.8.3 control registers local0 register 7 6 5 4 3 2 1 0 bit symbol l0e l0ea22 l0ea21 l0ea20 read/write r/w r/w after reset 0 0 0 0 function use bank for local0 0: not use 1: use setting bank number for local0 local1 register 7 6 5 4 3 2 1 0 bit symbol l1e l1ea23 l1ea22 l1ea21 read/write r/w r/w after reset 0 0 0 0 function use bank for local1 0: not use 1: use setting bank number for local1 local2 register 7 6 5 4 3 2 1 0 bit symbol l2e l2ea23 l2ea22 l2ea21 read/write r/w r/w after reset 0 0 0 0 function use bank for local2 0: disable 1: enable setting bank number for local2 local3 register 7 6 5 4 3 2 1 0 bit symbol l3e l3ea26 l3ea25 l3ea24 l3ea23 l3ea22 read/write r/w r/w after reset 0 0 0 0 0 0 function use bank for local3 0: disable 1: enable 00000 to 00011 cs2b 00100 to 00111 cs2c 01000 to 01011 cs2d 01100 to 01111 cs2e 10000 to 10011 cs2f 10100 to 10111 cs2g 11000 to 11111: set prohibition figure 3.8.4 mmu control register local0 (01d0h) local1 (01d1h) local2 (01d2h) local3 (01d3h) tmp92c820 2007-02-16 92c820-142 3.8.4 operational description setup bank value and bank use in bank setting register of each local area of local register in common area. moreover, in that case, a combination pin is set up and the memc simultaneously sets up mapping. when cpu outputs logical address of the local area, mmu outputs physical address to the outside pin according to value of bank setting register. access of external memory becomes possible therefore. common area located in each local area should be passed surely when changing bank. for example, when the program jump bank0 of local2 to bank6, please jump from bank0 to common2 once and afterwards jump to bank6. please do not use as bank that overlaps with another bank since this common area overlaps with either of eight banks of local area on the physical map. example program is as next page follows. tmp92c820 2007-02-16 92c820-143 * in case of 16-bit bus memory, address connection is : cpu a1 = memory a0, cpu a2 = memory a1 * in case of 8-bit bus memory, address connection is : cpu a0 = memory a0, cpu a1 = memory a1 figure 3.8.5 h/w setting example at, 2h figure 3.8.5 it shows example of connection tmp92c820 and some memories: program rom: mrom, 16 mbytes, data rom: mrom, 64 mbytes, data ram of 8-bit bus: sram, 8 mbytes, display ram: sdram, 16 mbytes. in case of 16-bit bus memory connection, it needs to shift 1-bit address bus from tmp92c820 and 8-bit bus case, direct co nnection address bus from tmp92c820. in that figure, logical address and physical address are shown. and each memory allot each chip select signal, ram: cs0 , sdram: cs1 , program mrom: cs2 , data mrom: cs3 . in case of this example, as data mrom is 64 mbytes, this mrom connect to ea24 and ea25. initial condition after reset, because tmp92c820 access from cs2 area, cs2 area allots to program rom. it can set free setting except program rom. sram 8 mbytes 8 bits rd wrll , wrlu , wrul , wruu srllb , srlub , srulb , sruub : sram sdclk, sdcke sdlldqm, sdludqm, sduldrm, sduudqm sdcsl , sdcsh , sdras , sdcas , sdwe cs0 ea24, ea25 tmp92c820 cs1 cs3 cs2 mrom 16 mbytes 16 bits sdram 16 mbytes 16 bits mrom 64 mbytes 16 bits data address data/stack ram cs0 000000h~1fffffh (logical) 000000h~7fffffh (physical) display sdram cs1 400000h~7fffffh (logical) 000000h~ffffffh (physical) program rom cs2 c00000h~ffffffh (logical) 000000h~ffffffh (physical) data rom cs3 800000h~bfffffh (logical) 000000h~3fffffh (physical) tmp92c820 2007-02-16 92c820-144 ; initial setting ; cs0 ld (msar0), 00h ; logical address area: 000000h to 1fffffh ld (mamr0), ffh ; logical address size: 2 mbytes ld (b0csl), 22h ; condition: wr 3 st ates (1 wait), rd 3 states (1 wait) ld (b0csh), 80h ; sram, 8 bits ; cs1 ld (msar1), 40h ; logical address area: 400000h to 7fffffh ld (mamr1), ffh ; logical address size: 4 mbytes ld (b1csl), 11h ; condition: wr 2 states (0 waits) rd 2 states (0 waits) ld (b1csh), 8dh ; condition: sdram, 16 bits ; cs2 ld (msar2),c0h ; logical address area: c00000h to ffffffh ld (mamr2), 7fh ; logical address size: 4 mbytes ld (b2csl), 11h ; condition: wr 2 states (0 waits) rd 2 states (0 waits) ld (b2csh), 0c1h ; condition: rom, 16 bits ; cs3 ld (msar3), 80h ; logical address area: 800000h to bfffffh ld (mamr3), 7fh ; logical address size: 4 mbytes ld (b3csl), 66h ; condition: wr 5 states (3 waits), rd 5 states (3 waits) ld (b3csh), 81h ; condition: rom,16 bits ; csx ld (bexcsl), 11h ; condition: wr 2 stat es (0 waits), rd 2 states (0 waits) ld (bexcsh), 01h ; condition: 16 bits ; port ld (p8fc), 3fh ; cs0 to cs3 , ea24, ea25: port 8 setting ld (p8fc2), 02h ; cs1 sdcsl setting ~ ldw (p7cr), 1f1fh ; wruu , wrul , wrlu , wrll , rd ld (pjfc), 0ffh ; pj<7:0> = sdram control ld (sdacr), 083h ; add-mux sele ct type b, sdram, auto init enable ~ sdram setup time ld (sdrcr), 01h ; interval refresh figure 3.8.6 bank o peration s/w example 1 secondly, it shows example of initial setting at 3h figure 3.8.6. because cs0 connect to ram: 8-bit bus, 8 mbytes, it need to set 8-bit bus. at this example, it set 3 states setting. in the same way cs1 set to 16-bit bus and 2 states, cs2 set 16-bit bus and 2 states, cs3 set 16-bit bus and 5 states. by memc controller, each chip selection sign al?s memory size, don?t set actual connect memory size, need to set that logical address size: fitting to each local area. actual physical address is set by each area ?s bank register setting. csex setting of memc is except above cs0 to cs3?s setting. this program example isn?t used csex setting. finally pin condition is set. ports 80 to 85 set to cs0 , cs1 , cs2 , cs3 , ea24, ea25, and sdram condition. tmp92c820 2007-02-16 92c820-145 ; bank operation ; ***** cs2 ***** org 000000h ; program rom: start address at bank0 of local2 org 200000h ; program rom: start address at bank1 of local2 org 400000h ; program rom: start address at bank2 of local2 org 600000h ; program rom: start address at bank3 of local2 org 800000h ; program rom: start address at bank4 of local2 org a00000h ; program rom: start address at bank5 of local2 org c00000h ; program rom: start address at bank6 of local2 org e00000h ; program rom: start address at bank7 ( = common2) of local2 ; logical address e00000h to ffffffh ; physical address 0e00000h to 0ffffffh ld (local3), 85h ; local3 bank5 set 14xxxxh ldw hl, (800000h) ; load data (5555h) form bank5 (140000h: physical address) of local3 ( cs3 ) ld (local3), 88h ; local3 bank8 set 20xxxxh ldw bc, (800000h) ; load data (aaaah) form bank8 (200000h: physical address) of local3 ( cs3 ) ~ org ffffffh ; program rom: end address at bank7 ( = common2) of local2 ; ***** cs3 ***** org 0000000h ; data rom: start address at bank0 of local3 org 0400000h ; data rom: start address at bank1 of local3 org 0800000h ; data rom: start address at bank2 of local3 org 0c00000h ; data rom: start address at bank3 of local3 org 1000000h ; data rom: start address at bank4 of local3 org 1400000h ; data rom: start address at bank5 of local3 dw 5555h ~ org 1800000h ; data rom: start address at bank6 of local3 org 1c00000h ; data rom: start address at bank7 of local3 org 2000000h ; data rom: start address at bank8 of local3 dw aaaah ~ org 2400000h ; data rom: start address at bank9 of local3 org 2800000h ; data rom: start address at bank10 of local3 org 2c00000h ; data rom: start address at bank11 of local3 org 3000000h ; data rom: start address at bank12 of local3 org 3400000h ; data rom: start address at bank13 of local3 org 3800000h ; data rom: start address at bank14 of local3 org 3c00000h ; data rom: start address at bank15 of local3 org 3ffffffh ; data rom: end address at bank15 of local3 figure 3.8.7 bank o peration s/w example 2 here shows example of data access between one bank and other bank. 4h figure 3.8.7 is one software example. a dot line square area shows one memory and each dot line square shows cs2 ?s program rom and cs3 ?s data rom. program start from e00000h address, firstly, write to bank register of local3 area upper 5-bit address of access point. in case of this example, because most upper address bit of physical address is ea25, most upper address bit of bank register is meaningl ess. 4 bits of upper 5 bits address means 16 banks. after setting bank5, accessing 800 000h to bfffffh address: logical local3 address, actually access to physical 1400000h to 1700000h address. tmp92c820 2007-02-16 92c820-146 ; bank operation ; ***** cs2 ***** org 000000h ; program rom: start address at bank0 of local2 org 200000h ; program rom: start address at bank1 of local2 nop ; operation at bank1 of local2 ~ jp e00100h ; jump to bank7 ( = common2) of local2 org 400000h ; program rom: start address at bank2 of local2 org 600000h ; program rom: start address at bank3 of local2 nop ; operation at bank3 of local2 ~ jp e00200h ; jump to bank7 ( = common2) of local2 org 800000h ; program rom: start address at bank4 of local2 org a00000h ; program rom: start address at bank5 of local2 org c00000h ; program rom: start address at bank6 of local2 !!!! program start !!!! org e00000h ; program rom: start address at bank7 ( = common2) of local2 ; logical address e00000h to ffffffh ; physical address 0e00000h to 0ffffffh ld (local2), 81h ; local2 bank1 set 20xxxxh jp c00000h ; jump to bank1 (200000h: physical address) of local2 ~ org e00100h ld (local2), 83h ; local2 bank3 set 60xxxxh jp c00000h ; jump to bank3 (600000h: physical address) of local2 ~ org e00200h ld (local1), 00h ; disable bank! ~ ; lcd display set ld (lsarch), 60h ; c_area start address ld (lsarcm), 00h ; c_area start address ld (lsarcl), 00h ; c_area start address set 0, (lctctl) ; lcd display start org ffffffh ; program rom: end address at bank7 ( = common2) of local2 ; ***** cs1 ***** org 000000h ; sdram: start address at bank0 of local1 org 200000h ; sdram: start address at bank1 of local1 org 400000h ; sdram: start address at bank2 of local1 org 600000h ; sdram: start address at bank3 ( = common1) of local1 dl 01234567h ; display data ~ org 800000h ; sdram: start address at bank4 of local1 org a00000h ; sdram: start address at bank5 of local1 org c00000 ; sdram: start address at bank6 of local1 org e00000h ; sdram: star t address at bank7 of local1 org ffffffh ; sdram: end address at bank7 of local1 figure 3.8.8 bank o peration s/w example 3 tmp92c820 2007-02-16 92c820-147 at 5h figure 3.8.8, it shows example of program jump. in the same way with before example, two dot line squares show each cs2 ?s program rom and cs1 ?s (sdcs) sdram. program start from e00000h common address, firstly, write to bank register of local2 area upper 3-bit address of jumping point. after setting bank1, jumpin g c00000h to dfffffh address: logical local2 address, actually jump to physical 200000h to 3fffffh address. when return to common area, it can only jump to e00000h to ffffffh withou t writing to bank re gister of local2 area. by a way of setting of bank register, the setting that bank address and common address conflict with is possi ble. when two kinds or more logical addresses to show common area exist, management of bank is confused. we recommends not to use the bank setting, bank address and common address conflict with. please set similarly when jumping through cs . after setting bank4, jumping 400000h to 5 fffffh address: logi cal local area of cs1 , actually jump to physical 800000h to 9fffffh address. when using lcd display data for sdram, we recommend setting display area to common area in sdram. because of, lcd displays dma occurs at synchronous less. if sdram bank is change; you don?t need to care only common area. it is a mark paid attention to here, it needs to go by way of common area by all means when moves from a bank to a bank. in other words, it must write to bank register only in common area and it prohibits writing the bank registers in bank area. if it modify the bank register?s data in bank area, program run away. please do no t set bank function of mmu as display ram. this is because reading lcdc display data is not controlled by the cpu. therefore if bank of display area is changed during lcd displaying, it cannot display. it is recommended to allocate disp lay data to a common area. tmp92c820 2007-02-16 92c820-148 3.9 serial channels (sio) the tmp92c820 includes three serial i/o channels. for each channel either uart mode (asynchronous transmission) or i/o interface mode (synchronous transmi ssion) can be selected. (channel 2 can be selected only uart mode.) ? i/o interface mode mode 0: for transmitting and receiving i/o data using the synchronizing signal sclk for extending i/o. mode 1: 7-bit data ? uart mode 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 slav e controllers via a serial link (multi-controller system). 0h figure 3.9.2, 1h figure 3.9.3, and 2h figure 3.9.4 are block diagrams for each channel. each channel can be used independently. each channel operates in the same fashion except for the following points; hence only the operation of channel 0 is explained below. table 3.9.1 differences between channels 0 to 2 channel 0 channel 1 channel 2 pin name txd0 (pf0) rxd0 (pf1) 0 cts /sclk0 (pf2) txd1 (pf3) rxd1 (pf4) 1 cts /sclk1 (pf5) txd2 (p95) rxd2 (p96) irda mode yes no no this chapter contains the following sections: 3h 3.9.1 4h block diagrams 5h 3.9.2 6h operation for each circuit 7h 3.9.3 8h sfrs 9h 3.9.4 10h operation in each mode 11h 3.9.5 12h support for irda tmp92c820 2007-02-16 92c820-149 figure 3.9.1 data formats stop bit0 1 2 3 4 5 6 7 bit0 1 2 3 4 5 6stop start bit0 1 2 3 4 5 parity stop start 6 bit0 1 2 3 4 5 7stop 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 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 tmp92c820 2007-02-16 92c820-150 3.9.1 block diagrams figure 3.9.2 block diagram of serial channel 0 selector t0 t2 t8 t32 sc0mod0 tmp92c820 2007-02-16 92c820-151 figure 3.9.3 block diagram of serial channel 1 selector t0 t2 t8 t32 sc1mod0 tmp92c820 2007-02-16 92c820-152 figure 3.9.4 block diagram of serial channel 2 selector t0 t2 t8 t32 sc2mod0 |