Part Number Hot Search : 
X9250 1N5369B 58SFBB 1595MNR2 NID30 31BCP EL400CS MH80626C
Product Description
Full Text Search
 

To Download R5S72011 Datasheet File

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


  Datasheet File OCR Text:
  revision date: sep. 07, 2007 32 hardware manual renesas 32-bit risc microcomputer superh tm risc engine family / sh7200 series R5S72011 rev.2.00 rej09b0321-0200 sh7201 group
rev. 2.00 sep. 07, 2007 page ii of xxviii
rev. 2.00 sep. 07, 2007 page iii of xxviii 1. this document is provided for reference purposes only so that renesas customers may select the appropriate renesas products for their use. renesas neither makes warranties or representations with respect to the accuracy or completeness of the information contained in this document nor grants any license to any intellectual property rights or any other rights of renesas or any third party with respect to the information in this document. 2. renesas shall have no liability for damages or infringement of any intellectual property or other rights arising out of the use of any information in this document, including, but not limited to, product data, diagrams, charts, programs, algorithms, and application circuit examples. 3. you should not use the products or the technology described in this document for the purpose of military applications such as the development of weapons of mass destruction or for the purpose of any other military use. when exporting the products or technology described herein, you should follow the applicable export control laws and regulations, and procedures required by such laws and regulations. 4. all information included in this document such as product data, diagrams, charts, programs, algorithms, and application circuit examples, is current as of the date this document is issued. such information, however, is subject to change without any prior notice. before purchasing or using any renesas products listed in this document, please confirm the latest product information with a renesas sales office. also, please pay regular and careful attention to additional and different information to be disclosed by renesas such as that disclosed through our website. (http://www.renesas.com ) 5. renesas has used reasonable care in compiling the information included in this document, but renesas assumes no liability whatsoever for any damages incurred as a result of errors or omissions in the information included in this document. 6. when using or otherwise relying on the information in this document, you should evaluate the information in light of the total system before deciding about the applicability of such information to the intended application. renesas makes no representations, warranties or guaranties regarding the suitability of its products for any particular application and specifically disclaims any liability arising out of the application and use of the information in this document or renesas products. 7. with the exception of products specified by renesas as suitable for automobile applications, renesas products are not designed, manufactured or tested for applications or otherwise in systems the failure or malfunction of which may cause a direct threat to human life or create a risk of human injury or which require especially high quality and reliability such as safety systems, or equipment or systems for transportation and traffic, healthcare, combustion control, aerospace and aeronautics, nuclear power, or undersea communication transmission. if you are considering the use of our products for such purposes, please contact a renesas sales office beforehand. renesas shall have no liability for damages arising out of the uses set forth above. 8. notwithstanding the preceding paragraph, you should not use renesas products for the purposes listed below: (1) artificial life support devices or systems (2) surgical implantations (3) healthcare intervention (e.g., excision, administration of medication, etc.) (4) any other purposes that pose a direct threat to human life renesas shall have no liability for damages arising out of the uses set forth in the above and purchasers who elect to use renesas products in any of the foregoing applications shall indemnify and hold harmless renesas technology corp., its affiliated companies and their officers, directors, and employees against any and all damages arising out of such applications. 9. you should use the products described herein within the range specified by renesas, especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. renesas shall have no liability for malfunctions or damages arising out of the use of renesas products beyond such specified ranges. 10. although renesas endeavors to improve the quality and reliability of its products, ic products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. please be sure to implement safety measures to guard against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a renesas product, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other applicable measures. among others, since the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or system manufactured by you. 11. in case renesas products listed in this document are detached from the products to which the renesas products are attached or affixed, the risk of accident such as swallowing by infants and small children is very high. you should implement safety measures so that renesas products may not be easily detached from your products. renesas shall have no liability for damages arising out of such detachment. 12. this document may not be reproduced or duplicated, in any form, in whole or in part, without prior written approval from renesas. 13. please contact a renesas sales office if you have any questions regarding the information contained in this document, renesas semiconductor products, or if you have any other inquiries. notes regarding these materials
rev. 2.00 sep. 07, 2007 page iv of xxviii general precautions on handling of product 1. treatment of nc pins note: do not connect anything to the nc pins. the nc (not connected) pins are either not connected to any of the internal circuitry or are used as test pins or to reduce noise. if something is connected to the nc pins, the operation of the lsi is not guaranteed. 2. treatment of unused input pins note: fix all unused input pins to high or low level. generally, the input pins of cmos products are high-impedance input pins. if unused pins are in their open states, intermediate levels are induced by noise in the vicinity, a pass- through current flows internally, and a malfunction may occur. 3. processing before initialization note: when power is first supplied, the product's state is undefined. the states of internal circuits are undefined until full power is supplied throughout the chip and a low level is input on the reset pi n. during the period where the states are undefined, the register settings and the output state of each pin are also undefined. design your system so that it does not malfunction because of processing while it is in this undefined state. for those products that have a reset function, reset the lsi immediately after the power supply has been turned on. 4. processing when the power supply voltage is beyond the operatin g voltage specification* when the power supply voltage exceeds the operating voltage specification, erroneous operation may occur. to prevent this, design your system so that it does not malfunction. for example, the system should be reset after the power supply voltage is changed to a value within the operating voltage specification. note: * the voltage must be within the range up to the absolute maximum rating. the lsi may be permanently damaged if the absolu te maximum rating is exceeded. 5. prohibition of access to undefined or reserved addresses note: access to undefined or reserved addresses is prohibited. the undefined or reserved addresses may be used to expand functions, or test registers may have been be allocated to these addresse s. do not access these registers; the system's operation is not guaranteed if they are accessed. 6. reading from/writing to reserved bit of each register treat the reserved bit of a register used in each module as follows except in cases where the specifications for values which are read from or written to the bit are provided in the description. the bit is always read as 0. the write value should be 0 or one, which has been read immediately before writing. writing the value, which has been read immediately before writing, has the advantage of preventing the bit from being affected on its extended function when the function is assigned.
rev. 2.00 sep. 07, 2007 page v of xxviii configuration of this manual this manual comprises the following items: 1. general precautions on handling of product 2. configuration of this manual 3. preface 4. contents 5. overview 6. description of functional modules ? cpu and system-control modules  on-chip peripheral modules the configuration of the functional description of each module differs according to the module. however, the generic style includes the following items: i) feature ii) input/output pin iii) register description iv) operation v) usage note when designing an application system that includes this lsi, take notes into account. each section includes notes in relation to the descriptions given, and usage notes are given, as required, as the final part of each section. 7. list of registers 8. electrical characteristics 9. appendix  product type, package dimensions, etc. 10. main revisions and additions in this edition (only for revised versions) the list of revisions is a summary of points that have been revised or added to earlier versions. this does not include all of the revised contents . for details, see the actual locations in this manual. 11. index
rev. 2.00 sep. 07, 2007 page vi of xxviii preface this lsi is an risc (reduced instruction set computer) microcomputer th at includes a renesas technology-original risc cpu as its core, and the peripheral functions required to configure a system. target users: this manual was written for users who will be using this lsi in the design of application systems. target users are e xpected to understand the fundamentals of electrical circuits, logical ci rcuits, and microcomputers. objective: this manual was written to explain the hardwa re functions and electrical characteristics of this ls i to the target users. notes on reading this manual: ? in order to understand the overall functions of the chip read the manual according to the contents. this manual can be roughly categorized into parts on the cpu, system control functions, periph eral functions and elect rical characteristics. ? in order to understand the details of the cpu's functions read the sh-2a, sh2a-f pu software manual. ? in order to understand the details of a register when its name is known read the index that is the final part of the manual to find the page number of the entry on the register. the addresses, bits, and initial values of the registers are summarized in section 28, list of registers.
rev. 2.00 sep. 07, 2007 page vii of xxviii ? description of numbers and symbols aspects of the notations for register names, bit names, numbers, and symbolic names in this manual are explained below. cmcsr indicates compare match generation, enables or disables interrupts, and selects the counter input clock. generation of a wdtovf signal or interrupt initializes the tcnt value to 0. 14.3 operation the style "register name"_"instance number" is used in cases where there is more than one instance of the same function or similar functions. [example] cmcsr_0: indicates the cmcsr register for the compare-match timer of channel 0. in descriptions involving the names of bits and bit fields within this manual, the modules and registers to which the bits belong may be clarified by giving the names in the forms "module name"."register name"."bit name" or "register name"."bit name". (1) overall notation (2) register notation rev. 0.50, 10/04, page 416 of 914 14.2.2 compare match control/status register_0, _1 (cmcsr_0, cmcsr_1) 14.3.1 interval count operation (4) (3) (2) binary numbers are given as b'nnnn (b' may be omitted if the number is obviously binary), hexadecimal numbers are given as h'nnnn or 0xnnnn, and decimal numbers are given as nnnn. [examples] binary: b'11 or 11 hexadecimal: h'efa0 or 0xefa0 decimal: 1234 (3) number notation an overbar on the name indicates that a signal or pin is active-low. [example] wdtovf note: the bit names and sentences in the above figure are examples and do not refer to specific data in this manual. (4) notation for active-low when an internal clock is selected with the cks1 and cks0 bits in cmcsr and the str bit in cmstr is set to 1, cmcnt starts incrementing using the selected clock. when the values in cmcnt and the compare match constant register (cmcor) match, cmcnt is cleared to h'0000 and the cmf flag in cmcsr is set to 1. when the cks1 and cks0 bits are set to b'01 at this time, a f/4 clock is selected.
rev. 2.00 sep. 07, 2007 page viii of xxviii ? description of registers each register description includes a bit chart, illu strating the arrangement of bits, and a table of bits, describing the meanings of the bit settings. the standard format and notation for bit charts and tables are described below. indicates the bit number or numbers. in the case of a 32-bit register, the bits are arranged in order from 31 to 0. in the case of a 16-bit register, the bits are arranged in order from 15 to 0. indicates the name of the bit or bit field. when the number of bits has to be clearly indicated in the field, appropriate notation is included (e.g., asid[3:0]). a reserved bit is indicated by " ? ". certain kinds of bits, such as those of timer counters, are not assigned bit names. in such cases, the entry under bit name is blank. (1) bit (2) bit name indicates the value of each bit immediately after a power-on reset, i.e., the initial value. 0: the initial value is 0 1: the initial value is 1 ? : the initial value is undefined (3) initial value for each bit and bit field, this entry indicates whether the bit or field is readable or writable, or both writing to and reading from the bit or field are impossible. the notation is as follows: r/w: r/(w): r: w: the bit or field is readable and writable. the bit or field is readable and writable. however, writing is only performed to flag clearing. the bit or field is readable. "r" is indicated for all reserved bits. when writing to the register, write the value under initial value in the bit chart to reserved bits or fields. the bit or field is writable. note: the bit names and sentences in the above figure are examples, and have nothing to do with the contents of this manual. (4) r/w describes the function of the bit or field and specifies the values for writing. (5) description bit 15 13 to 11 10 9 0 all 0 0 0 1 r r/w r r address identifier these bits enable or disable the pin function. reserved this bit is always read as 0. reserved this bit is always read as 1. ? asid2 to asid0 ? ? ? bit name initial value r/w description [bit chart] [table of bits] 14 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000001000000000 r/w r/w r/w r/w r/w r r r/w r/w r/w r/w r/w r/w r/w r/w r/w ? asid2 ?????? acmp2 q ife ? asid1 asid0 acmp1 acmp0 ? 0 r (1) (2) (3) (4) (5) reserved these bits are always read as 0. all trademarks and registered trademarks ar e the property of th eir respective owners.
rev. 2.00 sep. 07, 2007 page ix of xxviii contents section 1 overview................................................................................................1 1.1 sh7201 group featur es......................................................................................................... 1 1.2 product lineup................................................................................................................. ...... 8 1.3 block diagram .................................................................................................................. ..... 9 1.4 pin assign ments................................................................................................................ ... 10 1.5 pin functions .................................................................................................................. ..... 11 section 2 cpu......................................................................................................19 2.1 register conf igura tion......................................................................................................... 19 2.1.1 general registers.................................................................................................... 19 2.1.2 control registers .................................................................................................... 20 2.1.3 system regi sters..................................................................................................... 22 2.1.4 register banks ........................................................................................................ 23 2.1.5 initial values of registers....................................................................................... 23 2.2 data formats................................................................................................................... ..... 24 2.2.1 data format in registers ........................................................................................ 24 2.2.2 data formats in memory ........................................................................................ 24 2.2.3 immediate data format .......................................................................................... 25 2.3 instruction features........................................................................................................... ... 26 2.3.1 risc-type instruction set...................................................................................... 26 2.3.2 addressing modes .................................................................................................. 30 2.3.3 instruction format................................................................................................... 34 2.4 instruction set ................................................................................................................ ...... 38 2.4.1 instruction set by classifica tion ............................................................................. 38 2.4.2 data transfer instructions....................................................................................... 44 2.4.3 arithmetic operatio n instructions .......................................................................... 48 2.4.4 logic operation instructions .................................................................................. 51 2.4.5 shift instru ctions..................................................................................................... 52 2.4.6 branch instructions ................................................................................................. 53 2.4.7 system control instructions.................................................................................... 54 2.4.8 floating point opera tion instru ctions ..................................................................... 56 2.4.9 fpu-related cpu instructions ............................................................................... 58 2.4.10 bit manipulation instructions ................................................................................. 59 2.5 processing states.............................................................................................................. .... 60
rev. 2.00 sep. 07, 2007 page x of xxviii section 3 floating-point unit (fpu)................................................................... 63 3.1 features....................................................................................................................... ......... 63 3.2 data formats................................................................................................................... ..... 63 3.2.1 floating-poin t format............................................................................................. 63 3.2.2 non-numbers (nan) .............................................................................................. 65 3.2.3 denormalized numbers .......................................................................................... 66 3.3 register de scriptions.......................................................................................................... .67 3.3.1 floating-point registers ......................................................................................... 67 3.3.2 floating-point status/cont rol register (fpscr) ................................................... 68 3.3.3 floating-point communica tion register (fpul) ................................................... 69 3.4 rounding....................................................................................................................... ....... 70 3.5 floating-point exceptions.................................................................................................... 71 3.5.1 fpu exception sources .......................................................................................... 71 3.5.2 fpu exception handling ........................................................................................ 71 section 4 clock pulse generator (cpg) ............................................................. 73 4.1 features....................................................................................................................... ......... 73 4.2 input/output pins.............................................................................................................. ... 76 4.3 clock operatin g modes ....................................................................................................... 77 4.4 register de scriptions.......................................................................................................... .83 4.4.1 frequency control re gister (f rqcr) ................................................................... 83 4.4.2 ckio control regi ster (ckiocr) ........................................................................ 86 4.5 changing the frequency ...................................................................................................... 87 4.5.1 changing the multip lication rate........................................................................... 87 4.5.2 changing the divi sion ratio................................................................................... 88 4.6 notes on boar d design ........................................................................................................ 88 4.6.1 note on inputting ex ternal clock ........................................................................... 88 4.6.2 note on using crys tal resonator ........................................................................... 89 4.6.3 note on resonator .................................................................................................. 89 4.6.4 note on using a pll oscillation ci rcuit................................................................ 90 4.6.5 note on changing the multiplicati on rate ............................................................. 90 section 5 exception handling ............................................................................. 91 5.1 overview....................................................................................................................... ....... 91 5.1.1 types of exception ha ndling and pr iority ............................................................. 91 5.1.2 exception handlin g operations.............................................................................. 93 5.1.3 exception handling vector table .......................................................................... 95 5.2 resets......................................................................................................................... .......... 97 5.2.1 input/output pins.................................................................................................... 97
rev. 2.00 sep. 07, 2007 page xi of xxviii 5.2.2 types of reset ........................................................................................................ 97 5.2.3 power-on reset ...................................................................................................... 98 5.2.4 manual rese t ........................................................................................................ 100 5.3 address errors ................................................................................................................. .. 101 5.3.1 address error sources .......................................................................................... 101 5.3.2 address error excep tion handlin g ....................................................................... 102 5.4 bus error...................................................................................................................... ...... 102 5.4.1 bus error genera tion sour ce ................................................................................ 102 5.4.2 bus error exceptio n handlin g.............................................................................. 102 5.5 register bank errors.......................................................................................................... 1 03 5.5.1 register bank er ror sources................................................................................. 103 5.5.2 register bank error exception hand ling ............................................................. 103 5.6 interrupts..................................................................................................................... ....... 104 5.6.1 interrupt sources................................................................................................... 104 5.6.2 interrupt priority level ......................................................................................... 105 5.6.3 interrupt exceptio n handling ............................................................................... 106 5.7 exceptions triggered by instruc tions ................................................................................ 107 5.7.1 types of exceptions trigge red by instructions .................................................... 107 5.7.2 trap instructions ................................................................................................... 108 5.7.3 slot illegal in structions ......................................................................................... 108 5.7.4 general illegal in structions................................................................................... 108 5.7.5 integer division instructions................................................................................. 109 5.7.6 floating-point opera tion instruc tion .................................................................... 109 5.8 when exception sources are not acce pted ..................................................................... 110 5.9 stack status after exce ption handling ends...................................................................... 111 5.10 usage notes .................................................................................................................... ... 113 5.10.1 value of stack po inter (sp) .................................................................................. 113 5.10.2 value of vector base register (vbr) .................................................................. 113 5.10.3 address errors caused by stacking of address error exception handling ......... 113 section 6 interrupt controller (intc) ...............................................................115 6.1 features....................................................................................................................... ....... 115 6.2 input/output pins .............................................................................................................. .117 6.3 register desc riptions ......................................................................................................... 1 17 6.3.1 interrupt priority registers 01, 02, 05 to 16 (ipr01, ipr02, ipr05 to ipr16) .... 119 6.3.2 interrupt control regi ster 0 (i cr0)...................................................................... 121 6.3.3 interrupt control regi ster 1 (i cr1)...................................................................... 122 6.3.4 interrupt control regi ster 2 (i cr2)...................................................................... 123 6.3.5 irq interrupt request re gister (irqrr)............................................................. 123 6.3.6 pint interrupt enable register (pinter)........................................................... 125
rev. 2.00 sep. 07, 2007 page xii of xxviii 6.3.7 pint interrupt request register (pirr) .............................................................. 126 6.3.8 bank control regi ster (ibcr).............................................................................. 127 6.3.9 bank number regi ster (ibn r) ............................................................................ 128 6.3.10 dma transfer request enable register 0 (d reqer0) ...................................... 129 6.3.11 dma transfer request enable register 1 (d reqer1) ...................................... 130 6.3.12 dma transfer request enable register 2 (d reqer2) ...................................... 131 6.3.13 dma transfer request enable register 3 (d reqer3) ...................................... 132 6.4 interrupt sources.............................................................................................................. .. 133 6.4.1 nmi interrupt........................................................................................................ 133 6.4.2 user break interrupt ............................................................................................. 133 6.4.3 h-udi interrupt .................................................................................................... 133 6.4.4 irq interr upts....................................................................................................... 134 6.4.5 pint interrupts..................................................................................................... 135 6.4.6 on-chip peripheral mo dule interr upts ................................................................. 135 6.5 interrupt exception handling v ector table and priority................................................... 136 6.6 operation ...................................................................................................................... ..... 146 6.6.1 interrupt operati on sequence ............................................................................... 146 6.6.2 stack after interrupt ex ception hand ling ............................................................. 148 6.7 interrupt respon se time.................................................................................................... 149 6.8 register banks ................................................................................................................. .. 154 6.8.1 register banks and bank control regi sters ......................................................... 155 6.8.2 bank save and rest ore operations....................................................................... 155 6.8.3 save and restore operations af ter saving to all banks....................................... 157 6.8.4 register bank exception ...................................................................................... 158 6.8.5 register bank error ex ception hand ling ............................................................. 158 6.9 data transfer with interr upt request si gnals.................................................................... 159 6.9.1 handling interrupt request signals as sources for cpu interrupt but not dmac activation............................................................. 159 6.9.2 handling interrupt request signals as sources for dmac activation but no t cpu interrupt............................................................. 159 6.10 usage note..................................................................................................................... .... 160 6.10.1 timing to clear an interrupt so urce ..................................................................... 160 section 7 user break controller (ubc)............................................................ 161 7.1 features....................................................................................................................... ....... 161 7.2 input/output pin ............................................................................................................... .163 7.3 register desc riptions......................................................................................................... 1 63 7.3.1 break address regi ster (bar)............................................................................. 164 7.3.2 break address mask re gister (bamr) ............................................................... 165 7.3.3 break data regist er (bdr) .................................................................................. 166
rev. 2.00 sep. 07, 2007 page xiii of xxviii 7.3.4 break data mask re gister (b dmr)..................................................................... 167 7.3.5 break bus cycle re gister (bbr).......................................................................... 168 7.3.6 break control regi ster (brc r) ........................................................................... 170 7.4 operation ...................................................................................................................... ..... 173 7.4.1 flow of the user br eak operation ........................................................................ 173 7.4.2 break on instructio n fetch cy cle.......................................................................... 174 7.4.3 break on data a ccess cycle................................................................................. 175 7.4.4 value of saved prog ram counter ......................................................................... 176 7.4.5 usage examples.................................................................................................... 177 7.5 usage notes .................................................................................................................... ... 180 section 8 cache .................................................................................................183 8.1 features....................................................................................................................... ....... 183 8.1.1 cache struct ure..................................................................................................... 183 8.2 register desc riptions ......................................................................................................... 1 86 8.2.1 cache control regist er 1 (ccr1) ........................................................................ 186 8.2.2 cache control regist er 2 (ccr2) ........................................................................ 188 8.3 operation ...................................................................................................................... ..... 191 8.3.1 searching cache ................................................................................................... 191 8.3.2 read acces s.......................................................................................................... 193 8.3.3 prefetch operation (only for operand cache) ..................................................... 193 8.3.4 write operation (only fo r operand ca che).......................................................... 193 8.3.5 write-back buffer (only fo r operand c ache)...................................................... 194 8.3.6 coherency of cache and external memory .......................................................... 196 8.4 memory-mapped cache .................................................................................................... 196 8.4.1 address array ....................................................................................................... 196 8.4.2 data array ............................................................................................................ 197 8.4.3 usage examples.................................................................................................... 199 8.4.4 notes ..................................................................................................................... 200 section 9 bus state controller (bsc)................................................................201 9.1 features....................................................................................................................... ....... 201 9.2 input/output pins .............................................................................................................. .203 9.3 area overview .................................................................................................................. .205 9.3.1 address ma p ......................................................................................................... 205 9.3.2 data bus width and pin function se tting for individu al areas ........................... 206 9.4 register desc riptions ......................................................................................................... 2 07 9.4.1 csn control register (csn cnt) (n = 0 to 6)....................................................... 209 9.4.2 csn recovery cycle setting register (csnrec) (n = 0 to 6) ............................. 211 9.4.3 sdramcm control register (sdcmcnt) (m = 0, 1)........................................ 213
rev. 2.00 sep. 07, 2007 page xiv of xxviii 9.4.4 csn mode register (csmod n) (n = 0 to 6) ........................................................ 214 9.4.5 csn wait control register 1 (c s1wcntn) (n = 0 to 6) ..................................... 217 9.4.6 csn wait control register 2 (c s2wcntn) (n = 0 to 6) ..................................... 219 9.4.7 sdram refresh control regi ster 0 (sdrfcnt0)............................................. 222 9.4.8 sdram refresh control regi ster 1 (sdrfcnt1)............................................. 223 9.4.9 sdram initialization regi ster 0 (sdi r0)........................................................... 225 9.4.10 sdram initialization regi ster 1 (sdi r1)........................................................... 227 9.4.11 sdram power-down control register (sdpwdcnt) ..................................... 228 9.4.12 sdram deep-power-down control register (sddpwdcnt) ........................ 229 9.4.13 sdramm address register (sdmadr) (m = 0, 1)............................................ 230 9.4.14 sdramm timing register (sdmtr) (m = 0, 1) ................................................ 231 9.4.15 sdramm mode register (s dmmod) (m = 0, 1)............................................... 233 9.4.16 sdram status regist er (sdstr) ....................................................................... 234 9.4.17 sdram clock stop control signal setting register (sdckscnt) .................. 236 9.4.18 ac characteristics switchi ng register (a cswr) ............................................... 237 9.5 operation ...................................................................................................................... ..... 238 9.5.1 csc interf ace........................................................................................................ 238 9.5.2 sdram interface................................................................................................. 248 9.6 usage note..................................................................................................................... .... 285 9.6.1 note on power-on reset exception handling and deep standby mode cancellatio n ........................................................................ 285 9.6.2 write buffe r.......................................................................................................... 285 9.6.3 note on transition to software stan dby mode or deep standby mode............... 285 section 10 bus monitor..................................................................................... 287 10.1 register desc riptions......................................................................................................... 2 87 10.1.1 bus monitor enable regi ster (sycbeen) .......................................................... 288 10.1.2 bus monitor status regist er 1 (sycbests1)..................................................... 289 10.1.3 bus monitor status regist er 2 (sycbests2)..................................................... 291 10.1.4 bus error control regi ster (sycbesw)............................................................. 294 10.2 bus monitor f unction........................................................................................................ 295 10.2.1 operation when a bus er ror is detected............................................................... 295 10.2.2 illegal address access de tection func tion .......................................................... 296 10.2.3 bus timeout detec tion function .......................................................................... 298 10.2.4 combinations of master s and bus er rors ............................................................. 299 10.3 usage note..................................................................................................................... .... 300 10.3.1 operation when the cpu is not notified of a bu s error...................................... 300
rev. 2.00 sep. 07, 2007 page xv of xxviii section 11 direct memory access controller (dmac) ...................................301 11.1 features....................................................................................................................... ....... 301 11.2 input/output pins .............................................................................................................. .303 11.3 register desc riptions ......................................................................................................... 3 04 11.3.1 dma current source address register (dmcsadr) ........................................ 308 11.3.2 dma current destination addres s register (d mcdadr) ................................ 309 11.3.3 dma current byte count register (d mcbct) .................................................. 310 11.3.4 dma reload source address register (dmrsadr) ......................................... 311 11.3.5 dma reload destination addres s register (d mrdadr) ................................. 312 11.3.6 dma reload byte count register (d mrbct) ................................................... 313 11.3.7 dma mode register (dmmod) ......................................................................... 314 11.3.8 dma control register a (dmcnta) ................................................................. 320 11.3.9 dma control register b (dmcnt b) ................................................................. 328 11.3.10 dma activation control re gister (dmscnt).................................................... 334 11.3.11 dma interrupt control re gister (dmicnt) ....................................................... 335 11.3.12 dma common interrupt contro l register (d micnta)..................................... 336 11.3.13 dma interrupt status re gister (dmists) ........................................................... 337 11.3.14 dma transfer end detectio n register (dmedet) ............................................ 338 11.3.15 dma arbitration status register (d masts)...................................................... 340 11.4 operation ...................................................................................................................... ..... 342 11.4.1 dma transfer mode ............................................................................................ 342 11.4.2 dma transfer condition ...................................................................................... 344 11.4.3 dma activat ion ................................................................................................... 348 11.5 completion of dma transf er and interrupts .................................................................... 349 11.5.1 completion of dm a transfer .............................................................................. 349 11.5.2 dma interrupt requests....................................................................................... 350 11.5.3 dma end signal output ...................................................................................... 352 11.6 suspending, restarting, and st opping of dma transfer .................................................. 354 11.6.1 suspending and restar ting dma transfer ........................................................... 354 11.6.2 stopping dma transfer on any channel ............................................................ 354 11.7 dma requ ests................................................................................................................... 355 11.7.1 sources of dma requests.................................................................................... 355 11.7.2 synchronous circuits for dma request signals.................................................. 355 11.7.3 sense mode for dm a requests............................................................................ 356 11.8 determining dma chan nel prior ity.................................................................................. 359 11.8.1 channel priority order.......................................................................................... 359 11.8.2 operation during multip le dma requ ests........................................................... 359 11.8.3 output of the dma acknowledge and dna active signals ............................... 360 11.9 units of transfer and positioni ng of bytes for transfer.................................................... 362
rev. 2.00 sep. 07, 2007 page xvi of xxviii 11.10 reload fu nction................................................................................................................ .363 11.11 rotate fu nction................................................................................................................ .. 365 11.12 transfer speed ................................................................................................................. .. 366 11.13 usage note..................................................................................................................... .... 367 11.13.1 note on making a transition to software standby mode or deep standby mode............................................................................... 367 section 12 multi-function t imer pulse unit 2 (mtu2)................................... 369 12.1 features....................................................................................................................... ....... 369 12.2 input/output pins.............................................................................................................. .375 12.3 register desc riptions......................................................................................................... 3 76 12.3.1 timer control regi ster (tcr).............................................................................. 382 12.3.2 timer mode regist er (tmdr)............................................................................. 386 12.3.3 timer i/o control re gister (tior)...................................................................... 389 12.3.4 timer compare match clear re gister (tcntc mpclr).................................... 408 12.3.5 timer interrupt enable register (tier)............................................................... 409 12.3.6 timer status regi ster (tsr)................................................................................. 414 12.3.7 timer buffer operation transfer mode register (tbtm)................................... 421 12.3.8 timer input capture contro l register (ticcr)................................................... 422 12.3.9 timer a/d converter start request control regist er (tadcr) ......................... 423 12.3.10 timer a/d converter start re quest cycle set registers (tadcora_4 and tadcorb_4)...................................................................... 426 12.3.11 timer a/d converter start request cycle set buffer registers (tadcobra_4 and tadcobrb_4) ................................................................ 427 12.3.12 timer counter (tcnt)......................................................................................... 427 12.3.13 timer general regi ster (tgr) ............................................................................. 428 12.3.14 timer start regist er (tstr) ................................................................................ 429 12.3.15 timer synchronous re gister (tsyr)................................................................... 431 12.3.16 timer counter synchronous star t register (t csystr) ..................................... 433 12.3.17 timer read/write enable register (t rwer) ..................................................... 435 12.3.18 timer output master enab le register (toer) .................................................... 436 12.3.19 timer output control re gister 1 (tocr1).......................................................... 437 12.3.20 timer output control re gister 2 (tocr2).......................................................... 440 12.3.21 timer output level buffe r register (tolbr) .................................................... 443 12.3.22 timer gate control re gister (tgcr) .................................................................. 444 12.3.23 timer subcounter (tcnts) ................................................................................. 446 12.3.24 timer dead time data register (tddr)............................................................. 447 12.3.25 timer cycle data re gister (t cdr) ..................................................................... 447 12.3.26 timer cycle buffer register (tcbr) ................................................................... 448 12.3.27 timer interrupt skipping se t register (t itcr)................................................... 448
rev. 2.00 sep. 07, 2007 page xvii of xxviii 12.3.28 timer interrupt skipping counter (titcnt)....................................................... 450 12.3.29 timer buffer transfer se t register (t bter) ...................................................... 451 12.3.30 timer dead time enable register (tder).......................................................... 453 12.3.31 timer waveform control register (twcr) ........................................................ 454 12.3.32 bus master in terface............................................................................................. 455 12.4 operation ...................................................................................................................... ..... 456 12.4.1 basic func tions..................................................................................................... 456 12.4.2 synchronous op eration......................................................................................... 462 12.4.3 buffer operation ................................................................................................... 464 12.4.4 cascaded oper ation .............................................................................................. 469 12.4.5 pwm modes ......................................................................................................... 474 12.4.6 phase counting mode........................................................................................... 479 12.4.7 reset-synchronized pwm mode.......................................................................... 486 12.4.8 complementary pwm mode................................................................................ 489 12.4.9 a/d converter start reques t delaying fu nction.................................................. 525 12.4.10 external pulse widt h measurem ent...................................................................... 529 12.4.11 dead time comp ensation..................................................................................... 530 12.4.12 tcnt capture at crest and/or trough in complementary pwm operation ....... 532 12.5 interrupt sources.............................................................................................................. .. 533 12.5.1 interrupt sources an d prioriti es ............................................................................ 533 12.5.2 dmac activation................................................................................................. 535 12.5.3 a/d converter ac tivation ..................................................................................... 535 12.6 operation timing............................................................................................................... 537 12.6.1 input/output timing ............................................................................................. 537 12.6.2 interrupt signal timing......................................................................................... 544 12.7 usage notes .................................................................................................................... ... 548 12.7.1 module standby m ode setti ng ............................................................................. 548 12.7.2 input clock rest rictions ....................................................................................... 548 12.7.3 caution on peri od setting ..................................................................................... 549 12.7.4 contention between tcnt write and clear operations...................................... 550 12.7.5 contention between tcnt write and increment op erations............................... 550 12.7.6 contention between tgr write and compare match .......................................... 551 12.7.7 contention between buffer register write and comp are match ......................... 552 12.7.8 contention between buffer regist er write and tc nt clear ............................... 553 12.7.9 contention between tgr read and input capture............................................... 554 12.7.10 contention between tgr write and input capture.............................................. 555 12.7.11 contention between buffer register write and input capture ............................. 556 12.7.12 tcnt_2 write and overflow/underflow co ntention in cascade connection .... 556 12.7.13 counter value during comple mentary pwm mode stop .................................... 558 12.7.14 buffer operation se tting in complement ary pwm mode ................................... 558
rev. 2.00 sep. 07, 2007 page xviii of xxviii 12.7.15 reset sync pwm mode buffer opera tion and compare match flag .................. 559 12.7.16 overflow flags in reset synchronous pwm mode ............................................. 560 12.7.17 contention between overflow/underfl ow and counter clearing......................... 561 12.7.18 contention between tcnt write and overflow/u nderflow................................ 562 12.7.19 cautions on transition from normal operation or pwm mode 1 to reset-sync hronized pw m mode.............................................. 562 12.7.20 output level in complementary pwm mode and reset-synchronized pwm mode ......................................................................... 563 12.7.21 interrupts in module standby mode ..................................................................... 563 12.7.22 simultaneous capture of tcnt_1 and tcnt_2 in cascade connection............ 563 12.8 mtu2 output pin initializatio n......................................................................................... 564 12.8.1 operating m odes .................................................................................................. 564 12.8.2 reset start op eration ............................................................................................ 564 12.8.3 operation in case of re-setting due to error during oper ation, etc. ................. 565 12.8.4 overview of initialization procedures and mode transitions in case of error during operation, etc...................................................................... 566 section 13 8-bit timers (tmr) ........................................................................ 597 13.1 features....................................................................................................................... ....... 597 13.2 input/output pins.............................................................................................................. .599 13.3 register desc riptions......................................................................................................... 5 99 13.3.1 timer counter (tcnt)......................................................................................... 600 13.3.2 time constant regist er a (tcora) ................................................................... 600 13.3.3 time constant regi ster b (t corb).................................................................... 601 13.3.4 timer control regi ster (tcr).............................................................................. 601 13.3.5 timer counter control register (tccr) ............................................................. 603 13.3.6 timer control/status re gister (tcsr)................................................................. 605 13.4 operation ...................................................................................................................... ..... 609 13.4.1 pulse outp ut ......................................................................................................... 609 13.4.2 reset inpu t............................................................................................................ 610 13.5 operation timing............................................................................................................... 611 13.5.1 tcnt count timing ............................................................................................ 611 13.5.2 timing of cmfa and cmfb se tting at compar e match .................................... 612 13.5.3 timing of timer output at compare match......................................................... 612 13.5.4 timing of counter clear by compare match ....................................................... 613 13.5.5 timing of tcnt ex ternal reset........................................................................... 613 13.5.6 timing of overflow fl ag (ovf) se tting .............................................................. 614 13.6 operation with cascad ed connection................................................................................ 614 13.6.1 16-bit counter mode............................................................................................ 614 13.6.2 compare match co unt mode ............................................................................... 615
rev. 2.00 sep. 07, 2007 page xix of xxviii 13.7 interrupt sources.............................................................................................................. .. 615 13.7.1 interrupt sources................................................................................................... 615 13.7.2 a/d converter ac tivation ..................................................................................... 616 13.8 usage notes .................................................................................................................... ... 616 13.8.1 notes on settin g cycle.......................................................................................... 616 13.8.2 conflict between tcnt write and clear ............................................................. 616 13.8.3 conflict between tcnt wr ite and increment...................................................... 617 13.8.4 conflict between tcor write and compare match ............................................ 617 13.8.5 conflict between compare matches a and b....................................................... 618 13.8.6 switching of internal clocks and tcnt op eration.............................................. 618 13.8.7 mode setting with casc aded connec tion ............................................................. 620 13.8.8 module standby setting........................................................................................ 620 13.8.9 interrupts in module standby mode ..................................................................... 620 section 14 watchdog timer (wdt)..................................................................621 14.1 features....................................................................................................................... ....... 621 14.2 input/output pin............................................................................................................... .. 622 14.3 register desc riptions ......................................................................................................... 6 23 14.3.1 watchdog timer coun ter (wtcnt).................................................................... 623 14.3.2 watchdog timer control/statu s register (w tcsr)............................................ 624 14.3.3 watchdog reset control/sta tus register (wrcsr) ............................................ 626 14.3.4 notes on regist er access...................................................................................... 627 14.4 wdt usage ...................................................................................................................... .629 14.4.1 canceling software standby m ode....................................................................... 629 14.4.2 changing the frequency ....................................................................................... 629 14.4.3 using watchdog ti mer mode .............................................................................. 630 14.4.4 using interval timer mode .................................................................................. 631 14.5 usage notes .................................................................................................................... ... 632 14.5.1 timer varia tion..................................................................................................... 632 14.5.2 prohibition against settin g h'ff to wt cnt........................................................ 632 14.5.3 system reset by wdtovf signal....................................................................... 632 14.5.4 manual reset in watchd og timer mode.............................................................. 633 section 15 realtime clock (rtc) .....................................................................635 15.1 features....................................................................................................................... ....... 635 15.2 input/output pin............................................................................................................... .. 637 15.3 register desc riptions ......................................................................................................... 6 37 15.3.1 64-hz counter (r64cnt) .................................................................................... 638 15.3.2 second counter (rseccnt) ............................................................................... 639 15.3.3 minute counter (r mincnt) ............................................................................... 640
rev. 2.00 sep. 07, 2007 page xx of xxviii 15.3.4 hour counter (rhrcnt) .................................................................................... 641 15.3.5 day of week coun ter (rwkcnt) ...................................................................... 642 15.3.6 date counter (r daycnt) .................................................................................. 643 15.3.7 month counter (r moncnt) .............................................................................. 644 15.3.8 year counter (ryrcnt)..................................................................................... 645 15.3.9 second alarm regist er (rsecar) ...................................................................... 646 15.3.10 minute alarm regist er (rminar)...................................................................... 647 15.3.11 hour alarm regist er (rhrar) ........................................................................... 648 15.3.12 day of week alarm re gister (rwkar) ............................................................. 649 15.3.13 date alarm regist er (rdaya r)......................................................................... 650 15.3.14 month alarm regist er (rmonar) ..................................................................... 651 15.3.15 year alarm regist er (ryrar)............................................................................ 652 15.3.16 rtc control regist er 1 (rcr1)........................................................................... 653 15.3.17 rtc control regist er 2 (rcr2)........................................................................... 655 15.3.18 rtc control regist er 3 (rcr3)........................................................................... 657 15.4 operation ...................................................................................................................... ..... 658 15.4.1 initial settings of regist ers after po wer-on ......................................................... 658 15.4.2 setting ti me ......................................................................................................... 658 15.4.3 reading ti me........................................................................................................ 659 15.4.4 alarm func tion..................................................................................................... 660 15.5 usage notes .................................................................................................................... ... 661 15.5.1 register writing dur ing rtc count..................................................................... 661 15.5.2 use of realtime clock (rtc ) periodic inte rrupts................................................ 661 15.5.3 transition to standby mode after setting re gister............................................... 662 15.5.4 crystal oscillator ci rcuit for rtc........................................................................ 662 15.5.5 procedure for setting the 30-seco nd adjustment function.................................. 663 section 16 serial communication interface with fifo (scif)........................ 665 16.1 features....................................................................................................................... ....... 665 16.2 input/output pins.............................................................................................................. .667 16.3 register desc riptions......................................................................................................... 6 67 16.3.1 receive shift regi ster (scrs r) .......................................................................... 671 16.3.2 receive fifo data re gister (scf rdr) .............................................................. 671 16.3.3 transmit shift regi ster (sct sr) ......................................................................... 672 16.3.4 transmit fifo data re gister (scftdr)............................................................. 672 16.3.5 serial mode regist er (scsmr)............................................................................ 673 16.3.6 serial control regi ster (scs cr).......................................................................... 676 16.3.7 serial status regi ster (scfsr) ............................................................................ 680 16.3.8 bit rate regist er (scbrr) .................................................................................. 688 16.3.9 fifo control regi ster (scf cr) .......................................................................... 696
rev. 2.00 sep. 07, 2007 page xxi of xxviii 16.3.10 fifo data count regi ster (scfdr) .................................................................... 698 16.3.11 serial port regist er (scsptr) ............................................................................. 699 16.3.12 line status regist er (sclsr) .............................................................................. 701 16.4 operation ...................................................................................................................... ..... 702 16.4.1 overview............................................................................................................... 702 16.4.2 operation in asynch ronous mode ........................................................................ 704 16.4.3 operation in clocked synchronous mode ............................................................ 713 16.5 scif inte rrupts ................................................................................................................ .. 721 16.6 usage notes .................................................................................................................... ... 722 16.6.1 scftdr writing an d tdfe flag ........................................................................ 722 16.6.2 scfrdr reading an d rdf flag ......................................................................... 722 16.6.3 restriction on dm ac usage ................................................................................ 723 16.6.4 break detection an d processing ........................................................................... 723 16.6.5 sending a break signal......................................................................................... 723 16.6.6 receive data sampling timi ng and receive margin (asynchronous mode) ...... 724 section 17 i 2 c bus interface 3 (iic3) ................................................................725 17.1 features....................................................................................................................... ....... 725 17.2 input/output pins .............................................................................................................. .727 17.3 register desc riptions ......................................................................................................... 7 28 17.3.1 i 2 c bus control regist er 1 (iccr1 )..................................................................... 729 17.3.2 i 2 c bus control regist er 2 (iccr2 )..................................................................... 732 17.3.3 i 2 c bus mode regist er (icmr)............................................................................ 734 17.3.4 i 2 c bus interrupt enable register (i cier) ........................................................... 736 17.3.5 i 2 c bus status regi ster (icsr)............................................................................. 738 17.3.6 slave address regi ster (sar).............................................................................. 741 17.3.7 i 2 c bus transmit data re gister (icdrt)............................................................. 742 17.3.8 i 2 c bus receive data re gister (icd rr).............................................................. 742 17.3.9 i 2 c bus shift regist er (icdrs)............................................................................ 742 17.3.10 nf2cyc register (nf2cyc) .............................................................................. 743 17.4 operation ...................................................................................................................... ..... 744 17.4.1 i 2 c bus format...................................................................................................... 744 17.4.2 master transmit operation ................................................................................... 745 17.4.3 master receive operation..................................................................................... 747 17.4.4 slave transmit op eration ..................................................................................... 749 17.4.5 slave receive op eration....................................................................................... 752 17.4.6 clocked synchronous serial format..................................................................... 753 17.4.7 noise filte r ........................................................................................................... 757 17.4.8 example of use..................................................................................................... 758 17.5 interrupt reques ts ............................................................................................................. .762
rev. 2.00 sep. 07, 2007 page xxii of xxviii 17.6 bit synchronous circuit..................................................................................................... 763 17.7 usage note..................................................................................................................... .... 766 17.7.1 issuance of stop condition and st art condition (retra nsmission)....................... 766 17.7.2 settings for multi-mast er opera tion..................................................................... 766 17.7.3 reading icdrr in mast er receive mode............................................................ 766 section 18 serial sound interface (ssi)............................................................ 767 18.1 features....................................................................................................................... ....... 767 18.2 input/output pins.............................................................................................................. .769 18.3 register desc ription .......................................................................................................... 7 70 18.3.1 control register (ssicr) ..................................................................................... 771 18.3.2 status register (ssisr) ........................................................................................ 777 18.3.3 transmit data regi ster (ssitdr)........................................................................ 782 18.3.4 receive data regist er (ssirdr) ......................................................................... 782 18.4 operation desc ription........................................................................................................ 78 3 18.4.1 bus format ........................................................................................................... 783 18.4.2 non-compressed modes....................................................................................... 784 18.4.3 operation m odes .................................................................................................. 794 18.4.4 transmit oper ation............................................................................................... 795 18.4.5 receive oper ation ................................................................................................ 798 18.4.6 temporary stop and restart proc edures in transmit mode ................................. 801 18.4.7 serial bit cloc k control ....................................................................................... 802 18.5 usage notes .................................................................................................................... ... 802 18.5.1 limitations from overflow durin g receive dma op eration............................... 802 18.5.2 note on using over sample cl ock ........................................................................ 803 18.5.3 restriction on stopping clock supply.................................................................. 803 section 19 controller area network (rcan-et)............................................ 805 19.1 summary........................................................................................................................ .... 805 19.1.1 overview .............................................................................................................. 805 19.1.2 scope .................................................................................................................... 805 19.1.3 audience............................................................................................................... 805 19.1.4 references ............................................................................................................ 806 19.1.5 features................................................................................................................. 806 19.2 architecture ................................................................................................................... .... 807 19.2.1 block diag ram...................................................................................................... 807 19.2.2 functions of e ach block....................................................................................... 808 19.2.3 input/output pins.................................................................................................. 809 19.2.4 memory ma p ........................................................................................................ 810
rev. 2.00 sep. 07, 2007 page xxiii of xxviii 19.3 mailbox........................................................................................................................ ...... 811 19.3.1 mailbox stru cture ................................................................................................. 811 19.3.2 message contro l field .......................................................................................... 813 19.3.3 local acceptance filte r mask (l afm)................................................................ 817 19.3.4 message data fields ............................................................................................. 818 19.4 rcan-et control re gisters ............................................................................................. 819 19.4.1 master control re gister (m cr) ........................................................................... 819 19.4.2 general status regi ster (gsr) ............................................................................. 825 19.4.3 bit configuration regi ster (bcr0, bcr1) .......................................................... 828 19.4.4 interrupt request re gister (i rr) .......................................................................... 833 19.4.5 interrupt mask re gister (imr) ............................................................................. 839 19.4.6 transmit error counter (tec) and r eceive error coun ter (rec)....................... 840 19.5 rcan - et mailbox regi sters............................................................................................ 841 19.5.1 transmit pending register (txpr0, txpr1)...................................................... 842 19.5.2 transmit cancel regist er 0 (txcr0) .................................................................. 845 19.5.3 transmit acknowledge regi ster 0 (txack0) .................................................... 846 19.5.4 abort acknowledge regi ster 0 (aback0) ......................................................... 847 19.5.5 data frame receive pending register 0 (rxpr0)............................................... 848 19.5.6 remote frame receive pendin g register 0 (rfpr0) .......................................... 849 19.5.7 mailbox interrupt mask re gister 0 (mbimr0).................................................... 850 19.5.8 unread message status re gister 0 (umsr0)....................................................... 851 19.6 applicati on note............................................................................................................... .852 19.6.1 configuration of rcan-et ................................................................................. 852 19.6.2 test mode se ttings ............................................................................................... 857 19.6.3 message transmissi on sequence.......................................................................... 859 19.6.4 message receive sequence .................................................................................. 861 19.6.5 reconfiguration of mailbox.................................................................................. 863 19.7 interrupt sources.............................................................................................................. .. 865 19.8 can bus in terface............................................................................................................. 8 67 19.9 usage notes .................................................................................................................... ... 868 19.9.1 module standby mode.......................................................................................... 868 19.9.2 reset ..................................................................................................................... 868 19.9.3 can sleep mode.................................................................................................. 868 19.9.4 register a ccess..................................................................................................... 868 19.9.5 interrupts............................................................................................................... 869 section 20 a/d converter (adc)......................................................................871 20.1 features....................................................................................................................... ....... 871 20.2 input/output pins .............................................................................................................. .873 20.3 register conf iguratio n....................................................................................................... 87 4
rev. 2.00 sep. 07, 2007 page xxiv of xxviii 20.3.1 a/d data registers a to h (addra to addrh) .............................................. 874 20.3.2 a/d control/status regi ster (adcsr) ................................................................ 876 20.4 operation ...................................................................................................................... ..... 880 20.4.1 single mode.......................................................................................................... 880 20.4.2 multi mode ........................................................................................................... 883 20.4.3 scan mode ............................................................................................................ 885 20.4.4 a/d converter activation by extern al trigger, mtu2, or tmr......................... 888 20.4.5 input sampling and a/d conversion time .......................................................... 888 20.4.6 external trigger input timi ng.............................................................................. 890 20.5 interrupt sources and dmac transfer request ................................................................ 891 20.6 definitions of a/d co nversion accuracy.......................................................................... 891 20.7 usage notes .................................................................................................................... ... 893 20.7.1 module standby m ode setting ............................................................................. 893 20.7.2 setting analog in put voltage ............................................................................... 893 20.7.3 notes on boar d design ......................................................................................... 893 20.7.4 processing of analog input pins........................................................................... 894 20.7.5 permissible signal s ource impedance .................................................................. 895 20.7.6 influences on abso lute precision.......................................................................... 896 20.7.7 usage note when shifting to single mode during a/d conversion .................... 896 section 21 d/a converter (dac) ..................................................................... 897 21.1 features....................................................................................................................... ....... 897 21.2 input/output pins.............................................................................................................. .898 21.3 register desc riptions......................................................................................................... 8 98 21.3.1 d/a data registers 0 and 1 (dadr0 and dadr1)............................................. 899 21.3.2 d/a control regist er (dacr) ............................................................................. 899 21.4 operation ...................................................................................................................... ..... 901 21.5 usage notes .................................................................................................................... ... 902 21.5.1 module standby m ode setting ............................................................................. 902 21.5.2 d/a output hold function in software stan dby mode........................................ 902 21.5.3 d/a conversion and d/a output in deep standby mode.................................... 902 21.5.4 setting analog in put voltage ............................................................................... 902 section 22 i/o ports........................................................................................... 903 22.1 port a......................................................................................................................... ........ 903 22.1.1 register config uration.......................................................................................... 904 22.1.2 port a data registers h an d l (padrh and padrl)........................................ 904 22.1.3 port a port registers h an d l (paprh and paprl).......................................... 906 22.2 port b ......................................................................................................................... ........ 907 22.2.1 register config uration.......................................................................................... 908
rev. 2.00 sep. 07, 2007 page xxv of xxviii 22.2.2 port b data registers h an d l (pbdrh and pbdrl) ........................................ 908 22.2.3 port b port registers h an d l (pbprh and pbprl)........................................... 910 22.3 port c ......................................................................................................................... ........ 911 22.3.1 register config uration.......................................................................................... 911 22.3.2 port c data registers h an d l (pcdrh and pcdrl) ........................................ 912 22.3.3 port c port registers h an d l (pcprh and pcprl)........................................... 913 22.4 port d......................................................................................................................... ........ 914 22.4.1 register config uration.......................................................................................... 914 22.4.2 port d data regi ster (pddr)............................................................................... 915 22.4.3 port d port registers h an d l (pdprh and pdprl).......................................... 916 22.5 port e ......................................................................................................................... ........ 917 22.5.1 register config uration.......................................................................................... 917 22.5.2 port e port regi ster (pepr) ................................................................................. 917 22.6 port f ......................................................................................................................... ........ 918 22.6.1 register config uration.......................................................................................... 918 22.6.2 port f data regi ster (pfdr) ................................................................................ 919 22.6.3 port f port regi ster (pfpr).................................................................................. 920 section 23 pin functio n controller (pfc).........................................................921 23.1 register desc riptions ......................................................................................................... 9 29 23.1.1 port a i/o registers h and l (paiorh and paiorl) ....................................... 931 23.1.2 port a control registers 1 to 8 (pacr1 to pacr8) ........................................... 932 23.1.3 port b i/o registers h and l (pbiorh and pbiorl)........................................ 942 23.1.4 port b control registers 1 to 8 (pbcr1 to pbcr8) ............................................ 943 23.1.5 port c i/o registers h and l (pciorh and pciorl)........................................ 956 23.1.6 port c control registers 1 to 7 (pccr1 to pccr7) ............................................ 957 23.1.7 port d i/o regist er (pdior)................................................................................ 967 23.1.8 port d control registers 1 to 5 (pdcr1 to pdcr5) ........................................... 968 23.1.9 port e control registers 1 an d 2 (pecr1 and pecr2) ....................................... 975 23.1.10 port f i/o regist er (pfior) ................................................................................. 978 23.1.11 port f control registers 1 an d 2 (pfcr1 and pfcr2) ........................................ 979 23.2 usage note..................................................................................................................... .... 982 section 24 on-chip ram .................................................................................983 24.1 features....................................................................................................................... ....... 983 24.2 usage notes .................................................................................................................... ... 984 24.2.1 page conflict ........................................................................................................ 984 24.2.2 rame and ramw e bits .................................................................................... 984
rev. 2.00 sep. 07, 2007 page xxvi of xxviii section 25 power-down modes........................................................................ 985 25.1 features....................................................................................................................... ....... 985 25.1.1 power-down modes ............................................................................................. 985 25.2 register desc riptions......................................................................................................... 9 87 25.2.1 standby control regi ster (st bcr)...................................................................... 988 25.2.2 standby control regist er 2 (st bcr2)................................................................. 989 25.2.3 standby control regist er 3 (st bcr3)................................................................. 991 25.2.4 standby control regist er 4 (st bcr4)................................................................. 992 25.2.5 standby control regist er 5 (st bcr5)................................................................. 994 25.2.6 system control regist er 1 (syscr1) .................................................................. 996 25.2.7 system control regist er 2 (syscr2) .................................................................. 997 25.2.8 ram retaining area specifyi ng register (ramkp).......................................... 998 25.2.9 deep standby oscillation settling cl ock select regist er (dscnt) .................... 999 25.2.10 deep standby cancel source flag register (dsfr).......................................... 1000 25.3 operation ...................................................................................................................... ... 1002 25.3.1 sleep mode ......................................................................................................... 1002 25.3.2 software sta ndby mode ...................................................................................... 1003 25.3.3 software standby mode a pplication example................................................... 1005 25.3.4 deep standb y mode ........................................................................................... 1006 25.3.5 module standby function................................................................................... 1011 25.4 usage note..................................................................................................................... .. 1011 25.4.1 note on setting register s ................................................................................... 1011 25.4.2 note on canceling standby mode when an external clock is being input ........ 1011 section 26 user debugging interface (h-udi)............................................... 1013 26.1 features....................................................................................................................... ..... 1013 26.2 input/output pins............................................................................................................. 1 014 26.3 register desc riptions....................................................................................................... 101 5 26.3.1 bypass register (sdbpr) .................................................................................. 1015 26.3.2 instruction regist er (sdir) ................................................................................ 1016 26.4 operation ...................................................................................................................... ... 1017 26.4.1 tap contro ller ................................................................................................... 1017 26.4.2 reset type s......................................................................................................... 1018 26.4.3 udtdo output timing ...................................................................................... 1018 26.4.4 h-udi rese t ....................................................................................................... 1019 26.4.5 h-udi interrupt .................................................................................................. 1019 26.5 usage notes .................................................................................................................... . 1020
rev. 2.00 sep. 07, 2007 page xxvii of xxviii section 27 advanced u ser debugger ii (aud-ii) ..........................................1021 27.1 features....................................................................................................................... ..... 1021 27.2 input/output pins ............................................................................................................. 1 021 27.3 ram monitor mode ........................................................................................................ 1023 27.3.1 communication protocol .................................................................................... 1023 27.3.2 operatio n ............................................................................................................ 1024 27.3.3 usage notes (ram mo nitor mode) ................................................................... 1026 section 28 list of registers .............................................................................1027 28.1 register addresses (a ddress order)................................................................................ 1028 28.2 register bits.................................................................................................................. ... 1046 28.3 register states in ea ch operating mode ......................................................................... 1084 section 29 electrica l characteristics ...............................................................1101 29.1 absolute maximu m ratings ............................................................................................ 1101 29.2 dc character istics ........................................................................................................... 11 02 29.3 ac character istics ........................................................................................................... 11 10 29.3.1 clock timi ng ...................................................................................................... 1110 29.3.2 control signal timing ........................................................................................ 1114 29.3.3 bus timi ng ......................................................................................................... 1116 29.3.4 dmac module timing ...................................................................................... 1127 29.3.5 ubc trigger timing .......................................................................................... 1128 29.3.6 mtu2 module timing ....................................................................................... 1129 29.3.7 8-bit timer timing............................................................................................. 1130 29.3.8 watchdog time r timing ..................................................................................... 1131 29.3.9 scif module timing.......................................................................................... 1132 29.3.10 iic3 module timing........................................................................................... 1133 29.3.11 ssi module ti ming ............................................................................................ 1134 29.3.12 rcan-et module timing ................................................................................. 1136 29.3.13 a/d trigger input timing .................................................................................. 1137 29.3.14 i/o port ti ming................................................................................................... 1137 29.3.15 h-udi-related pi n timing................................................................................. 1138 29.3.16 aud-ii ti ming ................................................................................................... 1140 29.3.17 ac characteristics meas urement cond itions ..................................................... 1141 29.4 a/d converter char acteristic s ......................................................................................... 1142 29.5 d/a converter char acteristic s ......................................................................................... 1143 29.6 usage note..................................................................................................................... .. 1144
rev. 2.00 sep. 07, 2007 page xxviii of xxviii appendix ....................................................................................................... 1145 a. pin states ..................................................................................................................... .... 1145 b. package dime nsions ........................................................................................................ 1150 main revisions and additions in this edition................................................... 1151 index ....................................................................................................... 1157
section 1 overview rev. 2.00 sep. 07, 2007 page 1 of 1164 rej09b0321-0200 section 1 overview 1.1 sh7201 group features this lsi is a single-chip risc (reduced instruction set compute r) microprocessor that integrates a renesas technology original risc cpu core with peripheral functions required for system configuration. the cpu incorporated in this lsi is the sh-2a cpu, which features upward compatibility on the object code level with the sh-1, sh-2, and sh-2e microcomputers. the cpu has a risc-type instruction set and employs a supe rscalar architecture and the harv ard architecture, which greatly improves instruction execution speed. in addition, the 32-bit internal-bus architecture independent of the bus for the direct memory access controller (dmac) enhances data processing power. this cpu realizes low-cost, high-performance, and high -functioning systems for applications such as high-speed realtime control, which has been next to impossible with the conventional microcomputers. this lsi has a floating-point unit and a cache. in addition, this lsi includes on-chip peripheral functions necessary for system configuration, such as, 32-kbyte ram for high-speed operation, a controller area networ k (rcan-et), a serial sound interface (ssi), a serial communication inte rface with fifo (scif), i 2 c bus interface 3 (iic3), a multi-function timer pulse unit 2 (mtu2), an 8-bit timer (tmr), a realtime clock (rtc), an a/d converter, a d/a converter, an interrupt controller (intc), i/o ports, and advanced user debugger ii (aud-ii). this lsi also provides an external memory access support function to enable direct connection to various memory devices or peripheral lsis. these on-chip functions significantly reduce costs of designing and manufacturing application systems. the features of this lsi are listed in table 1.1.
section 1 overview rev. 2.00 sep. 07, 2007 page 2 of 1164 rej09b0321-0200 table 1.1 sh7201 group features item features cpu ? renesas technology original superh architecture ? compatible with sh-1 and sh-2 at object code level ? 32-bit internal data bus ? support of an abundant register-set ? sixteen 32-bit general registers ? four 32-bit control registers ? four 32-bit system registers ? register bank for high-speed response to interrupts ? risc-type instruction set (upward compatible with sh series) ? instruction length: 16-bit fixed-length basic instructions for improved code efficiency and 32-bit instructions for high performance and usability ? load/store architecture ? delayed branch instructions ? instruction set based on c language ? superscalar architecture to execut e two instructions at one time including fpu ? instruction execution time: up to two instructions/cycle ? address space: 4 gbytes ? internal multiplier ? five-stage pipeline ? harvard architecture
section 1 overview rev. 2.00 sep. 07, 2007 page 3 of 1164 rej09b0321-0200 item features floating-point unit (fpu) ? floating-point co-processor included ? supports single-precision (32-bit) and double-precision (64-bit) ? supports data type and exceptions that conforms to ieee754 standard ? two rounding modes: round to nearest and round to zero ? denormalization modes: flush to zero ? floating-point registers sixteen 32-bit floating-point registers (single-precision 16 words or double-precision 8 words) two 32-bit floating-point system registers ? supports fmac (multiplication and accumulation) instructions ? supports fdiv (division) and fsqrt (square root) instructions ? supports fldi0/fldi1 (load c onstant 0/1) instructions ? instruction execution time latency (famc/fadd/fsub/fmul): th ree cycles (single-precision), eight cycles (double-precision) pitch (famc/fadd/fsub/fmul): o ne cycle (single-precision), six cycles (double-precision) note: fmac only supports single-precision ? 5-stage pipeline cache ? instruction cache: 8 kbytes ? operand cache: 8 kbytes ? 128-entry, 4-way set associative, 16- byte block length configuration each for the instruction cache and operand cache ? write-back, write-through and lru replacement algorithm ? cache locking function available (only for operand cache); ways 2 and 3 can be locked interrupt controller (intc) ? seventeen external interrupt pins (nmi, irq7 to irq0, and pint7 to pint0) ? on-chip peripheral interrupts: prio rity level set for each module ? 16 priority levels available ? register bank enabling fast register saving and restoring in interrupt handling
section 1 overview rev. 2.00 sep. 07, 2007 page 4 of 1164 rej09b0321-0200 item features bus state controller (bsc) ? csc ? seven-channel chip select controller (csc) ? external devices with their bus sizes of 32, 16, or 8 bits can be connected ? cycle wait function up to 31 cycles (up to 7 cycles for page access cycle) ? the following features settable for wait controlling timings of asserting and negating chip select signals timings of asserting and negating read/write signals timings of starting and stopping data output ? one-write strobe and byte write strobe modes are available as write access modes ? page read and page write modes are available as page access modes ? sdramc ? two-channel external sdram interfaces ? auto refresh using the internal programmable refresh counter or self refresh mode selectable ? the following features settable row-column latency, column latency, row-active period, write- recovery period, row precharge period, auto refresh request interval, initial precharge cycle count, and initial auto refresh request interval ? random column burst access available (one sdram burst length) ? initialization sequencer issues precharge and auto refresh commands bus monitor ? bus monitor function when an illegal address access or a bus timeout is detected, a bus error interrupt is generated.
section 1 overview rev. 2.00 sep. 07, 2007 page 5 of 1164 rej09b0321-0200 item features direct memory access controller (dmac) ? eight channels; external request available for four of them ? can be activated by software, on-chip modules, or external devices ? software; 1, internal source; 32, external source; 4 ? up to 64 mbytes can be transferred ? maximum transfer data size ? 8, 16, or 32 bits for single-data transfer ? 1, 2, 4, 8, 16, 32, 64, or 128 sets of data for single operand transfer (a transfer continues until the byte count reaches 0) ? transfer method ? cycle-stealing transfer (dual address transfer) three clock cycles per one set of data (best) bus released between read and write cycles ? pipeline transfer (dual address transfer) one clock cycle per one set of data (best) ? addressing method increment, decrement, or fixed ? three clock cycles per one set of data (best) ? transfer modes single operand transfer, continuo us operand transfer, and non-stop transfer ? an interrupt is requested when the byte count reaches 0 ? reloading function source address, destination address, and byte count ? dmac suspend, resume, and stop function ? dmac forcible terminate function clock pulse generator (cpg) ? clock mode: input clock can be selected from external input (extal or ckio) or crystal resonator ? input clock can be multiplied by 16 (max.) by the internal pll circuit ? three types of clocks generated cpu clock: maximum 120 mhz bus clock: maximum 60 mhz peripheral clock: maximum 40 mhz watchdog timer (wdt) ? on-chip one-channel watchdog timer ? a counter overflow can reset this lsi
section 1 overview rev. 2.00 sep. 07, 2007 page 6 of 1164 rej09b0321-0200 item features power-down modes ? four power-down modes provided to reduce the current consumption in this lsi ? sleep mode ? software standby mode ? deep standby mode ? module standby mode multi-function timer pulse unit 2 (mtu2) ? maximum 16 lines of pulse inputs/out puts and 3 lines of pulse inputs based on six channels of 16-bit timers ? 21 output compare and input capture registers ? input capture function ? pulse output modes one shot, toggle, pwm, complementary pwm, and reset- synchronized pwm modes ? synchronization of multiple counters ? complementary pwm output mode ? non-overlapping waveforms output for 3-phase inverter control ? automatic dead time setting ? 0% to 100% pwm dut y cycle specifiable ? a/d converter start request delaying function ? interrupt skipping at crest or trough ? reset-synchronized pwm mode three-phase pwm waveforms in positive and negative phases can be output with a required duty value ? phase counting mode two-phase encoder pulse counting available 8-bit timer (tmr) ? two-channel 8-bit timer ? six internal clocks (p /2, p /8, p /32, p /64, p /1024, or p /8192) or external clock specifiable ? timer outputs controllable using two compare match signals ? two channels can be cascade-connected realtime clock (rtc) ? internal clock, calendar function, alarm function ? interrupts can be generated at interv als of 1/256 s by the 32.768-khz on-chip crystal oscillator
section 1 overview rev. 2.00 sep. 07, 2007 page 7 of 1164 rej09b0321-0200 item features serial communication interface with fifo (scif) ? eight channels ? clock synchronous or asynchronous mode selectable ? simultaneous transmission and reception (full-duplex communication) supported ? dedicated baud rate generator ? separate 16-byte fifo register s for transmission and reception i 2 c bus interface 3 (iic3) ? three channels ? master mode and slave mode supported serial sound interface (ssi) ? two-channel bidirectional serial transfer ? support of various serial audio formats ? support of master and slave functions ? generation of programmable word clock and bit clock ? multichannel formats ? support of 8, 16, 18, 20, 22, 24 and 32-bit data formats controller area network (rcan-et) ? two channels ? supports can specification 2.0b ? data and remote frame in standard format (11-bit id) ? data and remote frame in extended format (18-bit id) ? 16 independent message buffers using ids in standard (11-bit) or extended (18-bit) format ? 15 mailboxes for transmission or reception ? one receive-only mailbox ? message reception filtering by ids: ? standard message id ? extended message id ? local reception filter for all mailboxes (standard and extended ids) can be specified ? power consumption can be reduced in sleep mode ? can data transfer rate of up to 1 mbit/s available ? transmit message queue having an internal priority sorting mechanism which handles priority-inversion issue of realtime applications ? data buffer access without hand-shaking i/o ports ? 109 i/os and 14 inputs ? input or output can be selected for each bit
section 1 overview rev. 2.00 sep. 07, 2007 page 8 of 1164 rej09b0321-0200 item features a/d converter (adc) ? 10-bit resolution ? eight input channels ? a/d conversion request by the external trigger or timer trigger d/a converter (dac) ? 8-bit resolution ? two output channels user break controller (ubc) ? two break channels ? addresses, data values, type of access, and data size can all be set as break conditions user debugging interface (h-udi) ? e10a emulator support ? jtag-standard pin assignment advanced user debugger ii ? eight i/o pins ? functions to read/write modules conn ected to internal/external buses (except cache and h-udi) in ram monitor mode on-chip ram ? 32-kbyte memory power supply voltage ? pvcc, vccr, and pllvcc: 3.0 to 3.6 v packages ? lqfp2424-176cu (0.5 pitch) 1.2 product lineup table 1.2 product lineup abbreviation product code operating temperature R5S72011rb120fp ? 20 to + 70 c (regular specifications) R5S72011 R5S72011rw100fp ? 20 to + 85 c (wide-range specifications)
section 1 overview rev. 2.00 sep. 07, 2007 page 9 of 1164 rej09b0321-0200 1.3 block diagram the block diagram of this lsi is shown in figure 1.1. res input mres input nmi input irq input pint input timer pulse i/o compare match output external counter clock input external counter reset input rtc_ x1 input rtc_ x2 output serial i/o i 2 c bus i/o analog input adtrg input analog output jtag i/o serial i/o audio clock input can bus i/o sh-2a cpu core floating-point unit (fpu) instruction cache memory (8 kbytes) operand cache memory (8 kbytes) cache controller on-chip ram (32 kbytes) user break controller (ubc) cpu instruction fetch bus (f bus) cpu memory access bus (m bus) internal bus (i bus) audrst input audsync input audck input audmd input audata i/o port advanced user debugger-ii (aud-ii) port ubctrg output bus bridge external bus i/o external bus width mode input bus state controller (bsc) on-chip peripheral module bus 1 controller on-chip peripheral module bus 2 controller bus monitor direct memory access controller (dmac) port dreq input dack output dact output dtend output on-chip peripheral module bus 1 on-chip peripheral module bus 2 pin function controller (pfc) i/o port clock pulse generator (cpg) watchdog timer (wdt) interrupt controller (intc) multi-function timer pulse unit 2 (mtu2) 8-bit timer (tmr) realtime clock (rtc) general i/o extal input xtal output ckio i/o clock mode input wdtovf output internal cpu bus internal dma write bus internal dma read bus port port port port port port port port port port port port port port port user debugging interface (h-udi) power-down mode control d/a converter (dac) a/d converter (adc) controller area network (rcan-et) serial sound interface (ssi) i 2 c bus interface 3 (iic3) serial communication interface with fifo (scif) cpu bus (c bus) figure 1.1 block diagram
section 1 overview rev. 2.00 sep. 07, 2007 page 10 of 1164 rej09b0321-0200 1.4 pin assignments 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 asebrk / asebrkak udtck udtdi udtdo udtms pvcc udtrst pvss audio_x1 audio_x2 pvss pd0/audio_clk pd1/ssidata0 pd2/ssisck0 pd3/ssiws0 pd4/txd4/ssidata1 pd5/rxd4/ssisck1 pd6/sck4/ssiws1 pd7/tioc0a/txd0/dact1 pd8/tioc0b/rxd0/dtend1 pd9/tioc0c/sck0 pd10/tmo1/tioc0d/txd1 pd11/tmri1/rxd1 pd12/tmci1/sck1 pd13/dreq1 pd14/dack1 pd15/sda2 pd16/scl2 pf7/audata3 pvss pf6/audata2 pvcc pf5/audata1 pf4/audata0 pf3/ audsync pf2/tclkd/sck7/audck pf1/rxd7/audmd pf0/txd7/ audrst avss pe7/irq7/an7/da1 pe6/irq6/an6/da0 pe5/irq5/an5 pe4/irq4/an4 pe3/pint7/an3 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 vssr res pllvcc nmi pllvss rtc_x1 rtc_x2 pvss xtal extal pvss ckio/sdclk pvcc md_clk0 md_clk1 pvss pa0/a0 pvcc pa1/a1 pa2/a2 pa3/a3 pa4/a4 pa5/a5 pa6/a6 pa7/a7 pa8/a8 pa9/a9 pa10/a10 pa11/a11 pa12/a12 pa13/a13 pa14/a14 pa15/a15 pa16/a16 pa17/a17 pa18/a18 pa19/a19 pvss pa20/a20 pvcc pa21/a21 pa22/a22 pa23/a23 vcl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 lqfp2424-176cu (fp-176ev) top view pe2/pint6/an2 pe1/pint5/an1 pe0/pint4/an0 avref avcc pc0/ cs0 pc1/ cs1 pc2/ cs2 / sdcs1 / adtrg pc3/ cs3 / ubctrg pc4/ cs4 /tioc1a/txd5 pc5/ cs5 /tioc1b/rxd5 pc6/ cs6 /tclka/sck5 pvcc pc7/ sdcs0 pvss pc8/ rd pc9/ wr0 pc10/ wr1 pc11/ wr2 /tioc2a/dact2 pc12/ wr3 /tioc2b/dtend2 pc13/ wait pc14/sdcke pc15/ sdras pc16/ sdcas pc17/ sdwe pc18/bc0/dqm0 pc19/bc1/dqm1 pc20/bc2/dqm2/tclkb pc21/bc3/dqm3/tclkc/dack2 pc22/irq0/scl0/dreq2 pc23/irq1/sda0 pc24/irq2/scl1 pc25/irq3/sda1 pvss pa31/crx1/dtend0 pvcc pa30/ctx1/dact0 pa29/crx0/dack0 pa28/ctx0/dreq0 pa27/a27/pint3/dtend3 pa26/a26/pint2/dact3 pa25/a25/pint1/dack3 pa24/a24/pint0/dreq3 vss asemd md1 md0 wdtovf pvss pb0/d0 pvcc pb1/d1 pb2/d2 pb3/d3 pb4/d4 pb5/d5 pb6/d6 pb7/d7 pb8/d8 pb9/d9 pb10/d10 pb11/d11 pb12/d12 pb13/d13 pb14/d14 pb15/d15 pvss pb16/d16/irq0/tioc3a pvcc pb17/d17/irq1/tioc3b pb18/d18/irq2/tioc3c pb19/d19/irq3/tioc3d pb20/d20/irq4/tioc4a/txd2 pb21/d21/irq5/tioc4b/rxd2 pb22/d22/irq6/tioc4c/sck2 pb23/d23/irq7/tioc4d pb24/d24/pint0/tic5u/txd6 pb25/d25/pint1/tic5v/rxd6 pvcc pb26/d26/pint2/tic5w/sck6 pvss pb27/d27/pint3 pb28/d28/pint4/tmo0/txd3 pb29/d29/pint5/tmri0/rxd3 pb30/d30/pint6/tmci0/sck3 pb31/d31/pint7 vccr mres figure 1.2 pin assignments
section 1 overview rev. 2.00 sep. 07, 2007 page 11 of 1164 rej09b0321-0200 1.5 pin functions table 1.3 lists the pin functions. table 1.3 pin functions classification symbol i/o name function vccr i power supply for internal step- down circuit power supply pin for the internal step-down circuit. this pin must be connected to t he system power supply. this lsi does not operate correctly if this pin is left open. vssr i ground for internal step- down circuit ground pin for the internal step- down circuit. this pin must be connected to t he system power supply (0 v). this lsi does not operate correctly if this pin is left open. vcl i capacitor connected pin for internal step- down circuit pin for connecting an external capacitor for the internal step-down circuit. this pin should be connected to the vss via the external capacitor (place closer to this pin). vss i ground for internal step- down circuit ground pin for the internal step- down circuit used for stabilize internal step-down power supply. this pin should be connected to the vcl via the external capacitor (place closer to this pin) pvcc i power supply for i/o circuits power supply pins for i/o pins. all the pvcc pins must be connected to the system power supply. this lsi does not operate correctly if there is a pin left open. power supply pvss i ground for i/o circuits ground pins for i/o pins. all the pvss pins must be connected to the system power supply (0 v). this lsi does not operate correctly if there is a pin left open.
section 1 overview rev. 2.00 sep. 07, 2007 page 12 of 1164 rej09b0321-0200 classification symbol i/o name function pllvcc i power supply for pll power supply for the on-chip pll oscillator. this lsi does not operate correctly if this pin is left open. power supply pllvss i ground for pll ground pin for the on-chip pll oscillator. this lsi does not operate correctly if this pin is left open. extal i xtal o crystal resonator/ external clock pin connected to a crystal resonator. an external clock signal may also be input to the extal pin. clock ckio i/o system clock i/o input pin for an external clock or output pin for supplying the system clock to external devices operating mode control md1, md0 i mode set pins to set the operating mode. do not change signal levels on these pins during operation. md_clk1, md_clk0 i clock mode set pins to set the clock operating mode. do not change signal levels on these pins during operation. asemd i debugging mode this pin is valid when the e10a-usb emulator is in use. otherwise, fix the signal level on this pin high. system control res i power-on reset this lsi enters the power-on reset state when this signal goes low. mres i manual reset this lsi enters the manual reset state when this signal goes low. wdtovf o watchdog timer overflow an overflow signal from the wdt is output on this pin. asebrkak o break mode acknowledge indicates that the e10a-usb emulator has entered its break mode. asebrk * i break request e10a-usb emulator break input pin
section 1 overview rev. 2.00 sep. 07, 2007 page 13 of 1164 rej09b0321-0200 classification symbol i/o name function interrupts nmi i non-maskable interrupt non-maskable interrupt request pin. fix it high when not in use. irq7 to irq0 i interrupt requests 7 to 0 maskable interrupt request pins. level-input or edge-input detection can be selected. when the edge- input detection is selected, the rising edge, falling edge, or both edges can also be selected. pint7 to pint0 i interrupt requests 7 to 0 maskable interrupt request pins. only level-input detection can be selected. address bus a27 to a0 o address bus addresses are output on these pins. data bus d31 to d0 i/o data bus bidirectional data bus bus control cs6 to cs0 o chip select 6 to 0 chip-select signals for external memory or devices rd o read indicates that data is read from an external device. wait i wait input pin for inserting a wait cycle into the bus cycles during access to the external space wr0 o byte select indicates a write access to bits 7 to 0 of data of external memory or device. (for an access in units of 8, 16, or 32 bits) wr1 o byte select indicates a write access to bits 15 to 8 of data of external memory or device. (for an access in units of 16 or 32 bits) wr2 o byte select indicates a write access to bits 23 to 16 of data of external memory or device. (for an access in units of 32 bits) wr3 o byte select indicates a write access to bits 31 to 24 of data of external memory or device. (for an access in units of 32 bits)
section 1 overview rev. 2.00 sep. 07, 2007 page 14 of 1164 rej09b0321-0200 classification symbol i/o name function bus control bc0 o byte select selects bits 7 to 0 of data of external memory or device. (for an access in units of 8, 16, or 32 bits) bc1 o byte select selects bits 15 to 8 of data of external memory or device. (for an access in units of 16 or 32 bits) bc2 o byte select selects bits 23 to 16 of data of external memory or device. (for an access in units of 32 bits) bc3 o byte select selects bits 31 to 24 of data of external memory or device. (for an access in units of 32 bits) dqm0 o byte select selects bits d7 to d0 when sdram is connected. (for an access in units of 8, 16, or 32 bits) dqm1 o byte select selects bits d15 to d8 when sdram is connected. (for an access in units of 16 or 32 bits) dqm2 o byte select selects bits d23 to d16 when sdram is connected. (for an access in units of 32 bits) dqm3 o byte select selects bits d31 to d24 when sdram is connected. (for an access in units of 32 bits) sdcs1 , sdcs0 o chip select pins connected to the cs pins of sdram sdras o ras pin connected to the ras pin of sdram sdcas o cas pin connected to the cas pin of sdram sdwe o we pin connected to the we pin of sdram sdcke o ck enable pin connected to the cke pin of sdram sdclk o clock output pin connected to the clk pin of sdram
section 1 overview rev. 2.00 sep. 07, 2007 page 15 of 1164 rej09b0321-0200 classification symbol i/o name function dreq3 to dreq0 i dma-transfer request input pins to receive external requests for dma transfer direct memory access controller (dmac) dack3 to dack0 o dma-transfer request acknowledge output pins for signals indicating acknowledge of external requests from external devices dact3 to dact0 o dma-transfer request active output pins for signals indicating dma active in response to external requests from external devices dtend3 to dtend0 o dma-transfer end output output pins for dma transfer end tclka, tclkb, tclkc, tclkd i mtu2 timer clock input external clock input pins for the timer tioc0a, tioc0b, tioc0c, tioc0d i/o mtu2 input capture/output compare (channel 0) the tgra_0 to tgrd_0 input capture input/output compare output/pwm output pins. tioc1a, tioc1b i/o mtu2 input capture/output compare (channel 1) the tgra_1 and tgrb_1 input capture input/output compare output/pwm output pins. tioc2a, tioc2b i/o mtu2 input capture/output compare (channel 2) the tgra_2 and tgrb_2 input capture input/output compare output/pwm output pins. tioc3a, tioc3b, tioc3c, tioc3d i/o mtu2 input capture/output compare (channel 3) the tgra_3 to tgrd_3 input capture input/output compare output/pwm output pins. tioc4a, tioc4b, tioc4c, tioc4d i/o mtu2 input capture/output compare (channel 4) the tgra_4 and tgrb_4 input capture input/output compare output/pwm output pins. multi-function timer pulse unit 2 (mtu2) tioc5u, tioc5v, tioc5w i mtu2 input capture (channel 5) the tgru_5, tgrv_5, and tgrw_5 input capture input/dead time compensation input pins.
section 1 overview rev. 2.00 sep. 07, 2007 page 16 of 1164 rej09b0321-0200 classification symbol i/o name function 8-bit timer (tmr) tmo0, tmo1 o timer out put pins for waveform outputs by output compare tmci0, tmci1, tmri0, tmri1 i timer clock/timer reset input input pins for an external clock or an external reset for the timer rtc_x1 i realtime clock (rtc) rtc_x2 o crystal resonator for rtc pin connected to 32.768-khz crystal resonator txd7 to txd0 o transmit data data output pins rxd7 to rxd0 i receive data data input pins serial communication interface with fifo (scif) sck7 to sck0 i/o serial cl ock clock input/output pins scl2 to scl0 i/o serial clock pin serial clock input/output pin i 2 c bus interface 3 (iic3) sda2 to sda0 i/o seri al data pin serial data input/output pin ssidata0, ssidata1 i/o ssi data i/o i/o pins for serial data serial sound interface (ssi) ssisck0, ssisck1 i/o ssi clock i/o i/o pins for serial clocks ssiws0, ssiws1 i/o ssi clock lr i/o i/o pins for word selection audio_clk i external clock for ssi audio input pin of external clock for ssi audio (32/44.1/48 khz 256/384/512). a clock input to the divider is selected from an oscillation clock input on this pin or pins audio_x1 and audio_x2. audio_x1 i audio_x2 o crystal resonator for ssi audio pins connected to a crystal resonator for ssi audio. an external clock can be input on pin audio_x1 (32/44.1/48 khz 256/384/512). a clock input to the divider is selected from an oscillation clock input on these pins or the audio_clk pin.
section 1 overview rev. 2.00 sep. 07, 2007 page 17 of 1164 rej09b0321-0200 classification symbol i/o name function ctx0, ctx1 o can bus transmit data output pin for transmit data on the can bus controller area network (rcan-et) crx0, crx1 i can bus receive data output pin for receive data on the can bus an7 to an0 i analog input pins analog input pins a/d converter adtrg i a/d conversion trigger input external trigger input pin for starting a/d conversion d/a converter da1, da0 o analog output pins analog output pins avcc i analog power supply power supply pins for the a/d converter and d/a converter avref i analog reference power supply reference voltage input pin for the a/d converter and d/a converter analog power supply avss i analog ground ground pins for the a/d converter and d/a converter i/o ports pa31 to pa0 i/o general port 32-bit general i/o port pins pb31 to pb0 i/o general port 32-bit general i/o port pins pc25 to pc22 i general port 4-bit general input port pins pc21 to pc0 i/o general port 22-bit general i/o port pins pd16 to pd15 i general port 2-bit general input port pins pd14 to pd0 i/o general port 15-bit general i/o port pins pe7 to pe0 i general port 8-bit general input port pins pf7 to pf0 i/o general port 8-bit general i/o port pins udtck * i test clock test-clock input pin udtms * i test mode select test-mode select signal input pin udtdi * i test data input serial input pin for instructions and data udtdo o test data output serial output pin for instructions and data user debugging interface (h-udi) udtrst * i test reset initialization-signal input pin
section 1 overview rev. 2.00 sep. 07, 2007 page 18 of 1164 rej09b0321-0200 classification symbol i/o name function advanced user debugger ii (aud-ii) audata3 to audata0 i/o aud data input pins for monitor addresses/data i/o pins audck i aud clock external clock input pin audsync i aud sync signal input pin for an signal identifying the data start position audmd i aud mode pin to select the aud mode audrst i aud reset input pins for an aud reset user break controller (ubc) ubctrg o user break trigger output trigger output pin for ubc condition match note: * the pin with the pull-up function.
section 2 cpu rev. 2.00 sep. 07, 2007 page 19 of 1164 rej09b0321-0200 section 2 cpu 2.1 register configuration the register set consists of sixteen 32-bit general registers, four 32-bit control registers, and four 32-bit system registers. 2.1.1 general registers figure 2.1 shows the general registers. the sixteen 32-bit general register s are numbered r0 to r15. general registers are used for data processing and address calculation. r0 is also used as an index register. several instructions have r0 fixed as their only usable register. r15 is used as the hardware stack pointer (sp). saving and restoring the status register (sr) and program counter (pc) in exception handling is accomplished by referencing the stack using r15. 31 0 r0 * 1 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15, sp (hardware stack pointer) * 2 notes: 1. r0 functions as an index register in the indexed register indirect addressing mode and indexed gbr indirect addressing mode. in some instructions, r0 functions as a fixed source register or destination register. 2. r15 functions as a hardware stack pointer (sp) during exception processing. figure 2.1 general registers
section 2 cpu rev. 2.00 sep. 07, 2007 page 20 of 1164 rej09b0321-0200 2.1.2 control registers the control registers consist of four 32-bit registers: the status register (sr), the global base register (gbr), the vector base register (vbr ), and the jump table base register (tbr). the status register indicates in struction processing states. the global base register functions as a base ad dress for the gbr indirect addressing mode to transfer data to the registers of on-chip peripheral modules. the vector base register functions as the base address of the exception handling vector area (including interrupts). the jump table base register functions as the base address of the function table area. 31 0 1 t s 2 3 4 5 6 7 8 9 i[3:0] q m 13 14 cs bo status register (sr) 31 0 gbr global base register (gbr) 31 vbr vector base register (vbr) 0 31 tbr jump table base register (tbr) 0 figure 2.2 control registers (1) status register (sr) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr 000000??111100?? r r/w r/w r r r r/w r/w r/w r/w r/w r/w r r r/w r/w bit: initial value: r/w: bit: initial value: r/w: ???????????????? ? bo cs ? ? ? m q i[3:0] ? ? s t
section 2 cpu rev. 2.00 sep. 07, 2007 page 21 of 1164 rej09b0321-0200 bit bit name initial value r/w description 31 to 15 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 14 bo 0 r/w bo bit indicates that a register bank has overflowed. 13 cs 0 r/w cs bit indicates that, in clip instruction execution, the value has exceeded the saturation upper-limit value or fallen below the saturation lower-limit value. 12 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 m ? r/w 8 q ? r/w m bit q bit used by the div0s, div0u, and div1 instructions. 7 to 4 i[3:0] 1111 r/w interrupt mask level 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 s ? r/w s bit specifies a saturation operation for a mac instruction. 0 t ? r/w t bit true/false condition or carry/borrow bit
section 2 cpu rev. 2.00 sep. 07, 2007 page 22 of 1164 rej09b0321-0200 (2) global base register (gbr) gbr is referenced as the base address in a gbr-referencing mov instruction. (3) vector base register (vbr) vbr is referenced as the branch destination ba se address in the event of an exception or an interrupt. (4) jump table base register (tbr) tbr is referenced as the start address of a function table located in memory in a jsr/n@@(disp8,tbr) table-referenc ing subroutine call instruction. 2.1.3 system registers the system registers consist of four 32-bit registers: the high and low multiply and accumulate registers (mach and macl), the procedure register (pr), and the program counter (pc). mach and macl store the results of multiply or multiply and accumulate operations. pr stores the return address from a subroutine procedure. pc indicates the program address being executed and controls the flow of the processing. 31 0 31 0 31 pc pr macl mach multiply and accumulate register high (mach) and multiply and accumulate register low (macl): store the results of multiply or multiply and accumulate operations. procedure register (pr): stores the return address from a subroutine procedure. program counter (pc): indicates the four bytes ahead of the current instruction. 0 figure 2.3 system registers (1) multiply and accumulate register high (mach) and multiply and accumulate register low (macl) mach and macl are used as the addition value in a mac instruction, and store the result of a mac or mul instruction.
section 2 cpu rev. 2.00 sep. 07, 2007 page 23 of 1164 rej09b0321-0200 (2) procedure register (pr) pr stores the return address of a subroutine call using a bsr, bsrf, or jsr instruction, and is referenced by a subroutine return instruction (rts). (3) program counter (pc) pc indicates the address of th e instruction being executed. 2.1.4 register banks for the nineteen 32-bit registers comprising general registers r0 to r14, control register gbr, and system registers mach, macl, and pr, high-speed register saving and restoration can be carried out using a register bank. the register contents are automatically saved in the bank after the cpu accepts an interrupt that uses a register bank. re storation from the bank is executed by issuing a resbank instruction in an interrupt processing routine. this lsi has 15 banks. for details, see the sh-2a, sh2a-fpu software manual and section 6.8, register banks. 2.1.5 initial values of registers table 2.1 lists the values of the registers after a reset. table 2.1 initial values of registers classification register initial value r0 to r14 undefined general registers r15 (sp) value of the sta ck pointer in the vector address table sr bits i[3:0] are 1111 (h'f), bo and cs are 0, reserved bits are 0, and other bits are undefined gbr, tbr undefined control registers vbr h'00000000 mach, macl, pr undefined system registers pc value of the program counter in the vector address table
section 2 cpu rev. 2.00 sep. 07, 2007 page 24 of 1164 rej09b0321-0200 2.2 data formats 2.2.1 data format in registers register operands are always longwords (32 bits). if the size of memory operand is a byte (8 bits) or a word (16 bits), it is changed into a longword by expanding the sign-part when loaded into a register. 31 0 longword figure 2.4 data format in registers 2.2.2 data formats in memory memory data formats are classifi ed into bytes, words, and longwords. memory can be accessed in 8-bit bytes, 16-bit words, or 32-bit longwords. a memory operand of fewer than 32 bits is stored in a register in sign-extended or zero-extended form. a word operand should be accessed at a word boundary (an even address of multiple of two bytes: address 2n), and a longword operand at a longword boundary (an even address of multiple of four bytes: address 4n). otherwise, an address error will occur. a byte operand can be accessed at any address. only big-endian byte order can be selected for the data format. data formats in memory are shown in figure 2.5. 31 0 15 23 7 byte byte byte byte word word address 2n address 4n longword address m address m + 2 address m + 1 address m + 3 figure 2.5 data formats in memory
section 2 cpu rev. 2.00 sep. 07, 2007 page 25 of 1164 rej09b0321-0200 2.2.3 immediate data format byte (8-bit) immediate data is located in an instruction code. immediate data accessed by the mov, add, and cmp/eq instructions is sign-extended and handled in registers as longword data. immediate data accessed by the tst, and, or, and xor instructions is zero-extended and handled as longword data. consequently, and instructions with immediate data always clear the upper 24 bits of the destination register. 20-bit immediate data is located in the code of a movi20 or movi20s 32-bit transfer instruction. the movi20 instruction stores immediate data in the destination register in sign-extended form. the movi20s instruction shifts immediate data by eight bits in the upper direction, and stores it in the destination register in sign-extended form. word or longword immediate data is not located in the instruction code, but rather is stored in a memory table. the memory table is accessed by an immediate data transfer instruction (mov) using the pc relative addressi ng mode with displacement. see examples given in section 2.3.1 (10), immediate data.
section 2 cpu rev. 2.00 sep. 07, 2007 page 26 of 1164 rej09b0321-0200 2.3 instruction features 2.3.1 risc-type instruction set instructions are risc type. this section details their functions. (1) 16-bit fixed-length instructions basic instructions have a fixed length of 16 bits, improving program code efficiency. (2) 32-bit fixed-length instructions the sh-2a additionally features 32-bit fixed-length instructions, improving performance and ease of use. (3) one instruction per state each basic instruction can be executed in one cycle using the pipeline system. (4) data length longword is the standard data length for all operations. memory can be accessed in bytes, words, or longwords. byte or word data in memory is sign-extended and handled as longword data. immediate data is sign-extended for arithmetic operations or zero-extended for logic operations. it is also handled as longword data. table 2.2 sign extension of word data sh-2a cpu description example of other cpu mov.w @(disp,pc),r1 add r1,r0 ......... .data.w h'1234 data is sign-extended to 32 bits, and r1 becomes h'00001234. it is next operated upon by an add instruction. add.w #h'1234,r0 note: @(disp, pc) accesses the immediate data.
section 2 cpu rev. 2.00 sep. 07, 2007 page 27 of 1164 rej09b0321-0200 (5) load-store architecture basic operations are executed between registers. for operations that involve memory access, data is loaded to the registers and executed (load-stor e architecture). instructio ns such as and that manipulate bits, however, are executed directly in memory. (6) delayed branch instructions with the exception of some instructions, uncond itional branch instructions, etc., are executed as delayed branch instructions. with a delayed branch instruction, the branch is taken after execution of the instruction immediately following the delayed branch instruction. this reduces disturbance of the pipeline control when a branch is taken. in a delayed branch, the actual branch operation occurs after execution of the slot instruction. however, instruction execution such as register updating excluding the actual branch operation, is performed in the order of delayed branch instruction delay slot instruction. for example, even though the contents of the register holding the br anch destination address are changed in the delay slot, the branch destination address remains as the register contents prior to the change. table 2.3 delayed branch instructions sh-2a cpu description example of other cpu bra trget add r1,r0 executes the add before branching to trget. add.w r1,r0 bra trget (7) unconditional branch instructions with no delay slot the sh-2a additionally features unconditional branch instructions in which a delay slot instruction is not executed. this eliminates unn ecessary nop instructions, and so reduces the code size. (8) multiply/multiply-an d-accumulate operations 16-bit 16-bit 32-bit multiply operations are executed in one to two cycles. 16-bit 16-bit + 64-bit 64-bit multiply-and-accumulate operations are executed in tw o to three cycles. 32-bit 32-bit 64-bit multiply and 32-bit 32-bit + 64-bit 64-bit multiply-and-accumulate operations are executed in two to four cycles.
section 2 cpu rev. 2.00 sep. 07, 2007 page 28 of 1164 rej09b0321-0200 (9) t bit the t bit in the status register (sr) changes acco rding to the result of the comparison. whether a conditional branch is taken or not taken depends upon the t bit condition (true/false). the number of instructions that change the t bit is kept to a minimum to improve the processing speed. table 2.4 t bit sh-2a cpu description example of other cpu cmp/ge r1,r0 bt trget0 bf trget1 t bit is set when r0 r1. the program branches to trget0 when r0 r1 and to trget1 when r0 < r1. cmp.w r1,r0 bge trget0 blt trget1 add # ? 1,r0 cmp/eq #0,r0 bt trget t bit is not changed by add. t bit is set when r0 = 0. the program branches if r0 = 0. sub.w #1,r0 beq trget (10) immediate data byte immediate data is located in an instructi on code. word or longword immediate data is not located in instruction codes but in a memory tabl e. the memory table is accessed by an immediate data transfer instruction (mov) using the pc relative addressing mode with displacement. with the sh-2a, 17- to 28-bit immediate data can be located in an instruction code. however, for 21- to 28-bit immediate data, an or instruction must be executed after the data is transferred to a register. table 2.5 immediat e data accessing classification sh-2a cpu example of other cpu 8-bit immediate mov #h'12,r0 mov.b #h'12,r0 16-bit immediate movi20 #h'1234,r0 mov.w #h'1234,r0 20-bit immediate movi20 #h'12345,r0 mov.l #h'12345,r0 28-bit immediate movi20s #h'12345,r0 or #h'67,r0 mov.l #h'1234567,r0 32-bit immediate mov.l @(disp,pc),r0 ................. .data.l h'12345678 mov.l #h'12345678,r0 note: @(disp, pc) accesses the immediate data.
section 2 cpu rev. 2.00 sep. 07, 2007 page 29 of 1164 rej09b0321-0200 (11) absolute address when data is accessed by an absolute address, the absolute address valu e should be placed in the memory table in advance. that va lue is transferred to the register by loading the immediate data during the execution of the instruction, and the data is accessed in regist er indirect addressing mode. with the sh-2a, when data is refe renced using an absolute address not exceeding 28 bi ts, it is also possible to transfer immediate data located in the in struction code to a register and to reference the data in register indirect addressing mode. however, when referencing data using an absolute address of 21 to 28 bits, an or instruction must be used after the data is transferred to a register. table 2.6 absolute address accessing classification sh-2a cpu example of other cpu up to 20 bits movi20 #h'12345,r1 mov.b @r1,r0 mov.b @h'12345,r0 21 to 28 bits movi20s #h'12345,r1 or #h'67,r1 mov.b @r1,r0 mov.b @h'1234567,r0 29 bits or more mov.l @(disp,pc),r1 mov.b @r1,r0 .................. .data.l h'12345678 mov.b @h'12345678,r0 (12) 16-bit/32-bit displacement when data is accessed by 16-bit or 32-bit displacement, the disp lacement value should be placed in the memory table in advance. that value is tr ansferred to the register by loading the immediate data during the execution of the instruction, and the data is accessed in the indexed indirect register addressing mode. table 2.7 displacement accessing classification sh-2a cpu example of other cpu 16-bit displacement mov.w @(disp,pc),r0 mov.w @(r0,r1),r2 .................. .data.w h'1234 mov.w @(h'1234,r1),r2
section 2 cpu rev. 2.00 sep. 07, 2007 page 30 of 1164 rej09b0321-0200 2.3.2 addressing modes addressing modes and effective ad dress calculation are as follows: table 2.8 addressing modes and effective addresses addressing mode instruction format effective address calculation equation register direct rn the effective address is register rn. (the operand is the contents of register rn.) ? register indirect @rn the effective address is the contents of register rn. rn rn rn register indirect with post-increment @rn+ the effective address is the contents of register rn. a constant is added to the contents of rn after the instruction is executed. 1 is added for a byte operation, 2 for a word operation, and 4 for a longword operation. rn rn 1/2/4 + rn + 1/2/4 rn (after instruction execution) byte: rn + 1 rn word: rn + 2 rn longword: rn + 4 rn register indirect with pre-decrement @-rn the effective address is the value obtained by subtracting a constant from rn. 1 is subtracted for a byte operation, 2 for a word operation, and 4 for a longword operation. rn 1/2/4 rn ? 1/2/4 ? rn ? 1/2/4 byte: rn ? 1 rn word: rn ? 2 rn longword: rn ? 4 rn (instruction is executed with rn after this calculation)
section 2 cpu rev. 2.00 sep. 07, 2007 page 31 of 1164 rej09b0321-0200 addressing mode instruction format effective address calculation equation register indirect with displacement @(disp:4,rn) the effective address is the sum of rn and a 4-bit displacement (disp). the value of disp is zero-extended, and remains unchanged for a byte operation, is doubled for a word operation, and is quadrupled for a longword operation. rn rn + disp 1/2/4 + 1/2/4 disp (zero-extended) byte: rn + disp word: rn + disp 2 longword: rn + disp 4 register indirect with displacement @(disp:12,rn) the effective address is the sum of rn and a 12-bit displacement (disp). the value of disp is zero-extended. + rn disp (zero-extended) rn + disp byte: rn + disp word: rn + disp longword: rn + disp indexed register indirect @(r0,rn) the effective address is the sum of rn and r0. rn r0 rn + r0 + rn + r0 gbr indirect with displacement @(disp:8,gbr) the effective address is the sum of gbr value and an 8-bit displacement (disp). the value of disp is zero-extended, and remains unchanged for a byte operation, is doubled for a word operation, and is quadrupled for a longword operation. gbr 1/2/4 gbr + disp 1/2/4 + disp (zero-extended) byte: gbr + disp word: gbr + disp 2 longword: gbr + disp 4
section 2 cpu rev. 2.00 sep. 07, 2007 page 32 of 1164 rej09b0321-0200 addressing mode instruction format effective address calculation equation indexed gbr indirect @(r0,gbr) the effective address is the sum of gbr value and r0. gbr r0 gbr + r0 + gbr + r0 tbr duplicate indirect with displacement @@ (disp:8,tbr) the effective address is the sum of tbr value and an 8-bit displacement (disp). the value of disp is zero-extended, and is multiplied by 4. tbr tbr + disp 4 (tbr + disp 4) 4 + disp (zero-extended) contents of address (tbr + disp 4) pc indirect with displacement @(disp:8,pc) the effective address is the sum of pc value and an 8-bit displacement (disp). the value of disp is zero-extended, and is doubled for a word operation, and quadrupled for a longword operation. for a longword operation, the lowest two bits of the pc value are masked. pc h'fffffffc pc + disp 2 or pc & h'fffffffc + disp 4 + 2/4 & (for longword) disp (zero-extended) word: pc + disp 2 longword: pc & h'fffffffc + disp 4 pc relative disp:8 the effective address is the sum of pc value and the value that is obtained by doubling the sign-extended 8-bit displacement (disp). pc 2 + disp (sign-extended) pc + disp 2 pc + disp 2
section 2 cpu rev. 2.00 sep. 07, 2007 page 33 of 1164 rej09b0321-0200 addressing mode instruction format effective address calculation equation pc relative disp:12 the effective address is the sum of pc value and the value that is obtained by doubling the sign- extended 12-bit displacement (disp). pc 2 + disp (sign-extended) pc + disp 2 pc + disp 2 rn the effective address is the sum of pc value and rn. pc rn pc + rn + pc + rn the 20-bit immediate data (imm) for the movi20 instruction is sign-extended. sign- extended imm (20 bits) 31 19 0 ? immediate #imm:20 the 20-bit immediate data (imm) for the movi20s instruction is shifted by eight bits to the left, the upper bits are sign-extended, and the lower bits are padded with zero. sign-extended imm (20 bits) 00000000 31 27 8 0 ? #imm:8 the 8-bit immediate data (imm) for the tst, and, or, and xor instructions is zero-extended. ? #imm:8 the 8-bit immediate data (imm) for the mov, add, and cmp/eq instructions is sign-extended. ? #imm:8 the 8-bit immediate data (imm) for the trapa instruction is zero-extended and then quadrupled. ? #imm:3 the 3-bit immediate data (imm) for the band, bor, bxor, bst, bld, bset, and bclr instructions indicates the target bit location. ?
section 2 cpu rev. 2.00 sep. 07, 2007 page 34 of 1164 rej09b0321-0200 2.3.3 instruction format the instruction formats and the m eaning of source and destination operands are described below. the meaning of the operand depends on the instru ction code. the symbols used are as follows: ? xxxx: instruction code ? mmmm: source register ? nnnn: destination register ? iiii: immediate data ? dddd: displacement table 2.9 instruction formats instruction formats source operand destination operand example 0 format xxxx xxxx xxxx xxxx 15 0 ? ? nop ? nnnn: register direct movt rn control register or system register nnnn: register direct sts mach,rn r0 (register direct) nnnn: register direct divu r0,rn control register or system register nnnn: register indirect with pre- decrement stc.l sr,@-rn mmmm: register direct r15 (register indirect with pre- decrement) movmu.l rm,@-r15 r15 (register indirect with post- increment) nnnn: register direct movmu.l @r15+,rn n format xxxx xxxx xxxx nnnn 15 0 r0 (register direct) nnnn: (register indirect with post- increment) mov.l r0,@rn+
section 2 cpu rev. 2.00 sep. 07, 2007 page 35 of 1164 rej09b0321-0200 instruction formats source operand destination operand example mmmm: register direct control register or system register ldc rm,sr mmmm: register indirect with post- increment control register or system register ldc.l @rm+,sr mmmm: register indirect ? jmp @rm mmmm: register indirect with pre- decrement r0 (register direct) mov.l @-rm,r0 m format xxxx mmmm xxxx xxxx 15 0 mmmm: pc relative using rm ? braf rm mmmm: register direct nnnn: register direct add rm,rn mmmm: register direct nnnn: register indirect mov.l rm,@rn mmmm: register indirect with post- increment (multiply- and-accumulate) nnnn * : register indirect with post- increment (multiply- and-accumulate) mach, macl mac.w @rm+,@rn+ mmmm: register indirect with post- increment nnnn: register direct mov.l @rm+,rn mmmm: register direct nnnn: register indirect with pre- decrement mov.l rm,@-rn nm format nnnn xxxx xxxx 15 0 mmmm mmmm: register direct nnnn: indexed register indirect mov.l rm,@(r0,rn) md format xxxx dddd 15 0 mmmm xxxx mmmmdddd: register indirect with displacement r0 (register direct) mov.b @(disp,rm),r0 nd4 format xxxx xxxx dddd 15 0 nnnn r0 (register direct) nnnndddd: register indirect with displacement mov.b r0,@(disp,rn)
section 2 cpu rev. 2.00 sep. 07, 2007 page 36 of 1164 rej09b0321-0200 instruction formats source operand destination operand example mmmm: register direct nnnndddd: register indirect with displacement mov.l rm,@(disp,rn) nmd format nnnn xxxx dddd 15 0 mmmm mmmmdddd: register indirect with displacement nnnn: register direct mov.l @(disp,rm),rn mmmm: register direct nnnndddd: register indirect with displacement mov.l rm,@(disp12,rn) nmd12 format xxxx dddd dddd dddd 15 0 xxxx mmmm xxxx nnnn 32 16 mmmmdddd: register indirect with displacement nnnn: register direct mov.l @(disp12,rm),rn dddddddd: gbr indirect with displacement r0 (register direct) mov.l @(disp,gbr),r0 r0 (register direct) dddddddd: gbr indirect with displacement mov.l r0,@(disp,gbr) dddddddd: pc relative with displacement r0 (register direct) mova @(disp,pc),r0 dddddddd: tbr duplicate indirect with displacement ? jsr/n @@(disp8,tbr) d format dddd xxxx 15 0 xxxx dddd dddddddd: pc relative ? bf label d12 format dddd xxxx 15 0 dddd dddd dddddddddddd: pc relative ? bra label (label = disp + pc) nd8 format dddd nnnn xxxx 15 0 dddd dddddddd: pc relative with displacement nnnn: register direct mov.l @(disp,pc),rn iiiiiiii: immediate indexed gbr indirect and.b #imm,@(r0,gbr) iiiiiiii: immediate r0 (register direct) and #imm,r0 i format xxxx xxxx iiii 15 0 iiii iiiiiiii: immediate ? trapa #imm
section 2 cpu rev. 2.00 sep. 07, 2007 page 37 of 1164 rej09b0321-0200 instruction formats source operand destination operand example ni format nnnn iiii xxxx 15 0 iiii iiiiiiii: immediate nnnn: register direct add #imm,rn nnnn: register direct iii: immediate ? bld #imm3,rn ni3 format xxxx nnnn xxxx 15 0 iii x ? nnnn: register direct iii: immediate bst #imm3,rn ni20 format iiii iiii iiii iiii 15 0 xxxx iiii xxxx nnnn 32 16 iiiiiiiiiiiiiiiiiiii: immediate nnnn: register direct movi20 #imm20, rn nnnndddddddddddd : register indirect with displacement iii: immediate ? bld.b #imm3,@(disp12,rn) nid format xiii dddd dddd dddd 15 0 xxxx nnnn xxxx xxxx 32 16 ? nnnndddddddddddd : register indirect with displacement iii: immediate bst.b #imm3,@(disp12,rn) note: * in multiply-and-accumula te instructions, nnnn is the source register.
section 2 cpu rev. 2.00 sep. 07, 2007 page 38 of 1164 rej09b0321-0200 2.4 instruction set 2.4.1 instruction set by classification table 2.10 lists the instructions according to their classification. table 2.10 classification of instructions classification types operation code function no. of instructions mov data transfer immediate data transfer peripheral module data transfer structure data transfer reverse stack transfer mova effective address transfer movi20 20-bit immediate data transfer movi20s 20-bit immediate data transfer 8-bit left-shit movml r0 ? rn register save/restore movmu rn ? r14 and pr register save/restore movrt t bit inversion and transfer to rn movt t bit transfer movu unsigned data transfer nott t bit inversion pref prefetch to operand cache swap swap of upper and lower bytes data transfer 13 xtrct extraction of t he middle of registers connected 62
section 2 cpu rev. 2.00 sep. 07, 2007 page 39 of 1164 rej09b0321-0200 classification types operation code function no. of instructions 26 add binary addition 40 addc binary addition with carry addv binary addition with overflow check cmp/cond comparison clips signed saturation value comparison clipu unsigned saturation value comparison divs signed division (32 32) divu unsigned division (32 32) div1 one-step division arithmetic operations div0s initialization of signed one-step division div0u initialization of unsigned one-step division dmuls signed double-precision multiplication dmulu unsigned double-precision multiplication dt decrement and test exts sign extension extu zero extension mac multiply-and-accumulate, double-precision multiply-and-accumulate operation mul double-precision multiply operation mulr signed multiplication with result storage in rn muls signed multiplication mulu unsigned multiplication neg negation negc negation with borrow sub binary subtraction subc binary subtraction with borrow subv binary subtraction with underflow
section 2 cpu rev. 2.00 sep. 07, 2007 page 40 of 1164 rej09b0321-0200 classification types operation code function no. of instructions 6 and logical and 14 not bit inversion or logical or tas memory test and bit set tst logical and and t bit set logic operations xor exclusive or shift 12 rotl one-bit left rotation 16 rotr one-bit right rotation rotcl one-bit left rotation with t bit rotcr one-bit right rotation with t bit shad dynamic arithmetic shift shal one-bit arithmetic left shift shar one-bit arithmetic right shift shld dynamic logical shift shll one-bit logical left shift shlln n-bit logical left shift shlr one-bit logical right shift shlrn n-bit logical right shift branch 10 bf conditional branch, conditional delayed branch (branch when t = 0) 15 bt conditional branch, conditional delayed branch (branch when t = 1) bra unconditional delayed branch braf unconditional delayed branch bsr delayed branch to subroutine procedure bsrf delayed branch to subroutine procedure jmp unconditional delayed branch jsr branch to subroutine procedure delayed branch to subroutine procedure rts return from subroutine procedure delayed return from subroutine procedure rtv/n return from subroutine procedure with rm r0 transfer
section 2 cpu rev. 2.00 sep. 07, 2007 page 41 of 1164 rej09b0321-0200 classification types operation code function no. of instructions 14 clrt t bit clear 36 clrmac mac register clear system control ldbank register restoration from specified register bank entry ldc load to control register lds load to system register nop no operation resbank register restoration from register bank rte return from exception handling sett t bit set sleep transition to power-down mode stbank register save to specified register bank entry stc store control register data sts store system register data trapa trap exception handling 19 fabs floating-poin t absolute value 48 floating-point instructions fadd floating-point addition fcmp floating-point comparison fcnvds conversion from double-precision to single- precision fcnvsd conversion from single-precision to double- precision fdiv floating-point division fldi0 floating-point load immediate 0 fldi1 floating-point load immediate 1 flds floating-point load into system register fpul float conversion from integer to floating-point fmac floating-point multiply and accumulate operation fmov floating-point data transfer fmul floating-point multiplication fneg floating-point sign inversion
section 2 cpu rev. 2.00 sep. 07, 2007 page 42 of 1164 rej09b0321-0200 classification types operation code function no. of instructions 19 fschg sz bit inversion 48 floating-point instructions fsqrt floating-point square root fsts floating-point store from system register fpul fsub floating-point subtraction ftrc floating-point conversion with rounding to integer 2 lds load into floating-point system register 8 fpu-related cpu instructions sts store from floating-point system register 10 band bit and 14 bit manipulation bclr bit clear bld bit load bor bit or bset bit set bst bit store bxor bit exclusive or bandnot bit not and bornot bit not or bldnot bit not load total: 112 253
section 2 cpu rev. 2.00 sep. 07, 2007 page 43 of 1164 rej09b0321-0200 the table below shows the format of instruction c odes, operation, and execution states. they are described by using this format according to their classification. instruction instruction code operation execution states t bit indicated by mnemonic. explanation of symbols rm: source register rn: destination register imm: immediate data disp: displacement * 2 indicated in msb ? lsb order. explanation of symbols mmmm: source register nnnn: destination register 0000: r0 0001: r1 ......... 1111: r15 iiii: immediate data dddd: displacement indicates summary of operation. explanation of symbols , : transfer direction (xx): memory operand m/q/t: flag bits in sr &: logical and of each bit |: logical or of each bit ^: exclusive logical or of each bit ~: logical not of each bit <>n: n-bit right shift value when no wait states are inserted. * 1 value of t bit after instruction is executed. explanation of symbols ?: no change notes: 1. instruction execution cycles: the execution cycl es shown in the table are minimums. in practice, the number of instruction execut ion states will be increased in cases such as the following: a. when there is a conflict between an instruction fetch and a data access b. when the destination register of a load instruction (memory register) is the same as the register used by the next instruction. 2. depending on the operand size, displacement is scaled by 1, 2, or 4. for details, refer to the sh-2a, sh2a-fpu software manual.
section 2 cpu rev. 2.00 sep. 07, 2007 page 44 of 1164 rej09b0321-0200 2.4.2 data transfer instructions table 2.11 data transfer instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a mov #imm,rn 1110nnnniiiiiiii imm sign extension rn 1 ? yes yes yes mov.w @(disp,pc),rn 1001nnnndddddddd (disp 2 + pc) sign extension rn 1 ? yes yes yes mov.l @(disp,pc),rn 1101nnnndddddddd (disp 4 + pc) rn 1 ? yes yes yes mov rm,rn 0110nnnnmmmm0011 rm rn 1 ? yes yes yes mov.b rm,@rn 0010nnnnmmmm0000 rm (rn) 1 ? yes yes yes mov.w rm,@rn 0010nnnnmmmm0001 rm (rn) 1 ? yes yes yes mov.l rm,@rn 0010nnnnmmmm0010 rm (rn) 1 ? yes yes yes mov.b @rm,rn 0110nnnnmmmm0000 (rm) sign extension rn 1 ? yes yes yes mov.w @rm,rn 0110nnnnmmmm0001 (rm) sign extension rn 1 ? yes yes yes mov.l @rm,rn 0110nnnnmmmm0010 (rm) rn 1 ? yes yes yes mov.b rm,@-rn 0010nnnnmmmm0100 rn-1 rn, rm (rn) 1 ? yes yes yes mov.w rm,@-rn 0010nnnnmmmm0101 rn-2 rn, rm (rn) 1 ? yes yes yes mov.l rm,@-rn 0010nnnnmmmm0110 rn-4 rn, rm (rn) 1 ? yes yes yes mov.b @rm+,rn 0110nnnnmmmm0100 (rm) sign extension rn, rm + 1 rm 1 ? yes yes yes mov.w @rm+,rn 0110nnnnmmmm0101 (rm) sign extension rn, rm + 2 rm 1 ? yes yes yes mov.l @rm+,rn 0110nnnnmmmm0110 (rm) rn, rm + 4 rm 1 ? yes yes yes mov.b r0,@(disp,rn) 10000000nnnndddd r0 (disp + rn) 1 ? yes yes yes mov.w r0,@(disp,rn) 10000001nnnndddd r0 (disp 2 + rn) 1 ? yes yes yes mov.l rm,@(disp,rn) 0001nnnnmmmmdddd rm (disp 4 + rn) 1 ? yes yes yes mov.b @(disp,rm),r0 10000100mmmmdddd (disp + rm) sign extension r0 1 ? yes yes yes mov.w @(disp,rm),r0 10000101mmmmdddd (disp 2 + rm) sign extension r0 1 ? yes yes yes mov.l @(disp,rm),rn 0101nnnnmmmmdddd (disp 4 + rm) rn 1 ? yes yes yes mov.b rm,@(r0,rn) 0000nnnnmmmm0100 rm (r0 + rn) 1 ? yes yes yes mov.w rm,@(r0,rn) 0000nnnnmmmm0101 rm (r0 + rn) 1 ? yes yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 45 of 1164 rej09b0321-0200 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a mov.l rm,@(r0,rn) 0000nnnnmmmm0110 rm (r0 + rn) 1 ? yes yes yes mov.b @(r0,rm),rn 0000nnnnmmmm1100 (r0 + rm) sign extension rn 1 ? yes yes yes mov.w @(r0,rm),rn 0000nnnnmmmm1101 (r0 + rm) sign extension rn 1 ? yes yes yes mov.l @(r0,rm),rn 0000nnnnmmmm1110 (r0 + rm) rn 1 ? yes yes yes mov.b r0,@(disp,gbr) 11000000dddddddd r0 (disp + gbr) 1 ? yes yes yes mov.w r0,@(disp,gbr) 11000001dddddddd r0 (disp 2 + gbr) 1 ? yes yes yes mov.l r0,@(disp,gbr) 11000010dddddddd r0 (disp 4 + gbr) 1 ? yes yes yes mov.b @(disp,gbr),r0 11000100dddddddd (disp + gbr) sign extension r0 1 ? yes yes yes mov.w @(disp,gbr),r0 11000101dddddddd (disp 2 + gbr) sign extension r0 1 ? yes yes yes mov.l @(disp,gbr),r0 11000110dddddddd (disp 4 + gbr) r0 1 ? yes yes yes mov.b r0,@rn+ 0100nnnn10001011 r0 (rn), rn + 1 rn 1 ? yes mov.w r0,@rn+ 0100nnnn10011011 r0 (rn), rn + 2 rn 1 ? yes mov.l r0,@rn+ 0100nnnn10101011 r0 rn), rn + 4 rn 1 ? yes mov.b @-rm,r0 0100mmmm11001011 rm-1 rm, (rm) sign extension r0 1 ? yes mov.w @-rm,r0 0100mmmm11011011 rm-2 rm, (rm) sign extension r0 1 ? yes mov.l @-rm,r0 0100mmmm11101011 rm-4 rm, (rm) r0 1 ? yes mov.b rm,@(disp12,rn) 0011nnnnmmmm0001 0000dddddddddddd rm (disp + rn) 1 ? yes mov.w rm,@(disp12,rn) 0011nnnnmmmm0001 0001dddddddddddd rm (disp 2 + rn) 1 ? yes mov.l rm,@(disp12,rn) 0011nnnnmmmm0001 0010dddddddddddd rm (disp 4 + rn) 1 ? yes mov.b @(disp12,rm),rn 0011nnnnmmmm0001 0100dddddddddddd (disp + rm) sign extension rn 1 ? yes mov.w @(disp12,rm),rn 0011nnnnmmmm0001 0101dddddddddddd (disp 2 + rm) sign extension rn 1 ? yes mov.l @(disp12,rm),rn 0011nnnnmmmm0001 0110dddddddddddd (disp 4 + rm) rn 1 ? yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 46 of 1164 rej09b0321-0200 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a mova @(disp,pc),r0 11000111dddddddd disp 4 + pc r0 1 ? yes yes yes movi20 #imm20,rn 0000nnnniiii0000 iiiiiiiiiiiiiiii imm sign extension rn 1 ? yes movi20s #imm20,rn 0000nnnniiii0001 iiiiiiiiiiiiiiii imm << 8 sign extension rn 1 ? yes movml.l rm,@-r15 0100mmmm11110001 r15-4 r15, rm (r15) r15-4 r15, rm-1 (r15) : r15-4 r15, r0 (r15) note: when rm = r15, read rm as pr 1 to 16 ? yes movml.l @r15+,rn 0100nnnn11110101 (r15) r0, r15 + 4 r15 (r15) r1, r15 + 4 r15 : (r15) rn note: when rn = r15, read rm as pr 1 to 16 ? yes movmu.l rm,@-r15 0100mmmm11110000 r15-4 r15, pr (r15) r15-4 r15, r14 (r15) : r15-4 r15, rm (r15) note: when rm = r15, read rm as pr 1 to 16 ? yes movmu.l @r15+,rn 0100nnnn11110100 (r15) rn, r15 + 4 r15 (r15) rn + 1, r15 + 4 r15 : (r15) r14, r15 + 4 r15 (r15) pr note: when rn = r15, read rm as pr 1 to 16 ? yes movrt rn 0000nnnn00111001 ~t rn 1 ? yes movt rn 0000nnnn00101001 t rn 1 ? yes yes yes movu.b @(disp12,rm),rn 0011nnnnmmmm0001 1000dddddddddddd (disp + rm) zero extension rn 1 ? yes movu.w @(disp12,rm),rn 0011nnnnmmmm0001 1001dddddddddddd (disp 2 + rm) zero extension rn 1 ? yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 47 of 1164 rej09b0321-0200 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a nott 0000000001101000 ~t t 1 ope- ration result yes pref @rn 0000nnnn10000011 (rn) operand cache 1 ? yes yes swap.b rm,rn 0110nnnnmmmm1000 rm swap lower 2 bytes rn 1 ? yes yes yes swap.w rm,rn 0110nnnnmmmm1001 rm swap upper and lower words rn 1 ? yes yes yes xtrct rm,rn 0010nnnnmmmm1101 middle 32 bits of rm:rn rn 1 ? yes yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 48 of 1164 rej09b0321-0200 2.4.3 arithmetic operation instructions table 2.12 arithmetic operation instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a add rm,rn 0011nnnnmmmm1100 rn + rm rn 1 ? yes yes yes add #imm,rn 0111nnnniiiiiiii rn + imm rn 1 ? yes yes yes addc rm,rn 0011nnnnmmmm1110 rn + rm + t rn, carry t 1 carry yes yes yes addv rm,rn 0011nnnnmmmm1111 rn + rm rn, overflow t 1 over- flow yes yes yes cmp/eq #imm,r0 10001000iiiiiiii when r0 = imm, 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/eq rm,rn 0011nnnnmmmm0000 when rn = rm, 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/hs rm,rn 0011nnnnmmmm0010 when rn rm (unsigned), 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/ge rm,rn 0011nnnnmmmm0011 when rn rm (signed), 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/hi rm,rn 0011nnnnmmmm0110 when rn > rm (unsigned), 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/gt rm,rn 0011nnnnmmmm0111 when rn > rm (signed), 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/pl rn 0100nnnn00010101 when rn > 0, 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/pz rn 0100nnnn00010001 when rn 0, 1 t otherwise, 0 t 1 com- parison result yes yes yes cmp/str rm,rn 0010nnnnmmmm1100 when any bytes are equal, 1 t otherwise, 0 t 1 com- parison result yes yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 49 of 1164 rej09b0321-0200 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a clips.b rn 0100nnnn10010001 when rn > (h'0000007f), (h'0000007f) rn, 1 cs when rn < (h'ffffff80), (h'ffffff80) rn, 1 cs 1 ? yes clips.w rn 0100nnnn10010101 when rn > (h'00007fff), (h'00007fff) rn, 1 cs when rn < (h'ffff8000), (h'ffff8000) rn, 1 cs 1 ? yes clipu.b rn 0100nnnn10000001 when rn > (h'000000ff), (h'000000ff) rn, 1 cs 1 ? yes clipu.w rn 0100nnnn10000101 when rn > (h'0000ffff), (h'0000ffff) rn, 1 cs 1 ? yes div1 rm,rn 0011nnnnmmmm0100 1-step division (rn rm) 1 calcu- lation result yes yes yes div0s rm,rn 0010nnnnmmmm0111 msb of rn q, msb of rm m, m ^ q t 1 calcu- lation result yes yes yes div0u 0000000000011001 0 m/q/t 1 0 yes yes yes divs r0,rn 0100nnnn10010100 signed operation of rn r0 rn 32 32 32 bits 36 ? yes divu r0,rn 0100nnnn10000100 unsigned operation of rn r0 rn 32 32 32 bits 34 ? yes dmuls.l rm,rn 0011nnnnmmmm1101 signed operation of rn rm mach, macl 32 32 64 bits 2 ? yes yes yes dmulu.l rm,rn 0011nnnnmmmm0101 unsigned operation of rn rm mach, macl 32 32 64 bits 2 ? yes yes yes dt rn 0100nnnn00010000 rn ? 1 rn when rn is 0, 1 t when rn is not 0, 0 t 1 com- parison result yes yes yes exts.b rm,rn 0110nnnnmmmm1110 byte in rm is sign-extended rn 1 ? yes yes yes exts.w rm,rn 0110nnnnmmmm1111 word in rm is sign-extended rn 1 ? yes yes yes extu.b rm,rn 0110nnnnmmmm1100 byte in rm is zero-extended rn 1 ? yes yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 50 of 1164 rej09b0321-0200 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a extu.w rm,rn 0110nnnnmmmm1101 word in rm is zero-extended rn 1 ? yes yes yes mac.l @rm+,@rn+ 0000nnnnmmmm1111 signed operation of (rn) (rm) + mac mac 32 32 + 64 64 bits 4 ? yes yes yes mac.w @rm+,@rn+ 0100nnnnmmmm1111 signed operation of (rn) (rm) + mac mac 16 16 + 64 64 bits 3 ? yes yes yes mul.l rm,rn 0000nnnnmmmm0111 rn rm macl 32 32 32 bits 2 ? yes yes yes mulr r0,rn 0100nnnn10000000 r0 rn rn 32 32 32 bits 2 yes muls.w rm,rn 0010nnnnmmmm1111 signed operation of rn rm macl 16 16 32 bits 1 ? yes yes yes mulu.w rm,rn 0010nnnnmmmm1110 unsigned operation of rn rm macl 16 16 32 bits 1 ? yes yes yes neg rm,rn 0110nnnnmmmm1011 0-rm rn 1 ? yes yes yes negc rm,rn 0110nnnnmmmm1010 0-rm-t rn, borrow t 1 borrow yes yes yes sub rm,rn 0011nnnnmmmm1000 rn-rm rn 1 ? yes yes yes subc rm,rn 0011nnnnmmmm1010 rn-rm-t rn, borrow t 1 borrow yes yes yes subv rm,rn 0011nnnnmmmm1011 rn-rm rn, underflow t 1 over- flow yes yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 51 of 1164 rej09b0321-0200 2.4.4 logic operation instructions table 2.13 logic operation instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a and rm,rn 0010nnnnmmmm1001 rn & rm rn 1 ? yes yes yes and #imm,r0 11001001iiiiiiii r0 & imm r0 1 ? yes yes yes and.b #imm,@(r0,gbr) 11001101iiiiiiii (r0 + gbr) & imm (r0 + gbr) 3 ? yes yes yes not rm,rn 0110nnnnmmmm0111 ~rm rn 1 ? yes yes yes or rm,rn 0010nnnnmmmm1011 rn | rm rn 1 ? yes yes yes or #imm,r0 11001011iiiiiiii r0 | imm r0 1 ? yes yes yes or.b #imm,@(r0,gbr) 11001111iiiiiiii (r0 + gbr) | imm (r0 + gbr) 3 ? yes yes yes tas.b @rn 0100nnnn00011011 when (rn) is 0, 1 t otherwise, 0 t, 1 msb of(rn) 3 test result yes yes yes tst rm,rn 0010nnnnmmmm1000 rn & rm when the result is 0, 1 t otherwise, 0 t 1 test result yes yes yes tst #imm,r0 11001000iiiiiiii r0 & imm when the result is 0, 1 t otherwise, 0 t 1 test result yes yes yes tst.b #imm,@(r0,gbr) 11001100iiiiiiii (r0 + gbr) & imm when the result is 0, 1 t otherwise, 0 t 3 test result yes yes yes xor rm,rn 0010nnnnmmmm1010 rn ^ rm rn 1 ? yes yes yes xor #imm,r0 11001010iiiiiiii r0 ^ imm r0 1 ? yes yes yes xor.b #imm,@(r0,gbr) 11001110iiiiiiii (r0 + gbr) ^ imm (r0 + gbr) 3 ? yes yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 52 of 1164 rej09b0321-0200 2.4.5 shift instructions table 2.14 shift instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a rotl rn 0100nnnn00000100 t rn msb 1 msb yes yes yes rotr rn 0100nnnn00000101 lsb rn t 1 lsb yes yes yes rotcl rn 0100nnnn00100100 t rn t 1 msb yes yes yes rotcr rn 0100nnnn00100101 t rn t 1 lsb yes yes yes shad rm,rn 0100nnnnmmmm1100 when rm 0, rn << rm rn when rm < 0, rn >> |rm| [msb rn] 1 ? yes yes shal rn 0100nnnn00100000 t rn 0 1 msb yes yes yes shar rn 0100nnnn00100001 msb rn t 1 lsb yes yes yes shld rm,rn 0100nnnnmmmm1101 when rm 0, rn << rm rn when rm < 0, rn >> |rm| [0 rn] 1 ? yes yes shll rn 0100nnnn00000000 t rn 0 1 msb yes yes yes shlr rn 0100nnnn00000001 0 rn t 1 lsb yes yes yes shll2 rn 0100nnnn00001000 rn << 2 rn 1 ? yes yes yes shlr2 rn 0100nnnn00001001 rn >> 2 rn 1 ? yes yes yes shll8 rn 0100nnnn00011000 rn << 8 rn 1 ? yes yes yes shlr8 rn 0100nnnn00011001 rn >> 8 rn 1 ? yes yes yes shll16 rn 0100nnnn00101000 rn << 16 rn 1 ? yes yes yes shlr16 rn 0100nnnn00101001 rn >> 16 rn 1 ? yes yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 53 of 1164 rej09b0321-0200 2.4.6 branch instructions table 2.15 branch instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a bf label 10001011dddddddd when t = 0, disp 2 + pc pc, when t = 1, nop 3/1 * ? yes yes yes bf/s label 10001111dddddddd delayed branch when t = 0, disp 2 + pc pc, when t = 1, nop 2/1 * ? yes yes yes bt label 10001001dddddddd when t = 1, disp 2 + pc pc, when t = 0, nop 3/1 * ? yes yes yes bt/s label 10001101dddddddd delayed branch when t = 1, disp 2 + pc pc, when t = 0, nop 2/1 * ? yes yes yes bra label 1010dddddddddddd delayed branch, disp 2 + pc pc 2 ? yes yes yes braf rm 0000mmmm00100011 delayed branch, rm + pc pc 2 ? yes yes yes bsr label 1011dddddddddddd delayed branch, pc pr, disp 2 + pc pc 2 ? yes yes yes bsrf rm 0000mmmm00000011 delayed branch, pc pr, rm + pc pc 2 ? yes yes yes jmp @rm 0100mmmm00101011 delayed branch, rm pc 2 ? yes yes yes jsr @rm 0100mmmm00001011 delayed branch, pc pr, rm pc 2 ? yes yes yes jsr/n @rm 0100mmmm01001011 pc-2 pr, rm pc 3 ? yes jsr/n @@(disp8,tbr) 10000011dddddddd pc-2 pr, (disp 4 + tbr) pc 5 ? yes rts 0000000000001011 delayed branch, pr pc 2 ? yes yes yes rts/n 0000000001101011 pr pc 3 ? yes rtv/n rm 0000mmmm01111011 rm r0, pr pc 3 ? yes note: * one cycle when the program does not branch.
section 2 cpu rev. 2.00 sep. 07, 2007 page 54 of 1164 rej09b0321-0200 2.4.7 system control instructions table 2.16 system control instructions compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a clrt 0000000000001000 0 t 1 0 yes yes yes clrmac 0000000000101000 0 mach,macl 1 ? yes yes yes ldbank @rm,r0 0100mmmm11100101 (specified register bank entry) r0 6 ? yes ldc rm,sr 0100mmmm00001110 rm sr 3 lsb yes yes yes ldc rm,tbr 0100mmmm01001010 rm tbr 1 ? yes ldc rm,gbr 0100mmmm00011110 rm gbr 1 ? yes yes yes ldc rm,vbr 0100mmmm00101110 rm vbr 1 ? yes yes yes ldc.l @rm+,sr 0100mmmm00000111 (rm) sr, rm + 4 rm 5 lsb yes yes yes ldc.l @rm+,gbr 0100mmmm00010111 (rm) gbr, rm + 4 rm 1 ? yes yes yes ldc.l @rm+,vbr 0100mmmm00100111 (rm) vbr, rm + 4 rm 1 ? yes yes yes lds rm,mach 0100mmmm00001010 rm mach 1 ? yes yes yes lds rm,macl 0100mmmm00011010 rm macl 1 ? yes yes yes lds rm,pr 0100mmmm00101010 rm pr 1 ? yes yes yes lds.l @rm+,mach 0100mmmm00000110 (rm) mach, rm + 4 rm 1 ? yes yes yes lds.l @rm+,macl 0100mmmm00010110 (rm) macl, rm + 4 rm 1 ? yes yes yes lds.l @rm+,pr 0100mmmm00100110 (rm) pr, rm + 4 rm 1 ? yes yes yes nop 0000000000001001 no operation 1 ? yes yes yes resbank 0000000001011011 bank r0 to r14, gbr, mach, macl, pr 9 * ? yes rte 0000000000101011 delayed branch, stack area pc/sr 6 ? yes yes yes sett 0000000000011000 1 t 1 1 yes yes yes sleep 0000000000011011 sleep 5 ? yes yes yes stbank r0,@rn 0100nnnn11100001 r0 (specified register bank entry) 7 ? yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 55 of 1164 rej09b0321-0200 compatibility instruction instruct ion code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a stc sr,rn 0000nnnn00000010 sr rn 2 ? yes yes yes stc tbr,rn 0000nnnn01001010 tbr rn 1 ? yes stc gbr,rn 0000nnnn00010010 gbr rn 1 ? yes yes yes stc vbr,rn 0000nnnn00100010 vbr rn 1 ? yes yes yes stc.l sr,@-rn 0100nnnn00000011 rn-4 rn, sr (rn) 2 ? yes yes yes stc.l gbr,@-rn 0100nnnn00010011 rn-4 rn, gbr (rn) 1 ? yes yes yes stc.l vbr,@-rn 0100nnnn00100011 rn-4 rn, vbr (rn) 1 ? yes yes yes sts mach,rn 0000nnnn00001010 mach rn 1 ? yes yes yes sts macl,rn 0000nnnn00011010 macl rn 1 ? yes yes yes sts pr,rn 0000nnnn00101010 pr rn 1 ? yes yes yes sts.l mach,@-rn 0100nnnn00000010 rn-4 rn, mach (rn) 1 ? yes yes yes sts.l macl,@-rn 0100nnnn00010010 rn-4 rn, macl (rn) 1 ? yes yes yes sts.l pr,@-rn 0100nnnn00100010 rn-4 rn, pr (rn) 1 ? yes yes yes trapa #imm 11000011iiiiiiii pc/sr stack area, (imm 4 + vbr) pc 5 ? yes yes yes notes: 1. instruction execution cycles: the execution cycl es shown in the table are minimums. in practice, the number of instruction executio n states in cases su ch as the following: a. when there is a conflict between an instruction fetch and a data access b. when the destination register of a load instruction (memory register) is the same as the register used by the next instruction. * in the event of bank overflow , the number of cycles is 19.
section 2 cpu rev. 2.00 sep. 07, 2007 page 56 of 1164 rej09b0321-0200 2.4.8 floating point operation instructions table 2.17 floating point operation instructions compatibility instruction instruction code operation execution cycles t bit sh2e sh4 sh-2a/ sh2a-fpu fabs frn 1111nnnn01011101 |frn| frn 1 ? yes yes yes fabs drn 1111nnn001011101 |drn| drn 1 ? yes yes fadd frm, frn 1111nnnnmmmm0000 frn+frm frn 1 ? yes yes yes fadd drm, drn 1111nnn0mmm00000 drn+drm drn 6 ? yes yes fcmp/eq frm, frn 1111nnnnmmmm0100 (frn=frm)? 1:0 t 1 operation result yes yes yes fcmp/eq drm, drn 1111nnn0mmm00100 (drn=drm)? 1:0 t 2 operation result yes yes fcmp/gt frm, frn 1111nnnnmmmm0101 (frn>frm)? 1:0 t 1 operation result yes yes yes fcmp/gt drm, drn 1111nnn0mmm00101 (drn>drm)? 1:0 t 2 operation result yes yes fcnvds drm, fpul 1111mmm010111101 (float)drm fpul 2 ? yes yes fcnvsd fpul, drn 1111nnn010101101 (double)fpul drn 2 ? yes yes fdiv frm, frn 1111nnnnmmmm0011 frn/frm frn 10 ? yes yes yes fdiv drm, drn 1111nnn0mmm00011 drn/drm drn 23 ? yes yes fldi0 frn 1111nnnn10001101 000000000 frn 1 ? yes yes yes fldi1 frn 1111nnnn10011101 03f800000 frn 1 ? yes yes yes flds frm, fpul 1111mmmm00011101 frm fpul 1 ? yes yes yes float fpul,frn 1111nnnn00101101 (float)fpul frn 1 ? yes yes yes float fpul,drn 1111nnn000101101 (double)fpul drn 2 ? yes yes fmac fr0,frm,frn 1111nnnnmmmm1110 fr0frm+frn frn 1 ? yes yes yes fmov frm, frn 1111nnnnmmmm1100 frm frn 1 ? yes yes yes fmov drm, drn 1111nnn0mmm01100 drm drn 2 ? yes yes fmov.s @(r0, rm), frn 1111nnnnmmmm0110 (r0+rm) frn 1 ? yes yes yes fmov.d @(r0, rm), drn 1111nnn0mmmm0110 (r0+rm) drn 2 ? yes yes fmov.s @rm+, frn 1111nnnnmmmm1001 (rm) frn, rm+=4 1 ? yes yes yes fmov.d @rm+, drn 1111nnn0mmmm1001 (rm) drn, rm+=8 2 ? yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 57 of 1164 rej09b0321-0200 compatibility instruction instruction code operation execution cycles t bit sh2e sh4 sh-2a/ sh2a-fpu fmov.s @rm, frn 1111nnnnmmmm1000 (rm) frn 1 ? yes yes yes fmov.d @rm, drn 1111nnn0mmmm1000 (rm) drn 2 ? yes yes fmov.s @(disp12,rm),frn 0011nnnnmmmm0001 0111dddddddddddd (disp4+rm) frn 1 ? yes fmov.d @(disp12,rm),drn 0011nnn0mmmm0001 0111dddddddddddd (disp8+rm) drn 2 ? yes fmov.s frm, @(r0,rn) 1111nnnnmmmm0111 frm (r0+rn) 1 ? yes yes yes fmov.d drm, @( r0,rn ) 1111nnnnmmm00111 drm (r0+rn) 2 ? yes yes fmov.s frm, @-rn 1111nnnnmmmm1011 rn-=4, frm (rn) 1 ? yes yes yes fmov.d drm, @-rn 1111nnnnmmm01011 rn-=8, drm (rn) 2 ? yes yes fmov.s frm, @rn 1111nnnnmmmm1010 frm (rn) 1 ? yes yes yes fmov.d drm, @rn 1111nnnnmmm01010 drm (rn) 2 ? yes yes fmov.s frm, @(disp12,rn) 0011nnnnmmmm000100 11dddddddddddd frm (disp4+rn) 1 ? yes fmov.d drm, @(disp12,rn) 0011nnnnmmm0000100 11dddddddddddd drm (disp8+rn) 2 ? yes fmul frm, frn 1111nnnnmmmm0010 frnfrm frn 1 ? yes yes yes fmul drm, drn 1111nnn0mmm00010 drndrm drn 6 ? yes yes fneg frn 1111nnnn01001101 -frn frn 1 ? yes yes yes fneg drn 1111nnn001001101 -drn drn 1 ? yes yes fschg 1111001111111101 fpscr.sz=~fpscr.sz 1 ? yes yes fsqrt frn 1111nnnn01101101 frn frn 9 ? yes yes fsqrt drn 1111nnn001101101 drn drn 22 ? yes yes fsts fpul,frn 1111nnnn00001101 fpul frn 1 ? yes yes yes fsub frm, frn 1111nnnnmmmm0001 frn-frm frn 1 ? yes yes yes fsub drm, drn 1111nnn0mmm00001 drn-drm drn 6 ? yes yes ftrc frm, fpul 1111mmmm00111101 (long)frm fpul 1 ? yes yes yes ftrc drm, fpul 1111mmm000111101 (long)drm fpul 2 ? yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 58 of 1164 rej09b0321-0200 2.4.9 fpu-related cpu instructions table 2.18 fpu-related cpu instructions compatibility instruction instruction code operation execution cycles t bit sh2e sh4 sh-2a/ sh2a-fpu lds rm,fpscr 0100mmmm01101010 rm fpscr 1 ? yes yes yes lds rm,fpul 0100mmmm01011010 rm fpul 1 ? yes yes yes lds.l @rm+, fpscr 0100mmmm01100110 (rm) fpscr, rm+=4 1 ? yes yes yes lds.l @rm+, fpul 0100mmmm01010110 (rm) fpul, rm+=4 1 ? yes yes yes sts fpscr, rn 0000nnnn01101010 fpscr rn 1 ? yes yes yes sts fpul,rn 0000nnnn01011010 fpul rn 1 ? yes yes yes sts.l fpscr,@-rn 0100nnnn01100010 rn-=4, fpscr (rn) 1 ? yes yes yes sts.l fpul,@-rn 0100nnnn01010010 rn-=4, fpul (rn) 1 ? yes yes yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 59 of 1164 rej09b0321-0200 2.4.10 bit manipulation instructions table 2.19 bit manipulation instructions compatibility instruction instruction code operation execu- tion cycles t bit sh2, sh2e sh4 sh-2a band.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0100dddddddddddd (imm of (disp + rn)) & t t 3 operation result yes bandnot.b #imm3,@(disp12,rn) 0011nnnn0iii1001 1100dddddddddddd ~(imm of (disp + rn)) & t t 3 ope-ration result yes bclr.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0000dddddddddddd 0 (imm of (disp + rn)) 3 ? yes bclr #imm3,rn 10000110nnnn0iii 0 imm of rn 1 ? yes bld.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0011dddddddddddd (imm of (disp + rn)) t 3 operation result yes bld #imm3,rn 10000111nnnn1iii imm of rn t 1 operation result yes bldnot.b #imm3,@(disp12,rn) 0011nnnn0iii1001 1011dddddddddddd ~(imm of (disp + rn)) t 3 operation result yes bor.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0101dddddddddddd ( imm of (disp + rn)) | t t 3 operation result yes bornot.b #imm3,@(disp12,rn) 0011nnnn0iii1001 1101dddddddddddd ~( imm of (disp + rn)) | t t 3 operation result yes bset.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0001dddddddddddd 1 ( imm of (disp + rn)) 3 ? yes bset #imm3,rn 10000110nnnn1iii 1 imm of rn 1 ? yes bst.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0010dddddddddddd t (imm of (disp + rn)) 3 ? yes bst #imm3,rn 10000111nnnn0iii t imm of rn 1 ? yes bxor.b #imm3,@(disp12,rn) 0011nnnn0iii1001 0110dddddddddddd (imm of (disp + rn)) ^ t t 3 operation result yes
section 2 cpu rev. 2.00 sep. 07, 2007 page 60 of 1164 rej09b0321-0200 2.5 processing states the cpu has four processing states: reset, exception handling, program execution, and power- down. figure 2.6 shows the transitions between the states. power-on reset from any state manual reset from any state power-on reset state manual reset state program execution state sleep mode software standby mode exception handling state exception handling source occurs exception handling ends nmi interrupt or irq interrupt occurs power-down state reset canceled stby bit cleared for sleep instruction reset state interrupt source or dma address error occurs nmi interrupt, irq interrupt * , manual reset, and power-on reset stby bit set and deep bit clear for sleep instruction stby and deep bits set for sleep instruction deep standby mode note: * irq can be released only by pe7 to pe4 and pc25 to pc22 figure 2.6 transitions between processing states
section 2 cpu rev. 2.00 sep. 07, 2007 page 61 of 1164 rej09b0321-0200 (1) reset state in the reset state, the cpu is reset. there are tw o kinds of reset, power-on reset and manual reset. (2) exception handling state the exception handling state is a transient state that occurs when exception handling sources such as resets or interrupts alter the cpu?s processing state flow. for a reset, the initial values of the program counter (pc) (execu tion start address) and stack pointer (sp) are fetched from the exception handling vector table and stored; the cpu then branches to the execution start addres s and execution of the program begins. for an interrupt, the stack pointer (sp) is acc essed and the program counter (pc) and status register (sr) are saved to the stack area. the ex ception service routine st art address is fetched from the exception handling vector table; the cpu then branches to that address and the program starts executing, thereby enteri ng the program execution state. (3) program execution state in the program execution state, the cpu sequentia lly executes the program. (4) power-down state in the power-down state, the cpu stops opera ting to reduce power co nsumption. the sleep instruction places the cpu in sleep mode, software standby mode, or deep standby mode.
section 2 cpu rev. 2.00 sep. 07, 2007 page 62 of 1164 rej09b0321-0200
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 63 of 1164 rej09b0321-0200 section 3 floating-point unit (fpu) 3.1 features the fpu has the following features. ? conforms to ieee754 standard ? 16 single-precision floating-point registers (can also be referenced as eight double-precision registers) ? two rounding modes: round to nearest and round to zero ? denormalization modes: flush to zero ? five exception sources: invalid operation, divide by zero, overflow, underflow, and inexact ? comprehensive instructions: single-precision, double-precision, and system control when the fd bit in sr is set to 1, the fpu ca nnot be used, and an attempt to execute an fpu instruction will cause an fpu disable exception. 3.2 data formats 3.2.1 floating-point format a floating-point number consists of the following three fields: ? sign (s) ? exponent (e) ? fraction (f) this lsi can handle single-precision and double-precision floating-point numbers, using the formats shown in figures 3.1 and 3.2. 31 30 23 22 0 s e f figure 3.1 format of single -precision floati ng-point number
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 64 of 1164 rej09b0321-0200 63 62 52 51 0 s e f figure 3.2 format of double -precision floating-point number the exponent is expressed in biased form, as follows: e = e + bias the range of unbiased exponent e is e min ? 1 to e max + 1. the two values e min ? 1 and e max + 1 are distinguished as follows. e min ? 1 indicates zero (both positive and negative sign) and a denormalized number, and e max + 1 indicates positive or negative infinity or a non-number (nan). table 3.1 shows e min and e max values. table 3.1 floating-point number formats and parameters parameter single-preci sion double-precision total bit width 32 bits 64 bits sign bit 1 bit 1 bit exponent field 8 bits 11 bits fraction field 23 bits 52 bits precision 24 bits 53 bits bias +127 +1023 e max +127 +1023 e min ?126 ?1022 floating-point number value v is determined as follows: if e = e max + 1 and f 0, v is a non-number (nan) irrespective of sign s if e = e max + 1 and f = 0, v = (?1) s (infinity) [positive or negative infinity] if e min e e max , v = (?1) s 2 e (1.f) [normalized number] if e = e min ? 1 and f 0, v = (?1) s 2 emin (0.f) [denormalized number] if e = e min ? 1 and f = 0, v = (?1) s 0 [positive or negative zero]
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 65 of 1164 rej09b0321-0200 table 3.2 shows the ranges of the various numbers in hexadecimal notation. table 3.2 floating-point ranges type single-precision double-precision signaling non- number h'7fff ffff to h'7fc0 0000 h'7fff ffff ffff ffff to h'7ff8 0000 0000 0000 quiet non-number h'7fbf ffff to h'7f80 0001 h'7ff7 ffff ffff ffff to h'7ff0 0000 0000 0001 positive infinity h'7f80 0000 h'7ff0 0000 0000 0000 positive normalized number h'7f7f ffff to h'0080 0000 h'7fef ffff ffff ffff to h'0010 0000 0000 0000 positive denormalized number h'007f ffff to h'0000 0001 h'000f ffff ffff ffff to h'0000 0000 0000 0001 positive zero h'0000 0000 h'0000 0000 0000 0000 negative zero h'8000 0000 h'8000 0000 0000 0000 negative denormalized number h'8000 0001 to h'807f ffff h' 8000 0000 0000 0001 to h'800f ffff ffff ffff negative normalized number h'8080 0000 to h'ff7f ffff h' 8010 0000 0000 0000 to h'ffef ffff ffff ffff negative infinity h'ff 80 0000 h'fff0 0000 0000 0000 quiet non-number h'ff80 0001 to h'ffbf ffff h'fff0 0000 0000 0001 to h'fff7 ffff ffff ffff signaling non-number h'ffc0 0000 to h 'ffff ffff h'fff8 0000 0000 0000 to h'ffff ffff ffff ffff 3.2.2 non-numbers (nan) figure 3.3 shows the bit pattern of a non-number (nan). a value is nan in the following case: ? sign bit: don't care ? exponent field: all bits are 1 ? fraction field: at least one bit is 1 the nan is a signaling nan (snan) if the msb of the fraction field is 1, and a quiet nan (qnan) if the msb is 0.
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 66 of 1164 rej09b0321-0200 31 30 23 22 0 x n = 1: snan n = 0: qnan 11111111 nxxxxxxxxxxxxxxxxxxxxxx figure 3.3 single-precision nan bit pattern an snan is input in an operation, except copy, fabs, and fneg, that generates a floating-point value. ? when the en.v bit in fpscr is 0, the operation result (output) is a qnan. ? when the en.v bit in fpscr is 1, an invalid operation exception will be generated. in this case, the contents of the operation de stination register are unchanged. if a qnan is input in an operation that generates a floating-point value, and an snan has not been input in that operation, the output will always be a qnan irrespective of the setting of the en.v bit in fpscr. an exception will not be generated in this case. the qnan values as opera tion results are as follows: ? single-precision qnan: h'7fbf ffff ? double-precision qnan: h'7ff7 ffff ffff ffff see the individual instruction descriptions for details of floating-point operations when a non- number (nan) is input. 3.2.3 denormalized numbers for a denormalized number floating-point value, the exponent field is expressed as 0, and the fraction field as a non-zero value. in the sh2a-fpu, the dn bit in the status regi ster fpscr is always set to 1, therefore a denormalized number (source operand or operation result) is always flushed to 0 in a floating- point operation that generates a value (an operation other than copy, fneg, or fabs). when the dn bit in fpscr is 0, a denormalized number (source operand or operation result) is processed as it is. see the individual instruction descriptions for details of floating-point operations when a denormalized number is input.
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 67 of 1164 rej09b0321-0200 3.3 register descriptions 3.3.1 floating-point registers figure 3.4 shows the floating-point register configuration. there are sixteen 32-bit floating-point registers fpr0 to fpr15, referenced by specifying fr0 to fr15, dr0/2/4/6/8/10/12/14. the correspondence between fr pn and the reference name is determined by the pr and sz bits in fpscr. refer figure 3.4. 1. floating-point registers, fpri (16 registers) fpr0 to fpr15 2. single-precision floating-point registers, fri (16 registers) fr0 to fr15 indicate fpr0 to fpr15 3. double-precision floating-point registers or single-precision floating-point vector registers in pairs, dri (8 registers) a dr register comprise s two fr registers. dr0 = {fr0, fr1}, dr2 = {fr2, fr3}, dr4 = {fr4, fr5}, dr6 = {fr6, fr7}, dr8 = {fr8, fr9}, dr10 = {fr10, fr11}, dr12 = {fr12, fr13}, dr14 = {fr14, fr15} fpr0 fpr1 fpr2 fpr3 fpr4 fpr5 fpr6 fpr7 fpr8 fpr9 fpr10 fpr11 fpr12 fpr13 fpr14 fpr15 fr0 fr1 fr2 fr3 fr4 fr5 fr6 fr7 fr8 fr9 fr10 fr11 fr12 fr13 fr14 fr15 dr0 dr2 dr4 dr6 dr8 dr10 dr12 dr14 transfer instruction case: fpscr.sz = 0 fpscr.sz = 1 operation instruction case: fpscr.pr = 0 fpscr.pr = 1 register name reference name figure 3.4 floating-point registers
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 68 of 1164 rej09b0321-0200 3.3.2 floating-point status/control register (fpscr) fpscr is a 32-bit register that controls floating-point instructions, sets fpu exceptions, and selects the rounding mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ? ?? ?? ?? ?? ? bit: 000000000 0 0 00100 0000000001 initial value: rrrrrrrrr r r/w r/w r/w r r/w r/w r/w r/w r/w enable flag cause rm1 qis sz pr dn rm0 cause r/w r/w r/w r/w r/w r/w: bit: initial value: r/w: 1514131211109876543210 000000 r/w r/w r/w r/w r/w r/w r/w r/w bit bit name initial value r/w description 31 to 23 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 22 qis 0 r/w nonnunerical processing mode 0: processes qnan or as such 1: treats qnan or as the same as snan (valid only when the v bit in fpscr enable is set to 1) 21 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 20 sz 0 r/w transfer size mode 0: data size of fmov instruction is 32-bits 1: data size of fmov instruction is a 32-bit register pair (64 bits) 19 pr 0 r/w precision mode 0: floating-point instruct ions are executed as single-precision operations 1: floating-point instruct ions are executed as double-precision operations (graphics support instructions are undefined) 18 dn 1 r denormalization mode (always fixed to 1 in sh2a- fpu) 1: denormalized number is treated as zero
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 69 of 1164 rej09b0321-0200 bit bit name initial value r/w description 17 to 12 cause all 0 r/w 11 to 7 enable all 0 r/w 6 to 2 flag all 0 r/w fpu exception cause field fpu exception enable field fpu exception flag field when an fpu exception occurs, the bits corresponding to the fpu exception cause field and fpu exception flag field are set to 1. each time an fpu operation instruction is executed, t he fpu exception cause field is cleared to 0. the fpu exception flag field remains set to 1 until it is cleared to 0 by software. for bit allocations of each field, see table 3.3. 1 0 rm1 rm0 0 1 r/w r/w rounding mode these bits select the rounding mode. 00: round to nearest 01: round to zero 10: reserved 11: reserved table 3.3 bit allocation for fpu exception handling field name fpu error (e) invalid operation (v) division by zero (z) overflow (o) underflow (u) inexact (i) cause fpu exception cause field bit 17 bit 16 bit 15 bit 14 bit 13 bit 12 enable fpu exception enable field none bit 11 bit 10 bit 9 bit 8 bit 7 flag fpu exception flag field none bit 6 bit 5 bit 4 bit 3 bit 2 note: no fpu error occurs in the sh2a-fpu. 3.3.3 floating-point communication register (fpul) information is transferred between the fpu and cp u via fpul. fpul is a 32 -bit system register that is accessed from the cpu side by means of lds and sts instructions. for example, to convert the integer stored in general register r1 to a single-precision floating-point number, the processing flow is as follows: r1 (lds instruction) fpul (single-precision float instruction) fr1
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 70 of 1164 rej09b0321-0200 3.4 rounding in a floating-point instruction, rounding is performed when generating the final operation result from the intermediate result. therefore, the result of combination instructions such as fmac will differ from the result when using a basic instruction such as fadd, fsub, or fmul. rounding is performed once in fmac, but twice in fadd, fsub, and fmul. which of the two rounding methods is to be used is determined by the rm bits in fpscr. fpscr.rm[1:0] = 00: round to nearest fpscr.rm[1:0] = 01: round to zero (1) round to nearest the operation result is rounded to the nearest expressible value. if there are two nearest expressible values, the one with an lsb of 0 is selected. if the unrounded value is 2 emax (2 ? 2 ?p ) or more, the result will be infinity with the same sign as the unrounded value. the values of emax and p, respectively, are 127 and 24 for single-precision, and 1023 and 53 for double-precision. (2) round to zero the digits below the round bit of the unrounded value are discarded. if the unrounded value is larger than the maximum expressible absolute value, the value will become the maximum expres sible absolute value.
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 71 of 1164 rej09b0321-0200 3.5 floating-point exceptions 3.5.1 fpu exception sources the exception sources are as follows: ? fpu error (e): when fpscr.dn = 0 and a denormalized number is input (no chance to occur in the sh2a-fpu) ? invalid operation (v): in case of an invalid operation, such as nan input ? division by zero (z): division with a zero divisor ? overflow (o): when the operation result overflows ? underflow (u): when the operation result underflows ? inexact exception (i): when overflow, underflow, or rounding occurs the fpu exception cause field in fp scr contains bits corresponding to all of above sources e, v, z, o, u, and i, and the fpu exception flag and en able fields in fpscr contain bits corresponding to sources v, z, o, u, and i, but not e. thus, fpu errors cannot be disabled. when an fpu exception occurs, the corresponding bit in the fpu exception cause field is set to 1, and 1 is added to the corresponding bit in the fp u exception flag field. when an fpu exception does not occur, the corresponding bit in the fpu exception cause field is cleared to 0, but the corresponding bit in the fpu excepti on flag field remains unchanged. 3.5.2 fpu exception handling fpu exception handling is initiated in the following cases: ? fpu error (e): fpscr.dn = 0 and a denormalized nu mber is input (no chance to occur in the sh2a-fpu) ? invalid operation (v): fpscr.enab le.v = 1 and invalid operation ? division by zero (z): fpscr.enable.z = 1 and division with a zero divisor ? overflow (o): fpscr.enable.o = 1 and instru ction with possibility of operation result overflow ? underflow (u): fpscr.enable.u = 1 and instruction with possibility of operation result underflow ? inexact exception (i): fpscr.enable .i = 1 and instruction with po ssibility of inexact operation result
section 3 floating-point unit (fpu) rev. 2.00 sep. 07, 2007 page 72 of 1164 rej09b0321-0200 these possibilities are shown in the individual instruction descriptions. all exception events that originate in the fpu are assigned as the same ex ception event. the meanin g of an exception is determined by software by reading from fpscr and interpreting the information it contains. if no bits are set in the fpu exception cause field of fpscr when one or more of bits o, u, i, and v are set in the fpu exception enable field, this in dicates that an actual exception source is not generated. also, the destination register is not changed by any fpu exception handling operation. except for the above, the fpu disables exception handling. in every processing, the bit corresponding to source v, z, o, u, or i is set to 1, and a default value is generated as the operation result. ? invalid operation (v): qnan is generated as the result. ? division by zero (z): infinity with the same sign as the unrounded value is generated. ? overflow (o): when rounding mode = rz, the maximum norma lized number, with th e same sign as the unrounded value, is generated. when rounding mode = rn, infinity with the same sign as the unrounded value is generated. ? underflow (u): zero with the same sign as the unrounded value is generated. ? inexact exception (i): an inexact result is generated.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 73 of 1164 rej09b0321-0200 section 4 clock pulse generator (cpg) this lsi has a clock pulse generator (cpg) that generates an internal clock (i ), a peripheral clock (p ), and a bus clock (b ). the cpg consists of a crystal oscillator, pll circuits, and divider circuits. 4.1 features ? three clock operating modes the mode is selected from am ong the three clock operating modes by the selection of the following three conditions: the frequency-divisor in use, whether the plls are on or off, and whether the internal crystal resonator or the inpu t on the external clock-signal line is used. ? three clocks generated independently an internal clock (i ) for the cpu and cache; a peripheral clock (p ) for the on-chip peripheral modules; a bus clock (b = ckio) for the external bus interface. ? frequency change function internal and peripheral clock frequencies can be changed independently using the pll (phase locked loop) circuits and divider circuits within the cpg. frequencies are changed by software using frequency control register (frqcr) settings. ? power-down mode control the clock can be stopped by sleep mode, software standby mode, and deep standby mode. specific modules can also be stopped using the module standby function. for details on clock control in the power-down modes, see section 25, power-down modes.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 74 of 1164 rej09b0321-0200 figure 4.1 shows a block diagram of the clock pulse generator. ckio pll circuit 2 ( 2, 4) extal xtal md_clk1 md_clk0 frqcr stbcr stbcr2 stbcr3 stbcr4 stbcr5 pll circuit 1 ( 1, 2, 3, 4, 6, 8) crystal oscillator peripheral bus bus interface cpg control unit clock frequency control circuit standby control circuit on-chip oscillator 1 1/2 1/3 1/4 1/6 1/8 1/12 divider internal clock (i , max. : 120 mhz (regular specifications), 100 mhz (wide-range specifications)) peripheral clock (p , max. 40 mhz) bus clock (b = ckio, max. 60 mhz) frqcr: stbcr: stbcr2: stbcr3: stbcr4: stbcr5: [legend] frequency control register standby control register standby control register 2 standby control register 3 standby control register 4 standby control register 5 figure 4.1 block diagram of clock pulse generator
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 75 of 1164 rej09b0321-0200 the clock pulse generator blocks function as follows: (1) pll circuit 1 pll circuit 1 multiplies the input clock frequency from the ckio pin by 1, 2, 3, 4, 6, or 8. the multiplication rate is set by the frequency control register. when this is done, the phase of the rising edge of the internal clock is controlled so that it will agree with the phase of the rising edge of the ckio pin. (2) pll circuit 2 pll circuit 2 multiplies the input clock frequency from the crystal oscillator or extal pin by 2 or 4. the multiplication rate is fixed according to the clock operating mode. the clock operating mode is specified by the md_clk1 and md_clk0 pins. for details on the clock operating mode, see table 4.2. note that the settings of these pins cannot be changed during operation. if changed, the operation of this lsi cannot be guaranteed. (3) crystal oscillator the crystal oscillator is an oscillation circuit in which a crystal resonator is connected to the xtal pin or extal pin. this can be used according to the clock operating mode. (4) divider divider generates a clock signal at the operating frequency used by the internal or peripheral clock. the operating frequency can be 1, 1/2, 1/3, 1/4, 1/6, 1/8, or 1/12 times the output frequency of pll circuit 1, as long as it stays at or above the clock frequency of the ckio pin. the division ratio is set in the frequency control register (frqcr). (5) clock frequency control circuit the clock frequency control circuit controls the clock frequency using the md_clk1 and md_clk0 pins and the frequency control register (frqcr). (6) standby control circuit the standby control circuit controls the states of the clock pulse generator and other modules during clock switching, or in sleep, software, and deep standby mode.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 76 of 1164 rej09b0321-0200 (7) frequency control register (frqcr) the frequency control register (frqcr) has control bits assigned for the following functions: clock output/non-output from the ckio pin during software standby mode, the frequency multiplication ratio of pll circuit 1, and the frequency division ratio of the internal clock and the peripheral clock (p ). (8) standby control register the standby control register has bits for controlling the power-down modes. see section 25, power-down modes, for more information. 4.2 input/output pins table 4.1 lists the clock pulse generator pins and their functions. table 4.1 pin configuration and func tions of the clock pulse generator pin name symbol i/o function (clock operating modes 0 and 2) function (clock operating mode 3) md_clk0 input sets the clock operating mode. sets the clock operating mode. mode control pins md_clk1 input sets the clock operating mode. sets the clock operating mode. xtal output connected to the crystal resonator. (leave this pin open when the crystal resonator is not in use.) leave this pin open. crystal input/output pins (clock input pins) extal input connected to the crystal resonator or used to input an external clock. pull-up this pin. clock input/output pin ckio i/o clock output pin. clock input pin.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 77 of 1164 rej09b0321-0200 4.3 clock operating modes table 4.2 shows the relationship between the combinations of the mode control pins (md_clk1 and md_clk0) and the clock operating modes. table 4.2 shows the usable frequency ranges in the clock operating modes. table 4.2 clock operating modes pin values clock i/o mode md_clk1 md_clk0 source output pll circuit 2 on/off pll circuit 1 on/off ckio frequency 0 0 0 extal or crystal resonator ckio on ( 4) on ( 1, 2, 3, 4) (extal or crystal resonator) 4 2 1 0 extal or crystal resonator ckio on ( 2) on ( 1, 2, 3, 4, 6, 8) (extal or crystal resonator) 2 3 1 1 ckio ? off on ( 1, 2, 3, 4, 6, 8) (ckio) ? mode 0 the frequency of the signal received from the extal pin or crystal resonator is quadrupled by the pll circuit 2 before it is supplied to the lsi as the clock signal. this enables to use the external clock of lower frequency. either a crysta l resonator with a frequency in the range from 10 to 15 mhz or an external signal in the same frequency range input on the extal pin may be used. the frequency range of ckio is from 40 to 60 mhz. ? mode 2 the frequency of the signal received from the extal pin or crystal resonator is doubled by the pll circuit 2 before it is supplied to the lsi as the clock signal. this enables to use the external clock of lower frequency. an external signal with a fre quency in the range from 10 to 30 mhz or a crystal resonator with 10 to 20 mhz may be used. the frequency range of ckio is from 20 to 60 mhz. ? mode 3 in mode 3, the ckio pin functions as an input pin and draws an external clock signal. the pll circuit 1 shapes its waveform and the setting of the frequency control register multiplies its frequency before the clock enters the lsi. frequency between 20 to 60 mhz can be input to the ckio pin. for reduced current and hence power consumption, pull up the extal pin and open the xtal pin when the lsi is used in mode 3.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 78 of 1164 rej09b0321-0200 table 4.3 relationship between clock operating mode and frequency range pll frequency multiplier selectable frequency range (mhz) clock operating mode frqcr setting pll circuit 1 pll circuit 2 ratio of internal clock frequencies (i:b:p) * 1 input clock * 2 output clock (ckio pin) * 3 internal clock (i ) * 3 bus clock (b ) * 3 peripheral clock (p ) * 3 0 h'1000 on ( 1) on ( 4) 4:4:4 10 40 40 40 40 h'1001 on ( 1) on ( 4) 4:4:2 10 to 15 40 to 60 40 to 60 40 to 60 20 to 30 h'1002 on ( 1) on ( 4) 4:4:4/3 10 to 15 40 to 60 40 to 60 40 to 60 13.33 to 20 h'1003 on ( 1) on ( 4) 4:4:1 10 to 15 40 to 60 40 to 60 40 to 60 10 to 15 h'1004 on ( 1) on ( 4) 4:4:2/3 10 to 15 40 to 60 40 to 60 40 to 60 6.7 to 10 h'1005 on ( 1) on ( 4) 4:4:1/2 10 to 15 40 to 60 40 to 60 40 to 60 5 to 7.5 h'1006 on ( 1) on ( 4) 4:4:1/3 10 to 15 40 to 60 40 to 60 40 to 60 3.33 to 5 h'1101 on ( 2) on ( 4) 8:4:4 10 40 80 40 40 h'1103 on ( 2) on ( 4) 8:4:2 10 to 15 40 to 60 80 to 120 40 to 60 20 to 30 h'1104 on ( 2) on ( 4) 8:4:4/3 10 to 15 40 to 60 80 to 120 40 to 60 13.33 to 20 h'1105 on ( 2) on ( 4) 8:4:1 10 to 15 40 to 60 80 to 120 40 to 60 10 to 15 h'1106 on ( 2) on ( 4) 8:4:2/3 10 to 15 40 to 60 80 to 120 40 to 60 6.7 to 10 h'1111 on ( 2) on ( 4) 4:4:4 10 40 40 40 40 h'1113 on ( 2) on ( 4) 4:4:2 10 to 15 40 to 60 40 to 60 40 to 60 20 to 30 h'1114 on ( 2) on ( 4) 4:4:4/3 10 to 15 40 to 60 40 to 60 40 to 60 13.33 to 20 h'1115 on ( 2) on ( 4) 4:4:1 10 to 15 40 to 60 40 to 60 40 to 60 10 to 15 h'1116 on ( 2) on ( 4) 4:4:2/3 10 to 15 40 to 60 40 to 60 40 to 60 6.7 to 10 h'1202 on ( 3) on ( 4) 4:4:4 10 40 120 40 40 h'1204 on ( 3) on ( 4) 4:4:2 10 40 120 40 20 h'1206 on ( 3) on ( 4) 4:4:1 10 40 120 40 10 h'1222 on ( 3) on ( 4) 4:4:4 10 40 120 40 40 h'1224 on ( 3) on ( 4) 4:4:2 10 40 120 40 20 h'122c on ( 3) on ( 4) 4:4:2 10 to 15 40 to 60 40 to 60 40 to 60 20 to 30 h'1226 on ( 3) on ( 4) 4:4:1 10 40 40 40 10 h'122e on ( 3) on ( 4) 4:4:1 10 to 15 40 to 60 40 to 60 40 to 60 10 to 15
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 79 of 1164 rej09b0321-0200 pll frequency multiplier selectable frequency range (mhz) clock operating mode frqcr setting pll circuit 1 pll circuit 2 ratio of internal clock frequencies (i:b:p) * 1 input clock * 2 output clock (ckio pin) * 3 internal clock (i ) * 3 bus clock (b ) * 3 peripheral clock (p ) * 3 0 h'1313 on ( 4) on ( 4) 8:4:4 10 40 80 40 40 h'1315 on ( 4) on ( 4) 8:4:2 10 to 12.5 40 to 50 80 to 100 40 to 50 20 to 25 h'1316 on ( 4) on ( 4) 8:4:4/3 10 to 12.5 40 to 50 80 to 100 40 to 50 13.33 to 16.67 h'1333 on ( 4) on ( 4) 4:4:4 10 40 40 40 40 h'1335 on ( 4) on ( 4) 4:4:2 10 to 12.5 40 to 50 40 to 50 40 to 50 20 to 25 h'1336 on ( 4) on ( 4) 4:4:4/3 10 to 12.5 40 to 50 40 to 50 40 to 50 13.33 to 16.67 2 h'1000 on ( 1) on ( 2) 2:2:2 10 to 20 20 to 40 20 to 40 20 to 40 20 to 40 h'1001 on ( 1) on ( 2) 2:2:1 10 to 30 20 to 60 20 to 60 20 to 60 10 to 30 h'1002 on ( 1) on ( 2) 2:2:2/3 10 to 30 20 to 60 20 to 60 20 to 60 6.67 to 20 h'1003 on ( 1) on ( 2) 2:2:1/2 10 to 30 20 to 60 20 to 60 20 to 60 5 to 15 h'1004 on ( 1) on ( 2) 2:2:1/3 10 to 30 20 to 60 20 to 60 20 to 60 3.33 to 10 h'1005 on ( 1) on ( 2) 2:2:1/4 10 to 30 20 to 60 20 to 60 20 to 60 2.5 to 7.5 h'1006 on ( 1) on ( 2) 2:2:1/6 10 to 30 20 to 60 20 to 60 20 to 60 1.67 to 5 h'1101 on ( 2) on ( 2) 4:2:2 10 to 20 20 to 40 40 to 80 20 to 40 20 to 40 h'1103 on ( 2) on ( 2) 4:2:1 10 to 30 20 to 60 40 to 120 20 to 60 10 to 30 h'1104 on ( 2) on ( 2) 4:2:2/3 10 to 30 20 to 60 40 to 120 20 to 60 6.67 to 20 h'1105 on ( 2) on ( 2) 4:2:1/2 10 to 30 20 to 60 40 to 120 20 to 60 5 to 15 h'1106 on ( 2) on ( 2) 4:2:1/3 10 to 30 20 to 60 40 to 120 20 to 60 3.3 to 10 h'1111 on ( 2) on ( 2) 2:2:2 10 to 20 20 to 40 20 to 40 20 to 40 20 to 40 h'1113 on ( 2) on ( 2) 2:2:1 10 to 30 20 to 60 20 to 60 20 to 60 10 to 30 h'1114 on ( 2) on ( 2) 2:2:2/3 10 to 30 20 to 60 20 to 60 20 to 60 6.67 to 20 h'1115 on ( 2) on ( 2) 2:2:1/2 10 to 30 20 to 60 20 to 60 20 to 60 5 to 15 h'1116 on ( 2) on ( 2) 2:2:1/3 10 to 30 20 to 60 20 to 60 20 to 60 3.3 to 10 h'1202 on ( 3) on ( 2) 6:2:2 10 to 20 20 to 40 60 to 120 20 to 40 20 to 40 h'120c on ( 3) on ( 2) 6:2:1 20 40 120 40 20 h'120e on ( 3) on ( 2) 6:2:1/2 20 40 120 40 10 h'1206 on ( 3) on ( 2) 6:2:1/2 10 to 20 20 to 40 60 to 120 20 to 40 5 to 10 h'1222 on ( 3) on ( 2) 2:2:2 10 to 20 20 to 40 20 to 40 20 to 40 20 to 40 h'1224 on ( 3) on ( 2) 2:2:1 10 to 20 20 to 40 20 to 40 20 to 40 10 to 20 h'122c on ( 3) on ( 2) 2:2:1 20 to 30 40 to 60 40 to 60 40 to 60 20 to 30
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 80 of 1164 rej09b0321-0200 pll frequency multiplier selectable frequency range (mhz) clock operating mode frqcr setting pll circuit 1 pll circuit 2 ratio of internal clock frequencies (i:b:p) * 1 input clock * 2 output clock (ckio pin) * 3 internal clock (i ) * 3 bus clock (b ) * 3 peripheral clock (p ) * 3 2 h'1226 on ( 3) on ( 2) 2:2:1/2 10 to 20 20 to 40 20 to 40 20 to 40 5 to 10 h'1303 on ( 4) on ( 2) 8:2:2 10 to 15 20 to 30 80 to 120 20 to 30 20 to 30 h'1305 on ( 4) on ( 2) 8:2:1 10 to 15 20 to 30 80 to 120 20 to 30 10 to 15 h'1306 on ( 4) on ( 2) 8:2:2/3 10 to 15 20 to 30 80 to 120 20 to 30 6.67 to 10 h'1313 on ( 4) on ( 2) 4:2:2 10 to 20 20 to 40 40 to 80 20 to 40 20 to 40 h'1315 on ( 4) on ( 2) 4:2:1 10 to 25 20 to 50 40 to 100 20 to 50 10 to 25 h'1316 on ( 4) on ( 2) 4:2:2/3 10 to 25 20 to 50 40 to 100 20 to 50 6.67 to 16.67 h'1333 on ( 4) on ( 2) 2:2:2 10 to 20 20 to 40 20 to 40 20 to 40 20 to 40 h'1335 on ( 4) on ( 2) 2:2:1 10 to 25 20 to 50 20 to 50 20 to 50 10 to 25 h'1336 on ( 4) on ( 2) 2:2:2/3 10 to 25 20 to 50 20 to 50 20 to 50 6.67 to 16.67 h'1404 on ( 6) on ( 2) 12:2:2 10 20 120 20 20 h'1406 on ( 6) on ( 2) 12:2:1 10 20 120 20 10 h'1414 on ( 6) on ( 2) 6:2:2 10 to 16.67 20 to 33.33 60 to 100 20 to 33.33 20 to 33.33 h'1416 on ( 6) on ( 2) 6:2:1 10 to 16.67 20 to 33.33 60 to 100 20 to 33.33 10 to 16.67 h'1424 on ( 6) on ( 2) 4:2:2 10 to 16.67 20 to 33.33 40 to 66.67 20 to 33.33 20 to 33.33 h'1426 on ( 6) on ( 2) 4:2:1 10 to 16.67 20 to 33.33 40 to 66.67 20 to 33.33 10 to 16.67 h'1444 on ( 6) on ( 2) 2:2:2 10 to 16.67 20 to 33.33 20 to 33.33 20 to 33.33 20 to 33.33 h'1446 on ( 6) on ( 2) 2:2:1 10 to 16.67 20 to 33.33 20 to 33.33 20 to 33.33 10 to 16.67 h'1515 on ( 8) on ( 2) 8:2:2 10 to 12.5 20 to 25 80 to 100 20 to 25 20 to 25 h'1535 on ( 8) on ( 2) 4:2:2 10 to 12.5 20 to 25 40 to 50 20 to 25 20 to 25 h'1555 on ( 8) on ( 2) 2:2:2 10 to 12.5 20 to 25 20 to 25 20 to 25 20 to 25 3 h'1000 on ( 1) off 1:1:1 20 to 40 ? 20 to 40 20 to 40 20 to 40 h'1001 on ( 1) off 1:1:1/2 20 to 60 ? 20 to 60 20 to 60 10 to 30 h'1002 on ( 1) off 1:1:1/3 20 to 60 ? 20 to 60 20 to 60 6.67 to 20 h'1003 on ( 1) off 1:1:1/4 20 to 60 ? 20 to 60 20 to 60 5 to 15 h'1004 on ( 1) off 1:1:1/6 20 to 60 ? 20 to 60 20 to 60 3.33 to 10 h'1005 on ( 1) off 1:1:1/8 20 to 60 ? 20 to 60 20 to 60 2.5 to 7.5 h'1006 on ( 1) off 1:1:1/12 20 to 60 ? 20 to 60 20 to 60 1.67 to 5
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 81 of 1164 rej09b0321-0200 pll frequency multiplier selectable frequency range (mhz) clock operating mode frqcr setting pll circuit 1 pll circuit 2 ratio of internal clock frequencies (i:b:p) * 1 input clock * 2 output clock (ckio pin) * 3 internal clock (i ) * 3 bus clock (b ) * 3 peripheral clock (p ) * 3 3 h'1101 on ( 2) off 2:1:1 20 to 40 ? 40 to 80 20 to 40 20 to 40 h'1103 on ( 2) off 2:1:1/2 20 to 60 ? 40 to 120 20 to 60 10 to 30 h'1104 on ( 2) off 2:1:1/3 20 to 60 ? 40 to 120 20 to 60 6.67 to 20 h'1105 on ( 2) off 2:1:1/4 20 to 60 ? 40 to 120 20 to 60 5 to 15 h'1106 on ( 2) off 2:1:1/6 20 to 60 ? 40 to 120 20 to 60 3.33 to 10 h'1111 on ( 2) off 1:1:1 20 to 40 ? 20 to 40 20 to 40 20 to 40 h'1113 on ( 2) off 1:1:1/2 20 to 60 ? 20 to 60 20 to 60 10 to 30 h'1114 on ( 2) off 1:1:1/3 20 to 60 ? 20 to 60 20 to 60 6.67 to 20 h'1115 on ( 2) off 1:1:1/4 20 to 60 ? 20 to 60 20 to 60 5 to 15 h'1116 on ( 2) off 1:1:1/6 20 to 60 ? 20 to 60 20 to 60 3.33 to 10 h'1202 on ( 3) off 3:1:1 20 to 40 ? 60 to 120 20 to 40 20 to 40 h'120c on ( 3) off 3:1:1/2 40 ? 120 40 20 h'1206 on ( 3) off 3:1:1/4 20 to 40 ? 60 to 120 20 to 40 5 to 10 h'1222 on ( 3) off 1:1:1 20 to 40 ? 20 to 40 20 to 40 20 to 40 h'1224 on ( 3) off 1:1:1/2 20 to 40 ? 20 to 40 20 to 40 10 to 20 h'122c on ( 3) off 1:1:1/2 20 to 60 ? 40 to 60 40 to 60 20 to 30 h'1226 on ( 3) off 1:1:1/4 20 to 40 ? 20 to 40 20 to 40 5 to 10 h'122e on ( 3) off 1:1:1/4 40 to 60 ? 40 to 60 40 to 60 10 to 15 h'1303 on ( 4) off 4:1:1 20 to 30 ? 80 to 120 20 to 30 20 to 30 h'1305 on ( 4) off 4:1:1/2 20 to 30 ? 80 to 120 20 to 30 10 to 15 h'1306 on ( 4) off 4:1:1/3 20 to 30 ? 80 to 120 20 to 30 6.67 to 10 h'1313 on ( 4) off 2:1:1 20 to 40 ? 40 to 80 20 to 40 20 to 40 h'1315 on ( 4) off 2:1:1/2 20 to 50 ? 40 to 100 20 to 50 10 to 25 h'1316 on ( 4) off 2:1:1/3 20 to 50 ? 40 to 100 20 to 50 6.67 to 16.67 h'1333 on ( 4) off 1:1:1 20 to 40 ? 20 to 40 20 to 40 20 to 40 h'1335 on ( 4) off 1:1:1/2 20 to 50 ? 20 to 50 20 to 50 10 to 25 h'1336 on ( 4) off 1:1:1/3 20 to 50 ? 20 to 50 20 to 50 6.67 to 16.67
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 82 of 1164 rej09b0321-0200 pll frequency multiplier selectable frequency range (mhz) clock operating mode frqcr setting pll circuit 1 pll circuit 2 ratio of internal clock frequencies (i:b:p) * 1 input clock * 2 output clock (ckio pin) * 3 internal clock (i ) * 3 bus clock (b ) * 3 peripheral clock (p ) * 3 3 h'1404 on ( 6) off 6:1:1 20 ? 120 20 20 h'1406 on ( 6) off 6:1:1/2 20 ? 120 20 10 h'1414 on ( 6) off 3:1:1 20 to 33.33 ? 60 to 100 20 to 33.33 20 to 33.33 h'1416 on ( 6) off 3:1:1/2 20 to 33.33 ? 60 to 100 20 to 33.33 10 to 16.67 h'1424 on ( 6) off 2:1:1 20 to 33.33 ? 40 to 66.67 20 to 33.33 20 to 33.33 h'1426 on ( 6) off 2:1:1/2 20 to 33.33 ? 40 to 66.67 20 to 33.33 10 to 16.67 h'1444 on ( 6) off 1:1:1 20 to 33.33 ? 20 to 33.33 20 to 33.33 20 to 33.33 h'1446 on ( 6) off 1:1:1/2 20 to 33.33 ? 20 to 33.33 20 to 33.33 10 to 16.67 h'1515 on ( 8) off 4:1:1 20 to 25 ? 80 to 100 20 to 25 20 to 25 h'1535 on ( 8) off 2:1:1 20 to 25 ? 40 to 50 20 to 25 20 to 25 h'1555 on ( 8) off 1:1:1 20 to 25 ? 20 to 25 20 to 25 20 to 25 notes: 1. the ratio of clock frequencies, where the input clock frequency is assumed to be 1. 2. in modes 0 and 2, the frequency of t he clock input from the extal pin or the frequency of the crystal resonator. in m ode 3, the frequency of the clock input from the ckio pin. 3. use an internal clock (i ) frequency of 120 mhz or lower for the regular specifications and 100 mhz or lower for the wide-range specifications. use a ckio pin or bus clock (b ) frequency of 60 mhz or lower. p must be from 5 through 40 mhz. caution: 1. the frequency of the internal clock is the frequency of the signal input to the ckio pin after multiplication by the frequency-mult iplier of pll circuit 1 and division by the divider's divisor. do not set a frequency fo r the internal clock below the frequency of the signal on the ckio pin. 2. the frequency of the peripheral clock is the frequency of the signal input to the ckio pin after multiplication by the frequency-mult iplier of pll circuit 1 and division by the divider's divisor. set the frequency of the peripheral clock to 40 mhz or below. in addition, do not set a higher frequency for the internal clock than the frequency on the ckio pin. 3. the frequency multiplier of pll circuit 1 can be selected as 1, 2, 3, 4, 6, or 8. the divisor of the divider can be selected as 1, 1/2, 1/3, 1/4, 1/6, 1/8, or 1/12. the settings are made in the frequency-control register (frqcr). 4. the signal output by pll circuit 1 is the signal on the ckio pin multiplied by the frequency multiplier of pll circuit 1. ensure that the frequency of the signal from pll circuit 1 is not more than 200 mhz.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 83 of 1164 rej09b0321-0200 4.4 register descriptions the clock pulse generator has the following registers. table 4.4 register configuration register name abbreviation r/w initial value address access size frequency control register frqcr r/w h'1003 h'fffe0010 16 ckio control register ckiocr r/w h'10/h'00 h'fffe3894 8, 16, 32 4.4.1 frequency control register (frqcr) frqcr is a 16-bit readable/writable register used to specify whether a clock is output from the ckio pin in software standby mode, the frequency multiplication ratio of pll circuit 1, and the frequency division ratio of the internal clock and peripheral clock (p ). only word access can be used on frqcr. frqcr is initialized to h'1003 only by a power-on reset or in deep standby mode. frqcr retains its previous value by a manual reset or in software standby mode. the previous value is also retained when an internal reset is triggered by an overflow of the wdt. 151413121110987654321 0 0001000000000011 r r r r/w r r/w r/w r/w r r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: ??? ckoen ? stc[2:0] ? ifc[2:0] rngs pfc[2:0] bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 84 of 1164 rej09b0321-0200 bit bit name initial value r/w description 12 ckoen 1 r/w clock output enable specifies whether a clock is output from the ckio pin, or whether the ckio pin is placed in the level- fixed state during software standby mode or cancellation of software standby mode. if this bit is cleared to 0, the ckio pin is fixed at low during software standby mode or cancellation of software standby mode. theref ore, the malfunction of an external circuit because of an unstable ckio clock during cancellation of software standby mode can be prevented. in clock operating mode 3, the ckio pin functions as an input regardless of this bit value. 0: the ckio pin is fixed to the low level during software standby mode or cancellation of software standby mode. 1: clock is output from ckio pin (low level in software standby mode). 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 to 8 stc[2:0] 000 r/w frequency mult iplication ratio of pll circuit 1 000: 1 time 001: 2 times 010: 3 times 011: 4 times 100: 6 times 101: 8 times 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 85 of 1164 rej09b0321-0200 bit bit name initial value r/w description 6 to 4 ifc[2:0] 000 r/w internal clock frequency division ratio these bits specify the frequency division ratio of the internal clock with respect to the output frequency of pll circuit 1. 000: 1 time 001: 1/2 time 010: 1/3 time 011: 1/4 time 100: 1/6 time 101: 1/8 time 3 rngs 0 r/w output range select for pll circuit 1 when the multiplication ratio for the pll circuit 1 is specified to 3, set this bit according to the output frequency of the pll circuit 1. 0: low frequency mode (output frequency of the pll circuit 1 is equal to or smaller than 120 mhz.) 1: high frequency mode (multiplication ratio for the pll circuit 1 is specified to 3 and its output frequency exceeds 120 mhz.) 2 to 0 pfc[2:0] 011 r/w periph eral clock frequency division ratio these bits specify the frequency division ratio of the peripheral clock with respect to the output frequency of pll circuit 1. 000: 1 time 001: 1/2 time 010: 1/3 time 011: 1/4 time 100: 1/6 time 101: 1/8 time 110: 1/12 time
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 86 of 1164 rej09b0321-0200 4.4.2 ckio control register (ckiocr) ckiocr is an 8-bit readable/writable register used to control output of the ckio pin. when this lsi is started in clock operating mode 3, writing 1 to this register is invalid. when this lsi is started in clock operating mode 3, ckiocr is initialized to h'00 by a power-on reset caused by the res pin or in deep standby mode. when this lsi is started in clock operating mode 0 or 2, ckiocr is initialized to h'01 by a power-on reset caused by the res pin or in deep standby mode. this register is not initialized by an internal reset triggered by an overflow of the wdt, a manual reset, in sleep mode , or in software standby mode. 7654321 0 0 0/1 * r 0 r 0 r 0 r 0 r 0 r 0 rr/w bit: initial value: r/w: ???? ??? ckio oe bit bit name initial value r/w description 7 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 ckiooe 0/1 * r/w ckio output enable enables output of the ckio pin. 0: output from ckio is not enabled. 1: output from ckio is enabled. note: * the initial value depends on the clock operating mode of the lsi.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 87 of 1164 rej09b0321-0200 4.5 changing the frequency the frequency of the internal clock (i ) and peripheral clock (p ) can be changed either by changing the multiplication rate of pll circuit 1 or by changing the division rates of divider. all of these are controlled by software through the frequency control register (frqcr). the methods are described below. 4.5.1 changing the multiplication rate a pll settling time is required when the multiplicati on rate of pll circuit 1 is changed. the on- chip wdt counts the settling time. 1. in the initial state, the multiplication rate of pll circuit 1 is 1 time. 2. set a value that will become the specified os cillation settling time in the wdt and stop the wdt. the following must be set: wtcsr.tme = 0: wdt stops wtcsr.cks[2:0]: division ratio of wdt count clock wtcnt counter: initial counter value 3. set the desired value in the stc[2:0] bits. the division ratio can also be set in the ifc[2:0] and pfc[2:0] bits. 4. this lsi pauses temporarily and the wdt star ts incrementing. the internal and peripheral clocks both stop and the wdt is supplied with the clock. the clock will continue to be output at the ckio pin. this state is the same as so ftware standby mode. whether or not registers are initialized depends on the module. for details, see section 25, power-down modes. 5. supply of the clock that has been set begins at wdt count overflow, and this lsi begins operating again. the wdt stops after it overflows.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 88 of 1164 rej09b0321-0200 4.5.2 changing the division ratio counting by the wdt does not pro ceed if the frequency divisor is changed but the multiplier is not. 1. in the initial state, ifc[2:0] = b'000 and pfc[2:0] = b'011. 2. set the desired value in the ifc[2:0] and pfc[2:0] bits. the values that can be set are limited by the clock operating mode and the multiplication rate of pll circuit 1. note that if the wrong value is set, this lsi will malfunction. 3. after the register bits (ifc[2:0] and pfc[2:0]) have been set, the clock is supplied of the new division ratio. note: when executing the sleep instruction after the frequency has been changed, be sure to read the frequency control register (frqcr) three times before executing the sleep instruction. 4.6 notes on board design 4.6.1 note on inputting external clock figure 4.2 is an example of connecting the external clock input. when putting the xtal pin in open state, make sure the parasitic capacitance is less than or equal to 10 pf. to stably input the external clock with enough pll st abilizing time at power on or releasing the standby, wait longer than the oscillation stabilizing time. extal xtal example of connection with xtal pin open open state external clock input figure 4.2 example of connecting external clock for details on input conditions of the external clock, see section 29.3.1, clock timing.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 89 of 1164 rej09b0321-0200 4.6.2 note on using crystal resonator place the crystal resonator and capacitors cl1 and cl2 as close to the xtal and extal pins as possible. in addition, to minimize induction and th us obtain oscillation at the correct frequency, the capacitors to be attached to the resonator must be grounded to the same ground. do not bring wiring patterns close to these components. cl1 cl2 extal xtal signal lines prohibited this lsi the values for cl1 and cl2 should be determined after consultation with the crystal resonator manufacturer. note: reference value cl1 = 10 to 22 pf cl2 = 10 to 22 pf figure 4.3 note on using crystal resonator 4.6.3 note on resonator since various characteristics related to the resonato r are closely linked to the user's board design, thorough evaluation is necessary on the user's part, using the resonator connection examples shown in this section as a guide. as the parameters for the oscillation circuit will depend on the floating capacitance of the resonator and the user board, the parameters should be determined in consultation with the resonator ma nufacturer. the design must ensu re that a voltage exceeding the maximum rating is not applied to the resonator pin.
section 4 clock pulse generator (cpg) rev. 2.00 sep. 07, 2007 page 90 of 1164 rej09b0321-0200 4.6.4 note on using a pll oscillation circuit in the pllvcc and pllvss connection pattern for the pll, signal lines from the board power supply pins must be as short as possible and pattern width must be as wide as possible to reduce inductive interference. in clock operating mode 3, the extal pin is pulled up and the xtal pin is left open. since the analog power supply pins of the pll are sensitive to the noise, the system may malfunction due to inductive interference at the other power supply pins. to prevent such malfunction, the analog power supply pin vcc and the digital power supply pins vccr and pvcc should not supply the same resources on the board if at all possible. pllvcc pllvss vcc vss power supply signal lines prohibited figure 4.4 note on using pll oscillation circuit 4.6.5 note on changing the multiplication rate if the multiplication rate is changed by the frequency control register (frqcr) during transfer by the dmac, the dmac stops its operation without waiting for the completion of the transfer. thus, the dma transfer is not gu aranteed. therefore, when changi ng the multiplication rate with the frequency control register (frqcr), wait for the completion of the dma transfer or stop the dma transfer to change the setting of the frequency control register (frqcr).
section 5 exception handling rev. 2.00 sep. 07, 2007 page 91 of 1164 rej09b0321-0200 section 5 exception handling 5.1 overview 5.1.1 types of exception handling and priority exception handling is started by so urces, such as resets, address er rors, bus errors, register bank errors, interrupts, and instructions. table 5.1 shows their priorities. when several exception handling sources occur at once, they are processed according to the priority shown. table 5.1 types of exception handling and priority order type exception handling priority power-on reset reset manual reset address error cpu address error bus error bus error instructions fpu exception integer division exception (division by zero) integer division exception (overflow) bank underflow register bank error bank overflow interrupts nmi user break h-udi irq pint high low
section 5 exception handling rev. 2.00 sep. 07, 2007 page 92 of 1164 rej09b0321-0200 type exception handling priority a/d converter (adc) multifunction timer pulse unit 2 (mtu2) realtime clock (rtc) watchdog timer (wdt) i2c bus interface 3 (iic3) direct memory access controller (dmac) serial communication interface with fifo (scif) controller area network (rcan-et) serial sound interface (ssi) interrupts on-chip peripheral modules 8-bit timer (tmr) trap instruction (trapa instruction) general illegal instructions (undefined code) instructions slot illegal instructions (undefined code placed directly after a delayed branch instruction * 1 , instructions that rewrite the pc * 2 , 32-bit instructions * 3 , resbank instruction, divs instruction, and divu instruction) high low notes: 1. delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf. 2. instructions that rewrite the pc: jmp, jsr, bra, bsr, rts, rte, bt, bf, trapa, bf/s, bt/s, bsrf, braf, jsr/n, rtv/n. 3. 32-bit instructions: band.b, bandnot. b, bclr.b, bld.b, bldnot.b, bor.b, bornot.b, bset.b, bst.b, bxor.b, mov.b@disp12, mov.w@disp12, mov.l@disp12, movi20, movi20s, movu.b, movu.w.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 93 of 1164 rej09b0321-0200 5.1.2 exception handling operations the exception handling sources are detected and begin processi ng according to the timing shown in table 5.2. table 5.2 timing of exception source de tection and start of exception handling exception source timing of source detection and start of handling power-on reset starts when the res pin changes from low to high, when the h-udi reset negate command is set after the h-udi reset assert command has been set, or when the wdt overflows. reset manual reset starts when the mres pin changes from low to high or when the wdt overflows. address error bus error interrupts detected when instruction is decoded and starts when the previous executing instruct ion finishes executing. bank underflow starts upon attempted execution of a resbank instruction when saving has not been performed to register banks. register bank error bank overflow in the state where sa ving has been performed to all register bank areas, starts when acceptance of register bank overflow exception has been set by the in terrupt controller (the bove bit in ibnr of the intc is 1) and an interrupt that uses a register bank has occurred and been accepted by the cpu. trap instruction starts from the execution of a trapa instruction. general illegal instructions starts from the decoding of undefined code anytime except immediately after a delayed branc h instruction (delay slot). slot illegal instructions starts from the decoding of u ndefined code placed immediately after a delayed branch instruction (delay slot), of instructions that rewrite the pc, of 32-bi t instructions, of the resbank instruction, of the divs instructi on, or of the divu instruction. integer division instructions starts when detecting division-by-zero exception or overflow exception caused by division of the negative maximum value (h'80000000) by ? 1. instructions floating-point operation instruction exception handling starts tri ggered by disabled operation exception of floating-point operation instruction (ieee754 standard), division exception by zero, overflow, underflow, or imprecise exception. setting the qis bit in fpscr or inputting qnan as well as as the floating-point operation instruction source also starts exception handling.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 94 of 1164 rej09b0321-0200 when exception handling starts, the cpu operates as follows: (1) exception handling triggered by reset the initial values of the program counter (pc) and stack pointer (sp) are fetched from the exception handling vector table (pc and sp are respectively the h'00000000 and h'00000004 addresses for power-on resets and the h'00000008 and h'0000000c addresses for manual resets). see section 5.1.3, exception hand ling vector table, for more information. the vector base register (vbr) is then initialized to h'00000000, the interrupt mask level bits (i3 to i0) of the status register (sr) are initialized to h'f (b'1111) , and the bo and cs bits are initialized. the bn bit in ibnr of the interrupt controller (intc) is also initialized to 0. fpscr is initialized to h'00040001 by a power-on reset. the program begins running from the pc address fetched from the exception handling vector table. (2) exception handling triggered by address errors, bus errors, register bank errors, interrupts, and instructions sr and pc are saved to the stack indicated by r15. in the case of interrupt exception handling other than the nmi or user break, with usage of the register banks enabled, general registers r0 to r14, control register gbr, system registers ma ch, macl, and pr, and the vector number of the interrupt exception handling to be executed are saved to the register banks. in the case of exception handling due to an address error, bus error, register bank error, nmi interrupt, user break interrupt, or instruction, saving to a register bank is not performed. when saving is performed to all register banks, automatic saving to the stack is performed instead of register bank saving. in this case, an interrupt controller setting must have been made so that register bank overflow exceptions are not accepte d (the bove bit in ibnr of the intc is 0). if a setting to accept register bank overflow excep tions has been made (the bove bit in ibnr of the intc is 1), register bank overflow exception will be generated. in the case of interrupt exception handling, the interrupt priority level is written to the i3 to i0 bits in sr. in the case of exception handling due to an address error or instruction, the i3 to i0 bits are not affected. the start address is then fetched from the exception handling vector table and the program begins running from that address.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 95 of 1164 rej09b0321-0200 5.1.3 exception handling vector table before exception handling begins running, the exception handling vector table must be set in memory. the exception handling vector table stor es the start addresses of exception service routines. (the reset exception handling table holds the initial values of pc and sp.) all exception sources are given different vector numbers and vector table address offsets, from which the vector table addresses are calculated. during exception handling, the start addresses of the exception service routines are fetched from the exception handling vector table, which is indicated by this v ector table address. table 5.3 shows the vector numbers and vector table address offsets. table 5.4 shows how vector table addresses are calculated. table 5.3 exception handling vector table exception sources vector numbers vector table address offset pc 0 h'00000000 to h'00000003 power-on reset sp 1 h'00000004 to h'00000007 pc 2 h'00000008 to h'0000000b manual reset sp 3 h'0000000c to h'0000000f general illegal instructio n 4 h'00000010 to h'00000013 (reserved by system) 5 h'00000014 to h'00000017 slot illegal instruction 6 h'00000018 to h'0000001b 7 h'0000001c to h'0000001f (reserved by system) 8 h'00000020 to h'00000023 cpu address error 9 h'00000024 to h'00000027 bus error 10 h'00000028 to h'0000002b nmi 11 h'0000002c to h'0000002f interrupts user break 12 h'00000030 to h'00000033 fpu exception 13 h'00000034 to h'00000037 h-udi 14 h'00000038 to h'0000003b bank overflow 15 h'0000003c to h'0000003f bank underflow 16 h'00000040 to h'00000043 integer division exception (divisi on by zero) 17 h'00000044 to h'00000047 integer division exception (overf low) 18 h'00000048 to h'0000004b
section 5 exception handling rev. 2.00 sep. 07, 2007 page 96 of 1164 rej09b0321-0200 exception sources vector numbers vector table address offset (reserved by system) 19 : 31 h'0000004c to h'0000004f : h'0000007c to h'0000007f trap instruction (user vector) 32 : 63 h'00000080 to h'00000083 : h'000000fc to h'000000ff external interrupts (irq, pint), on-chip peripheral module interrupts * 64 : 255 h'00000100 to h'00000103 : h'000003fc to h'000003ff note: * the vector numbers and vector table addre ss offsets for each external interrupt and on- chip peripheral module interrupt are given in table 6.4 in section 6, interrupt controller (intc). table 5.4 calculating exception handling vector table addresses exception source vector table address calculation resets vector table address = (vector table address offset) = (vector number) 4 address errors, bus errors, register bank errors, interrupts, instructions vector table address = vbr + (vector table address offset) = vbr + (vector number) 4 notes: 1. vector table add ress offset: see table 5.3. 2. vector number: see table 5.3.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 97 of 1164 rej09b0321-0200 5.2 resets 5.2.1 input/output pins table 5.5 shows the configuration of pins relating to the resets. table 5.5 pin configuration pin name symbol i/o function power-on reset res input when this pin is driven low, this lsi shifts to the power-on reset processing manual reset mres input when this pin is driven low, this lsi shifts to the manual reset processing. 5.2.2 types of reset a reset is the highest-priority exception handling source. there are two kinds of resets, power-on and manual. as shown in table 5.6, the cpu state is initialized by both a power-on reset and a manual reset. the fpu state is initialized by a po wer-on reset, but not by a manual reset. on-chip peripheral module registers except a few registers ar e initialized by a power-on reset, but not by a manual reset. table 5.6 reset states conditions for transition to reset state internal states type res h-udi command mres wdt overflow cpu on-chip peripheral modules, i/o port wrcsr of wdt, frqcr of cpg low ? ? ? initialized initialized * 1 initialized high h-udi reset assert command is set ? ? initialized initialized * 1 initialized power-on reset high command other than h-udi reset assert is set ? power-on reset initialized initialized * 1 not initialized
section 5 exception handling rev. 2.00 sep. 07, 2007 page 98 of 1164 rej09b0321-0200 conditions for transition to reset state internal states type res h-udi command mres wdt overflow cpu on-chip peripheral modules, i/o port wrcsr of wdt, frqcr of cpg high command other than h-udi reset assert is set low ? initialized not initialized * 2 not initialized manual reset high command other than h-udi reset assert is set high manual reset initialized not initialized * 2 not initialized notes: 1. some registers are excluded. for deta ils, see section 28.3, register states in each operating mode. 2. the bn bit in ibnr of the intc is initialized. 5.2.3 power-on reset (1) power-on reset by means of res pin when the res pin is driven low, this lsi enters the power-on reset state. to reliably reset this lsi, the res pin should be kept at the low level for the duration of the oscillation settling time at power-on or when in software standby mode (when the clock is halted), or at least 20-tcyc when the clock is running. in the power-on reset state, the internal state of the cpu and all the on-chip peripheral module registers are initialized. see append ix a, pin states, for th e status of individual pins during the power-on reset state. in the power-on reset state, power-on reset exception handling starts when the res pin is first driven low for a fixed period and then retu rned to high. the cpu operates as follows: 1. the initial value (execution start address) of the program counter (pc) is fetched from the exception handling vector table. 2. the initial value of the stack pointer (sp) is fetched from the exception handling vector table. 3. the vector base register (vbr) is cleared to h'00000000, the interrupt mask level bits (i3 to i0) of the status register (sr) are initialized to h'f (b'1111), and the bo and cs bits are initialized to 0. the bn bit in ibnr of the intc is also initialized to 0. fpscr is initialized to h'00040001. 4. the values fetched from the exception handling vector table are set in the pc and sp, and the program begins executing. be certain to always perform power-on reset processing when turnin g the system power on.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 99 of 1164 rej09b0321-0200 (2) power-on reset by means of h-udi reset assert command when the h-udi reset assert command is set, this lsi enters the power-on reset state. power-on reset by means of an h-udi reset assert command is equivalent to power-on reset by means of the res pin. setting the h-udi reset negate command cancels the power-on reset state. the time required between an h-udi reset assert command and h-udi reset negate command is the same as the time to keep the res pin low to initiate a power-on re set. in the power-on reset state generated by an h-udi reset assert command, setting the h-udi reset negate command starts power-on reset exception handling. the cpu operates in the same way as when a power-on reset was caused by the res pin. (3) power-on reset initiated by wdt when a setting is made for a power-on reset to be generated in the wdt?s watchdog timer mode, and wtcnt of the wdt overflows, this lsi enters the power-on reset state. in this case, wrcsr of the wdt and frqcr of the cpg are not initialized by the reset signal generated by the wdt. if a reset caused by the res pin or the h-udi reset assert comma nd occurs simultaneously with a reset caused by wdt overflow, the reset caused by the res pin or the h-udi reset assert command has priority, and the wovf bit in wrcsr is cleared to 0. when power-on reset exception processing is started by the wdt, the cpu operates in the same way as when a power- on reset was caused by the res pin.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 100 of 1164 rej09b0321-0200 5.2.4 manual reset (1) manual reset by means of mres pin when the mres pin is driven low, this lsi enters the ma nual reset state. to reset this lsi without fail, the mres pin should be kept at the low level for at least 20-tcyc. in the manual reset state, the cpu?s internal state is initialized, but all the on-chip peripheral module registers are not initialized. in the manual reset state, manual reset exception handling starts when the mres pin is first driven low for a fixed period and then returned to high. the cpu operates as follows: 1. the initial value (execution start address) of the program counter (pc) is fetched from the exception handling vector table. 2. the initial value of the stack pointer (sp) is fetched from the exception handling vector table. 3. the vector base register (vbr) is cleared to h'00000000, the interrupt mask level bits (i3 to i0) of the status register (sr) are initialized to h'f (b'1111), and the bo and cs bits are initialized. the bn bit in ibnr of the intc is also initialized to 0. 4. the values fetched from the exception handling vector table are set in the pc and sp, and the program begins executing. (2) manual reset initiated by wdt when a setting is made for a manual reset to be generated in the wdt?s watchdog timer mode, and wtcnt of the wdt overflows, this lsi enters the manual reset state. when manual reset exception pro cessing is started by the wdt, the cpu operates in the same way as when a manual reset was caused by the mres pin. (3) notes at a manual reset when a manual reset is generated, the bus cycle is retained. thus, manual reset exception handling will be deferred until the cpu acquires the bus ma stership. however, if the interval from generation of the manual reset until the end of the bus cycle is equal to or longer than the fixed internal manual reset interval cycles, the internal manual reset source is ignored instead of being deferred, and manual reset exception handling is not executed. the cpu and the bn bit in ibnr of the intc are initialized by a manual reset. the fpu and other modules are not initialized.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 101 of 1164 rej09b0321-0200 5.3 address errors 5.3.1 address error sources address errors occur when instructions are fetched or data read or written, as shown in table 5.7. table 5.7 bus cycles and address errors bus cycle type bus master bus cycle description address errors instruction fetched from even address none (normal) instruction fetched from odd address address error occurs instruction fetched from area other than h'f0000000 to h'f5 fffffff in cache address array space * 1 none (normal) instruction fetch cpu instruction fetched from h'f0000000 to h'f5fffffff in ca che address array space * 1 address error occurs word data accessed from even address none (normal) word data accessed from odd address address error occurs longword data accessed from a longword boundary none (normal) longword data accessed from other than a long-word boundary address error occurs byte or word data accessed in on-chip peripheral module space * 2 none (normal) longword data accessed in 16-bit on- chip peripheral module space * 2 none (normal) data read/write cpu longword data accessed in 8-bit on-chip peripheral module space * 2 none (normal) notes: 1. for details on cache addre ss array space, see section 8, cache. 2. for details on peripheral module space, see section 9, bus state controller (bsc).
section 5 exception handling rev. 2.00 sep. 07, 2007 page 102 of 1164 rej09b0321-0200 5.3.2 address error exception handling when an address error occurs, address error excep tion handling starts after the bus cycle in which the address error occurred ends and execution of the instruction being executed completes. the cpu operates as follows. 1. the exception service routine start address which corresponds to th e address error that occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the last executed instruction. 4. after jumping to the address fetched from the exception handling vector table, program execution starts. the jump that o ccurs is not a delayed branch. 5.4 bus error 5.4.1 bus error generation source in bus monitor, notification of bus error occurrence to the cpu can be set. the notification is generated when incorrect address access or bus timeo ut is detected. for details, see section 10, bus monitor. 5.4.2 bus error exception handling when a bus error occurs, bus error exception hand ling starts after the bus cycle in which the bus error occurred ends and executi on of the instruction being executed completes. the cpu operates as follows. 1. the exception service routine start address which corresponds to the bus error that occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the last executed instruction. 4. after jumping to the address fetched from the exception handling vector table, program execution starts. the jump that o ccurs is not a delayed branch.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 103 of 1164 rej09b0321-0200 5.5 register bank errors 5.5.1 register bank error sources (1) bank overflow in the state where saving has al ready been performed to all regi ster bank areas, bank overflow occurs when acceptance of regi ster bank overflow exception has been set by the interrupt controller (the bove bit in ibnr of the intc is set to 1) and an interrupt that uses a register bank has occurred and been accepted by the cpu. (2) bank underflow bank underflow occurs when an attempt is made to execute a re sbank instruction while saving has not been performed to register banks. 5.5.2 register bank e rror exception handling when a register bank error occurs, register bank error exception handling starts. the cpu operates as follows: 1. the exception service routine start address which corresponds to the register bank error that occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the last execut ed instruction for a bank overflow, and the start address of the executed resbank instruction for a bank underflow. to prevent multiple interrupts from occurring at a bank overflow, the interrupt priority level that caused the bank overflow is written to the interrupt mask level bits (i3 to i0) of the status register (sr). 4. after jumping to the address fetched from the exception handling vector table, program execution starts. the jump that o ccurs is not a delayed branch.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 104 of 1164 rej09b0321-0200 5.6 interrupts 5.6.1 interrupt sources table 5.8 shows the sources that start up interrupt exception ha ndling. these are divided into nmi, user breaks, h-udi, irq, pint , and on-chip peripheral modules. table 5.8 interrupt sources type request source number of sources nmi nmi pin (external input) 1 user break user break controller (ubc) 1 h-udi user debugging interface (h-udi) 1 irq irq0 to irq7 pins (external input) 8 pint pint0 to pint7 pi ns (external input) 8 a/d converter (adc) 1 multifunction timer pulse unit 2 (mtu2) 28 realtime clock (rtc) 3 watchdog timer (wdt) 1 i2c bus interface 3 (iic3) 15 direct memory access controller (dmac) 9 serial communication inte rface with fifo (scif) 32 controller area network (rcan-et) 2 serial sound interface (ssi) 2 on-chip peripheral module 8-bit timer (tmr) 6 each interrupt source is allocated a different vect or number and vector ta ble offset. see table 6.4 in section 6, interrupt controller (intc), for more information on vector numbers and vector table address offsets.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 105 of 1164 rej09b0321-0200 5.6.2 interrupt priority level the interrupt priority order is predetermined. when multiple interrupts occur simultaneously (overlap), the interrupt controller (intc) determines their relative priorities and starts processing according to the results. the priority order of interrupts is expressed as prio rity levels 0 to 16, with priority 0 the lowest and priority 16 the highest. the nmi interrupt has priority 16 and cannot be masked, so it is always accepted. the user break inte rrupt and h-udi interrupt priority level is 15. priority levels of irq interrupts, pint interrupts, and on-chip peripheral module interrupts can be set freely using the interrupt priority registers 01, 02, and 05 to 16 (ipr01, ipr02, and ipr05 to ipr16) of the intc as shown in table 5.9. the priority levels that can be set are 0 to 15. level 16 cannot be set. see section 6.3.1, interrupt priority registers 01, 02, 05 to 16 (ipr01, ipr02, ipr05 to ipr16), for details of ipr01, ipr02, and ipr05 to ipr16. table 5.9 interrupt priority order type priority level comment nmi 16 fixed priority level. cannot be masked user break 15 fixed priority level h-udi 15 fixed priority level irq 0 to 15 pint set with interrupt priority registers 01, 02, and 05 to 16 (ipr01, ipr02, and ipr05 to ipr16) on-chip peripheral module 0 to 15 set with interrupt priority registers 01, 02, and 05 to 16 (ipr01, ipr02, and ipr05 to ipr16)
section 5 exception handling rev. 2.00 sep. 07, 2007 page 106 of 1164 rej09b0321-0200 5.6.3 interrupt exception handling when an interrupt occurs, its priority level is ascertained by the interrupt controller (intc). nmi is always accepted, but other interr upts are only accepted if they ha ve a priority level higher than the priority level set in the interrupt mask leve l bits (i3 to i0) of the status register (sr). when an interrupt is accepted, interrupt exce ption handling begins. in interrupt exception handling, the cpu fetches the ex ception service routin e start address which corresponds to the accepted interrupt from the exception handling vector table, and sa ves sr and the program counter (pc) to the stack. in the case of interrupt excep tion handling other than the nmi or user break, with usage of the register banks enabled, general registers r0 to r14, control register gbr, system registers mach, macl, and pr, and the vector number of the interrupt exception handling to be executed are saved in the register ba nks. in the case of except ion handling due to an address error, bus error, nmi interrupt, user break interrupt, or instruction, saving is not performed to the register banks. if saving has been performed to all register banks (0 to 14), automatic saving to the stack is performed instead of register bank saving. in this case, an interrupt controller setting must have been made so that register bank overflow exceptions are not accepted (the bove bit in ibnr of the intc is 0). if the interrupt controller is set to accept register bank overflow exceptions (the bove bit in ibnr of intc is se t to 1), a register bank overflow exception will occur. next, the priority level value of the accepted interrupt is written to the i3 to i0 bits in sr. for nmi, however, the priority level is 16, but the value set in the i3 to i0 bits is h'f (level 15). then, after jumping to the start address of the interrupt exception service routine fetched from the exception handling vector table, program execution starts. the jump that occurs is not a delayed branch. see section 6.6, operation, for further details of interrupt exception handling.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 107 of 1164 rej09b0321-0200 5.7 exceptions triggered by instructions 5.7.1 types of exceptions triggered by instructions exception handling can be triggered by trap instructions, general illegal instructions, slot illegal instructions, and integer division exceptions, as shown in table 5.10. table 5.10 types of exceptions triggered by instructions type source instruction comment trap instruction trapa slot illegal instructions undefined code placed immediately after a delayed branch instruction (delay slot), instructions that rewrite the pc, 32-bit instructions, resbank instruction, divs instruction, and divu instruction delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf instructions that rewrite the pc: jmp, jsr, bra, bsr, rts, rte, bt, bf, trapa, bf/s, bt/s, bsrf, braf, jsr/n, rtv/n 32-bit instructions: band.b, bandnot.b, bclr.b, bld.b, bldnot.b, bor.b, bornot.b, bset.b, bst.b, bxor.b, mov.b@disp12, mov.w@disp12, mov.l@disp12, movi20, movi20s, movu.b, movu.w. general illegal instructions undefined code anywhere besides in a delay slot division by zero divu, divs integer division exceptions negative maximum value ( ? 1) divs floating-point operation instruction instructions that cause disabled operation exception defined by ieee754 standard or division exception by zero. instructions that could cause overflow, underflow, or imprecise exception. fadd, fsub, fmul, fdiv, fmac, fcmp/eq, fcmp/gt, float, ftrc, fcnvds, fcnvsd, fsqrt
section 5 exception handling rev. 2.00 sep. 07, 2007 page 108 of 1164 rej09b0321-0200 5.7.2 trap instructions when a trapa instruction is executed, trap instruction exception handling starts. the cpu operates as follows: 1. the exception service routine start address wh ich corresponds to the vector number specified in the trapa instruction is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the trapa instruction. 4. after jumping to the address fetched from the exception handling vector table, program execution starts. the jump that o ccurs is not a delayed branch. 5.7.3 slot illegal instructions an instruction placed immedi ately after a delayed branch instructio n is said to be placed in a delay slot. when the instruction placed in the delay slot is undefined code, an instruction that rewrites the pc, a 32-bit instruction, an resbank instructio n, a divs instruction, or a divu instruction, slot illegal exception handling starts when such kind of instruction is decoded. the cpu operates as follows: 1. the exception service routine start address is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the jump address of the delayed branch instruction immediately before the undefined code, the instruction that rewrites the pc, the 32-bit instruction, the resbank inst ruction, the divs instruction, or the divu instruction. 4. after jumping to the address fetched from the exception handling vector table, program execution starts. the jump that o ccurs is not a delayed branch. 5.7.4 general illegal instructions when undefined code placed anywhere other than immediately after a delayed branch instruction (delay slot) is decoded, general illegal instruction exception handling starts. the cpu handles general illegal instructions in the same way as slot illegal instructions. unlike processing of slot illegal instructions, however, the program counter va lue stored is the start address of the undefined code.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 109 of 1164 rej09b0321-0200 5.7.5 integer division instructions when an integer division instruction performs division by zero or the result of integer division overflows, integer division instruction exception handling starts. the instructions that may become the source of division-by-zero exception are divu and divs. the only source instruction of overflow exception is divs, and overflow exception occurs only when the negative maximum value is divided by ? 1. the cpu operates as follows: 1. the exception service routin e start address which corresponds to the integer division instruction exception that occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the integer division instruction at which the exception occurred. 4. after jumping to the address fetched from the exception handling vector table, program execution starts. the jump that o ccurs is not a delayed branch. 5.7.6 floating-point operation instruction when the bits v, z, o, u, or i in the enabled field of the floating point status/control register (fpscr) are set, a fpu exception is generated. this means that instructions that cause disabled operation exception defined by ieee754 standard, division exception by zero, overflow (possible instruction), underflow (possible instruction), or imprecise exception (pos sible instruction) are yielded. floating-point operation instructions that can be exception sources are fadd, fsub, fmul, fdiv, fmac, fcmp/eq, fcmp/gt, float, ftrc, fcnvds, fcnvsd, and fsqrt. fpu exceptions occur only when the said enabled bits are set. when the fpu detects exception sources, the fpu operation stops and exception occurrence is notified to the cpu. the cpu starts the exception handling as follows: 1. the exception service routin e start address which correspond s to the fpu exception that occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the last executed instruction. 4. after jumping to the address fetched from the exception handling vector table, program execution starts. the jump that o ccurs is not a delayed branch.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 110 of 1164 rej09b0321-0200 the fpu exception flag field (flag) of fpscr is always updated regardless of whether or not an fpu exception has been accepted, and remains set un til explicitly cleared by the user through an instruction. the fpu exception source field (cause) of fpscr changes each time an fpu instruction is executed. when the v bit in the fpu exception enable field (enable) of fpscr is set and the qis bit in fpscr is also set, fpu exception is generated when qnan or is input to a floating point operation instruction source. 5.8 when exception sources are not accepted when an address error, bus error, fpu exception, register bank error (overflow), or interrupt is generated immediately after a delayed branch instruction, it is sometimes not accepted immediately but stored instead, as shown in tabl e 5.11. when this happen s, it will be accepted when an instruction that can a ccept the exception is decoded. table 5.11 exception source generation imme diately after delayed branch instruction exception source point of occurrence address error bus error fpu exception register bank error (overflow) interrupt immediately after a delayed branch instruction * not accepted not accepted not accepted not accepted not accepted note: * delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 111 of 1164 rej09b0321-0200 5.9 stack status after exception handling ends the status of the stack after exception handling ends is as shown in table 5.12. table 5.12 stack status af ter exception handling ends exception type stack status address error 32 bits 32 bits sr address of instruction after executed instruction sp interrupt 32 bits 32 bits sr address of instruction after executed instruction sp bus error 32 bits 32 bits sr address of instruction after executed instruction sp fpu exception 32 bits 32 bits sr address of instruction after executed instruction sp register bank error (overflow) 32 bits 32 bits sr address of instruction after executed instruction sp
section 5 exception handling rev. 2.00 sep. 07, 2007 page 112 of 1164 rej09b0321-0200 exception type stack status register bank error (underflow) 32 bits 32 bits sr start address of relevant resbank instruction sp trap instruction 32 bits 32 bits sr address of instruction after trapa instruction sp slot illegal instruction 32 bits 32 bits sr jump destination address of delayed branch instruction sp general illegal instruction 32 bits 32 bits sr start address of general illegal instruction sp integer division instruction 32 bits 32 bits sr start address of relevant integer division instruction sp
section 5 exception handling rev. 2.00 sep. 07, 2007 page 113 of 1164 rej09b0321-0200 5.10 usage notes 5.10.1 value of stack pointer (sp) the value of the stack pointer must always be a mu ltiple of four. if it is not, an address error will occur when the stack is accessed during exception handling. 5.10.2 value of vector base register (vbr) the value of the vector base register must always be a multiple of four. if it is not, an address error will occur when the stack is acce ssed during exception handling. 5.10.3 address errors caused by stacki ng of address error exception handling when the stack pointer is not a multiple of four, an address error will occur during stacking of the exception handling (interrupts, etc.) and address error exception handling will start up as soon as the first exception handling is ended. address erro rs will then also occur in the stacking for this address error exception handling. to ensure that address error exce ption handling does not go into an endless loop, no address erro rs are accepted at that point. this allows program control to be shifted to the address erro r exception service routine and enables error processing. when an address error occurs during exception handling stacking, the stacking bus cycle (write) is executed. during the stack ing of the status register (sr) and program counter (pc), the sp is decremented by 4 for both, so the value of sp w ill not be a multiple of four after the stacking either. the address value output during stacking is the sp value, so the address where the error occurred is itself output. this means the write data stacked will be undefined.
section 5 exception handling rev. 2.00 sep. 07, 2007 page 114 of 1164 rej09b0321-0200
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 115 of 1164 rej09b0321-0200 section 6 interrupt controller (intc) the interrupt controller (intc) ascertains the prior ity of interrupt sources and controls interrupt requests to the cpu. the intc registers set the order of priority of each interrupt, allowing the user to process interr upt requests according to the user-set priority. 6.1 features ? 16 levels of interrupt priority can be set by setting the 14 interrupt priority registers, the priorities of the irq, pint, and on-chip peripheral module interrupts can be set to one of 16 levels for each source. ? nmi noise canceller function this controller provides an nm i input level bit that indicates the nmi pin state. the interrupt exception service routine can verify the pin state by reading this bit and use the information to implement a noise canceling function. ? register banks this lsi has register banks that enable register saving and restoration required in the interrupt processing to be performed at high speed. figure 6.1 shows a block diagram of the intc.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 116 of 1164 rej09b0321-0200 ubc h-udi adc mtu2 rtc wdt iic3 dmac scif rcan-et ssi tmr ubc: user break controller h-udi: user debugging interface adc: a/d converter mtu2: multi-function timer pulse unit 2 rtc: realtime clock wdt: watchdog timer iic3: i 2 c bus interface 3 dmac: direct memory access controller scif: serial communication interface with fifo rcan-et: controller area network ssi: serial sound interface tmr: 8-bit timer icr0: icr1: icr2: irqrr: pinter: pirr: ibcr: ibnr: ipr01, ipr02, ipr05 to ipr16: interrupt control register 0 interrupt control register 1 interrupt control register 2 irq interrupt request register pint interrupt enable register pint interrupt request register bank control register bank number register interrupt priority registers 01, 02, 05 to 16 sr cpu i3 i2 i1 i0 (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) pinter ibcr ipr01, ipr02, ipr05 to ipr16 [legend] icr0 icr2 pirr ibnr icr1 irqrr pint7 to pint0 irq7 to irq0 nmi ipr input control intc priority identifier com- parator interrupt request module bus bus interface peripheral bus figure 6.1 block diagram of intc
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 117 of 1164 rej09b0321-0200 6.2 input/output pins table 6.1 shows the pin configuration of the intc. table 6.1 pin configuration pin name symbol i/o function nonmaskable interrupt input pin nmi input input of nonmaskable interrupt request signal irq7 to irq0 input interrupt request input pins pint7 to pint0 input input of maskable interrupt request signals 6.3 register descriptions the intc has the following regist ers. these registers are used to set the interrupt priorities and control detection of the external interrupt input signal. table 6.2 register configuration register name abbreviation r/w initial value address access size interrupt control register 0 icr0 r/w * 1 h'fffd9400 16, 32 interrupt control register 1 icr1 r/w h'0000 h'fffd9402 16 interrupt control register 2 icr2 r/w h'0000 h'fffd9404 16, 32 irq interrupt request register irqrr r/(w) * 2 h'0000 h'fffd9406 16 pint interrupt enable register pinter r/ w h'0000 h'fffd9408 16, 32 pint interrupt request regi ster pirr r h'0000 h'fffd940a 16 bank control register ib cr r/w h'0000 h'fffd940c 16, 32 bank number register ibnr r/w h'0000 h'fffd940e 16 interrupt priority register 01 ipr01 r/w h'0000 h'fffd9418 16, 32 interrupt priority register 02 ipr02 r/w h'0000 h'fffd941a 16 interrupt priority register 05 ipr05 r/w h'0000 h'fffd9420 16 interrupt priority register 06 ipr06 r/w h'0000 h'fffd9800 16, 32 interrupt priority register 07 ipr07 r/w h'0000 h'fffd9802 16
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 118 of 1164 rej09b0321-0200 register name abbreviation r/w initial value address access size interrupt priority register 08 ipr08 r/w h'0000 h'fffd9804 16, 32 interrupt priority register 09 ipr09 r/w h'0000 h'fffd9806 16 interrupt priority register 10 ipr10 r/w h'0000 h'fffd9808 16, 32 interrupt priority register 11 ipr11 r/w h'0000 h'fffd980a 16 interrupt priority register 12 ipr12 r/w h'0000 h'fffd980c 16, 32 interrupt priority register 13 ipr13 r/w h'0000 h'fffd980e 16 interrupt priority register 14 ipr14 r/w h'0000 h'fffd9810 16, 32 interrupt priority register 15 ipr15 r/w h'0000 h'fffd9812 16 interrupt priority register 16 ipr16 r/w h'0000 h'fffd9814 16 dma transfer request enable register 0 dreqer0 r/w h'00 h'ffff1600 8, 16, 32 dma transfer request enable register 1 dreqer1 r/w h'00 h'ffff1601 8 dma transfer request enable register 2 dreqer2 r/w h'00 h'ffff1602 8, 16 dma transfer request enable register 3 dreqer3 r/w h'00 h'ffff1603 8 notes: 1. when the nmi pin is high, bec omes h'8000; when lo w, becomes h'0000. 2. only 0 can be written after reading 1, to clear the flag.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 119 of 1164 rej09b0321-0200 6.3.1 interrupt priority registers 01, 02, 05 to 16 (i pr01, ipr02, ip r05 to ipr16) ipr01, ipr02, and ipr05 to ipr16 are 16-bit readable/writable registers in which priority levels from 0 to 15 are set for irq interrupts, pint interrupts, and on-chip peripheral module interrupts. table 6.3 shows the corres pondence between the interrupt request sources and the bits in ipr01, ipr02, and ipr05 to ipr16. bit: initial value: r/w: 1514131211109876543210 0 0 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0 0 0 0 0 0 table 6.3 interrupt request sources and ipr01, ipr02, and ipr05 to ipr16 register name bits 15 to 12 bits 11 to 8 bits 7 to 4 bits 3 to 0 interrupt priority register 01 irq0 irq1 irq2 irq3 interrupt priority register 02 irq4 irq5 irq6 irq7 interrupt priority register 05 pint0 to pint7 reserved adi reserved interrupt priority register 06 reserved mtu0 (tgi0a to tgi0d) mtu0 (tci0v, tgi0e, tgi0f) mtu1 (tgi1a, tgi1b) interrupt priority register 07 mtu1 (tci1v, tci1u) mtu2 (tgi2a, tgi2b) mtu2 (tci2v, tci2u) mtu3 (tgi3a to tgi3d) interrupt priority register 08 mtu3 (tgi3v) mtu4 (tgi4a to tgi4d) mtu4 (tgi4v) mtu5 (tgi5u, tgi5v, tgi5w) interrupt priority register 09 rtc wdt iic0 reserved interrupt priority register 10 iic1 iic2 dmac0 dmac1 interrupt priority register 11 dmac2 dmac3 scif0 scif1 interrupt priority register 12 scif2 scif3 scif4 scif5
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 120 of 1164 rej09b0321-0200 register name bits 15 to 12 bits 11 to 8 bits 7 to 4 bits 3 to 0 interrupt priority register 13 scif6 scif7 dminta dmac4 interrupt priority register 14 dmac5 dmac6 dmac7 reserved interrupt priority register 15 reserved rcan-et0 rcan-et1 reserved interrupt priority register 16 ssi0 ssi1 tmr0 tmr1 as shown in table 6.3, by setting the 4-bit groups (bits 15 to 12, bits 11 to 8, bits 7 to 4, and bits 3 to 0) with values from h'0 (0000) to h'f (1111), the priority of each corresponding interrupt is set. setting of h'0 means priority level 0 (the lowest level) and h'f means priority level 15 (the highest level). ipr01, ipr02, and ipr05 to ipr16 are initialized to h'0000 by a power-on reset or in deep standby mode.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 121 of 1164 rej09b0321-0200 6.3.2 interrupt contro l register 0 (icr0) icr0 is a 16-bit register that sets the input signa l detection mode for the external interrupt input pin nmi, and indicates the input level at the nmi pin. icr0 is initialized by a power-on reset or in deep standby mode. bit: initial value: r/w: 1514131211109876543210 0 r 0 r 0 r 0 r 0 r ????? 0 r ? 0 r ? 0 r ? 0 r/w nmie 0 r ? 0 r ? 0 r ? 0 r ? 0 r ? 0 r ? * r nmil note: * 1 when the nmi pin is high, and 0 when the nmi pin is low. bit bit name initial value r/w description 15 nmil * r nmi input level sets the level of the signal input at the nmi pin. the nmi pin level can be obtained by reading this bit. this bit cannot be modified. 0: low level is input to nmi pin 1: high level is input to nmi pin 14 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 nmie 0 r/w nmi edge select selects whether the falling or rising edge of the interrupt request signal on the nmi pin is detected. 0: interrupt request is detected on falling edge of nmi input 1: interrupt request is detected on rising edge of nmi input 7 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 122 of 1164 rej09b0321-0200 6.3.3 interrupt contro l register 1 (icr1) icr1 is a 16-bit register that specifies the detection mode for external interrupt input pins irq7 to irq0 individually: low level, falling edge, rising edge, or both edges. icr1 is initialized by a power-on reset or in deep standby mode. bit: initial value: r/w: 1514131211109876543210 0 0 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0 0 0 0 0 0 irq7 1s irq7 0s irq6 1s irq6 0s irq5 1s irq5 0s irq4 1s irq4 0s irq3 1s irq3 0s irq2 1s irq2 0s irq1 1s irq1 0s irq0 1s irq0 0s bit bit name initial value r/w description 15 irq71s 0 r/w 14 irq70s 0 r/w 13 irq61s 0 r/w 12 irq60s 0 r/w 11 irq51s 0 r/w 10 irq50s 0 r/w 9 irq41s 0 r/w 8 irq40s 0 r/w 7 irq31s 0 r/w 6 irq30s 0 r/w 5 irq21s 0 r/w 4 irq20s 0 r/w 3 irq11s 0 r/w 2 irq10s 0 r/w 1 irq01s 0 r/w 0 irq00s 0 r/w irq sense select these bits select whether interrupt signals corresponding to pins irq7 to irq0 are detected by a low level, falling edge, rising edge, or both edges. 00: interrupt request is detected on low level of irqn input 01: interrupt request is detected on falling edge of irqn input 10: interrupt request is detected on rising edge of irqn input 11: interrupt request is detected on both edges of irqn input [legend] n = 7 to 0
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 123 of 1164 rej09b0321-0200 6.3.4 interrupt contro l register 2 (icr2) icr2 is a 16-bit register that specifies the detection mode for external interrupt input pins pint7 to pint0 individually: low level or high level. icr2 is initialized by a power-on reset or in deep standby mode. bit: initial value: r/w: 1514131211109876543210 0 0 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w 0 0 0 0 0 0 rrrrrrrr ???????? pint 7s pint 6s pint 5s pint 4s pint 3s pint 2s pint 1s pint 0s bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 pint7s 0 r/w 6 pint6s 0 r/w 5 pint5s 0 r/w 4 pint4s 0 r/w 3 pint3s 0 r/w 2 pint2s 0 r/w 1 pint1s 0 r/w 0 pint0s 0 r/w pint sense select these bits select whether interrupt signals corresponding to pins pint7 to pint0 are detected by a low level or high level. 0: interrupt request is detected on low level of pintn input 1: interrupt request is det ected on high level of pintn input [legend] n = 7 to 0 6.3.5 irq interrupt re quest register (irqrr) irqrr is a 16-bit register that indicates interrupt requests from external input pins irq7 to irq0. if edge detection is set for the irq7 to irq0 inte rrupts, writing 0 to the irq7f to irq0f bits after reading irq7f to irq0f = 1 can cels the retained interrupts. irqrr is initialized by a power-on reset or in deep standby mode.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 124 of 1164 rej09b0321-0200 bit: initial value: r/w: 151413121110987654321 0 00000000 r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: only 0 can be written to clear the flag after 1 is read. * 00000000 rrrrrrrr ???????? irq7f irq6f irq5f irq4f irq3f irq2f irq1f irq0f bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 irq7f 0 r/(w) * 6 irq6f 0 r/(w) * 5 irq5f 0 r/(w) * 4 irq4f 0 r/(w) * 3 irq3f 0 r/(w) * 2 irq2f 0 r/(w) * 1 irq1f 0 r/(w) * 0 irq0f 0 r/(w) * irq interrupt request these bits indicate the status of the irq7 to irq0 interrupt requests. level detection: 0: irqn interrupt request has not occurred [clearing condition] ? irqn input is high 1: irqn interrupt has occurred [setting condition] ? irqn input is low edge detection: 0: irqn interrupt request is not detected [clearing conditions] ? cleared by reading irqnf while irqnf = 1, then writing 0 to irqnf ? cleared by executing irqn interrupt exception handling 1: irqn interrupt request is detected [setting condition] ? edge corresponding to irqn1s or irqn0s of icr1 has occurred at irqn pin [legend] n = 7 to 0
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 125 of 1164 rej09b0321-0200 6.3.6 pint interrupt enable register (pinter) pinter is a 16-bit register that enables interrupt request inputs to external interrupt input pins pint7 to pint0. pinter is initialized by a power-on reset or in deep standby mode. 0 1 2 3 4 5 6 7 ? ? ? ? ? ? ? ? 000 0 0 0 0 0 000 0 0 0 0 0 r r r r r r r r bit: initial value: r/w: 15 14 13 12 11 10 9 8 r/w r/w r/w r/w r/w r/w r/w r/w pint 7e pint 6e pint 5e pint 4e pint 3e pint 2e pint 1e pint 0e bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 pint7e 0 r/w 6 pint6e 0 r/w 5 pint5e 0 r/w 4 pint4e 0 r/w 3 pint3e 0 r/w 2 pint2e 0 r/w 1 pint1e 0 r/w 0 pint0e 0 r/w pint enable these bits select whether to enable interrupt request inputs to external interrupt input pins pint7 to pint0. 0: pintn input interrupt request is disabled 1: pintn input interrupt request is enabled [legend] n = 7 to 0
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 126 of 1164 rej09b0321-0200 6.3.7 pint interrupt request register (pirr) pirr is a 16-bit register that indicates interrupt requests from external input pins pint7 to pint0. pirr is initialized by a power-on reset or in deep standby mode. 0 1 2 3 4 5 6 7 ? ? ? ? ? ? ? ? 000 0 0 0 0 0 000 0 0 0 0 0 r r r r r r r r r r r r r r r r bit: initial value: r/w: 15 14 13 12 11 10 9 8 pint 7r pint 6r pint 5r pint 4r pint 3r pint 2r pint 1r pint 0r bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 pint7r 0 r 6 pint6r 0 r 5 pint5r 0 r 4 pint4r 0 r 3 pint3r 0 r 2 pint2r 0 r 1 pint1r 0 r 0 pint0r 0 r pint interrupt request these bits indicate the stat us of the pint7 to pint0 interrupt requests. 0: no interrupt request at pintn pin 1: interrupt request at pintn pin [legend] n = 7 to 0
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 127 of 1164 rej09b0321-0200 6.3.8 bank control register (ibcr) ibcr is a 16-bit register that enables or disables use of register banks for each interrupt priority level. ibcr is initialized to h'0000 by a power-on reset or in deep standby mode. bit: initial value: r/w: 1514131211109876543210 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r e15 e14 e13 e12 e11 e10 e9 e8 e7 e6 e5 e4 e3 e2 e1 ? bit bit name initial value r/w description 15 e15 0 r/w 14 e14 0 r/w 13 e13 0 r/w 12 e12 0 r/w 11 e11 0 r/w 10 e10 0 r/w 9 e9 0 r/w 8 e8 0 r/w 7 e7 0 r/w 6 e6 0 r/w 5 e5 0 r/w 4 e4 0 r/w 3 e3 0 r/w 2 e2 0 r/w 1 e1 0 r/w enable these bits enable or disable use of register banks for interrupt priority levels 15 to 1. however, use of register banks is always disabled for the user break interrupts. 0: use of register banks is disabled 1: use of register banks is enabled 0 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 128 of 1164 rej09b0321-0200 6.3.9 bank number register (ibnr) ibnr is a 16-bit register that enables or disables use of register banks and register bank overflow exception. ibnr also indicates th e bank number to which saving is performed next through the bits bn3 to bn0. ibnr is initialized to h'0000 by a power-on reset or in deep standby mode. bit: initial value: r/w: 1514131211109876543210 0 r 0 r 0 r bn[3:0] * 0 r 0 r ? 0 r ? 0 r ? 0 r ? 0 r ? 0 r ? 0 r ? 0 r ? 0 r ? 0 r/w bove be[1:0] 0 r/w 0 r/w bit bit name initial value r/w description 15, 14 be[1:0] 00 r/w r egister bank enable these bits enable or disable use of register banks. 00: use of register banks is disabled for all interrupts. the setting of ibcr is ignored. 01: use of register banks is enabled for all interrupts except nmi and user break. the setting of ibcr is ignored. 10: reserved (setting prohibited) 11: use of register banks is controlled by the setting of ibcr. 13 bove 0 r/w register bank overflow enable enables of disables register bank overflow exception. 0: generation of register b ank overflow exception is disabled 1: generation of register b ank overflow exception is enabled 12 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 129 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3 to 0 bn[3:0] * 0000 r bank number these bits indicate the bank number to which saving is performed next. when an interrupt using register banks is accepted, saving is performed to the register bank indicated by these bits, and bn is incremented by 1. after bn is decremented by 1 due to execution of a resbank (restore from register bank) instruction, restoration from the regi ster bank is performed. note: * bits bn[3:0] are initialized at a manual reset. 6.3.10 dma transfer request enable register 0 (dreqer0) dma transfer request enable register 0 (dreqer0 ) is an 8-bit readable/w ritable register that enables/disables the iic3 dma transfer requests, and enables/disables cpu interrupt requests. dma transfer request enable register 0 is initialized by a power-on reset or in deep standby mode. 0 1 2 3 4 5 6 7 000 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w reserved iic3 2ch tx iic3 2ch rx iic3 1ch tx iic3 1ch rx iic3 0ch tx iic3 0ch rx bit: initial value: r/w: bit bit name initial value r/w description 7 reserved 0 r/w 6 reserved 0 r/w 5 iic3 2ch tx 0 r/w 4 iic3 2ch rx 0 r/w 3 iic3 1ch tx 0 r/w 2 iic3 1ch rx 0 r/w 1 iic3 0ch tx 0 r/w 0 iic3 0ch rx 0 r/w dma transfer request enable bits these bits enable/disable dma transfer requests, and enable/disable cpu interrupt requests. 0: dma transfer request disabled, cpu interrupt request enabled 1: dma transfer request enabled, cpu interrupt request disabled
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 130 of 1164 rej09b0321-0200 6.3.11 dma transfer request enable register 1 (dreqer1) dma transfer request enable register 1 (dreqer1 ) is an 8-bit readable/w ritable register that enables/disables the scif (channels 0 to 3) dm a transfer requests, and enables/disables cpu interrupt requests. dma transfer request enable register 1 is initialized by a power-on reset or in deep standby mode. 0 1 2 3 4 5 6 7 000 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w scif 3ch tx scif 3ch rx scif 2ch tx scif 2ch rx scif 1ch tx scif 1ch rx scif 0ch tx scif 0ch rx bit: initial value: r/w: bit bit name initial value r/w description 7 scif 3ch tx 0 r/w 6 scif 3ch rx 0 r/w 5 scif 2ch tx 0 r/w 4 scif 2ch rx 0 r/w 3 scif 1ch tx 0 r/w 2 scif 1ch rx 0 r/w 1 scif 0ch tx 0 r/w 0 scif 0ch rx 0 r/w dma transfer request enable bits these bits enable/disable dma transfer requests, and enable/disable cpu interrupt requests. 0: dma transfer request disabled, cpu interrupt request enabled 1: dma transfer request enabled, cpu interrupt request disabled
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 131 of 1164 rej09b0321-0200 6.3.12 dma transfer request enable register 2 (dreqer2) dma transfer request enable register 2 (dreqer2 ) is an 8-bit readable/w ritable register that enables/disables the scif (channels 4 to 7) dm a transfer requests, and enables/disables cpu interrupt requests. dma transfer request enable register 2 is initialized by a power-on reset or in deep standby mode. 0 1 2 3 4 5 6 7 000 0 0 0 0 0 r/w r/w scif 7ch tx scif 7ch rx scif 6ch tx scif 6ch rx scif 5ch tx scif 5ch rx scif 4ch tx scif 4ch rx r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit bit name initial value r/w description 7 scif 7ch tx 0 r/w 6 scif 7ch rx 0 r/w 5 scif 6ch tx 0 r/w 4 scif 6ch rx 0 r/w 3 scif 5ch tx 0 r/w 2 scif 5ch rx 0 r/w 1 scif 4ch tx 0 r/w 0 scif 4ch rx 0 r/w dma transfer request enable bits these bits enable/disable dma transfer requests, and enable/disable cpu interrupt requests. 0: dma transfer request disabled, cpu interrupt request enabled 1: dma transfer request enabled, cpu interrupt request disabled
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 132 of 1164 rej09b0321-0200 6.3.13 dma transfer request enable register 3 (dreqer3) dma transfer request enable register 3 (dreqer3 ) is an 8-bit readable/w ritable register that enables/disables the adc, mtu2 (channels 0 to 4), and rcan-et (channels 0 and 1) dma transfer requests, and enables/di sables cpu interrupt requests. dma transfer request enable register 3 is initialized by a power-on reset or in deep standby mode. 0 1 2 3 4 5 6 7 000 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w adc mtu2 4ch mtu2 3ch mtu2 2ch mtu2 1ch mtu2 0ch rcan-et 1ch rcan-et 0ch bit: initial value: r/w: bit bit name initial value r/w description 7 adc 0 r/w 6 mtu2 4ch 0 r/w 5 mtu2 3ch 0 r/w 4 mtu2 2ch 0 r/w 3 mtu2 1ch 0 r/w 2 mtu2 0ch 0 r/w 1 rcan-et 1ch 0 r/w 0 rcan-et 0ch 0 r/w dma transfer request enable bits these bits enable/disable dma transfer requests, and enable/disable cpu interrupt requests. 0: dma transfer request disabled, cpu interrupt request enabled 1: dma transfer request enabled, cpu interrupt request disabled
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 133 of 1164 rej09b0321-0200 6.4 interrupt sources there are six types of interrupt sources: nmi, user break, h-udi, irq, pint, and on-chip peripheral modules. each interrupt has a priority level (0 to 16), with 0 the lowest and 16 the highest. when set to level 0, that interrupt is masked at all times. 6.4.1 nmi interrupt the nmi interrupt has a pr iority level of 16 and is accepted at all times. nmi interrupt requests are edge-detected, and the nmi edge select bit (nmie) in interrupt control register 0 (icr0) selects whether the rising edge or falling edge is detected. though the priority level of the nmi interrupt is 16, the nmi interrupt exception handling sets the interrupt mask level bits (i3 to i0) in the status register (sr) to level 15. 6.4.2 user break interrupt a user break interrupt which occurs when a break condition set in the user break controller (ubc) matches has a priority level of 15. the user break exception handling sets the i3 to i0 bits in sr to level 15. for user break interrupts, see section 7, user break controller (ubc). 6.4.3 h-udi interrupt the user debugging interface (h-udi) interrupt has a priority level of 15, and occurs at serial input of an h-udi interrupt instruction. h-udi interrupt requests are edge-detected and retained until they are accepted. the h-udi exception handling se ts the i3 to i0 bits in sr to level 15. for h-udi interrupts, see section 26, user debugging interface (h-udi).
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 134 of 1164 rej09b0321-0200 6.4.4 irq interrupts irq interrupts are input from pins irq7 to irq0. as regard to the setting method of pins irq7 to irq0, see section 23, pin function controller (pfc ). for the irq interrupts, low-level, falling- edge, rising-edge, or both-edge detection can be selected individually for each pin by the irq sense select bits (irq71s to irq01s and irq70s to irq00s) in interrupt control register 1 (icr1). the priority level can be set individually in a range from 0 to 15 for each pin by interrupt priority registers 01 and 02 (ipr01 and ipr02). when using low-level sensing for irq interrupts, an interrupt request signal is sent to the intc while the irq7 to irq0 pins are low. an interrupt request signal is stopped being sent to the intc when the irq7 to irq0 pins are driven high. the status of the interrupt requests can be checked by reading the irq interrupt request bits (irq7f to irq0f) in the irq interrupt request register (irqrr). when using edge-sensing for irq interrupts, an interrupt request is detected due to change of the irq7 to irq0 pin states, and an interrupt request signal is sent to the intc. the result of irq interrupt request detection is retained until th at interrupt request is accepted. whether irq interrupt requests have been detected or not can be checked by reading the irq7f to irq0f bits in irqrr. writing 0 to these bits after reading them as 1 clears the result of irq interrupt request detection. the irq interrupt exception handling sets the i3 to i0 bits in sr to the priority level of the accepted irq interrupt. when restoring from the service routine of irq interrupt exception handling, execute the rte instruction after an interrupt request has been cleared in the irq inte rrupt request register (irqrr).
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 135 of 1164 rej09b0321-0200 6.4.5 pint interrupts pint interrupts are input from pins pint7 to pint0. as regard to the setting method of pins pint7 to pint0, see section 23, pin function cont roller (pfc). input of the interrupt requests is enabled by the pint enable bits (pint7e to pi nt0e) in the pint interrupt enable register (pinter). for the pint7 to pint0 interrupts, low-level or high-level detection can be selected individually for each pin by the pint sense select bits (pint7s to pint0s) in interrupt control register 2 (icr2). a single priority level in a range from 0 to 15 can be set for all pint7 to pint0 interrupts by bits 15 to 12 in interrupt priority register 05 (ipr05). when using low-level sensing for the pint7 to pint0 interrupts, an interrupt request signal is sent to the intc while the pint7 to pint0 pins are low. an interrupt request signal is stopped being sent to the intc when the pint7 to pint0 pins are driven high. the status of the interrupt requests can be checked by reading the pint in terrupt request bits (pint7r to pint0r) in the pint interrupt request register (pirr). the above description also applies to when using high- level sensing, except for the polarity being reversed. the pint interrupt exception handling sets the i3 to i0 bits in sr to the priority level of the pint interrupt. when restoring from the service routine of pint interrupt exception handling, execute the rte instruction after an interrupt request has been cleared in the pint interrupt request register (pirr). 6.4.6 on-chip peripheral module interrupts on-chip peripheral module interrupts are generated by the following on-chip peripheral modules: ? a/d converter (adc) ? multi-function timer pulse unit 2 (mtu2) ? realtime clock (rtc) ? watchdog timer (wdt) ? i 2 c bus interface 3 (iic3) ? direct memory access controller (dmac) ? serial communication inte rface with fifo (scif) ? controller area network (rcan-et) ? serial sound interface (ssi) ? 8-bit timer (tmr)
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 136 of 1164 rej09b0321-0200 as every source is assigned a different interrupt v ector, the source does not n eed to be identified in the exception service routine. a priority level in a range from 0 to 15 can be set for each module by interrupt priority registers 05 to 16 (ipr05 to ipr16). the on-chip peripheral module interrupt exception handling sets the i3 to i0 bits in sr to the priority level of the accepted on-chip peripheral module interrupt. 6.5 interrupt exception handling vector table and priority table 6.4 lists interrupt sources and their vector numbers, vector table address offsets, and interrupt priorities. each interrupt source is allocated a different vector number and vect or table address offset. vector table addresses are calculated from the vector numbers and vector table address offsets. in interrupt exception handling, the exception service routine start address is fetched from the vector table indicated by the vector tabl e address. for details of calculat ion of the vector table address, see table 5.4, calculating exception handling vector table addresses, in section 5, exception handling. the priorities of irq interrupts, pint interrupts, and on-chip peripheral module interrupts can be set freely between 0 and 15 for each pin or module by setting interrupt prio rity registers 01, 02, and 05 to 16 (ipr01, ipr02, and ipr05 to ipr16). however, if two or more interrupts specified by the same ipr among ipr05 to ipr16 occur, the priorities are defined as shown in the ipr setting unit internal priority of table 6.4, and the priorities cannot be changed. a power-on reset assigns priority level 0 to irq interrupts, pint interrupts, and on-chip peripheral module interrupts. if the same priority level is assigned to two or more interrupt sources and interrupts from those sources occur simultaneou sly, they are processed by the default priorities indicated in table 6.4.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 137 of 1164 rej09b0321-0200 table 6.4 interrupt exception ha ndling vectors and priorities interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority nmi 11 h'0000002c to h'0000002f 16 ? ? high user break 12 h'00000030 to h'00000033 15 ? ? h-udi 14 h'00000038 to h'0000003b 15 ? ? irq irq0 64 h'00000100 to h'00000103 0 to 15 (0) ipr01 (15 to 12) ? irq1 65 h'00000104 to h'00000107 0 to 15 (0) ipr01 (11 to 8) ? irq2 66 h'00000108 to h'0000010b 0 to 15 (0) ipr01 (7 to 4) ? irq3 67 h'0000010c to h'0000010f 0 to 15 (0) ipr01 (3 to 0) ? irq4 68 h'00000110 to h'00000113 0 to 15 (0) ipr02 (15 to 12) ? irq5 69 h'00000114 to h'00000117 0 to 15 (0) ipr02 (11 to 8) ? irq6 70 h'00000118 to h'0000011b 0 to 15 (0) ipr02 (7 to 4) ? irq7 71 h'0000011c to h'0000011f 0 to 15 (0) ipr02 (3 to 0) ? low
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 138 of 1164 rej09b0321-0200 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority pint pint0 80 h'00000140 to h'00000143 0 to 15 (0) ipr05 (15 to 12) 1 high pint1 81 h'00000144 to h'00000147 2 pint2 82 h'00000148 to h'0000014b 3 pint3 83 h'0000014c to h'0000014f 4 pint4 84 h'00000150 to h'00000153 5 pint5 85 h'00000154 to h'00000157 6 pint6 86 h'00000158 to h'0000015b 7 pint7 87 h'0000015c to h'0000015f 8 adc adi 92 h'00000170 to h'00000173 0 to 15 (0) ipr05 (7 to 4) ? low
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 139 of 1164 rej09b0321-0200 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority mtu2 mtu0 tgi0a 108 h'000001b0 to h'000001b3 0 to 15 (0) ipr06 (11 to 8) 1 high tgi0b 109 h'000001b4 to h'000001b7 2 tgi0c 110 h'000001b8 to h'000001bb 3 tgi0d 111 h'000001bc to h'000001bf 4 tci0v 112 h'000001c0 to h'000001c3 0 to 15 (0) ipr06 (7 to 4) 1 tci0e 113 h'000001c4 to h'000001c7 2 tci0f 114 h'000001c8 to h'000001cb 3 mtu1 tgi1a 116 h'000001d0 to h'000001d3 0 to 15 (0) ipr06 (3 to 0) 1 tgi1b 117 h'000001d4 to h'000001d7 2 tci1v 120 h'000001e0 to h'000001e3 0 to 15 (0) ipr07 (15 to 12) 1 tci1u 121 h'000001e4 to h'000001e7 2 mtu2 tgi2a 124 h'000001f0 to h'000001f3 0 to 15 (0) ipr07 (11 to 8) 1 tgi2b 125 h'000001f4 to h'000001f7 2 tci2v 128 h'00000200 to h'00000203 0 to 15 (0) ipr07 (7 to 4) 1 tci2u 129 h'00000204 to h'00000207 2 low
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 140 of 1164 rej09b0321-0200 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority mtu2 mtu3 tgi3a 132 h'00000210 to h'00000213 0 to 15 (0) ipr07 (3 to 0) 1 high tgi3b 133 h'00000214 to h'00000217 2 tgi3c 134 h'00000218 to h'0000021b 3 tgi3d 135 h'0000021c to h'0000021f 4 tci3v 136 h'00000220 to h'00000223 0 to 15 (0) ipr08 (15 to 12) ? mtu4 tgi4a 140 h'00000230 to h'00000233 0 to 15 (0) ipr08 (11 to 8) 1 tgi4b 141 h'00000234 to h'00000237 2 tgi4c 142 h'00000238 to h'0000023b 3 tgi4d 143 h'0000023c to h'0000023f 4 tci4v 144 h'00000240 to h'00000243 0 to 15 (0) ipr08 (7 to 4) ? mtu5 tgi5u 148 h'00000250 to h'00000253 0 to 15 (0) ipr08 (3 to 0) 1 tgi5v 149 h'00000254 to h'00000257 2 tgi5w 150 h'00000258 to h'0000025b 3 rtc arm 152 h'00000260 to h'00000263 0 to 15 (0) ipr09 (15 to 12) 1 prd 153 h'00000264 to h'00000267 2 cup 154 h'00000268 to h'0000026b 3 low
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 141 of 1164 rej09b0321-0200 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority wdt iti 156 h'00000270 to h'00000273 0 to 15 (0) ipr09 (11 to 8) ? high iic3 iic0 stpi0 157 h'00000274 to h'00000277 0 to 15 (0) ipr09 (7 to 4) 1 naki0 158 h'00000278 to h'0000027b 2 rxi0 159 h'0000027c to h'0000027f 3 txi0 160 h'00000280 to h'00000283 4 tei0 161 h'00000284 to h'00000287 5 iic1 stpi1 164 h'00000290 to h'00000293 0 to 15 (0) ipr10 (15 to 12) 1 naki1 165 h'00000294 to h'00000297 2 rxi1 166 h'00000298 to h'0000029b 3 txi1 167 h'0000029c to h'0000029f 4 tei1 168 h'000002a0 to h'000002a3 5 iic2 stpi2 170 h'000002a8 to h'000002ab 0 to 15 (0) ipr10 (11 to 8) 1 naki2 171 h'000002ac to h'000002af 2 rxi2 172 h'000002b0 to h'000002b3 3 txi2 173 h'000002b4 to h'000002b7 4 tei2 174 h'000002b8 to h'000002bb 5 low
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 142 of 1164 rej09b0321-0200 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority dmac dmac0 dmint0 176 h'000002c0 to h'000002c3 0 to 15 (0) ipr10 (7 to 4) ? high dmac1 dmint1 177 h'000002c4 to h'000002c7 0 to 15 (0) ipr10 (3 to 0) ? dmac2 dmint2 178 h'000002c8 to h'000002cb 0 to 15 (0) ipr11 (15 to 12) ? dmac3 dmint3 179 h'000002cc to h'000002cf 0 to 15 (0) ipr11 (11 to 8) ? scif scif0 bri0 180 h'000002d0 to h'000002d3 0 to 15 (0) ipr11 (7 to 4) 1 eri0 181 h'000002d4 to h'000002d7 2 rxi0 182 h'000002d8 to h'000002db 3 txi0 183 h'000002dc to h'000002df 4 scif1 bri1 184 h'000002e0 to h'000002e3 0 to 15 (0) ipr11 (3 to 0) 1 eri1 185 h'000002e4 to h'000002e7 2 rxi1 186 h'000002e8 to h'000002eb 3 txi1 187 h'000002ec to h'000002ef 4 scif2 bri2 188 h'000002f0 to h'000002f3 0 to 15 (0) ipr12 (15 to 12) 1 eri2 189 h'000002f4 to h'000002f7 2 rxi2 190 h'000002f8 to h'000002fb 3 txi2 191 h'000002fc to h'000002ff 4 low
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 143 of 1164 rej09b0321-0200 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority scif scif3 bri3 192 h'00000300 to h'00000303 0 to 15 (0) ipr12 (11 to 8) 1 high eri3 193 h'00000304 to h'00000307 2 rxi3 194 h'00000308 to h'0000030b 3 txi3 195 h'0000030c to h'0000030f 4 scif4 bri4 196 h'00000310 to h'00000313 0 to 15 (0) ipr12 (7 to 4) 1 eri4 197 h'00000314 to h'00000317 2 rxi4 198 h'00000318 to h'0000031b 3 txi4 199 h'0000031c to h'0000031f 4 scif5 bri5 200 h'00000320 to h'00000323 0 to 15 (0) ipr12 (3 to 0) 1 eri5 201 h'00000324 to h'00000327 2 rxi5 202 h'00000328 to h'0000032b 3 txi5 203 h'0000032c to h'0000032f 4 scif6 bri6 204 h'00000330 to h'00000333 0 to 15 (0) ipr13 (15 to 12) 1 eri6 205 h'00000334 to h'00000337 2 rxi6 206 h'00000338 to h'0000033b 3 txi6 207 h'0000033c to h'0000033f 4 low
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 144 of 1164 rej09b0321-0200 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority scif scif7 bri7 208 h'00000340 to h'00000343 0 to 15 (0) ipr13 (11 to 8) 1 high eri7 209 h'00000344 to h'00000347 2 rxi7 210 h'00000348 to h'0000034b 3 txi7 211 h'0000034c to h'0000034f 4 dmac dminta 212 h'00000350 to h'00000353 0 to 15 (0) ipr13 (7 to 4) ? dmac4 dmint4 216 h'00000360 to h'00000363 0 to 15 (0) ipr13 (3 to 0) ? dmac5 dmint5 217 h'00000364 to h'00000367 0 to 15 (0) ipr14 (15 to 12) ? dmac6 dmint6 218 h'00000368 to h'0000036b 0 to 15 (0) ipr14 (11 to 8) ? dmac7 dmint7 219 h'0000036c to h'0000036f 0 to 15 (0) ipr14 (7 to 4) ? rcan- et rcan- et0 ers 228 h'00000390 to h'00000393 0 to 15 (0) ipr15 (11 to 8) 1 ovr 229 h'00000394 to h'00000397 2 sle 230 h'00000398 to h'0000039b 3 rm0 231 h'0000039c to h'0000039f 4 rm1 232 h'000003a0 to h'000003a3 5 low
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 145 of 1164 rej09b0321-0200 interrupt vector interrupt source number vector vector table address offset interrupt priority (initial value) corresponding ipr (bit) ipr setting unit internal priority default priority rcan- et rcan- et1 ers 234 h'000003a8 to h'000003ab 0 to 15 (0) ipr15 (7 to 4) 1 high ovr 235 h'000003ac to h'000003af 2 sle 236 h'000003b0 to h'000003b3 3 rm0 237 h'000003b4 to h'000003b7 4 rm1 238 h'000003b8 to h'000003bb 5 ssi ssi0 244 h'000003d0 to h'000003d3 0 to 15 (0) ipr16 (15 to 12) ? ssi1 245 h'000003d4 to h'000003d7 0 to 15 (0) ipr16 (11 to 8) ? tmr tmr0 cmia0 246 h'000003d8 to h'000003db 0 to 15 (0) ipr16 (7 to 4) 1 cmib0 247 h'000003dc to h'000003df 2 ovi0 248 h'000003e0 to h'000003e3 3 tmr1 cmia1 252 h'000003f0 to h'000003f3 0 to 15 (0) ipr16 (3 to 0) 1 cmib1 253 h'000003f4 to h'000003f7 2 ovi1 254 h'000003f8 to h'000003fb 3 low
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 146 of 1164 rej09b0321-0200 6.6 operation 6.6.1 interrupt op eration sequence the sequence of interrupt operations is described below. figure 6.2 shows the operation flow. 1. the interrupt request sources send interrupt request signals to the interrupt controller. 2. the interrupt controller selects the highest-prio rity interrupt from the interrupt requests sent, following the priority levels set in interrupt pr iority registers 01, 02, and 05 to 16 (ipr01, ipr02, and ipr05 to ipr16). lowe r priority interrupts are ignored * . if two of these interrupts have the same priority level or if multiple interrupts occur within a single ipr, the interrupt with the highest priority is selected, according to the default priority and ipr setting unit internal priority shown in table 6.4. 3. the priority level of the interrupt selected by the interrupt controller is compared with the interrupt level mask bits (i3 to i0) in the stat us register (sr) of the cpu. if the interrupt request priority level is equal to or less than the le vel set in bits i3 to i0, the interrupt request is ignored. if the interrupt request priority level is higher than the level in bits i3 to i0, the interrupt controller accepts the interrupt and send s an interrupt request signal to the cpu. 4. the cpu detects the interrupt request sent fro m the interrupt controller when the cpu decodes the instruction to be executed. instead of executing the decode d instruction, the cpu starts interrupt exception handling (figure 6.4). 5. the start address of the interrupt exception service routine is fetc hed from the exception handling vector tabl e corresponding to th e accepted interrupt. 6. the status register (sr) is saved onto the stac k, and the priority level of the accepted interrupt is copied to bits i3 to i0 in sr. 7. the program counter (pc) is saved onto the stack. 8. the cpu jumps to the fetched start address of the interrupt exception service routine and starts executing the program. the jump that occurs is not a delayed branch. notes: the interrupt sour ce flag should be cleared in the in terrupt handler. after clearing the interrupt source flag, "time from occurrence of interrupt request until interrupt controller identifies priority, compares it with mask bits in sr, and sends interrupt request signal to cpu" shown in table 6.5 is required before the interrupt source sent to the cpu is actually cancelled. to ensure that an interrupt requ est that should have been cleared is not inadvertently accepted again, read the interrup t source flag after it has been cleared, and then execute an rte instruction. * interrupt requests that are designated as edge-sensing are held pending until the interrupt requests are accepted. irq interrupt s, however, can be cancelled by accessing the irq interrupt request register (irqrr). for details, see section 6.4.4, irq interrupts. interrupts held pending due to edge-sensing are cleared by a power-on reset or in deep standby mode.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 147 of 1164 rej09b0321-0200 no no no no yes yes yes yes yes yes no yes no yes yes no no no no program execution state interrupt? nmi? user break? i3 to i0 level 14? level 14 interrupt? level 1 interrupt? i3 to i0 level 13? i3 to i0 = level 0? h-udi interrupt? level 15 interrupt? save sr to stack save pc to stack copy accept-interrupt level to i3 to i0 read exception handling vector table branch to interrupt exception service routine figure 6.2 interru pt operation flow
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 148 of 1164 rej09b0321-0200 6.6.2 stack after interru pt exception handling figure 6.3 shows the stack after interrupt exception handling. address sp * 2 4n ? 8 pc * 1 sr 4n ? 4 4n 32 bits 32 bits notes: 1. pc: start address of the next instruction (return destination instruction) after the executed instruction 2. always make sure that sp is a multiple of 4. figure 6.3 stack after interrupt exception handling
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 149 of 1164 rej09b0321-0200 6.7 interrupt response time table 6.5 lists the interrupt response time, which is the time from the occurrence of an interrupt request until the interrupt exception handling starts and fetching of the first instruction in the interrupt exception service routine begins. the interrupt processing operations differ in the cases when banking is disabled, when banking is enabled without register bank overflow, and when banking is enabled with register bank overflow. figures 6.4 and 6.5 show examples of pipeline operation when banking is disabled. figures 6.6 and 6.7 show examples of pipeline operation when banking is enabled without register bank overflow. figures 6.8 and 6.9 show examples of pipeline operation when banking is enabled with register bank overflow. table 6.5 interrupt response time number of states item nmi user break h-udi irq, pint peripheral module remarks time from occurrence of interrupt request until interrupt controller identifies priority, compares it with mask bits in sr, and sends interrupt request signal to cpu 2 icyc + 2 bcyc + 1 pcyc 3 icyc 2 icyc + 1 pcyc 2 icyc + 3 bcyc + 1 pcyc 2 icyc + 1 bcyc + 1 pcyc min. 3 icyc + m1 + m2 no register banking max. 4 icyc + 2 (m1 + m2) + m3 min. is when the interrupt wait time is zero. max. is when a higher- priority interrupt request has occurred during interrupt exception handling. min. ? 3 icyc + m1 + m2 register banking without register bank overflow max. ? 12 icyc + m1 + m2 min. is when the interrupt wait time is zero. max. is when an interrupt request has occurred during execution of the resbank instruction. min. ? 3 icyc + m1 + m2 time from input of interrupt request signal to cpu until sequence currently being executed is completed, interrupt exception handling starts, and first instruction in interrupt exception service routine is fetched register banking with register bank overflow max. ? 3 icyc + m1 + m2 + 19 (m4) min. is when the interrupt wait time is zero. max. is when an interrupt request has occurred during execution of the resbank instruction.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 150 of 1164 rej09b0321-0200 number of states item nmi user break h-udi irq, pint peripheral module remarks min. 5 icyc + 2 bcyc + 1 pcyc + m1 + m2 6 icyc + m1 + m2 5 icyc + 1 pcyc + m1 + m2 5 icyc + 3 bcyc + 1 pcyc + m1 + m2 5 icyc + 1 bcyc + 1 pcyc + m1 + m2 120-mhz operation * 1 * 2 : 0.067 to 0.142 s no register banking max. 6 icyc + 2 bcyc + 1 pcyc + 2 (m1 + m2) + m3 7 icyc + 2 (m1 + m2) + m3 6 icyc + 1 pcyc + 2 (m1 + m2) + m3 6 icyc + 3 bcyc + 1 pcyc + 2 (m1 + m2) + m3 6 icyc + 1 bcyc + 1 pcyc + 2 (m1 + m2) + m3 120-mhz operation * 1 * 2 : 0.100 to 0.175 s min. ? ? 5 icyc + 1 pcyc + m1 + m2 5 icyc + 3 bcyc + 1 pcyc + m1 + m2 5 icyc + 1 bcyc + 1 pcyc + m1 + m2 120-mhz operation * 1 * 2 : 0.092 to 0.142 s register banking without register bank overflow max. ? ? 14 icyc + 1 pcyc + m1 + m2 14 icyc + 3 bcyc + 1 pcyc + m1 + m2 14 icyc + 1 bcyc + 1 pcyc + m1 + m2 120-mhz operation * 1 * 2 : 0.167 to 0.217 s min. ? ? 5 icyc + 1 pcyc + m1 + m2 5 icyc + 3 bcyc + 1 pcyc + m1 + m2 5 icyc + 1 bcyc + 1 pcyc + m1 + m2 120-mhz operation * 1 * 2 : 0.092 to 0.142 s interrupt response time register banking with register bank overflow max. ? ? 5 icyc + 1 pcyc + m1 + m2 + 19 (m4) 5 icyc + 3 bcyc + 1 pcyc + m1 + m2 + 19 (m4) 5 icyc + 1 bcyc + 1 pcyc + m1 + m2 + 19 (m4) 120-mhz operation * 1 * 2 : 0.245 to 0.300 s notes: m1 to m4 are the number of stat es needed for the following memory accesses. m1: vector address read (longword read) m2: sr save (longword write) m3: pc save (longword write) m4: banked registers (r0 to r14, gbr, mach, macl, and pr) are restored from the stack. 1. in the case of m1 = m2 = m3 = m4 = 1 icyc. 2. in the case of i :b :p = 120:60:30 [mhz].
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 151 of 1164 rej09b0321-0200 f 2 icyc + 3 bcyc + 1 pcyc 3 icyc m1 m2 m3 3 icyc + m1 + m2 irq instruction (instruction replacing interrupt exception handling) m1: m2: m3: f: d: e: m: first instruction in interrupt service routine interrupt acceptance deemm m fd e [legend] vector address read saving of sr (stack) saving of pc (stack) instruction fetch. instruction is fetched from memory in which program is stored. instruction decoding. fetched instruction is decoded. instruction execution. data operation or address calculation is performed in accordance with the result of decoding. memory access. memory data access is performed. figure 6.4 example of pipeline operati on when irq interrupt is accepted (no register banking) f 2 icyc + 3 bcyc + 1 pcyc 1 icyc + m1 + 2(m2) + m3 m1 m2 m3 3 icyc + m1 irq deemm m deemm m f d f d m1 m2 [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) interrupt acceptance multiple interrupt acceptance first instruction in interrupt service routine first instruction in multiple interrupt service routine figure 6.5 example of pipeline op eration for multiple interrupts (no register banking)
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 152 of 1164 rej09b0321-0200 f 2 icyc + 3 bcyc + 1 pcyc 3 icyc m1 m2 m3 3 icyc + m1 + m2 irq d e emmm e fd e [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) interrupt acceptance first instruction in interrupt service routine instruction (instruction replacing interrupt exception handling) figure 6.6 example of pipeline operati on when irq interrupt is accepted (register banking without register bank overflow) f 2 icyc + 3 bcyc + 1 pcyc 3 icyc + m1 + m2 m1 m2 m3 9 icyc irq resbank instruction deeeeeeee e deemmm e f d [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) interrupt acceptance first instruction in interrupt service routine instruction (instruction replacing interrupt exception handling) figure 6.7 example of pipeline operation when interrupt is accepted during resbank instruction execution (register banki ng without register bank overflow)
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 153 of 1164 rej09b0321-0200 f 2 icyc + 3 bcyc + 1 pcyc 3 icyc m1 m2 m3 3 icyc + m1 + m2 irq deem m m m f d [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) interrupt acceptance first instruction in interrupt service routine instruction (instruction replacing interrupt exception handling) ... ... ... figure 6.8 example of pipeline operati on when irq interrupt is accepted (register banking with register bank overflow) f 2 icyc + 3 bcyc + 1 pcyc 1 icyc + m1 + m2 + 2(m4) m1 m2 m3 2 icyc + 17(m4) irq resbank instruction d emmm mmm w deemm m f d m4 m4 [legend] m1: m2: m3: m4: vector address read saving of sr (stack) saving of pc (stack) restoration of banked registers interrupt acceptance first instruction in interrupt service routine instruction (instruction replacing interrupt exception handling) ... ... ... figure 6.9 example of pipeline operation when interrupt is accepted during resbank instruction execution (register banki ng with register bank overflow)
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 154 of 1164 rej09b0321-0200 6.8 register banks this lsi has fifteen register banks used to perform register saving and restoration required in the interrupt processing at high speed. figure 6.10 shows the register bank configuration. general registers bank control register bank number register bank control registers (interrupt controller) banked register vector table address offset note: interrupt generated (save) resbank instruction (restore) registers register banks bank 0 bank 1 .... bank 14 r0 r1 : : r14 r15 sr gbr vbr tbr mach macl pr pc control registers system registers r0 r1 : : r14 gbr ivo vto: ibcr ibnr mach macl pr : figure 6.10 overview of register bank configuration
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 155 of 1164 rej09b0321-0200 6.8.1 register banks and bank control registers (1) banked register the contents of the general registers (r0 to r1 4), global base register (gbr), multiply and accumulate registers (mach and macl), and pro cedure register (pr), and the vector table address offset (vto) are banked. (2) input/output of banks this lsi has fifteen register banks, bank 0 to bank 14. register banks are stacked in first-in last- out (filo) sequence. saving takes place in order, beginning from bank 0, and restoration takes place in the reverse order, beginning from the last bank saved to. 6.8.2 bank save and restore operations (1) saving to bank figure 6.11 shows register bank save operations. the following operations are performed when an interrupt for which usage of register banks is allowed is accepted by the cpu: (a) assume that the bank number bit value in the bank number register (ibnr), bn, is i before the interrupt is generated. (b) the contents of registers r0 to r14, gbr, mach, macl, and pr, and the interrupt vector table address offset (v to) of the accepted interrupt are save d in the bank indicated by bn, bank i. (c) the bn value is incremented by 1. bank 0 register banks registers bank 1 : : : : bank i bank i + 1 bank 14 +1 (a) (c) (b) bn gbr mach macl pr vto r0 to r14 figure 6.11 bank save operations
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 156 of 1164 rej09b0321-0200 figure 6.12 shows the timing for sa ving to a register bank. saving to a register bank takes place between the start of interrupt exception handling and the start of fetching the first instruction in the exception service routine. f 2 icyc + 3 bcyc + 1 pcyc 3 icyc m1 m2 m3 3 icyc + m1 + m2 irq (1) vto, pr, gbr, macl (2) r12, r13, r14, mach (3) r8, r9, r10, r11 (4) r4, r5, r6, r7 (5) r0, r1, r2, r3 overrun fetch saved to bank d e emmm e f fd e [legend] m1: m2: m3: vector address read saving of sr (stack) saving of pc (stack) first instruction in interrupt service routine instruction (instruction replacing interrupt exception handling) figure 6.12 bank save timing (2) restoration from bank the resbank (restore from register bank) instruction is used to restore data saved in a register bank. after restoring data from the register banks with the resbank instruction at the end of the interrupt service routine, execute the rte inst ruction to return from exception handling.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 157 of 1164 rej09b0321-0200 6.8.3 save and restore operations after saving to all banks if an interrupt occurs and usage of the register banks is enabled for the interrupt accepted by the cpu in a state where saving has been performed to all register banks, automatic saving to the stack is performed instead of register bank saving if the bove bit in the bank number register (ibnr) is cleared to 0. if the bove bit in ibnr is set to 1, register bank overflow exception occurs and data is not saved to the stack. save and restore operations when using the stack are as follows: (1) saving to stack 1. the status register (sr) and program counter (pc) are saved to the stack during interrupt exception handling. 2. the contents of the banked registers (r0 to r14, gbr, mach, macl, and pr) are saved to the stack. the registers are saved to the stack in the order of macl, mach, gbr, pr, r14, r13, ?, r1, and r0. 3. the register bank overflow bit (bo) in sr is set to 1. 4. the bank number bit (bn) value in the ba nk number register (ibnr) remains set to the maximum value of 15. (2) restoration from stack when the resbank (restore from register bank) instruction is executed with the register bank overflow bit (bo) in sr set to 1, the cpu operates as follows: 1. the contents of the banked registers (r0 to r14, gbr, mach, macl , and pr) are restored from the stack. the registers are restored from the stack in the order of r0, r1, ?, r13, r14, pr, gbr, mach, and macl. 2. the bank number bit (bn) value in the ba nk number register (ibnr) remains set to the maximum value of 15.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 158 of 1164 rej09b0321-0200 6.8.4 register bank exception there are two register bank exceptions (register bank errors): register bank overflow and register bank underflow. (1) register bank overflow this exception occurs if, after data has been saved to all of the register banks, an interrupt for which register bank use is allowed is accepted by the cpu, and the bove bit in the bank number register (ibnr) is set to 1. in this case, the bank number bit (bn) value in the bank number register (ibnr) remains set to the bank count of 15 and saving is not performed to the register bank. (2) register bank underflow this exception occurs if the resb ank (restore from register bank) instruction is executed when no data has been saved to the register banks. in this case, the values of r0 to r14, gbr, mach, macl, and pr do not change. in addition, the bank number bit (bn) value in the bank number register (ibnr) remains set to 0. 6.8.5 register bank e rror exception handling when a register bank error occurs, register bank error exception handling starts. when this happens, the cpu operates as follows: 1. the exception service routine start address which corresponds to the register bank error that occurred is fetched from the exception handling vector table. 2. the status register (sr) is saved to the stack. 3. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the last execut ed instruction for a regi ster bank overflow, and the start address of the execut ed resbank instruction for a register bank underflow. to prevent multiple interrupts from occurring at a register bank overflow, the interrupt priority level that caused the register bank overflow is written to the interrupt mask level bits (i3 to i0) of the status register (sr). 4. program execution starts from the ex ception service rout ine start address.
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 159 of 1164 rej09b0321-0200 6.9 data transfer with interrupt request signals interrupt request signals can be used to activate the dmac and transfer data. interrupt sources that are specified to activate th e dmac are masked by setting the dma transfer enable bit in dreqer0 to dreqer3 to 1 without being input to the intc. 6.9.1 handling interrupt reque st signals as sources for cpu interrupt but not dmac activation 1. clear the corresponding dmac transfer request enable bit in dreqer0 to dreqer3 to 0. 2. when an interrupt occurs, the interrupt request will be sent to the cpu. 3. the cpu clears the interrupt source and perfor ms the necessary proce ssing in the interrupt handling routine. 6.9.2 handling interrupt request signals as sources for dm ac activation but not cpu interrupt 1. select* the signals as dmac activating sour ces by setting the corresponding dmac transfer request enable bit in dreqer0 to dreqer3 to 1. this masks the cpu interrupt source regardless of the interrupt priority register settings. 2. when an interrupt occurs, the activation source will be sent to the dmac. 3. the dmac clears the activati on source during the transfer. note: * as for the method to select the dmac request sources, see section 11, direct memory access controller (dmac).
section 6 interrupt controller (intc) rev. 2.00 sep. 07, 2007 page 160 of 1164 rej09b0321-0200 6.10 usage note 6.10.1 timing to clear an interrupt source the interrupt source flags should be cleared in the interrupt handler. after clearing the interrupt source flag, "time from occurrence of interrupt request until interrupt controller identifies priority, compares it with mask bits in sr, and sends interrupt request signal to cpu" shown in table 6.5 is required before the interrupt source sent to th e cpu is actually cancelled. to ensure that an interrupt request that should have been cleared is not inadvertently accepted again, read the interrupt source flag after it has been clear ed, and then execute an rte instruction.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 161 of 1164 rej09b0321-0200 section 7 user break controller (ubc) the user break controller (ubc) provides functions that simplify program debugging. these functions make it easy to design an effective self-monitoring debugger, enabling the chip to debug programs without using an in-circuit emulator. instruction fetch or data read/write of cpu, data size, data contents, address value, and stop ti ming in the case of instruction fetch are break conditions that can be set in the ubc. since this lsi uses a harvard architecture, instruction fetch on the cpu bus (c bus) is performed by issuing bus cycles on the instruction fetch bus (f bus), and data access on the c bus is performed by issuing bus cycles on the memory access bus (m bus). the ubc monitors the c bus and internal bus (i bus). 7.1 features 1. the following break comparison conditions can be set. number of break channels: two channels (channels 0 and 1) user break can be requested as the independent condition on channels 0 and 1. ? address comparison of the 32-bit address is maskable in 1-bit units. one of the three address buses (f address bus (fab), m address bus (mab), and i address bus (iab)) can be selected. ? data comparison of the 32-bit data is maskable in 1-bit units. one of the two data buses (m data bus (mdb) and i data bus (idb)) can be selected. ? bus cycle instruction fetch (only when c bu s is selected) or data access ? read/write ? operand size byte, word, and longword 2. in an instruction fe tch cycle, it can be selected whethe r the start of user break interrupt exception processing is set before or after an instruction is executed. 3. when a break condition is satisfied, a trigger signal is output from the ubctrg pin.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 162 of 1164 rej09b0321-0200 figure 7.1 shows a block diagram of the ubc. idb iab mab fab mdb bbr_0 bbr_1 bar_0 bamr_0 bdr_0 bdmr_0 bar_1 bamr_1 bdr_1 bdmr_1 brcr internaal bus (i bus) access comparator address comparator channel 0 access comparator address comparator data comparator control channel 1 user break request [legend] bbr: bar: bamr: bdr: bdmr: brcr: break bus cycle register break address register break address mask register access control data comparator ubctrg pin output internal bus (i bus) cpu bus (c bus) break data register break data mask register break control register figure 7.1 block diagram of ubc
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 163 of 1164 rej09b0321-0200 7.2 input/output pin table 7.1 shows the pin configuration of the ubc. table 7.1 pin configuration pin name symbol i/o function ubc trigger ubctrg output indicates that a se tting condition is satisfied on either channel 0 or 1 of the ubc. 7.3 register descriptions the ubc has the following registers. table 7.2 register configuration channel register name abbrevia- tion r/w initial value address access size break address register_0 bar_0 r/w h'00000000 h'fffc0400 32 break address mask register_0 bamr_0 r/w h'00000000 h'fffc0404 32 break bus cycle register_0 bbr_0 r/w h'0000 h'fffc04a0 16 break data register_0 bdr_0 r/w h'00000000 h'fffc0408 32 0 break data mask register_0 bdmr_0 r/w h'00000000 h'fffc040c 32 break address register_1 bar_1 r/w h'00000000 h'fffc0410 32 break address mask register_1 bamr_1 r/w h'00000000 h'fffc0414 32 break bus cycle register_1 bbr_1 r/w h'0000 h'fffc04b0 16 break data register_1 bdr_1 r/w h'00000000 h'fffc0418 32 1 break data mask register_1 bdmr_1 r/w h'00000000 h'fffc041c 32 common break control register brcr r/w h'00000000 h'fffc04c0 32
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 164 of 1164 rej09b0321-0200 7.3.1 break addres s register (bar) bar is a 32-bit readable/writable register. bar sp ecifies the address used as a break condition in each channel. the control bits cd[1:0] in the br eak bus cycle register (b br) select one of the three address buses for a break condition. bar is initialized to h'00000000 by a power-on reset or in deep standby, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 ba15 ba14 ba13 ba12 ba11 ba10 ba9 ba8 ba7 ba6 ba5 ba4 ba3 ba2 ba1 ba0 bit bit name initial value r/w description 31 to 0 ba31 to ba0 all 0 r/w break address store an address on the cpu address bus (fab or mab) or iab specifying break conditions. when the c bus and instruction fetch cycle are selected by bbr, specify an fab address in bits ba31 to ba0. when the c bus and data access cycle are selected by bbr, specify an mab address in bits ba31 to ba0. note: when setting the instruction fetch cycle as a break condition, clear the lsb in bar to 0.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 165 of 1164 rej09b0321-0200 7.3.2 break address ma sk register (bamr) bamr is a 32-bit readable/writable register. ba mr specifies bits masked in the break address bits specified by bar. bamr is initialized to h'00000000 by a power-on reset or in deep standby, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: bam31 bam30 bam29 bam28 bam27 bam26 bam25 bam24 bam23 bam22 bam21 bam20 bam19 bam18 bam17 bam16 bam15 bam14 bam13 bam12 bam11 bam10 bam9 bam8 bam7 bam6 bam5 bam4 bam3 bam2 bam1 bam0 bit bit name initial value r/w description 31 to 0 bam31 to bam0 all 0 r/w break address mask specify bits masked in the break address bits specified by bar (ba31 to ba0). 0: break address bit ban is included in the break condition 1: break address bit ban is masked and not included in the break condition note: n = 31 to 0
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 166 of 1164 rej09b0321-0200 7.3.3 break data register (bdr) bdr is a 32-bit readable/writable re gister. the control bits cd[1:0] in the break bus cycle register (bbr) select one of the two data buses for a break condition. bdr is initialized to h'00000000 by a power-on reset or in deep standby, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 151413121110987654321 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: bd31 bd30 bd29 bd28 bd27 bd26 bd25 bd24 bd23 bd22 bd21 bd20 bd19 bd18 bd17 bd16 bd15 bd14 bd13 bd12 bd11 bd10 bd9 bd8 bd7 bd6 bd5 bd4 bd3 bd2 bd1 bd0 bit bit name initial value r/w description 31 to 0 bd31 to bd0 all 0 r/w break data bits store data which specifies a break condition. if the i bus is selected in bbr, specify the break data on idb in bits bd31 to bd0. if the c bus is selected in bbr, specify the break data on mdb in bits bd31 to bd0. notes: 1. set the operand size when specifying a value on a data bus as the break condition. 2. when the byte size is selected as a break condition, the same byte data must be set in bits 31 to 24, 23 to 16, 15 to 8, and 7 to 0 in bdr as the break data. similarly, when the word size is selected, the sa me word data must be set in bits 31 to 16 and 15 to 0.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 167 of 1164 rej09b0321-0200 7.3.4 break data mask register (bdmr) bdmr is a 32-bit readable/writable register. bdmr specifies bits masked in the break data bits specified by bdr. bdmr is initialized to h'00000000 by a power-on reset or in deep standby, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit: initial value: r/w: bdm31 bdm30 bdm29 bdm28 bdm27 bdm26 bdm25 bdm24 bdm23 bdm22 bdm21 bdm20 bdm19 bdm18 bdm17 bdm16 bdm15 bdm14 bdm13 bdm12 bdm11 bdm10 bdm9 bdm8 bdm7 bdm6 bdm5 bdm4 bdm3 bdm2 bdm1 bdm0 bit bit name initial value r/w description 31 to 0 bdm31 to bdm0 all 0 r/w break data mask specify bits masked in the break data bits specified by bdr (bd31 to bd0). 0: break data bit bdn is included in the break condition 1: break data bit bdn is masked and not included in the break condition note: n = 31 to 0 notes: 1. set the operand size when specifying a value on a data bus as the break condition. 2. when the byte size is selected as a break condition, the same byte data must be set in bits 31 to 24, 23 to 16, 15 to 8, and 7 to 0 in bdmr as the break mask data. similarly, when the word size is selected, the same wo rd data must be set in bits 31 to 16 and 15 to 0.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 168 of 1164 rej09b0321-0200 7.3.5 break bus cy cle register (bbr) bbr is a 16-bit readable/writable register, which sp ecifies (1) disabling or enabling of user break interrupts, (2) including or excluding of the data bus value, (3) bus master of the i bus, (4) c bus cycle or i bus cycle, (5) instruc tion fetch or data access, (6) read or write, and (7) operand size as the break conditions. bbr is initialized to h'0000 by a power-on reset and in deep standby, but retains its previous value by a manual reset or in software standby mode or sleep mode. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: ?? ubid dbe cp[3:0] cd[1:0] id[1:0] rw[1:0] sz[1:0] bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13 ubid 0 r/w user break interrupt disable disables or enables user break interrupt requests when a break condition is satisfied. 0: user break interrupt requests enabled 1: user break interrupt requests disabled 12 dbe 0 r/w data break enable selects whether the data bus condition is included in the break conditions. 0: data bus condition is not included in break conditions 1: data bus condition is included in break conditions 11 to 8 cp[3:0] 0000 r/w i-bus bus select select the bus master when the bus cycle of the break condition is the i bus cycle. however, when the c bus cycle is selected, this bit is invalidated (only the cpu cycle). xxx1: cpu cycle is included in break conditions xx1x: reserved. setting prohibited x1xx: reserved. setting prohibited 1xxx: reserved. setting prohibited
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 169 of 1164 rej09b0321-0200 bit bit name initial value r/w description 7, 6 cd[1:0] 00 r/w c bus cycle/i bus cycle select select the c bus cycle or i bus cycle as the bus cycle of the break condition. 00: condition comparison is not performed 01: break condition is the c bus (f bus or m bus) cycle 10: break condition is the i bus cycle 11: break condition is the c bus (f bus or m bus) cycle 5, 4 id[1:0] 00 r/w instructi on fetch/data access select select the instruction fetch cycle or data access cycle as the bus cycle of the break condition. if the instruction fetch cycle is se lected, select the c bus cycle. 00: condition comparison is not performed 01: break condition is the instruction fetch cycle 10: break condition is the data access cycle 11: break condition is the instruction fetch cycle or data access cycle 3, 2 rw[1:0] 00 r/w read/write select select the read cycle or write cycle as the bus cycle of the break condition. 00: condition comparison is not performed 01: break condition is the read cycle 10: break condition is the write cycle 11: break condition is the read cycle or write cycle 1, 0 sz[1:0] 00 r/w operand size select select the operand size of the bus cycle for the break condition. 00: break condition does not include operand size 01: break condition is byte access 10: break condition is word access 11: break condition is longword access [legend] x: don't care
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 170 of 1164 rej09b0321-0200 7.3.6 break control register (brcr) brcr sets the following conditions: 1. specifies whether a start of us er break interrupt exception processing by instruction fetch cycle is set before or after instruction execution. 2. specifies the pulse width of the ubctrg output when a break condition is satisfied. brcr is a 32-bit readable/writable register that has break condition match flags and bits for setting other break conditions. for the condition match flags of bits 15 to 12, writing 1 is invalid (previous values are retained) and writing 0 is only possible. to clear the flag, write 0 to the flag bit to be cleared and 1 to all other flag bits. brcr is initialized to h'00000000 by a power-on reset and in deep standby, but retains its previous value by a manual reset or in software standby mode or sleep mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrr/wr/w 0000000000000000 r/w r/w r/w r/w r r r r r r/w r/w r r r r r bit: initial value: r/w: bit: initial value: r/w: ????? ????? ????? ????????? cks[1:0] scmfc 0 scmfc 1 scmfd 0 scmfd 1 pcb1 pcb0 bit bit name initial value r/w description 31 to 18 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 17, 16 cks[1:0] 00 r/w clock select specifies the pulse width output to the ubctrg pin when a break condition is satisfied. 00: pulse width of ubctrg is one bus clock cycle 01: pulse width of ubctrg is two bus clock cycles 10: pulse width of ubctrg is four bus clock cycles 11: pulse width of ubctrg is eight bus clock cycles
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 171 of 1164 rej09b0321-0200 bit bit name initial value r/w description 15 scmfc0 0 r/w c bus cycle condition match flag 0 when the c bus cycle conditio n in the break conditions set for channel 0 is satisfied, this flag is set to 1. in order to clear this flag, write 0 to this bit. 0: the c bus cycle conditio n for channel 0 does not match 1: the c bus cycle conditio n for channel 0 matches 14 scmfc1 0 r/w c bus cycle condition match flag 1 when the c bus cycle conditio n in the break conditions set for channel 1 is satisfied, this flag is set to 1. in order to clear this flag, write 0 to this bit. 0: the c bus cycle conditio n for channel 1 does not match 1: the c bus cycle conditio n for channel 1 matches 13 scmfd0 0 r/w i bus cycle condition match flag 0 when the i bus cycle condition in the break conditions set for channel 0 is satisfied, this flag is set to 1. in order to clear this flag, write 0 to this bit. 0: the i bus cycle condition for channel 0 does not match 1: the i bus cycle condition for channel 0 matches 12 scmfd1 0 r/w i bus cycle condition match flag 1 when the i bus cycle condition in the break conditions set for channel 1 is satisfied, this flag is set to 1. in order to clear this flag, write 0 to this bit. 0: the i bus cycle condition for channel 1 does not match 1: the i bus cycle condition for channel 1 matches 11 to 7 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 172 of 1164 rej09b0321-0200 bit bit name initial value r/w description 6 pcb1 0 r/w pc break select 1 selects the break timing of the instruction fetch cycle for channel 1 as before or after instruction execution. 0: pc break of channel 1 is generated before instruction execution 1: pc break of channel 1 is generated after instruction execution 5 pcb0 0 r/w pc break select 0 selects the break timing of the instruction fetch cycle for channel 0 as before or after instruction execution. 0: pc break of channel 0 is generated before instruction execution 1: pc break of channel 0 is generated after instruction execution 4 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 173 of 1164 rej09b0321-0200 7.4 operation 7.4.1 flow of the user break operation the flow from setting of break conditions to user break exception handling is described below: 1. the break address is set in the break address re gister (bar). the masked address bits are set in the break address mask register (bamr). the break data is set in the break data register (bdr). the masked data bits are set in the br eak data mask register (bdmr). the bus break conditions are set in the break bus cycle regist er (bbr). three control bit groups of bbr (c bus cycle/i bus cycle select, instruction fetch/da ta access select, and read/write select) are each set. no user break will be generated if even one of these groups is set to 00. the relevant break control conditions are set in the bits of the break control register (brcr). make sure to set all registers related to breaks before setting bbr, and branch after reading from the last written register. the newly written register values beco me valid from the instruction at the branch destination. 2. in the case where the break co nditions are satisfied and the user break interrupt request is enabled, the ubc sends a user break request to the intc, sets the c bus condition match flag (scmfc) or i bus condition match flag (scmfd) for the appropriate channel, and outputs a pulse to the ubctrg pin with the width set by the cks[1:0] bits. setting the ubid bit in bbr to 1 enables external monitoring of the trigger output without requesting user break interrupts. 3. on receiving a user break inte rrupt request signal, the intc de termines its priority. since the user break interrupt has a priority level of 15, it is accepted when the priority level set in the interrupt mask level bits (i3 to i0) of the status re gister (sr) is 14 or lower. if the i3 to i0 bits are set to a priority level of 15, the user brea k interrupt is not accepted, but the conditions are checked, and condition match flags are set if the conditions match. for details on ascertaining the priority, see section 6, interrupt controller (intc). 4. condition match flags (scmfc and scmfd) can be used to check which condition has been satisfied. clear the condition match flags durin g the user break interrupt exception processing routine. the interrupt occurs again if this operation is not performed. 5. there is a chance that the break set in chan nel 0 and the break set in channel 1 occur around the same time. in this case, there will be onl y one break request to the intc, but these two break channel match flags may both be set.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 174 of 1164 rej09b0321-0200 6. when selecting the i bus as the break condition, note as follows: ? whether or not the access the cpu issued on th e c bus is issued on the i bus depends on the setting of the cache. as regard to the i bus operation that depends on cache conditions, see table 8.8 in section 8, cache. ? when a break condition is speci fied for the i bus, only the da ta access cycle is monitored. the instruction fetch cycle (including cac he update cycle) is not monitored. ? if a break condition is specified for the i bus, even when the condition matches in an i bus cycle resulting from an instruction executed by the cpu, at which instruction the break is to be accepted cannot be clearly defined. 7.4.2 break on inst ruction fetch cycle 1. when c bus/instruction fetch/read/word or longword is set in the break bus cycle register (bbr), the break condition is the fab bus instru ction fetch cycle. whether a start of user break interrupt exception processing is set befo re or after the execution of the instruction can be selected with the pcb0 or pcb1 bit in the break control regi ster (brcr) for the appropriate channel. if an inst ruction fetch cycle is set as a break condition, clear lsb in the break address register (bar) to 0. a break cannot be generated as long as this bit is set to 1. 2. a break for instruction fetch which is set as a break before instruction execution occurs when it is confirmed that the instruction has been fetc hed and will be executed. this means a break does not occur for instructions fetched by overrun (instructions fetched at a branch or during an interrupt transition, but not to be executed). wh en this kind of break is set for the delay slot of a delayed branch instruction, the user break interrupt request is not received until the execution of the first instructio n at the branch destination. note: if a branch does not occur at a delayed bran ch instruction, the subsequent instruction is not recognized as a delay slot. 3. when setting a break condition for break after instruction execution, the instruction set with the break condition is executed and then the break is generated prior to execution of the next instruction. as with pre-execution breaks, a break does not occu r with overrun fetch instructions. when this kind of break is set for a delayed branch instruction and its delay slot, the user break interrup t request is not received until the first instruction at the branch destination. 4. when an instruction fetch cycle is set, the break data register (bdr) is ignored. therefore, break data cannot be set for the break of the instruction fetch cycle. 5. if the i bus is set for a break of an instru ction fetch cycle, the setting is invalidated.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 175 of 1164 rej09b0321-0200 7.4.3 break on data access cycle 1. if the c bus is specified as a break conditi on for data access break, condition comparison is performed for the logical addresses (and data ) accessed by the executed instructions, and a break occurs if the condition is satisfied. if the i bus is specified as a break condition, condition comparison is performed for the addresses (and data) of the data access cycles on the bus specified by the i bus select bits, and a break occu rs if the condition is satisfied. for details on the cpu bus cycles issued on th e i bus, see 6 in section 7.4.1, flow of the user break operation. 2. the relationship between the data access cycle address and the comparison condition for each operand size is listed in table 7.3. table 7.3 data access cycle addresses and operand size comparison conditions access size address compared longword compares break address register bits 31 to 2 to address bus bits 31 to 2 word compares break address register bits 31 to 1 to address bus bits 31 to 1 byte compares break address register bits 31 to 0 to address bus bits 31 to 0 this means that when address h'00001003 is set in the break address register (bar), for example, the bus cycle in which the break condition is satisfied is as follows (where other conditions are met). longword access at h'00001000 word access at h'00001002 byte access at h'00001003 3. when the data value is included in the break conditions: when the data value is included in the break co nditions, either longword, word, or byte is specified as the operand size in the break bus cycle register (bbr). when data values are included in break conditions, a break is genera ted when the address conditions and data conditions both match. to specify byte data for this case, set the same data in the four bytes at bits 31 to 24, 23 to 16, 15 to 8, and 7 to 0 of the break data register (bdr) and break data mask register (bdmr). to specify word data for this case, set the same data in the two words at bits 31 to 16 and 15 to 0. 4. access by a pref instruction is handled as read access in long word units without access data. therefore, if including the value of the data bus when a pref instruction is specified as a break condition, a break will not occur. 5. if the data access cycle is selected, the instru ction at which the break will occur cannot be determined.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 176 of 1164 rej09b0321-0200 7.4.4 value of saved program counter when a user break interrupt request is receive d, the address of the instruction from where execution is to be resumed is saved to the stack, and the exception handling state is entered. if the c bus (fab)/instruction fetch cycle is specified as a break conditio n, the instruction at which the break should occur can be uniquely determined. if the c bus/data access cycle or i bus/data access cycle is specified as a break condition, the instru ction at which the break should occur cannot be uniquely determined. 1. when c bus (fab)/instruction fetch (before in struction execution) is specified as a break condition: the address of the instruction that matched the break condition is saved to the stack. the instruction that matched the condition is not executed, and the break occurs before it. however, when a delay slot instruction matches the condition, the instruction is executed, and the branch destination address is saved to the stack. 2. when c bus (fab)/instruction fetch (after in struction execution) is specified as a break condition: the address of the instruction following the in struction that matched the break condition is saved to the stack. the instruction that matches the condition is executed, and the break occurs before the next instruction is executed. however, when a delayed branch instruction or delay slot matches the condition, the instruction is executed, and the branch destination address is saved to the stack. 3. when c bus/data access cycle or i bus/data access cycle is specified as a break condition: the address after executing several instructions of the instruction that matched the break condition is saved to the stack.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 177 of 1164 rej09b0321-0200 7.4.5 usage examples (1) break condition specified fo r c bus instruction fetch cycle (example 1-1) ? register specifications bar_0 = h'00000404, bamr_0 = h'00000000, bbr_0 = h'0054, bar_1 = h'00008010, bamr_1 = h'00000006, bbr_1 = h'0054, bdr_1 = h'00000000, bdmr_1 = h'00000000, brcr = h'00000020 address: h'00000404, address mask: h'00000000 bus cycle: c bus/instruction fetch (after inst ruction execution)/read (operand size is not included in the condition) address: h'00008010, address mask: h'00000006 data: h'00000000, data mask: h'00000000 bus cycle: c bus/instruction fetch (before in struction execution)/read (operand size is not included in the condition) a user break occurs after an instruction of address h'00000404 is executed or before instructions of addresses h'00008010 to h'00008016 are executed. (example 1-2) ? register specifications bar_0 = h'00027128, bamr_0 = h'00000000, bbr_0 = h'005a, bar_1= h'00031415, bamr_1 = h'00000000, bbr_1 = h'0054, bdr_1 = h'00000000, bdmr_1 = h'00000000, brcr = h'00000000 address: h'00027128, address mask: h'00000000 bus cycle: c bus/instruction fetch (b efore instruction execution)/write/word address: h'00031415, address mask: h'00000000 data: h'00000000, data mask: h'00000000 bus cycle: c bus/instruction fetch (before in struction execution)/read (operand size is not included in the condition) on channel 0, a user break does not occur sin ce instruction fetch is not a write cycle. on channel 1, a user break does not occur since instruction fetch is performed for an even address.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 178 of 1164 rej09b0321-0200 (example 1-3) ? register specifications bar_0 = h'00008404, bamr_0 = h'00000fff, bbr_0 = h'0054, bar_1= h'00008010, bamr_1 = h'00000006, bbr_1 = h'0054, bdr_1 = h'00000000, bdmr_1 = h'00000000, brcr = h'00000020 address: h'00008404, address mask: h'00000fff bus cycle: c bus/instruction fetch (after inst ruction execution)/read (operand size is not included in the condition) address: h'00008010, address mask: h'00000006 data: h'00000000, data mask: h'00000000 bus cycle: c bus/instruction fetch (before in struction execution)/read (operand size is not included in the condition) a user break occurs after an in struction with addresses h'00008000 to h'00008ffe is executed or before an instruction with addresses h'00008010 to h'00008016 are executed. (2) break condition specified for c bus data access cycle (example 2-1) ? register specifications bar_0 = h'00123456, bamr_0 = h'00000000, bbr_0 = h'0064, bar_1= h'000abcde, bamr_1 = h'000000ff, bbr_1 = h'106a, bdr_1 = h'a512a512, bdmr_1 = h'00000000, brcr = h'00000000 address: h'00123456, address mask: h'00000000 bus cycle: c bus/data access/read (operand size is not included in the condition) address: h'000abcde, address mask: h'000000ff data: h'0000a512, data mask: h'00000000 bus cycle: c bus/data access/write/word on channel 0, a user break occurs with longword read from address h'00123456, word read from address h'00123456, or byte read from address h'00123456. on channel 1, a user break occurs when word h'a512 is written in addresses h'000abc00 to h'000abcfe. (3) break condition specified for i bus data access cycle
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 179 of 1164 rej09b0321-0200 (example 3-1) ? register specifications bar_0 = h'00314156, bamr_0 = h'00000000, bbr_0 = h'0094, bar_1= h'00055555, bamr_1 = h'00000000, bbr_1 = h'11a9, bdr_1 = h'78787878, bdmr_1 = h'0f0f0f0f, brcr = h'00000000 address: h'00314156, address mask: h'00000000 bus cycle: i bus/instruction fetch/read (operand size is not included in the condition) address: h'00055555, address mask: h'00000000 data: h'00000078, data mask: h'0000000f bus cycle: i bus/data access/write/byte on channel 0, the setting of i bus/instruction fetch is ignored. on channel 1, a user break occurs when the cpu writes byte data h'7x in address h'00055555 on the i bus.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 180 of 1164 rej09b0321-0200 7.5 usage notes 1. the cpu can read from or wr ite to the ubc registers via the i bus. accordingly, during the period from executing an instruction to rewrite the ubc register till the new value is actually rewritten, the desired break may not occur. in or der to know the timing when the ubc register is changed, read from the last written register. instructions after then are valid for the newly written register value. 2. the ubc cannot monitor access to the c bus and i bus cycles in the same channel. 3. when a user break interrupt request and another exception source occur at the same instruction, which has higher priority is determined according to the priority levels defined in table 5.1 in section 5, exception handling. if an exception source with higher priority occurs, the user break interrupt request is not received. 4. note the following when a break occurs in a delay slot. if a pre-execution break is set at a delay slot inst ruction, the user break interrupt request is not received immediately before executi on of the branch destination. 5. user breaks are disabled during ubc module standby mode. do not read from or write to the ubc registers during ubc module standby mode; the values are not guaranteed. 6. do not set an address within an interrupt exception handling routine whose interrupt priority level is at least 15 (including user break interrupts) as a break address. 7. do not set break after instruction executio n for the sleep instruct ion or for the delayed branch instruction where the sleep inst ruction is placed at its delay slot. 8. when setting a break for a 32-bit instruction, set the address where the upper 16 bits are placed. if the address of the lower 16 bits is set and a break before instruction execution is set as a break condition, the break is handled as a break after inst ruction execution. 9. do not set a break after instruction execution for the divu or divs instruction. if a break after instruction execution is set for the divu or divs instruction and an exception or interrupt occurs during execution of the divu or divs instruction, a break after instruction execution occurs even though execution of the divu or di vs instruction is halted. 10. do not set a pre-execution break for the instruction that comes after the divu or divs instruction. if a pre-execution break is set for the instruction that co mes after the divu or divs instruction and an exception or interrupt occurs during execution of the divu or divs instruction, a pre-execution br eak occurs even though exec ution of the divu or divs instruction is halted.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 181 of 1164 rej09b0321-0200 11. do not set a pre-execution break and a break af ter instruction execution simultaneously in one address. for example, if a pr e-execution break for channel 0 and a break after instruction execution for channel 1 are set simultaneously for one address, a break generated prior to instruction execution for channel 0 can set a condition-match flag after the instruction execution for channel 1.
section 7 user break controller (ubc) rev. 2.00 sep. 07, 2007 page 182 of 1164 rej09b0321-0200
section 8 cache rev. 2.00 sep. 07, 2007 page 183 of 1164 rej09b0321-0200 section 8 cache 8.1 features ? capacity instruction cache: 8 kbytes operand cache: 8 kbytes ? structure: instructions/data se parated, 4-way set associative ? cache lock function (only for operand cache): way 2 and way 3 are lockable ? line size: 16 bytes ? number of entries: 128 entries/way ? write system: write-back/write-through selectable ? replacement method: least-r ecently-used (lru) algorithm 8.1.1 cache structure the cache separates data and instructions and uses a 4-way set associative system. it is composed of four ways (banks), each of which is divide d into an address section and a data section. each of the address and data sections is divided into 128 entries. the data section of the entry is called a line. each line consists of 16 bytes (4 bytes 4). the data capacity per way is 2 kbytes (16 bytes 128 entries), with a total of 8 kbytes in the cache as a whole (4 ways). figure 8.1 shows the operand cache st ructure. the instructio n cache structure is the same as the operand cache structure except for not having the u bit.
section 8 cache rev. 2.00 sep. 07, 2007 page 184 of 1164 rej09b0321-0200 0 1 127 v u lw0 lw1 lw2 lw3 0 1 127 lru 23 (1 + 1 + 21) bits 128 (32 4) bits 6 bits lw0 to lw3: longword data 0 to 3 entry 0 entry 1 entry 127 tag address address array (ways 0 to 3) data array (ways 0 to 3) . . . . . . . . . . . . . . . . . . figure 8.1 operand cache structure (1) address array the v bit indicates whether the entry data is valid. when the v bit is 1, data is valid; when 0, data is not valid. the u bit (only for operand cache) indicates whether the entry has been written to in write-back mode. when the u bit is 1, the entry has been written to; when 0, it has not. the tag address holds the ph ysical address used in the external memory acce ss. it is composed of 21 bits (address bits 31 to 11) used for comparison during cache searches. in this lsi, as values of addresses in the cache valid sp ace are from h'00000000 to h'1ff fffff (see section 9, bus state controller (bsc)), the upper three bits of the tag address are cleared to 0. the v and u bits are initialized to 0 by a power-on reset and in deep standby mode but not initialized by a manual reset or in software standby mode. the tag address is not initialized by a power-on re set or manual reset or in software standby mode. the tag address becomes undefined after deep standby. (2) data array holds a 16-byte instruction or data. entries are registered in the cache in line units (16 bytes). the data array is not initialized by a power-on reset or manual reset or in software standby mode. the data array becomes undefined after deep standby.
section 8 cache rev. 2.00 sep. 07, 2007 page 185 of 1164 rej09b0321-0200 (3) lru with the 4-way set associative system, up to four instructions or data with the same entry address can be registered in the cache. when an entry is registered, lru shows which of the four ways it is recorded in. there are six lru bits, controlled by hardware. a least-recently-used (lru) algorithm is used to select the way that has been least recently accessed. six lru bits indicate the way to be replaced in case of a cache miss. the relationship between lru and way replacement is shown in table 8.1 when the cache lo ck function (only for operand cache) is not used (concerning th e case where the cache lock function is used, see section 8.2.2, cache control register 2 (ccr2)). if a bit pattern other than those listed in table 8.1 is set in the lru bits by software, the cache will not function correctly. when modifying the lru bits by software, set one of the patterns listed in table 8.1. the lru bits are initialized to b'000000 by a power-on reset and in deep standby but not initialized by a manual reset or in software standby mode. table 8.1 lru and way replacement (cache lock function not used) lru (bits 5 to 0) way to be replaced 000000, 000100, 010100, 100000, 110000, 110100 3 000001, 000011, 001011, 100001, 101001, 101011 2 000110, 000111, 001111, 010110, 011110, 011111 1 111000, 111001, 111011, 111100, 111110, 111111 0
section 8 cache rev. 2.00 sep. 07, 2007 page 186 of 1164 rej09b0321-0200 8.2 register descriptions the cache has the following registers. table 8.2 register configuration register name abbreviation r/w initial value address access size cache control register 1 ccr1 r/w h'00000000 h'fffc1000 32 cache control register 2 ccr2 r/w h'00000000 h'fffc1004 32 8.2.1 cache control register 1 (ccr1) the instruction cache is enabled or disabled using th e ice bit. the icf bit controls disabling of all instruction cache entries. the operand cache is enabled or disabled using the oce bit. the ocf bit controls disabling of all operand cache entries. the wt bit selects either write-through mode or write-back mode for operand cache. programs that change the conten ts of ccr1 should be placed in an address space that is not cached, and an address space that is cached should be accessed af ter reading the contents of ccr1. ccr1 is initialized to h'00000000 by a power-on reset and in deep standby but not initialized by a manual reset or in software standby mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 151413121110987654321 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 r r r r r/w r r r/w r r r r r/w r r/w r/w bit: initial value: r/w: bit: initial value: r/w: ? ? ? ? ? ? ????????????? ???????? icf ice ocf wt oce
section 8 cache rev. 2.00 sep. 07, 2007 page 187 of 1164 rej09b0321-0200 bit bit name initial value r/w description 31 to 12 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 11 icf 0 r/w instruction cache flush writing 1 flushes all instruction cache entries (clears the v and lru bits of all instruction cache entries to 0). always reads 0. write-back to external memory is not performed when the instruction cache is flushed. 10, 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 ice 0 r/w instruction cache enable indicates whether the instruction cache function is enabled or disabled. 0: instruction cache disabled 1: instruction cache enabled 7 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 ocf 0 r/w operand cache flush writing 1 flushes all operand cache entries (clears the v, u, and lru bits of all operand cache entries to 0). always reads 0. write-back to external memory is not performed when the operand cache is flushed. 2 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 1 wt 0 r/w write through selects write-back mode or write-through mode. 0: write-back mode 1: write-through mode 0 oce 0 r/w operand cache enable indicates whether the operand cache function is enabled or disabled. 0: operand cache disabled 1: operand cache enabled
section 8 cache rev. 2.00 sep. 07, 2007 page 188 of 1164 rej09b0321-0200 8.2.2 cache control register 2 (ccr2) ccr2 is used to enable or disable the cache lock ing function for operand cache and is valid in cache locking mode only. in cache locking mode, the lo ck enable bit (the le bit) in ccr2 is set to 1. in non-cache-locking mode, the cache locking function is invalid. when a cache miss occurs in cache locking mode by executing the prefet ch instruction (pref @rn), the line of data pointed to by rn is load ed into the cache according to bits 9 and 8 (the w3load and w3lock bits) and bits 1 and 0 (the w2load and w2lock bits) in ccr2. the relationship between the setting of each bit and a way, to be replaced when th e prefetch instruction is executed, are listed in table 8.3. on the other hand, when the prefetch instruction is executed and a cache hit occurs, new data is not fetched and the entry which is already enabled is held. for example, when the prefetch instruction is executed with w3load = 1 and w3lock = 1 specified in cache locking mode while one-line data already exists in way 0 which is specified by rn, a cache hit occurs and data is not fetched to way 3. in the cache access other than the prefetch instruction in cache locking mode, ways to be replaced by bits w3lock and w2lock are restricted. the relationship between the setting of each bit in ccr2 and ways to be replaced are listed in table 8.4. programs that change the conten ts of ccr2 should be placed in an address space that is not cached, and an address space that is cached should be accessed af ter reading the contents of ccr2. ccr2 is initialized to h'00000000 by a power-on reset and in deep standby but not initialized by a manual reset or in software standby mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr/w 0000000000000000 rrrrrrr/wr/wrrrrrrr/wr/w bit: initial value: r/w: bit: initial value: r/w: note: the w3load and w2load bits should not be set to 1 at the same time. * ? le ? ? ? ? ? ? ? ? ? ????????? ?????? ? ? w3 load * w3 lock w2 load * w2 lock
section 8 cache rev. 2.00 sep. 07, 2007 page 189 of 1164 rej09b0321-0200 bit bit name initial value r/w description 31 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 le 0 r/w lock enable enables or disables the cache locking function. 0: non-cache locking mode 1: cache locking mode 15 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9 8 w3load * w3lock 0 0 r/w r/w way 3 load way 3 lock when a cache miss occurs by the prefetch instruction while w3load = 1 and w3lock = 1 in cache locking mode, the data is always loaded into way 3. under any other condition, the cache miss data is loaded into the way to which lru points. 7 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 0 w2load * w2lock 0 0 r/w r/w way 2 load way 2 lock when a cache miss occurs by the prefetch instruction while w2load = 1 and w2lock =1 in cache locking mode, the data is always loaded into way 2. under any other condition, the cache miss data is loaded into the way to which lru points. note: * the w3load and w2load bits should not be set to 1 at the same time.
section 8 cache rev. 2.00 sep. 07, 2007 page 190 of 1164 rej09b0321-0200 table 8.3 way to be replaced when a cache miss occurs in pref instruction le w3load * w3lock w2load * w2lock way to be replaced 0 x x x x decided by lru (table 8.1) 1 x 0 x 0 decided by lru (table 8.1) 1 x 0 0 1 decided by lru (table 8.5) 1 0 1 x 0 decided by lru (table 8.6) 1 0 1 0 1 decided by lru (table 8.7) 1 0 x 1 1 way 2 1 1 1 0 x way 3 [legend] x: don't care note: * the w3load and w2load bits should not be set to 1 at the same time. table 8.4 way to be replaced when a cache miss occurs in other than pref instruction le w3load * w3lock w2load * w2lock way to be replaced 0 x x x x decided by lru (table 8.1) 1 x 0 x 0 decided by lru (table 8.1) 1 x 0 x 1 decided by lru (table 8.5) 1 x 1 x 0 decided by lru (table 8.6) 1 x 1 x 1 decided by lru (table 8.7) [legend] x: don't care note: * the w3load and w2load bits should not be set to 1 at the same time. table 8.5 lru and way replacement (when w2lock=1 and w3lock=0) lru (bits 5 to 0) way to be replaced 000000, 000001, 000100, 010100, 100000, 100001, 110000, 110100 3 000011, 000110, 000111, 001011, 001111, 010110, 011110, 011111 1 101001, 101011, 111000, 111001, 111011, 111100, 111110, 111111 0
section 8 cache rev. 2.00 sep. 07, 2007 page 191 of 1164 rej09b0321-0200 table 8.6 lru and way replacement (when w2lock=0 and w3lock=1) lru (bits 5 to 0) way to be replaced 000000, 000001, 000011, 001011, 100000, 100001, 101001, 101011 2 000100, 000110, 000111, 001111, 010100, 010110, 011110, 011111 1 110000, 110100, 111000, 111001, 111011, 111100, 111110, 111111 0 table 8.7 lru and way replacement (when w2lock=1 and w3lock=1) lru (bits 5 to 0) way to be replaced 000000, 000001, 000011, 000100, 00 0110, 000111, 001011, 001111, 010100, 010110, 011110, 011111 1 100000, 100001, 101001, 101011, 11 0000, 110100, 111000, 111001, 111011, 111100, 111110, 111111 0 8.3 operation operations for the operand cache are described here. operations for the instruction cache are similar to those for the operand cache except for the address array not having the u bit, and there being no prefetch operation or write operation, or a write-back buffer. 8.3.1 searching cache if the operand cache is enabled (oce bit in ccr1 is 1), whenever data in a cache-enabled area is accessed, the cache will be searched to see if the de sired data is in the cache. figure 8.2 illustrates the method by which the cache is searched. entries are selected using bits 10 to 4 of the address used to acce ss memory and the tag address of that entry is read. at this time, the upper three bits of the tag address are always cleared to 0. bits 31 to 11 of the address used to access memory are compared with the read tag address. the address comparison uses all four ways. when the comparis on shows a match and the selected entry is valid (v = 1), a cache hit occurs. when the comparison does not show a match or the selected entry is not valid (v = 0), a cache miss occurs. figure 8.2 shows a hit on way 1.
section 8 cache rev. 2.00 sep. 07, 2007 page 192 of 1164 rej09b0321-0200 entry 0 entry 0 entry 1 entry 127 vu lw0 lw1 lw2 lw3 31 10 11 4 3 2 1 0 cmp0 cmp1 cmp2 cmp3 . . . . . . . . . access address tag address address array (ways 0 to 3) data array (ways 0 to 3) [legend] cmp0 to cmp3: comparison circuits 0 to 3 hit signal (way 1) entry selection longword (lw) selection entry 127 entry 1 . . . . . . . . . figure 8.2 cache search scheme
section 8 cache rev. 2.00 sep. 07, 2007 page 193 of 1164 rej09b0321-0200 8.3.2 read access (1) read hit in a read access, data is transferred from the cache to the cpu. lru is updated so that the hit way is the latest. (2) read miss an external bus cycle starts and the entry is up dated. the way replaced follows table 8.4. entries are updated in 16-byte units. when the desired data that caused the miss is loaded from external memory to the cache, the data is transferred to th e cpu in parallel with being loaded to the cache. when it is loaded in the cache, the v bit is set to 1, and lru is updated so that the replaced way becomes the latest. in operand cache, the u bit is additionally cleared to 0. when the u bit of the entry to be replaced by updating the entry in write -back mode is 1, the cache update cycle starts after the entry is transferred to the write-back bu ffer. after the cache completes its update cycle, the write-back buffer writes the entry back to the memory. the write-back unit is 16 bytes. 8.3.3 prefetch operation (only for operand cache) (1) prefetch hit lru is updated so that the hit way becomes the latest. the contents in other caches are not modified. no data is transferred to the cpu. (2) prefetch miss no data is transferred to the cpu. the way to be replaced follows table 8.3. other operations are the same in case of read miss. 8.3.4 write operation (o nly for operand cache) (1) write hit in a write access in write-back mode, the data is written to the cache and no external memory write cycle is issued. the u bit of the entry written is set to 1 and lru is updated so that the hit way becomes the latest. in write-through mode, the data is written to th e cache and an external memory write cycle is issued. the u bit of the written entry is not upda ted and lru is updated so that the replaced way becomes the latest.
section 8 cache rev. 2.00 sep. 07, 2007 page 194 of 1164 rej09b0321-0200 (2) write miss in write-back mode, an external bus cycle star ts when a write miss occurs, and the entry is updated. the way to be replaced follows table 8.4. when the u bit of the entr y to be replaced is 1, the cache update cycle starts after th e entry is transferred to the writ e-back buffer. data is written to the cache, the u bit is set to 1, and the v bit is set to 1. lru is updated so that the replaced way becomes the latest. after the cache completes its u pdate cycle, the write-back buffer writes the entry back to the memory. the write-back unit is 16 bytes. in write-through mode, no write to cache occurs in a write miss; the write is only to the external memory. 8.3.5 write-back buffer (only for operand cache) when the u bit of the entry to be replaced in the write-back mode is 1, it must be written back to the external memory. to increase performance, the entry to be replaced is first transferred to the write-back buffer and fetching of new entries to the cache takes priority over writing back to the external memory. after the cache completes to fetch the new entry, the write-back buffer writes the entry back to external memory. during the write-back cycles, the cache can be accessed. the write-back buffer can hold one line of cache data (16 bytes) and its physical address. figure 8.3 shows the configuration of the write-back buffer. longword 0 longword 1 longword 2 longword 3 a (31 to 4) a (31 to 4): physical address written to external memory (upper three bits are 0) longword 0 to 3: one line of cache data to be written to external memory figure 8.3 write-back buffer configuration operations in sections 8.3.2 to 8.3.5 are compiled in table 8.8
section 8 cache rev. 2.00 sep. 07, 2007 page 195 of 1164 rej09b0321-0200 table 8.8 cache operations cache cpu cycle hit/ miss write-back mode/ write through mode u bit external memory accession (through internal bus) cache contents hit ? ? not generated not renewed instruction cache instruction fetch miss ? ? cache renewal cycle is generated. renewed to new values by cache renewal cycle operand cache prefetch/ read hit either mode is availabl e x not generated not renewed miss write-through mode ? cache renewal cycle is generated. renewed to new values by cache renewal cycle write-back mode 0 cache renewal cycle is generated renewed to new values by cache renewal cycle 1 cache renewal cycle is generated. succeedingly write-back cycle in write- back buffer is generated renewed to new values by cache renewal cycle write hit write-through mode ? write cycle cpu issues is generated. renewed to new values by write cycle the cpu issues write-back mode x not generat ed renewed to new values by write cycle the cpu issues miss write-through mode ? write cycle cpu issues is generated. not renewed * write-back mode 0 cache renewal cycle is generated. renewed to new values by cache renewal cycle. subsequently renewed again to new values in write cycle cpu issues. 1 cache renewal cycle is generated. succeedingly write-back cycle in write- back buffer is generated renewed to new values by cache renewal cycle. subsequently renewed again to new values in write cycle cpu issues. [legend] x: don't care note: cache renewal cycle: 16-byte read access, write-back cycle in write-back buffer: 16-byte write access * neither lru renewed. lru is renewed in all other cases.
section 8 cache rev. 2.00 sep. 07, 2007 page 196 of 1164 rej09b0321-0200 8.3.6 coherency of cach e and external memory use software to ensure coherency between the cache and the external memory. when memory shared by this lsi and another device is mapped in the address space to be cached, operate the memory-mapped cache to invalidat e and write back as required. 8.4 memory-mapped cache to allow software management of the cache, cache contents can be read an d written by means of mov instructions. the instruction cache address array is mapped onto addresses h'f0000000 to h'f07fffff, and the data array onto addresse s h'f1000000 to h'f17fffff. the operand cache address array is mapped onto addresses h'f0800000 to h'f0ffffff, and the data array onto addresses h'f1800000 to h'f1ff ffff. only longword can be used as the access size for the address array and data array, and instruction fetches cannot be performed. 8.4.1 address array to access an address array, the 32 -bit address field (for read/write accesses) and 32-bit data field (for write accesses) must be specified. in the address field, specify the entry address selecting the entry, the w bit for selecting the way, and the a bit for specifyin g the existence of associative operation. in the w bit, b'00 is way 0, b'01 is way 1, b'10 is way 2, and b'11 is way 3. since the access size of the address array is fixed at longword, specify b'00 for bits 1 and 0 of the address. the tag address, lru bits, u bit (only for operand cache), and v bit are specified as data. always specify 0 for the upper three bits (bits 31 to 29) of the tag address. for the address and data formats, see figure 8.4. the following three oper ations are possible for the address array. (1) address array read the tag address, lru bits, u bit (only for operand cache), and v bit are read from the entry address specified by the address and the entry corr esponding to the way. fo r the read operation, associative operation is not performed regardless of whether the associative bit (a bit) specified by the address is 1 or 0.
section 8 cache rev. 2.00 sep. 07, 2007 page 197 of 1164 rej09b0321-0200 (2) address-array write (non-associative operation) when the associative bit (a bit) in the address field is cleared to 0, write the tag address, lru bits, u bit (only for operand cache), and v bit, specified by the data field, to the entry address specified by the address and the entry corr esponding to the way. when writi ng to a cache line for which the u bit = 1 and the v bit =1 in the operand cache addr ess array, write the cont ents of the cache line back to memory, then write the tag address, lru bits, u bit, and v bit specified by the data field. when 0 is written to the v bit, 0 must also be written to the u bit of that entry. (3) address-array write (associative operation) when writing with the associative bit (a bit) of the address field set to 1, the addresses in the four ways for the entry specified by the address field ar e compared with the tag ad dress that is specified by the data field. write the u bit (only for operan d cache) and the v bit specified by the data field to the entry of the way that has a hit. however, the tag address and lru bits remain unchanged. when there is no way that has a hit, no thing is written and there is no operation. this function is used to invalidate a specific entr y in the cache. when the u bit of the entry that has had a hit is 1 in the operand cache, writing ba ck should be performed. however, when 0 is written to the v bit, 0 must also be written to the u bit of that entry. 8.4.2 data array to access a data array, the 32-bit ad dress field (for read/w rite accesses) and 32-bit data field (for write accesses) must be specified. the address field specifies inform ation for selecting the entry to be accessed; the data field specifies the longwor d data to be written to the data array. specify the entry address for selecting the entry, the l bit indicating the longword position within the (16-byte) line, and the w bit for selecting the way. in the l bit, b'00 is longword 0, b'01 is longword 1, b'10 is longword 2, and b'11 is longwo rd 3. in the w bit, b'00 is way 0, b'01 is way 1, b'10 is way 2, and b'11 is way 3. since the access size of the data array is fixed at longword, specify b'00 for bits 1 and 0 of the address. for the address and data formats, see figure 8.4. the following two operatio ns are possible for the data array. information in the address array is not modified by this operation.
section 8 cache rev. 2.00 sep. 07, 2007 page 198 of 1164 rej09b0321-0200 (1) data array read the data specified by the l bit in the address is read from th e entry address specified by the address and the entry corr esponding to the way. (2) data array write the longword data specified by the data is written to the position specified by the l bit in the address from the entry address sp ecified by the address and the en try corresponding to the way. 31 23 22 13 12 11 31 29 28 10 43210 111100000 111100000 111100010 * ---------- * * ---------- * * ---------- * * ---------- * * ---------- * * ---------- * w * lru x x 000 x v e 00 0 31 23 22 13 12 11 10 4 3 2 1 0 31 0 w 0 l 0 31 23 22 13 12 11 10 11 10 9 43210 43210 w * a0 0 31 23 22 13 12 11 31 29 28 10 43210 111100001 111100001 111100011 w * lru x x 000 u v e 00 0 31 23 22 13 12 11 10 4 3 2 1 0 31 0 w 0 l 0 31 23 22 13 12 11 10 11 10 9 43210 43210 w * a00 1. instruction cache 1.1 address array access (a) address specification read access write access (b) data specification (both read and write accesses) 1.2 data array access (both read and write accesses) (a) address specification tag address (28 to 11) entry address (b) data specification longword data * : don't care e: bit 10 of entry address for read, don't care for write x: 0 for read, don't care for write [legend] entry address tag address (28 to 11) entry address entry address entry address entry address longword data 2.2 data array access (both read and write accesses) (a) address specification (b) data specification 2. operand cache 2.1 address array access (a) address specification read access write access (b) data specification (both read and write accesses) figure 8.4 specifying address and data for memory-m apped cache access
section 8 cache rev. 2.00 sep. 07, 2007 page 199 of 1164 rej09b0321-0200 8.4.3 usage examples (1) invalidating specific entries specific cache entries can be invalidated by writing 0 to the entry's v bit in the memory mapping cache access. when the a bit is 1, the tag address specified by the write data is compared to the tag address within the cache select ed by the entry address, and data is written to the bits v and u specified by the write data when a match is found. if no match is found, there is no operation. when the v bit of an entry in the address array is se t to 0, the entry is written back if the entry's u bit is 1. an example when a write data is specified in r0 an d an address is specified in r1 is shown below. ; r0=h'0110 0010; tag address(28-11)=b'0 0001 0001 0000 0000 0, u=0, v=0 ; r1=h'f080 0088; operand cache address array access, entry=b'000 1000, a=1 ; mov.l r0,@r1 (2) reading the data of a specific entry the data section of a specific cache entry can be read by the memory mapping cache access. the longword indicated in the data field of the data array in figure 8.4 is read into the register. an example when an address is specified in r0 and data is read in r1 is shown below. ; r0=h'f100 004c; instruction cache data array access, entry=b'000 0100, ; way=0, longword address=3 ; mov.l @r0,r1
section 8 cache rev. 2.00 sep. 07, 2007 page 200 of 1164 rej09b0321-0200 8.4.4 notes 1. programs that access me mory-mapped cache should be placed in an address space that is not cached. 2. rewriting the address array contents so that two or more ways are hit simultaneously is prohibited. operation is not guaranteed if the ad dress array contents are changed so that two or more ways are hit simultaneously. 3. memory-mapped cache can be accessed only by the cpu and not by the dmac. registers can be accessed by the cpu and the dmac.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 201 of 1164 rej09b0321-0200 section 9 bus state controller (bsc) the bus state controller (bsc) outputs control si gnals for various types of memory that is connected to the external addr ess space and external devices. this enables the lsi to connect directly with sram, sdram, and other memory storage devices, and external devices. 9.1 features 1. external address space ? a maximum of 64 mbytes for the sdram and each for areas cs0 to cs6 (256 mbytes for cs6) ? ability to select the data bus width (8, 16, or 32 bits) independently for each address space 2. normal space interface ? supports an interface for di rect connection to sram ? cycle wait function: maximum of 31 wait states (maximum of seven wait states for page access cycles) ? wait control ? ability to select the assert/negate timing for chip select signals ? ability to select the assert/negate timing for the read strobe and write strobe signals ? ability to select the data output start/end timing ? ability to select the delay for chip select signals ? write access modes: one-write strobe and byte-write strobe modes ? page access mode: support for page read and page write (64-bit, 128-b it, and 256-bit page units) 3. sdram interface ? ability to set sdram in up to two areas ? refresh functions ? auto-refresh (on-chip programmable refresh counter) ? self-refresh ? ability to select the access timi ng (support for low column late ncy, column latency, and low active interval settings) ? initialization sequencer function, power-down function, deep-power-down function, and mode register setting function implemented on-chip figure 9.1 shows a block diagram of the bsc.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 202 of 1164 rej09b0321-0200 area controller (csc) access controller sdram controller (sdramc) internal bus cs6 to cs0 rd wr3 to wr0 wait a27 to a0 bc3 to bc0 d31 to d0 sdcs1 , sdcs0 sdras , sdcas sdwe , sdcke dqm3 to dqm0 csmodn cs1wcntn cs2wcntn sdrfcnt0/1 sdir0/1 sdmadr sdmtr sdmmod [legend] note: n = 0 to 6, m = 0 and 1 csmodn: csn mode register cs1wcntn: csn wait control register 1 cs2wcntn: csn wait control register 2 csncnt: csn control register csnrec: csn recovery cycle setting register sdcmcnt: sdramcm control register sdrfcnt0/1: sdram refresh control register 0/1 sdir0/1: sdram initialization register 0/1 sdmadr: sdramm address register sdmtr: sdramm timing register sdmmod: sdramm mode register sdpwdcnt: sdram power-down control register sddpwdcnt: sdram deep-power-down control register sdstr: sdram status register sdckscnt: sdram clock stop control signal setting register sdpwdcnt sddpwdcnt sdstr sdckscnt csncnt csnrec sdcmcnt figure 9.1 block diagram of bsc
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 203 of 1164 rej09b0321-0200 9.2 input/output pins table 9.1 shows the pin configuration of the bsc. table 9.1 pin configuration name i/o function a27 to a0 output address bus d31 to d0 i/o data bus cs6 to cs0 output chip select rd output read pulse signal (read data output enable signal) wr3 output when accessing the 32-bit bus ar ea, indicates that d31 to d24 are being written to in byte-write mode. wr2 output when accessing the 32-bit bus area, indicates that d23 to d16 are being written to in byte-write mode. wr1 output when accessing the 32-bit bus area, indicates that d15 to d8 are being written to in byte-write mode. when accessing the 16-bit bus area, indicates that d15 to d8 are being written to in byte-write mode. wr0 output when accessing the 8-bit bus ar ea, indicates that d7 to d0 are being written to in byte-write mode. bc3 output when accessing the 32-bit bus ar ea, indicates that d31 to d24 are being accessed in byte-access mode. bc2 output when accessing the 32-bit bus ar ea, indicates that d23 to d16 are being written to in byte-write mode. bc1 output when accessing the 32-bit bus ar ea, indicates that d15 to d8 are being accessed in byte-access mode. when accessing the 16-bit bus area, indicates that d15 to d8 are being accessed in byte-access mode. bc0 output when accessing the 8-bit bus ar ea, indicates that d7 to d0 are being accessed in byte-access mode. sdcs1 , sdcs0 output connects to cs pin when sdram is connected. sdras output connects to ras pin when sdram is connected. sdcas output connects to cas pin when sdram is connected. sdwe output connects to we pin when sdram is connected.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 204 of 1164 rej09b0321-0200 name i/o function sdcke output connects to cke pin when sdram is connected. dqm3 output connects to dqmuu pin when sdram is connected by 32-bit sdram. dqm2 output connects to dqmul pin when sdram is connected by 32-bit sdram. dqm1 output connects to dqmlu pin when sdram is connected by 32-bit bus. connects to dqmu pin when sdram is connected by 16-bit bus. dqm0 output connects to dqmll pin when sdram is connected by 32-bit bus. connects to dqml pin when sdram is connected by 16-bit bus. connects to dqm pin when sdram is connected by 8-bit bus. wait input external wait input
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 205 of 1164 rej09b0321-0200 9.3 area overview 9.3.1 address map in the architecture, this lsi has a 32-bit addr ess space, which is divided into cache-enabled, cache-disabled, and on-chip spaces (on-chip ram, on-chip peri pheral modules, and reserved areas) according to the upper bits of the address. external address spaces cs5 to cs0 are cache-ena bled when internal address a29 = 0 and cache- disabled when a29 = 1. the cs6 space is always cache-disabled. the kind of memory to be connected and the da ta bus width are specified independently for each partial space. the address map for the ex ternal address space is listed below. table 9.2 address map internal address space memory to be connected cache h'00000000 to h'03ffffff cs0 normal space h'04000000 to h'07ffffff cs1 normal space h'08000000 to h'0bffffff sdram0 sdram h'0c000000 to h'0fffffff sdram1 sdram h'10000000 to h'13ffffff cs2 normal space h'14000000 to h'17ffffff cs3 normal space h'18000000 to h'1bffffff cs4 normal space h'1c000000 to h'1ffff fff cs5 normal space cache- enabled h'20000000 to h'23ffffff cs0 normal space h'24000000 to h'27ffffff cs1 normal space h'28000000 to h'2bffffff sdram0 sdram h'2c000000 to h'2fffffff sdram1 sdram h'30000000 to h'33ffffff cs2 normal space h'34000000 to h'37ffffff cs3 normal space h'38000000 to h'3bffffff cs4 normal space h'3c000000 to h'3ffff fff cs5 normal space cache- disabled
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 206 of 1164 rej09b0321-0200 internal address space memory to be connected cache h'40000000 to h'4fffffff cs 6 normal space cache- disabled h'50000000 to h'e7ffffff other reserved area * ? h'e8000000 to h'efffffff other on-c hip peripheral modu les, reserved area * ? h'f0000000 to h'ff3fffff other cache address array space, reserved area * ? h'ff400000 to h'fff7ffff other on-chi p peripheral modu les, reserved area * ? h'fff80000 to h'fffbffff other on-chip ram, reserved area * ? h'fffc0000 to h'ffffffff other on-chip peripheral module s, reserved area * ? note: * for the on-chip ram space, access the addresses shown in section 24, on-chip ram. for the on-chip peripheral module space, access the addresses shown in section 28, list of registers. do not access addresses which are not described in these sections. otherwise, correct operati on cannot be guaranteed. 9.3.2 data bus width and pin functi on setting for individual areas in this lsi the data bus width of area 0 can be set to 8, 16, or 32 bits through external pins during a power-on reset. the data bus widths of areas 1 to 6 can be modified through register settings during program execution. note that the selectable data bus widths may be limited depending on the connected memory type. after a power-on reset, the lsi starts execution of the program stored in the external memory allocated in area 0. for details on pin function settings, see section 23, pin function controller (pfc). table 9.3 correspondence betw een external pin (m d1 and md0) settings and data bus width md1 md0 data bus width 1 32 bits 1 0 16 bits 1 8 bits 0 0 reserved (setting prohibited)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 207 of 1164 rej09b0321-0200 9.4 register descriptions the bsc has the following registers. all registers are initialized by a power -on reset or in deep standby mode. do not access spaces other than area 0 until setti ngs are completed for the connected memory interface. table 9.4 register configuration register name abbreviation r/w initial value address access size cs0 control register cs0cnt r/w h'00010000/ h'00110000/ h'00210000 * h'ff420000 8, 16, 32 cs0 recovery cycle setting register cs0rec r/w h'00000000 h'ff420008 8, 16, 32 cs1 control register cs1cnt r/w h'00000000 h'ff420010 8, 16, 32 cs1 recovery cycle setting register cs1rec r/w h'00000000 h'ff420018 8, 16, 32 cs2 control register cs2cnt r/w h'00000000 h'ff420020 8, 16, 32 cs2 recovery cycle setting register cs2rec r/w h'00000000 h'ff420028 8, 16, 32 cs3 control register cs3cnt r/w h'00000000 h'ff420030 8, 16, 32 cs3 recovery cycle setting register cs3rec r/w h'00000000 h'ff420038 8, 16, 32 cs4 control register cs4cnt r/w h'00000000 h'ff420040 8, 16, 32 cs4 recovery cycle setting register cs4rec r/w h'00000000 h'ff420048 8, 16, 32 cs5 control register cs5cnt r/w h'00000000 h'ff420050 8, 16, 32 cs5 recovery cycle setting register cs5rec r/w h'00000000 h'ff420058 8, 16, 32 cs6 control register cs6cnt r/w h'00000000 h'ff420060 8, 16, 32 cs6 recovery cycle setting register cs6rec r/w h'00000000 h'ff420068 8, 16, 32
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 208 of 1164 rej09b0321-0200 register name abbreviation r/w initial value address access size sdramc0 control register sdc0cn t r/w h'00000000 h'ff420100 8, 16, 32 sdramc1 control register sdc1cn t r/w h'00000000 h'ff420110 8, 16, 32 cs0 mode register csmod0 r/ w h'00000000 h'ff421000 8, 16, 32 cs0 wait control register 1 cs1wcnt 0 r/w h'1f1f0707 h 'ff421004 8, 16, 32 cs0 wait control register 2 cs2w cnt0 r/w h'00000007 h 'ff421008 8, 16, 32 cs1 mode register csmod1 r/ w h'00000000 h'ff421010 8, 16, 32 cs1 wait control register 1 cs1wcnt 1 r/w h'1f1f0707 h 'ff421014 8, 16, 32 cs1 wait control register 2 cs2w cnt1 r/w h'00000007 h 'ff421018 8, 16, 32 cs2 mode register csmod2 r/ w h'00000000 h'ff421020 8, 16, 32 cs2 wait control register 1 cs1wcnt 2 r/w h'1f1f0707 h 'ff421024 8, 16, 32 cs2 wait control register 2 cs2w cnt2 r/w h'00000007 h 'ff421028 8, 16, 32 cs3 mode register csmod3 r/ w h'00000000 h'ff421030 8, 16, 32 cs3 wait control register 1 cs1wcnt 3 r/w h'1f1f0707 h 'ff421034 8, 16, 32 cs3 wait control register 2 cs2w cnt3 r/w h'00000007 h 'ff421038 8, 16, 32 cs4 mode register csmod4 r/ w h'00000000 h'ff421040 8, 16, 32 cs4 wait control register 1 cs1wcnt 4 r/w h'1f1f0707 h 'ff421044 8, 16, 32 cs4 wait control register 2 cs2w cnt4 r/w h'00000007 h 'ff421048 8, 16, 32 cs5 mode register csmod5 r/ w h'00000000 h'ff421050 8, 16, 32 cs5 wait control register 1 cs1wcnt 5 r/w h'1f1f0707 h 'ff421054 8, 16, 32 cs5 wait control register 2 cs2w cnt5 r/w h'00000007 h 'ff421058 8, 16, 32 cs6 mode register csmod6 r/ w h'00000000 h'ff421060 8, 16, 32 cs6 wait control register 1 cs1wcnt 6 r/w h'1f1f0707 h 'ff421064 8, 16, 32 cs6 wait control register 2 cs2w cnt6 r/w h'00000007 h 'ff421068 8, 16, 32 sdram refresh control register 0 sdrfcnt0 r/w h'00000000 h'ff422000 8, 16, 32 sdram refresh control register 1 sdrfcnt1 r/w h'0000 xxxx h'ff422004 16, 32 sdram initialization register 0 sd ir0 r/w h'00000xxx h 'ff422008 8, 16, 32 sdram initialization register 1 sd ir1 r/w h'00000000 h'ff42200c 8, 16, 32
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 209 of 1164 rej09b0321-0200 register name abbreviation r/w initial value address access size sdram power-down control register sdpwdcnt r/w h'00000000 h'ff422010 8, 16, 32 sdram deep-power-down control register sddpwdcnt r/w h'00000000 h'ff422014 8, 16, 32 sdram0 address register sd0adr r/w h'00000x0x h'ff422020 8, 16, 32 sdram0 timing register sd0tr r/w h'000xxx0x h'ff422024 8, 16, 32 sdram0 mode register sd0mod r/w h'0000xxxx h'ff422028 16, 32 sdram1 address register sd1adr r/w h'00000x0x h'ff422040 8, 16, 32 sdram1 timing register sd1tr r/w h'000xxx0x h'ff422044 8, 16, 32 sdram1 mode register sd1mod r/w h'0000xxxx h'ff422048 16, 32 sdram status register sdstr r/w h'00000000 h'ff4220e4 8, 16, 32 sdram clock stop control signal setting register sdckscnt r/w h'0000000f h'ff4220e8 8, 16, 32 ac characteristics switching register acswr r/w h'00000000 h'fffd8808 8, 16, 32 note: * depends on the setting of the md pin. 9.4.1 csn control register (csncnt) (n = 0 to 6) csncnt selects the width of the external bus and controls the operation of the csc interface. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r r r r r r/w r/w r r r r/w 0000000000000000 rrrrrrrrrrrrrrrr * 1 * 1 * 2 ? bsize[1:0] exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ???? ??????? bit bit name initial value r/w description 31 to 22 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 210 of 1164 rej09b0321-0200 bit bit name initial value r/w description 21, 20 bsize[1:0] 00 * 1 r/w external bus width select these bits specify the width of the data bus for the external device of the corresponding channel of csc. the initial value for the data bus width for csc channel 0 (cs0) differs depending on the settings of pins md1 and md0. 10: 8-bit bus 00: 16-bit bus 01: 32-bit bus 19 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 exenb 0 * 2 r/w operation enable this bit enables or disables the operation for the corresponding channel of csc. the initial value corresponding to cs0 only is operation enabled (exenb = 1). 0: operation disabled 1: operation enabled 15 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. notes: 1. the initial value of the bsize bits in cs0 differs depending on the settings of pins md1 and md0. 2. the initial value of the exenb bit in cs0 is 1. to disable the operation for each channel, forcibly write out data tentatively stored in internal write buffer. the procedure is as follows: 1. execute read access to the channel whose operation is to be disabled. 2. then, write 0 to the exenb bit (operation disabled).
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 211 of 1164 rej09b0321-0200 9.4.2 csn recovery cycle setting register (csnrec) (n = 0 to 6) csnrec specifies the number of da ta recovery cycles to be inserted after read or write accesses. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r r/w r/w r/w r/w r r r r r/w r/w r/w r/w 0000000000000000 rrrrrrrrrrrrrrrr ? wrcv[3:0] rrcv[3:0] ? ? ? ? ? ? ???? ????????????? bit bit name initial value r/w description 31 to 28 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 27 to 24 wrcv[3:0] 0000 r/w post-wri te data recovery cycle setting these bits specify the numbe r of data recovery cycles to be inserted after write accesses to the external bus. if a value other than 0 is selected, between 1 and 15 data recovery cycles are inserted when a write access to the external bus is followed by a read access to the external bus. (data recovery cycles are inserted even when access is performed sequentially to the same csc channel.) note that if idle cycles occur between accesses to the external bus, the number of data recovery cycles inserted is reduced by the number of idle cycles. 0000: 0 cycle 0001: 1 cycles : 1111: 15 cycles 23 to 20 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 212 of 1164 rej09b0321-0200 bit bit name initial value r/w description 19 to 16 rrcv[3:0] 0000 r/w post-read data recovery cycle setting these bits specify the numbe r of data recovery cycles to be inserted after read accesses to the external bus. if a value other than 0 is selected, data recovery cycles are inserted in the following cases: if a read access to the external bus is followed by a write access to the external bus. (data recovery cycles are inserted even when access is performed sequentially to the same csc channel.) if a read access to the external bus is followed by a read access to a different csc channel. (no data recovery cycles are inserted in cases of sequential read accesses to the same csc channel.) note that if idle cycles o ccur between accesses to the external bus, the number of data recovery cycles inserted is reduced by the number of idle cycles. 0000: 0 cycle 0001: 1 cycles : 1111: 15 cycles 15 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. notes: 1. when accessing sdram, there is no dang er of data collision on the bus due to timing. consequently, there is no data recovery cycl e setting for sdram. (the value is fixed at 0 cycles.) 2. writing to the csn recovery cycle setti ng register (csnrec) must be done while csc for the corresponding channel is disabled (exenb = 0). only channel 0 (cs0) can be enabled by setting exenb = 1. to enable channel 0, stop the dmac and set exenb to 1 between the reset release and data write access to cs0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 213 of 1164 rej09b0321-0200 9.4.3 sdramcm control register (sdcmcnt) (m = 0, 1) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r r r r r r/w r/w r r r r/w 0000000000000000 rrrrrrrrrrrrrrrr ? bsize[1:0] exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ? ? ? ? ?? bit bit name initial value r/w description 31 to 22 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 21, 20 bsize[1:0] 00 r/w external bus width select these bits specify the width of the data bus for the external device of the corresponding channel of csc. 10: 8-bit bus 00: 16-bit bus 01: 32-bit bus 19 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 exenb 0 r/w operation enable this bit enables or disables the operation for the corresponding channel of csc. 0: operation disabled 1: operation enabled 15 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. to disable the operation for each channel, forcibly write out data tentatively stored in internal write buffer. the procedure is as follows: 1. execute read access to the channel whose operation is to be disabled.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 214 of 1164 rej09b0321-0200 2. then, write 0 to the exenb bit (operation disabled). 9.4.4 csn mode register (csmodn) (n = 0 to 6) csmodn selects the mode for page read access and the bit boundary for page access, enables page read/write access and external wait, and selects the mode for write access. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r r/w r/w r r r/w r/w r r r r r/w r r r/w 0000000000000000 rrrrrrrrrrrrrrrr pr mod ? pbcnt[1:0] ? ? pw enb pr enb ???? ew enb ?? wr mod ???????????????? bit bit name initial value r/w description 31 prmod 0 r/w page read access mode select this bit selects the operating mode for page read access. clearing prmod to 0 selects the normal access compatible mode. in this mode the rd signal is negated each time a unit of data is read and an rd assert wait is inserted. se tting prmod to 1 selects the external data read sequential assert mode. in this mode rd is asserted continuously between page accesses. 0: normal access compatible mode 1: external data read sequential assert mode 30 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 215 of 1164 rej09b0321-0200 bit bit name initial value r/w description 29, 28 pbcnt[1:0] 00 r/w page access bit boundary select these bits select the bit boundary for page access operation. when the bit bo undary specified by pbcnt is exceeded during page access, page access operation is halted temporarily (the csn signal is negated), and then page access operation begins again. the value written to these bits is valid only when either of the pwenb bit or the prenb bit is set to 1. 00: 64-bit boundary 01: 128-bit boundary 10: 256-bit boundary 11: setting prohibited 27, 26 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 25 pwenb 0 r/w page write access enable this bit is used to enable page write access. 0: page write access disabled 1: page write access enabled 24 prenb 0 r/w page read access enable this bit is used to enable page read access. 0: page write access disabled 1: page write access enabled 23 to 20 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 216 of 1164 rej09b0321-0200 bit bit name initial value r/w description 19 ewenb 0 r/w external wait enable this bit is used to enable or disable external wait input. when ewenb is set to 1, external wait input is enabled and the number of wa it states per cycle can be controlled using the external wait signal ( wait ). in this case wait cycles are inserted while the wait signal is low level. when ewenb is cleared to 0, the wait signal is invalid. 0: external wait disabled 1: external wait enabled 18, 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 wrmod 0 r/w write access mode select this bit selects the operating mode for write access. clearing wrmod to 0 selects the byte-write strobe mode. in this mode data writes are controlled by multiple write signals ( wr3 to wr0 ) that correspond to the individual byte positions. setting wrmod to 1 selects the one-write strobe mode. in this mode, data writes are controlled by multiple byte control signals ( bc3 to bc0 ) that correspond to the individual byte positions and a single write signal ( wr0 for the 8-bit bus width channel, wr1 for the 16-bit bus width channel, and wr3 for the 32-bit bus width channel) 0: byte-write strobe mode 1: one-write strobe mode 15 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. writing to the csn mode register (csmodn) must be done while csc for the corresponding channel is disabled (exenb = 0). only channel 0 (cs0) can be enabled by setting exenb = 1. to enable channel 0, stop the dmac and set exen b to 1 between the reset release and data write access to cs0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 217 of 1164 rej09b0321-0200 9.4.5 csn wait control register 1 (cs1wcntn) (n = 0 to 6) cs1wcntn specifies the number of wait states in serted into the read/write cycle or page read/page write cycle. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0001111100011111 r r r r/w r/w r/w r/w r/w r r r r/w r/w r/w r/w r/w 0000011100000111 rrrrrr/wr/wr/wrrrrrr/wr/wr/w ? ? ? csrwait[4:0] ? ? ? cswwait[4:0] ? ? ? ? ? csprwait[2:0] ? ? ? ? ? cspwwait[2:0] bit bit name initial value r/w description 31 to 29 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 28 to 24 csrwait [4:0] 11111 r/w read cycle wait select these bits specify the number of wait states inserted into the initial normal read cycle and page read cycle. 00000: 0 wait states : 11111: 31 wait states 23 to 21 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 20 to 16 cswwait [4:0] 11111 r/w write cycle wait select these bits specify the number of wait states inserted into the initial normal writ e cycle and page write cycle. 00000: 0 wait states : 11111: 31 wait states 15 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 218 of 1164 rej09b0321-0200 bit bit name initial value r/w description 10 to 8 csprwait [2:0] 111 r/w page read cycle wait select these bits specify the number of wait states inserted into the second and subsequent page read cycles. this setting is valid when the page read access enable bit (prenb) is set to 1. 000: 0 wait state : 111: 7 wait states 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 to 0 cspwwait [2:0] 111 r/w page write cycle wait select these bits specify the number of wait states inserted into the second and subsequent page write cycles. this setting is valid when the page write access enable bit (pwenb) is set to 1. 000: 0 wait state : 111: 7 wait states notes: 1. make sure the page read and pag e write cycle wait select (csprwait and cspwwait) settings are within the range defined by the read and write cycle wait select (csrwait and cswwait) settings. select each wait cycle number according the system configurat ion incorporated. 2. writing to the csn wait control regist er 1 (cs1wcntn) must be done while csc for the corresponding channel is disabled (exenb = 0). only channel 0 (cs0) can be enabled by setting exenb = 1. to enable channel 0, stop the dmac and set exenb to 1 between the reset release and data write access to cs0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 219 of 1164 rej09b0321-0200 9.4.6 csn wait control register 2 (cs2wcntn) (n = 0 to 6) cs2wcntn specifies the number of wait st ates and the number of delay cycles. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r/w r/w r/w r r/w r/w r/w r r/w r/w r/w r r/w r/w r/w 0000000000000111 r r r r r r/w r/w r/w r r/w r/w r/w r r/w r/w r/w ? cson[2:0] ? wdon[2:0] ? wron[2:0] ? rdon[2:0] ? ? ? ? ? wdoff[2:0] ? cswoff[2:0] ? csroff[2:0] bit bit name initial value r/w description 31 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 30 to 28 cson [2:0] 000 r/w cs assert wait select these bits specify the number of wait states inserted before the external chip select signal ( csn ) is asserted. 000: 0 wait state : 111: 7 wait states 27 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 26 to 24 wdon [2:0] 000 r/w write data output wait select these bits specify the number of wait states inserted before data is output to the external data bus. 000: 0 wait state : 111: 7 wait states 23 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 220 of 1164 rej09b0321-0200 bit bit name initial value r/w description 22 to 20 wron [2:0] 000 r/w wr assert wait select these bits specify the number of wait states inserted before the external data write signal ( wr3 to wr0 ) is asserted. 000: 0 wait state : 111: 7 wait states 19 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 18 to 16 rdon [2:0] 000 r/w rd assert wait select these bits specify the number of wait states inserted before the external data read signal ( rd ) is asserted. 000: 0 wait state : 111: 7 wait states 15 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 to 8 wdoff [2:0] 000 r/w write data output delay cycle select these bits specify the numbe r of cycles from the end of the wait cycle during write ope ration (negation of the wr3 to wr0 signals) and the negation of the external data bus. 000: 0 wait state : 111: 7 wait states 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 221 of 1164 rej09b0321-0200 bit bit name initial value r/w description 6 to 4 cswoff [2:0] 000 r/w write operation cs delay cycle select these bits specify the numbe r of cycles from the end of the wait cycle during write access operation (negation of the wr3 to wr0 signals) and the negation of the cs6 to cs0 signal. 000: 0 wait state : 111: 7 wait states 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 to 0 csroff [2:0] 111 r/w read operation cs delay cycle select these bits specify the numbe r of cycles from the end of the wait cycle during read access operation (negation of the rd signal) and the negation of the cs6 to cs0 signal. 000: 0 wait state : 111: 7 wait states notes: 1. select each wait cycle number or extended cycle number according the system configuration incorporated. 2. writing to the csn wait control regist er 2 (cs2wcntn) must be done while csc for the corresponding channel is disabled (exenb = 0). only channel 0 (cs0) can be enabled by setting exenb = 1. to enable channel 0, stop the dmac and set exenb to 1 between the reset release and data write access to cs0. 3. each bit must be set under the following restrictions. ? when page access is disabled (prenb, pwenb = 0) cson min (csrwait, cswwait), wdon cswwait wron cswwait, rdon csrwait wdoff cswoff ? when page access is enabled (prenb = 1 or pwenb = 1) in addition to the restrictions for disabled page access case, the following restrictions are required. cson min (csprwait, cspwwait) wron cspwwait, rdon csprwait wdon cspwwait
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 222 of 1164 rej09b0321-0200 9.4.7 sdram refresh control register 0 (sdrfcnt0) sdrfcnt0 controls self-refresh operation. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr/w ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? dsfen bit bit name initial value r/w description 31 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 dsfen 0 r/w sdram common se lf-refresh operation enable this bit controls self-refresh operation for all channels simultaneously. setting dsfen to 1 performs auto- refresh cycle operation, imme diately after which self- refresh operation begins. clearing dsfen to 0 ends self-refresh operation, and auto-refresh operation resumes immediately afterward. the value written to this bit is reflected when self-refresh operation starts, if dsfen was set to 1, or when auto-refresh operation starts following the end of se lf-refresh operation, if dsfen was cleared to 0. 0: self-refresh disabled 1: self-refresh enabled
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 223 of 1164 rej09b0321-0200 9.4.8 sdram refresh control register 1 (sdrfcnt1) sdrfcnt1 controls auto-refresh operation. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ??????????????? ???????????????? drfen drefw[3:0] drfc[11:0] bit bit name initial value r/w description 31 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 drfen 0 r/w auto-refresh operation enable this bit controls auto-refresh operation for all channels simultaneously. when drfen is cleared to 0, auto- refresh operation does not take place. auto-refresh operates when drfen is set to 1. clearing this bit to 0 while auto-refresh is enabled causes drfen to be cleared to 0, and auto-refresh operation to halt, after the end of the next auto-refresh cycle. setting this bit to 1 while auto-refresh is enabled causes auto-refresh operation to commence as soon as drfen is set to 1, and refresh requests are then generated at fixed intervals determined by a counter. the interval at which refresh requests are generated is determined by the set value of the auto-refresh request interval setting (drfc) bits. refresh requests are not accepted while sdram is being accessed; they must wait until the access completes. if a sdram access and refresh request are generated at the same time, the refresh request takes precedence. 0: auto-refresh disabled 1: auto-refresh enabled
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 224 of 1164 rej09b0321-0200 bit bit name initial value r/w description 15 to 12 drefw [3:0] undefined r/w auto-refresh cycle/self-refresh clearing cycle count setting these bits specify the num ber of auto-refresh cycles and the number of self-refresh clearing cycles. the drefw bits can be written to at any time, regardless of the state of the auto- refresh operation enable (drfen) bit. if auto-refresh is disabled, the value written to these bits takes effect immediately. if auto- refresh is enabled, the value written to these bits takes effect immediately if an auto-refresh cycle is not in progress. if an auto-refresh cycle is in progress, the new value takes effect a fter the cycle completes. 0000: 1 cycle 0001: 2 cycles 0010: 3 cycles : 1111: 16 cycles 11 to 0 drfc [11:0] undefined r/w auto-refresh request interval setting these bits specify the auto -refresh interval. the drfc bits can be written to at any time, regardless of the state of the auto-refresh o peration enable (drfen) bit. if auto-refresh is disabled, the value written to these bits takes effect immediately. if auto-refresh is enabled, the value written to these bits is reflected in the operation of the refresh counter from the next auto- refresh request generated. 000000000000: setting prohibited 000000000001: 2 cycles 000000000010: 3 cycles : 111111111111: 4096 cycles note: auto-refresh requests are not accepted wh ile multiple read or write accesses are in progress, or during a transfer using dmac, so the auto-refresh interval may become enlarged in some cases. set the drfc bits to an auto-refresh request interval value that satisfies the auto-refresh interval specific ation of the sdram being used. furthermore, make sure to set the auto-refresh request interv al to a duration longer than the auto-refresh cycle.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 225 of 1164 rej09b0321-0200 auto-refresh request interval and drfc set value: sdramc includes a 12-bit refresh counter that gene rates auto-refresh requests at fixed intervals. the following equation is used to calculate the set value for the drfc bits from the auto-refresh request interval. drfc = (auto-refresh request interval / system clock cycle) ? 1 auto-refresh requests are not accep ted while sdram is being accessed; they must wait until the access completes. however, the counter value is u pdated regardless or whether or not the request was accepted. note that if two or more auto-refresh requests are generated while sdram is being accessed, the second and subse quent requests are ignored. 9.4.9 sdram initialization register 0 (sdir0) sdir0 specifies the sdram initialization sequence timing. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 00000 r r r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ? ? ? ? ? ? ? ? ???????????? ??????????? ? dpc[2:0] darfc[3:0] darfi[3:0] bit bit name initial value r/w description 31 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 to 8 dpc[2:0] undefined r/w initia lization precharge cycle count setting these bits specify the numbe r of precharge cycles in the sdram initialization sequence. 000: 3 cycles 001: 4 cycles : 111: 10 cycles
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 226 of 1164 rej09b0321-0200 bit bit name initial value r/w description 7 to 4 darfc [3:0] undefined r/w initialization auto-refresh count these bits specify the numbe r of times auto-refresh is to be performed in the sdram initialization sequence. 0000: setting prohibited 0001: 1 time : 1111: 15 times 3 to 0 darfi[3:0] undefined r/w initialization auto-refresh interval these bits specify the inte rval at which auto-refresh commands are issued in the sdram initialization sequence. 0000: 3 cycles 0001: 4 cycles 0010: 5 cycles : 1111: 18 cycles note: make settings that satisfy the specificati ons of the connected sdram before starting the initialization sequence.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 227 of 1164 rej09b0321-0200 9.4.10 sdram initialization register 1 (sdir1) sdir1 controls activation of the sdram initialization sequence. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr/w 0000000000000000 rrrrrrrrrrrrrrrr/w ? din ist ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? din irq bit bit name initial value r/w description 31 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 dinist 0 r/w init ialization status when set to 1, this bit indicates that an sdram initialization sequence is in progress for channel sdram0 or sdram1. 0: initialization sequence not progress 1: initialization sequence in progress 15 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 dinirq 0 r/w common init ialization sequence start setting this bit to 1 causes the sdram initialization sequence to start and automatically sets the initialization status bit (dinis t) to 1. the initialization status bit (dinist) is cleared automatically after the initialization sequence ends. the value written to the dinirq bit is not retained. 0: invalid 1: initialization sequence start
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 228 of 1164 rej09b0321-0200 9.4.11 sdram power-down control register (sdpwdcnt) sdpwdcnt controls transition to and recovery from power-down mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0 000000000000000 r rrrrrrrrrrrrrrr 0 000000000000000 r rrrrrrrrrrrrrrr/w ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? dpwd bit bit name initial value r/w description 31 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 dpwd 0 r/w sdram common power-down enable this bit controls transition to and recovery from power- down mode for all channels simultaneously. setting dpwd to 1 causes all channels to transition to power- down mode. clearing dpwd to 0 causes all channels to recover from power-down mode. if an auto-refresh is in progress, the transition to power-down mode is delayed until the auto-refresh completes. 0: power-down disabled 1: power-down enabled
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 229 of 1164 rej09b0321-0200 9.4.12 sdram deep-power-down control register (sddpwdcnt) sddpwdcnt controls transition to and recovery from deep-power-down mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr/w ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ddpd bit bit name initial value r/w description 31 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 ddpd 0 r/w sdram common deep-power-down enable this bit controls transition to and recovery from deep- power-down mode for all channels simultaneously. setting ddpd to 1 causes all sdram channels to transition to deep-power-down mode. clearing ddpd to 0 causes all sdram channels to recover from deep- power-down mode. if an auto-refresh is in progress, the transition to deep-power-down mode is delayed until the auto-refresh completes. 0: deep-power-down disabled 1: deep-power-down enabled
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 230 of 1164 rej09b0321-0200 9.4.13 sdramm address register (sdmadr) (m = 0, 1) sdmadr specifies the data bus width and the channel size of sdram. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 000000??00000??? rrrrrrr/wr/wrrrrrr/wr/wr/w ? ? ? ? ? ? ? ? ? ? ??????????? ? ????? ddbw[1:0] dsz[2:0] bit bit name initial value r/w description 31 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 ddbw[1:0] undefined r/w sdram data bit width setting these bits specify the width of the sdram bus. 00: 8 bits 01: 16 bits 10: 32 bits 11: setting prohibited 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 to 0 dsz[2:0] undefined r/w channel size setting these bits specify the size of channels 0 and 1. if a size smaller than sdram area 0 or 1 is selected, ghost memory will result. when accessing 32-bit data in sdram with a 16-bit bus width, the 16 bits of the first half of the address (a1 = 0) are accessed first, and then the 16 bits of the second half of the address (a1 = 1) are accessed.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 231 of 1164 rej09b0321-0200 9.4.14 sdramm timing register (sdmtr) (m = 0, 1) sdmtr specifies the ti ming for read and write accesses to sdram. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000??? rrrrrrrrrrrrrr/wr/wr/w 0 0 ?????? 0 0000??? rrr/wr/wr/wr/wr/wr/wrrrrrr/wr/wr/w ????????????? dwr dras[2:0] ? ? drcd[1:0] dpcg[2:0] ? ? ? ? ? dcl[2:0] bit bit name initial value r/w description 31 to 19 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 18 to 16 dras[2:0] undefined r/w row active interval setting these bits specify the minimum interval that must elapse between the sdram row activation command (act) and deactivation (pra). 000: 1 cycle : 111: 8 cycles 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 drcd[1:0] undefined r/w row column latency setting these bits specify the sdram row column latency. 00: 1 cycles 01: 2 cycles 10: 3 cycles 11: 4 cycles
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 232 of 1164 rej09b0321-0200 bit bit name initial value r/w description 11 to 9 dpcg[2:0] undefined r/w row precharge interval setting these bits specify the mini mum number of cycles that must elapse between the sdram deactivation command (pra) and the next valid command. 000: 1 cycles : 111: 8 cycles 8 dwr 0 r/w write recovery interval setting this bit specifies the minimum interval that must elapse between the sdram write command (write) and deactivation (pra). 0: 1 cycles 1: 2 cycles 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 to 0 dcl[2:0] undefined r/w sdram controller column latency setting these bits specify the column latency of the sdram controller. this setting only affects the latency setting on the sdram controller side. to specify the column latency for externally connected sdram it is necessary to use the separate sdramm mode register (sdmmod), which is described below. 000: setting prohibited 001: 1 cycles 010: 2 cycles 011: 3 cycles 1xx: setting prohibited [legend] x: don't care
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 233 of 1164 rej09b0321-0200 9.4.15 sdramm mode register (sdmmod) (m = 0, 1) sdmmod specifies the values to be written to the sdram mode register or extended mode register. writing to this register causes a mode register set command or extended mode register set command to be issued automatically to sdram. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0 r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ???????????????? ??????????????? ? dmr[14:0] bit bit name initial value r/w description 31 to 15 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 14 to 0 dmr[14:0] undefined r/w mode register setting writing to these bits causes a mode register set command or extended mode register set command to be issued to sdram. the setting of the dmr bits is output as a16 to a2 signals. the distinction between the mode register set command and extended mode register set command is made on the bases of the sdram bank address. write operation: a mode register set command is issued. dmr bit b14 b13 ... b0 a16 to a2 signal a16 a15 ... a2 notes: the following points should be kept in mind regarding sdramm mode register settings. 1. make sure to set a burst length of 1 for sdram. operation c annot be guaranteed with settings other than burst length 1. 2. the sdram column latency must match the setting of the sdram controller column latency setting bits (dcl) in sdramc. o peration cannot be guaranteed if the latency settings do not agree. 3. check to make sure the status bits (dsrfst, dpwdst, ddpdst, and dmrsst) in the sdram status register (sdstr) are all cleared to 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 234 of 1164 rej09b0321-0200 9.4.16 sdram status register (sdstr) sdstr consists of the status flags that indica te the status of operation during self-refresh, initialization sequences, power-down mode, deep-p ower-down mode, and mode register setting. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0 000000000000000 r rrrrrrrrrrrrrrr 0 000000000000000 r rrrrrrrrrrrrrrr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?????? ? dsrf st dini st dpwd st ddpd st dmrs st bit bit name initial value r/w description 31 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 dsrfst 0 r self-refresh transition/recovery status when set to 1, this bit indicates that a transition to or recovery from self-refresh ope ration is in progress for channel sdram0 or sdram1. 0: transition/recovery not in progress 1: transition/recovery in progress 3 dinist 0 r init ialization status when set to 1, this bit indicates that an initialization sequence is in progress for channel sdram0 or sdram1. this bit has the same function as the dinist bit in sdir1. 0: initialization sequence not in progress 1: initialization sequence in progress
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 235 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 dpwdst 0 r power-down transition/recovery status when set to 1, this bit indicates that a transition to or recovery from power-down mode is in progress for a channel from sdram0 to sdram3. 0: initialization sequence not in progress 1: initialization sequence in progress 1 ddpdst 0 r deep-power-down transition/recovery status when set to 1, this bit indicates that a transition to or recovery from deep-power-down mode is in progress for channel sdram0 or sdram1. 0: transition/recovery not in progress 1: transition/recovery in progress 0 dmrsst 0 r mode register setting status when set to 1, this bit indicates that mode register setting is in progress for channel sdram0 or sdram1. 0: mode register setting not in progress 1: mode register setting in progress "transition to or recovery from in progress" refers to the interval from the point at which the bits listed in table 9.5 are written to until th e corresponding commands are issued. table 9.5 list of status regist ers and bits requiring checking function register bits self-refresh sdrfcnt0 dsfencm, dsfen initialization sequence sd ir1 dinirqcm, dinirq power-down sdpwdcnt dpwdcm, dpwd deep-power-down sddpdcnt ddpdcm, ddpd mode register setting sdmmod dmr note: execution of a self-refresh, a transition to or recovery from power-down or deep-power- down mode, an initialization sequence, or mode register setting may only be performed when all status bits are cleared to 0. do not rewrite the registers (bits) listed below when any of the status bits (dsrfst, dinist , dpwdst, ddpdst, dmrsst) is set to 1.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 236 of 1164 rej09b0321-0200 9.4.17 sdram clock stop control signal setting register (sdckscnt) sdckscnt enables or disables the clock stop co ntrol signal (internal signal in the chip) and specifies the number of assert cycles. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr/w 0 000000000001111 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w ? dck sen ? ? ? ? ? ? ? ? ? ? ? ? ? ???????? ? dcksc[7:0] bit bit name initial value r/w description 31 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 dcksen 0 r/w clock stop control signal enable this bit is used to enable or disable the clock stop control signal. when enabled, the clock stop control signal operates during transition to and from deep- power-down mode and stops the ckio (high level). when disabled, the clock stop control signal stays low level. 0: clock stop control signal disabled 1: clock stop control signal enabled 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 237 of 1164 rej09b0321-0200 bit bit name initial value r/w description 7 to 0 dcksc [7:0] h'0f r/w clock stop control signal assert cycle count setting these bits specify the interv al from the point at which the deep-power-down transition command is issued until the clock stop signal goes high level to stop the ckio (high level), and the interval from the point at which the clock stop signal goes low level to start the ckio operation until the recover command is issued. 00000000: 0 cycle : 00001111: 15 cycles : 11111111: 255 cycles 9.4.18 ac characteristics switching register (acswr) when writing to the external ad dress space or making sdram settings in power-on reset exception handling or cancellation of deep standby mode, be sure to set bits acosw[3:0] in acswr to b'0011 beforehand. acswr is initialized to h'00000000 by a power-on reset and entry to deep standby mode, but is not initialized by a manual reset, entry to sl eep mode, or entry to software standby mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 ? ? ? ? ? ? ???? ???? ????? ? ? ? ? ? ? ? ? ? acosw[3:0] bit bit name initial value r/w description 31 to 4 ? all 0 r/w reserved these bits are always read as 0. the write value should always be 0.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 238 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3 to 0 acosw[3:0] 0000 r/w ac characteristics switch these bits specify ac characteristics switching. 0000: does not extend the delay time 0011: switches characteri stics and extends the delay time other than above: setting prohibited 9.5 operation 9.5.1 csc interface (1) normal access normal read/write operation is used for all bu s access when page read/write access is disabled (prenb = 0, pwenb = 0). even when page read/write access is enabled (prenb = 1, pwenb = 1), normal read/write operati on is employed in cases where pa ge access cannot be used. figure 9.2 shows the basic operation of the external bus control signals in read operation, and figure 9.3 shows the basic operation of these signals in write operation. ckio ts tw1 tw2 tend (trd) twn tn1 tn2 tnm a27 to a0 csn rd wr d31 to d0 read cycle wait cs assert wait rd assert wait start enable point of next bus access cs delay cycle during read figure 9.2 basic bus timing (read operation)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 239 of 1164 rej09b0321-0200 ckio ts tw1 tw2 tend twn tn1 tnm a27 to a0 csn rd wr d31 to d0 write cycle wait cs assert wait wr assert wait write data output wait start enable point of next bus access cs delay cycle during write write data output delay cycle figure 9.3 basic bus ti ming (write operation) 1. ts (internal bus access start) this is a bus access request cycle initiated by the internal bus master and with the external bus as the target. csn is always high during this cycle. in the next cycle a27 to a0 and the write data change. 2. tw1 to twn (read cycl e wait, write cycle wait) these are the cycles between internal bus acce ss start and the wait end cycle. a duration of from 0 to 31 clocks may be selected. during this interval the csn , rd , and wr control signals are asserted (low level) in accordance with the wait settings. the assert timing can be controlled using the cs assert wait, rd assert wait, wr assert wait, and write data output wait bits in csn control registers 1 and 2. the number of wait cycles can be set to from 0 to 7 clocks, with the count starting from the cycle following inte rnal bus access start (ts). the number of clocks selected must be no greater th an the number of read/write cycle wait cycles. 3. tend (wait end cycle) this is the final cycle in a series of read cycle wait or write cycle wait cycles. the rd or wr signal is negated (high level) in the next cycle.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 240 of 1164 rej09b0321-0200 4. tn1 to tnm (cs delay cycle) these are the cycles between the wait end cycle and when csn is negated (high level). the negation timing can be controlled using write data output delay cycles. the number of cycles is counted beginning from the wait end cycle. in write access or if th e number of cs delay cycles during a read is other than 0 or 1, the succeeding bus access can start from the cycle following the cs delay cycle end. if the number of cs delay cycles is 0 or 1 in read access, the succeeding bus access can start after the end of the read data sample cycle (see below). 5. trd (read data sample cycle) this is the sample cycle for read data. (2) page access page read and write operation is employed for bus accesses for which page access can be used if page write access enable (pwenb = 1) and page read access enable (prenb = 1) have been selected. page access is used in the following cases. 1. cpu burst access (cache replacement) 2. when longword (32-bit) access to an 8-bit or 16-bit external data bus has been performed 3. when word (16-bit) acces s to an 8-bit external da ta bus has been performed table 9.6 shows the way addresses are modified in cases 1 above. table 9.6 address modifica tion during burst access bus master burst mode address modification cpu increment incremented by single transfer byte count only. note: * wrap boundary: single transfer byte count burst transfer length figure 9.4 shows the basic operation of the external bus control signals in page read operation, and figure 9.5 shows the basic operation of these signals in write operation. note that if the number of data bits accessed in a single burst is greater than the single page access bit boundary setting of the pbcnt bits in the mode register, a single bur st access will trigger multiple page accesses. regardless of whether the bust mode is incremen t or wraparound, page access stops temporarily (the csn signal is negated) at the point when th e address exceeds the page boundary, and page access operation starts again. if th e number of data bits accessed in a single burst is smaller than the page boundary bit count, a single page access is sufficient to complete the burst transfer.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 241 of 1164 rej09b0321-0200 note: * rd assert wait operation during the second and subsequent bus accesses differs depending on the page read access mode setting value. ckio ts a0 a1 tw1 tend (trd) twn tn1 tn2 tend (trd) twn tn1 tn2 tnm a27 to a0 csn rd wr d31 to d0 start enable point of next bus access cs delay cycle during read (end only) bus access (second and subsequent times) bus access (first time) read cycle wait page read cycle wait cs assert wait cs delay cycle during read rd assert wait rd assert wait * figure 9.4 basic bus timing (page read operation)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 242 of 1164 rej09b0321-0200 ckio ts a0 a1 d0 d1 tw1 tw2 tpw1 tend twn tdw1 tdwn tend tpwn tdw1 tdwn tn1 tnm a27 to a0 csn rd wr d31 to d0 bus access (first time) bus access (second and subsequent times) cs delay cycle during write (end only) write cycle wait write data output delay cycle page write cycle wait cs assert wait wr assert wait write data output wait write data output wait write data output delay cycle write data output delay cycle wr assert wait cs delay cycle during write figure 9.5 basic bus timing (page write operation) 1. ts (internal bus access start) this is a bus access request cycle initiated by the internal bus master and with the external bus as the target. csn is always high during this cycle. in the next cycle a27 to a0 and the write data change. 2. tw1 to twn (read cycle wait, write cycle wait) for the first page access, the wait operation from internal bus access star t to the wait end cycle is the same as in normal access. 3. tend (first wait end cycle) this is the final cycle in the first series of re ad cycle wait or write cycle wait cycles. in write access, the second and subsequent page accesses st art from the next cycle, unless a write data output delay cycle has been specified (with a value other than 0). the rd or wr signal is negated (high level) in the next cycle if the rd assert wait or wd assert wait setting is other than 0. if the rd assert wait or wd assert wait setting is 0, the rd or wr signal continues to be asserted (low level). the csn signal is not negated and continues to be asserted (low level). in page read access, the succeeding bus access star ts without waiting for the read data sample cycle (trd).
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 243 of 1164 rej09b0321-0200 4. tdw1 to tdwn (write data output delay cycle) in write access write data output delay cycles ar e inserted between the wait end cycle and the following page access if the write data output dela y wait setting is other than 0. assertion of the address and output data is extended for the duration of this interval. also, the wr signal is negated (high level). 5. tpw1 to tpwn (page read cycle wait, page write cycle wait) in page access the page read cycle wait and page write cycle wait settings are used in place of the read cycle wait and write cycle wait settings for the second and subsequent bus cycles. the wr assert wait setting works the same as during the first bus cycle. the rd assert wait setting operates differently depending on the page read access mode (prmod) setting value. prmod = 0: rd assert wait setting operates identically to first bus cycle. prmod = 1: rd assert wait setting is invalid. op eration is the same as an rd assert wait setting of 0. 6. tend/tdw1 to tdwn (wait end cycl e/write data output delay cycle) these operate the same as during the first access (3 and 4 above). 7. tn1 to tnm (cs delay cycle) these are the cycles between the final wait end cycle and when csn is negated (high level). the number of cs delay cycles is coun ted beginning from the wait end cycle. 8. trd (final read data sample cycle) this is the final sample cycle for read data. (3) external wait function the external wait signal ( wait ) can be used to extend the wa it cycle duration beyond the value specified by the cycle wait (csrwait, csww ait) or page access cycle wait (csprwait, cspwwait) settings in the csn wait control regi ster (cswcntn). if external wait enable (ewenb = 1) has been selected, wait cycl es are inserted for as long as the wait signal remains low level. the wait signal is disabled if external wait disable (ewenb = 0) has been selected. note that the wait cycles specifi ed by the settings of the csn wait control register (cswcntn) are inserted regardless of the state of the wait signal. (a) normal read/write operation the wait signal is sampled all the time and its result is reflected two cycles later. thus, when the wait signal is low two cycles before the end of the wait cycles, external cycles are inserted. after the wait signal has gone high, the wait cycles end two cycles later.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 244 of 1164 rej09b0321-0200 (b) page access operation the initial data read/write operation is the same as a normal read/write operation. that is, when the wait signal is low two cycles before the end of the wait cycles (tend), external wait cycles are inserted. after the wait signal has gone high, the wait cycl es end (tend) two cycles later. in the second and subsequent read accesses, the page wait cycle is extended if the wait signal is low two cycles before the end of the page access wait cycle (tend), and the page wait cycles end two cycles after the wait signal has gone high. figure 9.6 shows an exam ple of external wait timing for page read access using longword (32-bit) access to a 16-bit channel. ckio don't care don't care don't care ts a0 a1 (tend) tend (tend) tend a27 to a0 csn wait rd wr d31 to d0 cycle wait external wait page cycle wait external wait figure 9.6 external wait timing example (page read access to 16-bit channel)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 245 of 1164 rej09b0321-0200 (4) access type and data alignment (a) 32-bit bus channel if a 32-bit bus is selected by the external bus width select bits in the csn control register, a27 to a2 are enabled as address signal s for longword units and a1 and a0 are disabled (fixed low level). table 9.7 shows the data alignment corresponding to byte addresses for different data sizes. pins wr3 to wr0 are enabled when byte strobe mo de (wrmod = 0) is selected. pins bc3 to bc0 are not used. only the wr3 pin is enabled when one-write strobe mode (wrmod = 1) is selected. a low-level signal is output from the wr3 pin during write access, regardless of the data size. at this time pins wr2 to wr0 are disabled (fixed high level). the valid byte positions are indicated by pins bc3 to bc0 . table 9.7 data alignment (32-bit bus channel) data wr / bc data size byte address (lower 2 bits) [31:24] [23:16] [15:8] [7:0] [3] [2] [1] [0] 0 o l h h h 1 o h l h h 2 o h h l h byte 3 o h h h l 0 o o l l h h word 2 o o h h l l longword 0 o o o o l l l l note: the valid bits in the data bus for each data size are indicated by circles (o). crosses ( ) indicate bus data bits that are undefined.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 246 of 1164 rej09b0321-0200 (b) 16-bit bus channel if a 16-bit bus is selected by the external bus width select bits in the csn control register, a27 to a1 are enabled as address signals for word units and a0 is disabled (fixed low level). table 9.8 shows the data alignment corresponding to byte addresses for different data sizes. pins wr1 and wr0 are enabled when byte strobe mode (wrmod = 0) is selected. pins wr3 and wr2 are disabled. pins bc3 to bc0 are not used. only the wr1 pin is enabled when one-write strobe mode (wrmod = 1) is selected. a low-level signal is output from the wr1 pin during write access, regardless of the data size. at this time the wr0 pin is disabled (fixed high level). the valid byte positions are indicated by pins bc1 and bc0 . table 9.8 data alignment (16-bit bus channel) data wr / bc data size byte address (lower 2 bits) [31:24] [23:16] [15:8] [7:0] [3] [2] [1] [0] byte 0 o * * l h 1 o * * h l 2 o * * l h 3 o * * h l word 0 o o * * l l 2 o o * * l l longword 0 (1st) o o * * l l 2 (2nd) o o * * l l note: the valid bits in the data bus for each data size are indicated by circles (o). crosses ( ) indicate bus data bits that are undefined. asterisks ( * ) indicate write/byte control bits that are disabled (fixed high level).
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 247 of 1164 rej09b0321-0200 (c) 8-bit bus channel if an 8-bit bus is selected by the external bus width select bits in the csn control register, a27 to a0 are enabled as address signals for byte units. table 9.9 shows the data alignment corresponding to byte addres ses for different data sizes. with an 8-bit bus channel only the wr0 pin is enabled, regardless of the strobe mode setting. a low-level signal is output to wr0 during write access. bc0 constantly outputs low level. pins wr3 to wr1 and pins bc3 to bc1 are not used. table 9.9 data alignment (8-bit bus channel) data wr / bc data size byte address (lower 2 bits) [31:24] [23:16] [15:8] [7:0] [3] [2] [1] [0] 0 o * * * l 1 o * * * l 2 o * * * l byte 3 o * * * l 0 (1st) o * * * l 1 (2nd) o * * * l 2 (1st) o * * * l word 3 (2nd) o * * * l 0 (1st) o * * * l 1 (2nd) o * * * l 2 (3rd) o * * * l longword 3 (4th) o * * * l note: the valid bits in the data bus for each data size are indicated by circles (o). crosses ( ) indicate bus data bits that are undefined. asterisks ( * ) indicate write/byte control bits that are disabled (fixed high level).
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 248 of 1164 rej09b0321-0200 9.5.2 sdram interface a description is provided here of the sdra m controller (sdramc) operation enable and sdram bus width settings as well as operations involving sdram (read, write, auto-refresh, self-refresh, initialization sequence, and mode register settings). (1) sdram access enable/disable and sdram bus width settings enabling and disabling sdram access is performed by maki ng settings in the individual sdramcm control registers to enable or prohibit sdramc operation. sdram bus width settings are also performed by means of the sdramcm control registers. even if the sdramc control register is set to disable sdramc operation, refresh operation will still take place if self-refresh or auto-r efresh operation is set as enabled. (2) sdram commands sdramc controls the sdram by issuing comm ands each bus cycle. these commands are defined by combinations of ras, cas, we, cke, cs, etc. table 9.10 lists the commands issued by sdramc.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 249 of 1164 rej09b0321-0200 table 9.10 sdramc commands command sdcs sdras sdcas sdwe sdcke ba1 ba0 dsl deselect h x x x x x x act initialize row and bank l l h h h v v rd read l h l h h v v wr write l h l l h v v pra precharge all banks l l h l h x x rfa auto-refresh l l l h h x x mrs mode register set l l l l h l l emrs extended mode register set l l l l h h l rfs self-refresh entry l l l h h l x x rfx self-refresh exit h x x x l h x x dpd deep-power-down l h h l h l x x dpdx deep-power-down exit x x x x l h x x [legend] h: high level, l: low level, v: valid, x: don't care (3) sdramc register setting conditions rewriting of sdramc registers should only be performed when all of the conditions listed in table 9.11 are satisfied. table 9.11 register rewrite conditions function/operation re gister conditions self-refresh sdrfcnt0 ? sdram access disabled (set in sdramcm * 1 ) ? auto-refresh enabled (drfen = 1) ? power-down disabled (dpwd/dpwdci = 0) ? deep-power-down disabled (ddpd/ddpdci = 0) auto-refresh sdrfcnt1 ? self-refresh disabled (dsfen/dsfenci = 0) ? power-down disabled (dpwd/dpwdci = 0) sdir0 ? before start of initialization sequence initialization sequence sdir1 ? after reset or after re covery from deep-power- down
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 250 of 1164 rej09b0321-0200 function/operation re gister conditions power-down sdpwdcnt ? sdram access disabled (set in sdramcm * 1 ) ? auto-refresh enabled (drfen = 1) ? self-refresh disabled (dsfen/dsfenci = 0) ? deep-power-down disabled (ddpd/ddpdci = 0) deep-power-down sddpdcnt ? sdram access disabled (set in sdramcm * 1 ) ? self-refresh disabled (dsfen/dsfenci = 0) ? auto-refresh disabled (drfen = 0) ? power-down disabled (dpwd/dpwdci = 0) address register settings sd0adr, sd1adr ? auto-refresh disabled (drfen = 0) ? sdram access disabled (set in sdramcm * 1 ) ? self-refresh disabled (dsfen/dsfenci = 0) ? power-down disabled (dpwd/dpwdci = 0) ? deep-power-down disabled (ddpd/ddpdci = 0) timing register settings sd0tr, sd1tr ? self-refresh in progress (dsfen/dsfenci = 1) or ? self-refresh disabled (dsfen/dsfenci = 0) ? auto-refresh disabled (drfen = 0) ? sdram access disabled (set in sdramcm * 1 ) mode register settings sd0mod, sd1mod * 2 ? sdram access disabled (set in sdramcm * 1 ) ? self-refresh disabled (dsfen/dsfenci = 0) ? power-down disabled (dpwd/dpwdci = 0) ? deep-power-down disabled (ddpd/ddpdci = 0) clock stop control signal settings sdckscnt ? deep-power-down disabled (ddpd/ddpdci = 0) notes: 1. after writing 0 to exenb, check to c onfirm that the exenb bit has been cleared to 0. 2. do not fail to confirm that all status bi ts in the sdram status register (sdstr) have been cleared to 0 before rewriting this bit.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 251 of 1164 rej09b0321-0200 (4) self-refresh transition to and from self-refresh mode is cont rolled by means of sett ings to sdram refresh control register 0 (s drfcnt0). transition to and from self-refresh mode takes place simultaneously for all channels. an auto-refresh cycle operation takes place immedi ately before transition to self-refresh mode. while in self-refresh mode the cke signal is lo w level. immediately after recovery from self- refresh mode an auto-refresh cycle is triggered. figure 9.7 shows the timing of transition to sel f-refresh mode, and figure 9.8 shows the timing of recovery from self-refresh mode. ckio dsl: deselect command rfa: auto-refresh command rfs: self-refresh entry command sdram command self-refresh mode (cke = l) auto-refresh cycle rfa dsl drefw dsl rfs figure 9.7 example of timing of transition to self-refresh mode (drefw bit set value: 0010) ckio dsl: deselect command rfa: auto-refresh command rfx: self-refresh exit command sdram command self-refresh mode (cke = l) self-refresh clearing interval auto-refresh cycle rex dsl drefw drefw dsl rfa dsl dsl figure 9.8 example of timing of recovery from self-refresh mode (drefw bit set value: 0010)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 252 of 1164 rej09b0321-0200 (5) auto-refresh an auto-refresh cycle starts when the auto-r efresh operation enable bit (drfen) in sdram refresh control register 1 (sdrfcnt 1) is set to 1. after that refr esh requests are issued at fixed intervals, activating auto-refresh cycles. howeve r, the activation of auto-refresh cycles may sometimes be delayed because refresh requests are not accepted during read or write accesses. a refresh request is issued immediately if the auto-refresh operation enable bit (drfen) in sdram refresh control register 1 (sdrfcnt1) is set to 1 while auto-refresh is enabled. the refresh counter is halted in self-refresh or deep-power-down mode. after recovery from self- refresh or deep-power-down mode an auto-refresh cycle is activated, after which the counter value is reset and the counter begins operating again make auto-refresh settings in sdram refresh control register 1 (sdrfcnt1). note that refresh cycles affect all sdram channels. figure 9. 9 shows an auto-refresh cycle timing example. ckio dsl: deselect command rfa: auto-refresh command sdram command auto-refresh cycle rfa dsl drefw dsl figure 9.9 auto-refresh cycle timing example (drefw bit set value: 0010)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 253 of 1164 rej09b0321-0200 (6) initialization sequencer sdramc is provided with a sequencer for issu ing the commands for sdram initialization. the initialization sequence should always be initiated a single time only following a reset (all channels) and following recovery from deep-power-down mode (individual channels). in such cases operation cannot be guaranteed if the initialization sequence is not performed, or if it is performed more than once. the sdram initialization sequence issues the precharge-all-banks command followed by n (n = 1 to 15) auto-refresh commands, in that order. ma ke timing settings for the initialization sequencer to sdram initialization register 0 (sdir0). in itialization sequences are initiated using sdram initialization register 1 (sdir1). note that an initialization sequence for all channels is initiated using the dinirq bit. figure 9.10 shows a timing example for the initialization sequence. setting darfc to specify two or more times causes multiple initialization auto-refresh cycles to be performed. ckio dsl: deselect command rfa: auto-refresh command pra: precharge-all-banks command sdram command initialization precharge cycle initialization auto-refresh cycle dinst bit value changes to 0 pra dsl dpc darfi dsl dsl rfa dsl dsl dsl figure 9.10 initialization sequence timing example (dpc bit set value: 001, darfi bit set value: 0001, darfc bit set value: 001)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 254 of 1164 rej09b0321-0200 (7) power-down mode sdramc supports an sdram power-down mode. in power-down mode the sdcke signal from sdramc goes low level. while in power-down mode auto-refresh operations are performed at the interval specified by the auto-refresh reques t interval setting (drfc) bits in sdram refresh control register 1 (sdrfcnt1). the sdcke sign al only goes high when an auto-refresh command is issued. transition to and recovery from power-down mode are performed using the sdram power-down control register (sdpwdcnt). setting the dpwd bit to 1 causes sdramc to transition to power-down mode. clearing the dpwd bit to 0 causes sdramc to recover from power-down mode. the sdcke signal from sdramc goes high level when recovery from power-down mode occurs. ckio sdcke sdramc power-down mode figure 9.11 sdramc power-down mode ckio sdcke sdram command sdramc power-down mode auto-refresh command rfa figure 9.12 auto-refresh operati on in sdramc power-down mode
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 255 of 1164 rej09b0321-0200 (8) deep-power-down mode sdramc supports an sdram deep-power-down mode. in deep-power-down mode sdramc issues a deep-power-down command and drives the sdcke signal low level. transition to and recovery from deep-power-down mode are performed using the sdram deep- power-down control register (sddpdcnt). setting the ddpd bit to 1 causes sdramc to put all channels into deep-power-down mode. clearing the ddpd bit to 0 causes sdramc to recover from deep-power-down mode. during recovery from deep-power-down mode, sdramc issues a deep-power-down exit command and drives the sdcke signal high level. following recovery from deep-power-down exit, wait for the duration designated for the sdram being used and then execute an initialization sequence. ckio sdcke sdram command sdramc deep-power-down mode deep-power-down command dpd deep-power-down exit command dpdx figure 9.13 sdramc deep-power-down mode
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 256 of 1164 rej09b0321-0200 (9) read/write access the following two types of re ad/write access ar e supported. ? multiple read/multiple write ? single read/single write multiple read/multiple write occurs in the following cases. 1. cpu burst access (cache replace) 2. access with longword (32-bit) to the sdram data bus having 8-bit or 16-bit width 3. access with word (16-bit) to the sdram data bus having 8-bit width 4. multiple data transfer in dma pipeline transfer the access timing can be set independently for each channel using the sdrami timing register (sditr). access timing examples are described below. (a) multiple read/multiple write access figure 9.14 shows a timing example for multiple read of 4 units of data, and figure 9.15 for multiple write of 4 units of data. the number of dma transfers performed will vary depending on factors such as the number of transfers and the transfer data size per operand and the sdram bus width. read commands or write commands may or may not be issued consecutively in response to an access request from the bus master. when read commands or write comm ands are not issued c onsecutively, a deselect command is issued between them. furthermore, deactivation and activation are performed automatically when the sdram row address changes during a dma transfer operation. figure 9.16 shows a timing example for multiple read of 4 units of data, and figure 9.17 for multiple write of 4 units of data, when read/wri te commands are not issued consecutively. figure 9.18 shows a timing example for multip le write with a row address change. the access timing is m odified by means of settings in th e sdramm timing register (sdmtr).
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 257 of 1164 rej09b0321-0200 ckio act: row and bank activation command rd: read command pra: precharge-all command sdram command data bus multiple read act rd rd rd rd pra d0 d1 d2 d3 figure 9.14 multiple read timing example (multiple read of 4 data units, shortest timing settings) cons ecutive read commands issued ckio act: row and bank activation command wr: write command pra: precharge-all command sdram command data bus multiple write act wr wr wr wr pra d0 d1 d2 d3 figure 9.15 multiple write timing example (multiple write of 4 data units, shortest timing settings) cons ecutive write commands issued ckio act: row and bank activation command rd: read command pra: precharge-all command dsl: deselect command sdram command data bus multiple read act rd dsl rd dsl rd dsl rd pra d1 d2 d3 d0 figure 9.16 multiple read timing example (multiple read of 4 data units, shortest timing settings) non-consecutive read commands issued
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 258 of 1164 rej09b0321-0200 ckio act: row and bank activation command wr: write command pra: precharge-all command dsl: deselect command sdram command data bus multiple write act wr dsl wr dsl wr dsl wr pra d1 d2 d3 d0 figure 9.17 multiple write timing example (multiple write of 4 data units, shortest timing settings) non-cons ecutive write commands issued ckio act: row and bank activation command wr: write command pra: precharge-all command sdram command data bus multiple write row address a row address b act wr wr wr pra act wr pra d0 d1 d2 d3 figure 9.18 multiple write timing example (multiple write of 4 data units, shortest timing settings) access spanning rows
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 259 of 1164 rej09b0321-0200 (b) single read/single write access figure 9.19 shows a timing example for single read operation and figure 9.20 for single write operation. the access timing is modified by means of settings in the sd ramm timing register (sdmtr). ckio act: row and bank activation command rd: read command pra: precharge-all command sdram command data bus single read act rd pra d0 figure 9.19 single read timing example (shortest timing settings) ckio act: row and bank activation command wr: write command pra: precharge-all command sdram command data bus single write act wr pra d0 figure 9.20 single write timing example (shortest timing settings)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 260 of 1164 rej09b0321-0200 (c) byte access control by dqm figures 9.21 and 9.22 show timing examples fo r byte accesses to the sd ram with a 16-bit bus width. in the sdram access, the dqm signa l is asserted when data is masked. ckio dqm1 dqm0 low level data bus [7:0] data bus [15:8] high-z act wr pra d0 sdram command figure 9.21 byte write timing to sdram with 16-bit bus width (example) ckio dqm1 dqm0 data bus [7:0] data bus [15:8] high-z act rd dsl pra d0 sdram command low level figure 9.22 byte read timing from sdram with 16-bit bus width (example)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 261 of 1164 rej09b0321-0200 (10) mode register setting writing to the sdramm mode register (sdmmo d) causes mode regi ster set commands and extended mode register set commands to be issued to the various channels. settings to the sdramm mode register (sdmmod) should be made individually for each channel. figure 9.23 shows the operation timing for mode register setting. ckio dsl: deselect command mrs: mode register set command emrs: extended mode register set command sdram command mode register setting cycle extended mode register setting cycle mrs dsl dsl emrs dsl dsl 3 cycles (fixed) 3 cycles (fixed) figure 9.23 operation timi ng for mode register setting (11) clock stop control signal sdramc outputs a clock stop control signal (clkstop). clkstop can be enabled or disabled using the dcksen bit in the sdram clock stop control signal setting register (sdckscnt). the clkstop signal remains low level when the clock stop control signal is disabled. when clock stop control signal is enabled, the clkstop and ckio signals operate in conjunction with transition to and recovery from deep-power-down mode. during a transition to deep-power-down mode, the clkstop signal goes high after the deep- power-down entry command is issued. during a recovery from deep-power-down mode, the clkstop signal goes low and a deep-power-down exit co mmand is issued when the clearing of the ddpd bit to 0 is acce pted by sdramc and the ckio starts operation. dcksc, the period between the change of clksto p along with ckio and the issuance of deep power-down entry or exit command, can be set by the sdram clock stop control signal setting register.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 262 of 1164 rej09b0321-0200 figures 9.24 and 9.25 show the operation timing of the clock stop control signal. deep-power-down mode ddpdst bit value changes to 0 ckio clkstop (internal signal) sdcke dcksc dpd sdram command dpd: deep-power-down entry command figure 9.24 clock stop control signal operation timing (transition to deep -power-down mode) deep-power-down mode ddpd bit cleared to 0 ddpdst bit value changes to 1 ddpdst bit value changes to 0 ckio clkstop (internal signal) sdcke dcksc dpdx sdram command dpdx: deep-power-down exit command figure 9.25 clock stop control signal operation timing (recovery from deep-power-down mode)
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 263 of 1164 rej09b0321-0200 (12) sdramc setting examples the sdramc setting procedure, timing register setting examples, and the procedure for transitioning to and recovering from self-refresh mode, power-down mode, and deep-power-down mode are described below. (a) sdramc setting procedure figure 9.26 shows the sdramc setting procedure. note that the specifications of the power-up sequence, etc., may vary depending on the sdram used. study the sdram specifications carefully before making system settings.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 264 of 1164 rej09b0321-0200 reset specify all sdram control pins as port outputs with the pfc setting of portc to output high level channel m settings (1) confirm that all status bits in sdstr have been cleared to 0 (2) make settings to sdmmod mode register (3) set dras, drcd, dpcg, dcl, and dwr bits in sdmtr (4) set dsz bits in sdmadr enable access sdramcm control register operation enable setting dummy-read sdram area of all channels to be used disable access sdramcm control register operation disable setting specify sdram control pins (except dqm pin * ) as sdram with the pfc setting of portc sdram access enabled note : * driving the dqm pin high before the initialization sequence is recommended for some sdram modules. in this case, the setting may be necessary. specify dqm pin as dqm * with the pfc setting of portc initialization sequence (1) set dpc, darfc, and darfi bits in sdir0 (2) set dinirq bit in sdir1 to 1 (3) wait for dinist bit in sdir1 to be cleared to 0 channel m settings (1) confirm that all status bits in sdstr have been cleared to 0 (2) make settings to sdmmod mode register (3) set dras, drcd, dpcg, dcl, and dwr bits in sdmtr (4) set dsz bits in sdmadr start auto-refresh set drfen bit in sdrfcnt1 to 1 enable access sdramcm control register operation enable setting perform settings for all channels to be used perform settings for all channels to be used figure 9.26 sdramc setting procedure
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 265 of 1164 rej09b0321-0200 (b) procedure for transition to an d recovery from self-refresh mode figure 9.27 shows the procedure for transitioni ng to and recovering from self-refresh mode. self-refresh mode initialization sequence (1) halt any dma access to sdram area (2) halt access to all sdramc channels (exenb = 0) by means of program assigned to other than sdram area (3) confirm that exenb has been cleared to 0 start self-refresh (1) confirm that all status bits in sdstr have been cleared to 0 (2) set dsfen bit to 1 by means of program assigned to other than sdram area end self-refresh (1) confirm that all status bits in sdstr have been cleared to 0 (2) clear dsfen bit to 0 by means of program assigned to other than sdram area access enabled status (drfen = 1, exenb = 1) enable access enable access to sdramc (exenb = 1) by means of program assigned to other than sdram area access enabled status (drfen = 1, exenb = 1) figure 9.27 procedure for transition to and recovery from self-refresh mode note: before transitioning to or recovering fr om self-refresh mode it is necessary to halt sdram access to the affected channels. consequen tly, it is not possible to transition to or recover from self-refresh mode while progra ms or dma operations that access sdram are in progress. pay attention to the following points when writing programs. ? before transitioning to self-refresh mode , halt any dma channel transfers that access the sdram area of the affected channels. ? make sure that programs run while transi tioning to self-refresh mode, while in self- refresh mode, or while recovering from se lf-refresh mode do not access operands or fetch (or pre-fetch) instructions stored in the sdram area.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 266 of 1164 rej09b0321-0200 (c) procedure for transition to and recovery from deep-power-down mode figure 9.28 shows the procedure for transitioning to deep-power-down mode. halt access (1) halt any dma access to corresponding channels (2) halt access to corresponding channels (exenb = 0) by means of program assigned to other than to corresponding channel area (3) confirm that exenb has been cleared to 0 end auto-refresh clear drfen bit in sdrfcnt1 to 0 access enabled status exenb = 1 in sdramc control register start deep-power-down mode (1) confirm that all status bits in sdstr have been cleared to 0 (2) set deep-power-down enable bit to 1 by means of program assigned to other than to corresponding channel area deep-power-down mode figure 9.28 procedure for tran sition to deep-p ower-down mode
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 267 of 1164 rej09b0321-0200 figure 9.29 shows the procedure for recovering from deep-power-down mode. deep-power-down mode access enabled status (exenb = 1) end deep-power-down mode (1) confirm that all status bits in sdstr have been cleared to 0 (2) clear deep-power-down enable bit to 0 by means of program assigned to other than to corresponding channel area standby use a timer, etc., to wait for the same duration as the standby time specified in the power-on sequence (determined by specifications of sdram used) initialization sequence (1) set initialization sequence start bit (dinirqm) to 1 by means of program assigned to other than to corresponding channel area (2) wait for initialization sequence start bit (dinistm) to be cleared to 0 mode register setting (1) perform mode register setting (2) perform extended mode register setting start auto-refresh set drfen bit in sdrfcnt1 to 1 figure 9.29 procedure for recovery from deep-power-down mode note: before transitioning to or recovering from deep-power-down mode it is necessary to halt sdram access to the affected channels. consequen tly, it is not possible to transition to or recover from deep-power-dow n mode while programs or dma operations that access sdram are in progress. pay attention to th e following points when writing programs. ? before transitioning to deep-power-down mode, halt any dma channel transfers that access the sdram area of the affected channels. ? make sure that programs run while transitioning to deep-power-down mode, while in deep-power-down mode, or while recovering from deep-power-down mode do not access operands or fetch (or pre-fetch) in structions stored in the sdram area.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 268 of 1164 rej09b0321-0200 (d) timing register set values and access timing the correspondence between the sdramm timing register (sdmtr) set values and the read and write access timing is described below. ? multiple read timing setting examples figures 9.30 to 9.32 show the correspondence between the timing of multiple read operations involving 4 data units and the set values of the sdramm timing register (sdmtr). table 9.12 shows the sdramm timing register (sdmtr) set values for each figure. table 9.12 sditr set value correspond ence table (multiple read timing) figure dras drcd dpcg dcl figure 9.30 010 00 001 010 figure 9.31 000 01 001 010 figure 9.32 000 01 001 011 ckio act: row and bank activation command rd: read command pra: precharge-all command sdram command data bus multiple read act rd rd rd rd pra dsl d0 drcd (act-rd) dras (act-pra) dcl (rd-d) dpcg (pra-next) d1 d2 d3 figure 9.30 multiple read timing example 1
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 269 of 1164 rej09b0321-0200 ckio act: row and bank activation command rd: read command pra: precharge-all command sdram command data bus multiple read act dsl rd rd rd rd pra dsl d0 drcd (acr-rd) dras (act-pra) dcl (rd-d) dpcg (pra-next) d1 d2 d3 figure 9.31 multiple read timing example 2 ckio act: row and bank activation command rd: read command pra: precharge-all command sdram command data bus multiple read act dsl rd rd rd rd pra dsl dsl d0 drcd (act-rd) dras (act-pra) dcl (rd-d) dpcg (pra-next) d1 d2 d3 figure 9.32 multiple read timing example 3 ? multiple write timing setting examples figures 9.33 to 9.35 show the correspondence between the timing of multiple write operations involving 4 data units and the set values of the sdramm timing register (sdmtr). table 9.13 shows the sdramm timing register (sdmtr) set values for each figure.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 270 of 1164 rej09b0321-0200 table 9.13 sditr set value correspond ence table (multiple write timing) figure dras drcd dpcg dwr figure 9.33 010 00 001 0 figure 9.34 000 01 001 0 figure 9.35 000 01 001 1 ckio act: row and bank activation command wr: write command pra: precharge-all command sdram command data bus multiple write act wr wr wr wr pra dsl d0 drcd (act-wr) dras (act-pra) dwr (wr-pra) dpcg (pra-next) d1 d2 d3 figure 9.33 multiple write timing example 1
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 271 of 1164 rej09b0321-0200 ckio act: row and bank activation command wr: write command pra: precharge-all command sdram command data bus multiple write act dsl wr wr wr wr pra dsl d0 drcd (acr-wr) dras (act-pra) dwr (wr-pra) dpcg (pra-next) d1 d2 d3 figure 9.34 multiple write timing example 2 ckio act: row and bank activation command wr: write command pra: precharge-all command sdram command data bus multiple write act dsl wr wr wr wr dsl pra dsl d0 drcd (act-wr) dras (act-pra) dwr (wr-pra) dpcg (pra-next) d1 d2 d3 figure 9.35 multiple write timing example 3 ? single read timing setting examples figures 9.36 to 9.38 show the correspondence between the timing of single read operations and the set values of the sdramm timing regist er (sdmtr). table 9.14 shows the sdramm timing register (sdmtr) set values for each figure.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 272 of 1164 rej09b0321-0200 table 9.14 sditr set value correspo ndence table (single read timing) figure dras drcd dpcg dcl figure 9.36 010 00 001 010 figure 9.37 000 01 001 010 figure 9.38 000 01 001 011 ckio act: row and bank activation command rd: read command pra: precharge-all command sdram command data bus single read act rd dsl pra dsl drcd (act-rd) dras (act-pra) dcl (rd-d) dpcg (pra-next) d figure 9.36 single read timing example 1
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 273 of 1164 rej09b0321-0200 ckio act: row and bank activation command rd: read command dsl: deselect command pra: precharge-all command sdram command data bus single read note: if the interval set in dras ends before rd, pra is issued in the table size after rd. act dsl rd pra dsl drcd (act-rd) dras (act-pra) dcl (rd-d) dpcg (pra-next) d figure 9.37 single read timing example 2 ckio act: row and bank activation command rd: read command pra: precharge-all command sdram command data bus single read act dsl rd pra dsl drcd (act-rd) dras (act-pra) dcl (rd-d) dpcg (pra-next) d figure 9.38 single read timing example 3
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 274 of 1164 rej09b0321-0200 ? single write timing setting examples figures 9.39 to 9.41 show the correspondence between the timing of single write operations and the set values of the sdramm timing register (sdmtr). table 9.15 shows the sdramm timing register (sdmtr) set values for each figure. table 9.15 sditr set value correspo ndence table (single write timing) figure dras drcd dpcg dwr figure 9.39 010 00 001 0 figure 9.40 000 01 001 0 figure 9.41 000 01 001 1 ckio act: row and bank activation command wr: write command dsl: deselect command pra: precharge-all command sdram command data bus single write note: if the interval set in dras is longer than the period from when the wr command is issued until the dwr interval elapses, the dras setting is used. act wr dsl pra dsl drcd (act-wr) dwr (wr-pra) dpcg (pra-next) dras (act-pra) d figure 9.39 single write timing example 1
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 275 of 1164 rej09b0321-0200 ckio act: row and bank activation command wr: write command dsl: deselect command pra: precharge-all command sdram command data bus single write note: if the interval set in dras is longer than the period from when the wr command is issued until the dras interval elapses, the dwr setting is used. act dsl wr pra dsl drcd (act-wr) dwr (wr-pra) dpcg (pra-next) dras (act-pra) d figure 9.40 single write timing example 2 ckio act: row and bank activation command wr: write command dsl: deselect command pra: precharge-all command sdram command data bus single write act dsl wr dsl pra dsl drcd (act-wr) dwr (wr-pra) dpcg (pra-next) dras (act-pra) d figure 9.41 single write timing example 3
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 276 of 1164 rej09b0321-0200 (13) external address/sdram address signal multiplex (a) address multiplex either of addresses used for accessing external device or sdram is output through external address pins. the sdram address is shifted internally by changing the settings of ddbw and dsz in sdmadr and bsize in sdcmcnt. the bank address is output on a16 and a15 and the address is output on a14 to a2. table 9.16 external add ress/sdram address pins pin name function pin name function a27 external address a13 (/ma 11) external address/sdram address a26 external address a12 (/ma 10) external address/sdram address a25 external address a11 (/ma 9) external address/sdram address a24 external address a10 (/ma 8) external address/sdram address a23 external address a9 (/ma 7) external address/sdram address a22 external address a8 (/ma 6) external address/sdram address a21 external address a7 (/ma 5) external address/sdram address a20 external address a6 (/ma 4) external address/sdram address a19 external address a5 (/ma 3) external address/sdram address a18 external address a4 (/ma 2) external address/sdram address a17 external address a3 (/ma 1) external address/sdram address a16 (/ba1) external address/sdram bank address a2 (/ma0) external address/sdram address a15 (/ba0) external address/sdram ban k address a1 external address a14 (/ma12) external address/sdra m address a0 external address (b) address register setting value and supported sdram configuration tables 9.17 to 9.19 are the sdram configurations that to support for 8-, 16-, or 32-bit bus width. these tables are featured to ease the understa nding of the relationships between the sdram to support and address multiplex. addresses addr27 to addr0 are the logical addre sses used by the cpu and dmac in access to the sdram. the table below shows how the settings of dsz and ddbw determine which signals are output on the sdram-access pins.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 277 of 1164 rej09b0321-0200 table 9.17 case for 8-bit external data bus width (bsize * 1 = (1, 0)) sdram type number 64 mbits ( 8) 1 128 mbits ( 8) 1 256 mbits ( 8) 1 512 mbits ( 8) 1 dsz * 2 001 (8 mbytes) 010 (16 mbytes) 011 (32 mbytes) 100 (64 mbytes) ddbw * 3 00 (8 bits) 00 (8 bits) 00 (8 bits) 00 (8 bits) this lsi address row address column address row address column address row address column address row address column address a16 (/ba1) * 4 addr22 * 5 addr22 * 5 addr23 * 5 addr23 * 5 addr24 * 5 addr24 * 5 addr25 * 5 addr25 * 5 a15 (/ba0) * 4 addr21 * 5 addr21 * 5 addr22 * 5 addr22 * 5 addr23 * 5 addr23 * 5 addr24 * 5 addr24 * 5 a14 (/ma12) * 4 l l l l addr22 * 5 l addr23 * 5 l a13 (/ma11) * 4 addr20 * 5 l addr21 * 5 l addr21 * 5 l addr22 * 5 addr10 * 5 a12 (/ma10) * 4 addr19 * 5 * 6 addr20 * 5 * 6 addr20 * 5 * 6 addr21 * 5 * 6 a11 (/ma9) * 4 addr18 * 5 l addr19 * 5 addr9 * 5 addr19 * 5 addr9 * 5 addr20 * 5 addr9 * 5 a10 (/ma8) * 4 addr17 * 5 addr8 * 5 addr18 * 5 addr8 * 5 addr18 * 5 addr8 * 5 addr19 * 5 addr8 * 5 a9 (/ma7) * 4 addr16 * 5 addr7 * 5 addr17 * 5 addr7 * 5 addr17 * 5 addr7 * 5 addr18 * 5 addr7 * 5 a8 (/ma6) * 4 addr15 * 5 addr6 * 5 addr16 * 5 addr6 * 5 add16 * 5 addr6 * 5 addr17 * 5 addr6 * 5 a7 (/ma5) * 4 addr14 * 5 addr5 * 5 addr15 * 5 addr5 * 5 addr15 * 5 addr5 * 5 addr16 * 5 addr5 * 5 a6 (/ma4) * 4 addr13 * 5 addr4 * 5 addr14 * 5 addr4 * 5 addr14 * 5 addr4 * 5 addr15 * 5 addr4 * 5 a5 (/ma3) * 4 addr12 * 5 addr3 * 5 addr13 * 5 addr3 * 5 addr13 * 5 addr3 * 5 addr14 * 5 addr3 * 5 a4 (/ma2) * 4 addr11 * 5 addr2 * 5 addr12 * 5 addr2 * 5 addr12 * 5 addr2 * 5 addr13 * 5 addr2 * 5 a3 (/ma1) * 4 addr10 * 5 addr1 * 5 addr11 * 5 addr1 * 5 addr11 * 5 addr1 * 5 addr12 * 5 addr1 * 5 a2 (/ma0) * 4 addr9 * 5 addr0 * 5 addr10 * 5 addr0 * 5 addr10 * 5 addr0 * 5 addr11 * 5 addr0 * 5 notes: 1. the legend bsize r epresents the bsize bit in the sdramcm control register. 2. the legend dsz represents the dsz bit in the sdramm address register. 3. the legend ddbw repres ents the ddbw bit in the sdramm address register. 4. the legends ba1, ba0, and ma12 to ma 0 represent the sdram bank address and sdram address respectively. 5. addresses addr25 to addr0 are the logi cal addresses used by the cpu and dmac in access to the sdram. 6. when the rd, wr or pra command is i ssued, this carries the pre-charge option signal.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 278 of 1164 rej09b0321-0200 table 9.18 case for 16-bit external data bus width (bsize * 1 = (0, 0)) (1) sdram type number 64 mbits ( 16) 1 64 mbits ( 8) 2 128 mbits ( 16) 1 128 mbits ( 8) 2 dsz * 2 001 (8 mbytes) 010 (16 mbytes) 010 (16 mbytes) 011 (32 mbytes) ddbw * 3 01 (16 bits) 00 (8 bits) 01 (16 bits) 00 (8 bits) this lsi address row address column address row address column address row address column address row address column address a16 (/ba1) * 4 addr22 * 5 addr22 * 5 addr23 * 5 addr23 * 5 addr23 * 5 addr23 * 5 addr24 * 5 addr24 * 5 a15 (/ba0) * 4 addr21 addr21 * 5 addr22 * 5 addr22 * 5 addr22 * 5 addr22 * 5 addr23 * 5 addr23 * 5 a14 (/ma12) * 4 l l l l l l l l a13 (/ma11) * 4 addr20 * 5 l addr21 * 5 l addr21 * 5 l addr22 * 5 l a12 (/ma10) * 4 addr19 * 5 * 6 addr20 * 5 * 6 addr20 * 5 * 6 addr21 * 5 * 6 a11 (/ma9) * 4 addr18 * 5 l addr19 * 5 l addr19 * 5 l addr20 * 5 addr10 * 5 a10 (/ma8) * 4 addr17 * 5 l addr18 * 5 addr9 * 5 addr18 * 5 addr9 * 5 addr19 * 5 addr9 * 5 a9 (/ma7) * 4 addr16 * 5 addr8 * 5 addr17 * 5 addr8 * 5 addr17 * 5 addr8 * 5 addr18 * 5 addr8 * 5 a8 (/ma6) * 4 addr15 * 5 addr7 * 5 addr16 * 5 addr7 * 5 addr16 * 5 addr7 * 5 addr17 * 5 addr7 * 5 a7 (/ma5) * 4 addr14 * 5 addr6 * 5 addr15 * 5 addr6 * 5 addr15 * 5 addr6 * 5 addr16 * 5 addr6 * 5 a6 (/ma4) * 4 addr13 * 5 addr5 * 5 addr14 * 5 addr5 * 5 addr14 * 5 addr5 * 5 addr15 * 5 addr5 * 5 a5 (/ma3) * 4 addr12 * 5 addr4 * 5 addr13 * 5 addr4 * 5 addr13 * 5 addr4 * 5 addr14 * 5 addr4 * 5 a4 (/ma2) * 4 addr11 * 5 addr3 * 5 addr12 * 5 addr3 * 5 addr12 * 5 addr3 * 5 addr13 * 5 addr3 * 5 a3 (/ma1) * 4 addr10 * 5 addr2 * 5 addr11 * 5 addr2 * 5 addr11 * 5 addr2 * 5 addr12 * 5 addr2 * 5 a2 (/ma0) * 4 addr9 * 5 addr1 * 5 addr10 * 5 addr1 * 5 addr10 * 5 addr1 * 5 addr11 * 5 addr1 * 5 notes: 1. the legend bsize r epresents the bsize bit in the sdramcm control register. 2. the legend dsz represents the dsz bit in the sdramm address register. 3. the legend ddbw repres ents the ddbw bit in the sdramm address register. 4. the legends ba1, ba0, and ma12 to ma 0 represent the sdram bank address and sdram address respectively. 5. addresses addr24 to addr0 are the logi cal addresses used by the cpu and dmac in access to the sdram. 6. when the rd, wr or pra command is i ssued, this carries the pre-charge option signal.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 279 of 1164 rej09b0321-0200 table 9.18 case for 16-bit external data bus width (bsize * 1 = (0, 0)) (2) sdram type number 256 mbits ( 16) 1 256 mbits ( 8) 2 512 mbits ( 16) 1 512 mbits ( 8) 2 dsz * 2 011 (32 mbytes) 100 (64 mbytes) 100 (64 mbytes) 101 (128 mbytes) ddbw * 3 01 (16 bits) 00 (8 bits) 01 (16 bits) 00 (8 bits) this lsi address row address column address row address column address row address column address row address column address a16 (/ba1) * 4 addr24 * 5 addr24 * 5 addr25 * 5 addr25 * 5 addr25 * 5 addr25 * 5 addr26 * 5 addr26 * 5 a15 (/ba0) * 4 addr23 * 5 addr23 * 5 addr24 * 5 addr24 * 5 addr24 * 5 addr24 * 5 addr25 * 5 addr25 * 5 a14 (/ma12) * 4 addr22 * 5 l addr23 * 5 l addr23 * 5 l addr24 * 5 l a13 (/ma11) * 4 addr21 * 5 l addr22 * 5 l addr22 * 5 l addr23 * 5 addr11 * 5 a12 (/ma10) * 4 addr20 * 5 * 6 addr21 * 5 * 6 addr21 * 5 * 6 addr22 * 5 * 6 a11 (/ma9) * 4 addr19 * 5 l addr20 * 5 addr10 * 5 addr20 * 5 addr10 * 5 addr21 * 5 addr10 * 5 a10 (/ma8) * 4 addr18 * 5 addr9 * 5 addr19 * 5 addr9 * 5 addr19 * 5 addr9 * 5 addr20 * 5 addr9 * 5 a9 (/ma7) * 4 addr17 * 5 addr8 * 5 addr18 * 5 addr8 * 5 addr18 * 5 addr8 * 5 addr19 * 5 addr8 * 5 a8 (/ma6) * 4 addr16 * 5 addr7 * 5 addr17 * 5 addr7 * 5 addr17 * 5 addr7 * 5 addr18 * 5 addr7 * 5 a7 (/ma5) * 4 addr15 * 5 addr6 * 5 addr16 * 5 addr6 * 5 addr16 * 5 addr6 * 5 addr17 * 5 addr6 * 5 a6 (/ma4) * 4 addr14 * 5 addr5 * 5 addr15 * 5 addr5 * 5 addr15 * 5 addr5 * 5 addr16 * 5 addr5 * 5 a5 (/ma3) * 4 addr13 * 5 addr4 * 5 addr14 * 5 addr4 * 5 addr14 * 5 addr4 * 5 addr15 * 5 addr4 * 5 a4 (/ma2) * 4 addr12 * 5 addr3 * 5 addr13 * 5 addr3 * 5 addr13 * 5 addr3 * 5 addr14 * 5 addr3 * 5 a3 (/ma1) * 4 addr11 * 5 addr2 * 5 addr12 * 5 addr2 * 5 addr12 * 5 addr2 * 5 addr13 * 5 addr2 * 5 a2 (/ma0) * 4 addr10 * 5 addr1 * 5 addr11 * 5 addr1 * 5 addr11 * 5 addr1 * 5 addr12 * 5 addr1 * 5 notes: 1. the legend bsize r epresents the bsize bit in the sdramcm control register. 2. the legend dsz represents the dsz bit in the sdramm address register. 3. the legend ddbw repres ents the ddbw bit in the sdramm address register. 4. the legends ba1, ba0, and ma12 to ma 0 represent the sdram bank address and sdram address respectively. 5. addresses addr26 to addr0 are the logi cal addresses used by the cpu and dmac in access to the sdram. 6. when the rd, wr or pra command is i ssued, this carries the pre-charge option signal.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 280 of 1164 rej09b0321-0200 table 9.19 case for 32-bit external data bus width (bsize * 1 = (0, 1)) (1) sdram type number 64 mbits ( 32) 1 64 mbits ( 16) 2 128 mbits ( 32) 1 64 mbits ( 8) 4 dsz * 2 001 (8 mbytes) 010 (16 mbytes) 010 (16 mbytes) 011 (32 mbytes) ddbw * 3 10 (32 bits) 01 (16 bits) 10 (32 bits) 00 (8 bits) this lsi address row address column address row address column address row address column address row address column address a16 (/ba1) * 4 addr22 * 5 addr22 * 5 addr23 * 5 addr23 * 5 addr23 * 5 addr23 * 5 addr24 * 5 addr24 * 5 a15 (/ba0) * 4 addr21 * 5 addr21 * 5 addr22 * 5 addr22 * 5 addr22 * 5 addr22 * 5 addr23 * 5 addr23 * 5 a14 (/ma12) * 4 l l l l l l l l a13 (/ma11) * 4 l l addr21 * 5 l addr21 * 5 l addr22 * 5 l a12 (/ma10) * 4 addr20 * 5 * 6 addr20 * 5 * 6 addr20 * 5 * 6 addr21 * 5 * 6 a11 (/ma9) * 4 addr19 * 5 l addr19 * 5 l addr19 * 5 l addr20 * 5 l a10 (/ma8) * 4 addr18 * 5 l addr18 * 5 l addr18 * 5 l addr19 * 5 addr10 * 5 a9 (/ma7) * 4 addr17 * 5 addr9 * 5 addr17 * 5 addr9 * 5 addr17 * 5 addr9 * 5 addr18 * 5 addr9 * 5 a8 (/ma6) * 4 addr16 * 5 addr8 * 5 addr16 * 5 addr8 * 5 addr16 * 5 addr8 * 5 addr17 * 5 addr8 * 5 a7 (/ma5) * 4 addr15 * 5 addr7 * 5 addr15 * 5 addr7 * 5 addr15 * 5 addr7 * 5 addr16 * 5 addr7 * 5 a6 (/ma4) * 4 addr14 * 5 addr6 * 5 addr14 * 5 addr6 * 5 addr14 * 5 addr6 * 5 addr15 * 5 addr6 * 5 a5 (/ma3) * 4 addr13 * 5 addr5 * 5 addr13 * 5 addr5 * 5 addr13 * 5 addr5 * 5 addr14 * 5 addr5 * 5 a4 (/ma2) * 4 addr12 * 5 addr4 * 5 addr12 * 5 addr4 * 5 addr12 * 5 addr4 * 5 addr13 * 5 addr4 * 5 a3 (/ma1) * 4 addr11 * 5 addr3 * 5 addr11 * 5 addr3 * 5 addr11 * 5 addr3 * 5 addr12 * 5 addr3 * 5 a2 (/ma0) * 4 addr10 * 5 addr2 * 5 addr10 * 5 addr2 * 5 addr10 * 5 addr2 * 5 addr11 * 5 addr2 * 5 notes: 1. the legend bsize r epresents the bsize bit in the sdramcm control register. 2. the legend dsz represents the dsz bit in the sdramm address register. 3. the legend ddbw repres ents the ddbw bit in the sdramm address register. 4. the legends ba1, ba0, and ma12 to ma 0 represent the sdram bank address and sdram address respectively. 5. addresses addr24 to addr0 are the logi cal addresses used by the cpu and dmac in access to the sdram. 6. when the rd, wr or pra command is i ssued, this carries the pre-charge option signal.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 281 of 1164 rej09b0321-0200 table 9.19 case for 32-bit external data bus width (bsize * 1 = (0, 1)) (2) sdram type number 128 mbits ( 16) 2 256 mbits ( 32) 1 128 mbits ( 8) 4 256 mbits ( 16) 2 dsz * 2 011 (32 mbytes) 011 (32 mbytes) 100 (64 mbytes) 100 (64 mbytes) ddbw * 3 01 (16 bits) 10 (32 bits) 00 (8 bits) 01 (16 bits) this lsi address row address column address row address column address row address column address row address column address a16 (/ba1) * 4 addr24 * 5 addr24 * 5 addr24 * 5 addr24 * 5 addr25 * 5 addr25 * 5 addr25 * 5 addr25 * 5 a15 (/ba0) * 4 addr23 * 5 addr23 * 5 addr23 * 5 addr23 * 5 addr24 * 5 addr24 * 5 addr24 * 5 addr24 * 5 a14 (/ma12) * 4 l l l l l l addr23 * 5 l a13 (/ma11) * 4 addr22 * 5 l addr22 * 5 l addr23 * 5 l addr22 * 5 l a12 (/ma10) * 4 addr21 * 5 * 6 addr21 * 5 * 6 addr22 * 5 * 6 addr21 * 5 * 6 a11 (/ma9) * 4 addr20 * 5 l addr20 * 5 l addr21 * 5 addr11 * 5 addr20 * 5 l a10 (/ma8) * 4 addr19 * 5 addr10 * 5 addr19 * 5 addr10 * 5 addr20 * 5 addr10 * 5 addr19 * 5 addr10 * 5 a9 (/ma7) * 4 addr18 * 5 addr9 * 5 addr18 * 5 addr9 * 5 addr19 * 5 addr9 * 5 addr18 * 5 addr9 * 5 a8 (/ma6) * 4 addr17 * 5 addr8 * 5 addr17 * 5 addr8 * 5 addr18 * 5 addr8 * 5 addr17 * 5 addr8 * 5 a7 (/ma5) * 4 addr16 * 5 addr7 * 5 addr16 * 5 addr7 * 5 addr17 * 5 addr7 * 5 addr16 * 5 addr7 * 5 a6 (/ma4) * 4 addr15 * 5 addr6 * 5 addr15 * 5 addr6 * 5 addr16 * 5 addr6 * 5 addr15 * 5 addr6 * 5 a5 (/ma3) * 4 addr14 * 5 addr5 * 5 addr14 * 5 addr5 * 5 addr15 * 5 addr5 * 5 addr14 * 5 addr5 * 5 a4 (/ma2) * 4 addr13 * 5 addr4 * 5 addr13 * 5 addr4 * 5 addr14 * 5 addr4 * 5 addr13 * 5 addr4 * 5 a3 (/ma1) * 4 addr12 * 5 addr3 * 5 addr12 * 5 addr3 * 5 addr13 * 5 addr3 * 5 addr12 * 5 addr3 * 5 a2 (/ma0) * 4 addr11 * 5 addr2 * 5 addr11 * 5 addr2 * 5 addr12 * 5 addr2 * 5 addr11 * 5 addr2 * 5 notes: 1. the legend bsize r epresents the bsize bit in the sdramcm control register. 2. the legend dsz represents the dsz bit in the sdramm address register. 3. the legend ddbw repres ents the ddbw bit in the sdramm address register. 4. the legends ba1, ba0, and ma12 to ma 0 represent the sdram bank address and sdram address respectively. 5. addresses addr25 to addr0 are the logi cal addresses used by the cpu and dmac in access to the sdram. 6. when the rd, wr or pra command is i ssued, this carries the pre-charge option signal.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 282 of 1164 rej09b0321-0200 table 9.19 case for 32-bit external data bus width (bsize * 1 = (0, 1)) (3) sdram type number 512 mbits ( 32) 1 256 mbits ( 8) 4 512 mbits ( 16) 2 512 mbits ( 8) 4 dsz * 2 100 (64 mbytes) 101 (128 mbytes) 101 (128 mbytes) 110 (256 mbytes) ddbw * 3 10 (32 bits) 00 (8 bits) 01 (16 bits) 00 (8 bits) this lsi address row address column address row address column address row address column address row address column address a16 (/ba1) * 4 addr25 * 5 addr25 * 5 addr26 * 5 addr26 * 5 addr26 * 5 addr26 * 5 addr27 * 5 addr27 * 5 a15 (/ba0) * 4 addr24 * 5 addr24 * 5 addr25 * 5 addr25 * 5 addr25 * 5 addr25 * 5 addr26 * 5 addr26 * 5 a14 (/ma12) * 4 addr23 * 5 l addr24 * 5 l addr24 * 5 l addr25 * 5 l a13 (/ma11) * 4 addr22 * 5 l addr23 * 5 l addr23 * 5 l addr24 * 5 addr12 * 5 a12 (/ma10) * 4 addr21 * 5 * 6 addr22 * 5 * 6 addr22 * 5 * 6 addr23 * 5 * 6 a11 (/ma9) * 4 addr20 * 5 l addr21 * 5 addr11 * 5 addr21 * 5 addr11 * 5 addr22 * 5 addr11 * 5 a10 (/ma8) * 4 addr19 * 5 addr10 * 5 addr20 * 5 addr10 * 5 addr20 * 5 addr10 * 5 addr21 * 5 addr10 * 5 a9 (/ma7) * 4 addr18 * 5 addr9 * 5 addr19 * 5 addr9 * 5 addr19 * 5 addr9 * 5 addr20 * 5 addr9 * 5 a8 (/ma6) * 4 addr17 * 5 addr8 * 5 addr18 * 5 addr8 * 5 addr18 * 5 addr8 * 5 addr19 * 5 addr8 * 5 a7 (/ma5) * 4 addr16 * 5 addr7 * 5 addr17 * 5 addr7 * 5 addr17 * 5 addr7 * 5 addr18 * 5 addr7 * 5 a6 (/ma4) * 4 addr15 * 5 addr6 * 5 addr16 * 5 addr6 * 5 addr16 * 5 addr6 * 5 addr17 * 5 addr6 * 5 a5 (/ma3) * 4 addr14 * 5 addr5 * 5 addr15 * 5 addr5 * 5 addr15 * 5 addr5 * 5 addr16 * 5 addr5 * 5 a4 (/ma2) * 4 addr13 * 5 addr4 * 5 addr14 * 5 addr4 * 5 addr14 * 5 addr4 * 5 addr15 * 5 addr4 * 5 a3 (/ma1) * 4 addr12 * 5 addr3 * 5 addr13 * 5 addr3 * 5 addr13 * 5 addr3 * 5 addr14 * 5 addr3 * 5 a2 (/ma0) * 4 addr11 * 5 addr2 * 5 addr12 * 5 addr2 * 5 addr12 * 5 addr2 * 5 addr13 * 5 addr2 * 5 notes: 1. the legend bsize r epresents the bsize bit in the sdramcm control register. 2. the legend dsz represents the dsz bit in the sdramm address register. 3. the legend ddbw repres ents the ddbw bit in the sdramm address register. 4. the legends ba1, ba0, and ma12 to ma 0 represent the sdram bank address and sdram address respectively. 5. addresses addr27 to addr0 are the logi cal addresses used by the cpu and dmac in access to the sdram. 6. when the rd, wr or pra command is i ssued, this carries the pre-charge option signal.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 283 of 1164 rej09b0321-0200 (c) example of sdram connection figures 9.42 and 9.43 show examples of the connection of sdram with this lsi. a16 a15 a14 a13 to a2 a1, a0 sdcke sdclk sdcs sdras sdcas sdwe d13 to d16 dqm3 dqm2 d15 to d0 dqm1 dqm0 64 m sdram (1 m 16 bits 4 banks) a13 (ba1) a12 (ba0) a11 to a0 cke clk cs ras cas we i/o15 to i/o0 dqmu dqml a13 (ba1) a12 (ba0) a11 to a0 cke clk cs ras cas we i/o15 to i/o0 dqmu dqml this lsi not in use not in use figure 9.42 example of connecting a 32-bit data-width sdram
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 284 of 1164 rej09b0321-0200 a16 a15 a14 a13 to a2 a1, a0 sdcke sdclk sdcs sdras sdcas sdwe d13 to d16 dqm3 dqm2 d15 to d0 dqm1 dqm0 a13 (ba1) a12 (ba0) a11 to a0 cke clk cs ras cas we i/o15 to i/o0 dqmu dqml 64 m sdram (1 m 16 bits 4 banks) this lsi not in use not in use not in use not in use not in use figure 9.43 example of connecting a 16-bit data-width sdram
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 285 of 1164 rej09b0321-0200 9.6 usage note 9.6.1 note on power-on reset exception handling and deep standby mode cancellation when writing to the external address space or making sdram settings in power-on reset exception handling or cancellation of deep standby mode, be sure to set bits acosw[3:0] in acswr to b'0011 beforehand. 9.6.2 write buffer in write access to normal or sdra m space, the write data are stor ed once in the internal write buffer of the bsc, and only after that does actu al writing to the device (e xternal device) connected in the normal or sdram space proceed. since writing from the write buffer to th e external device is performed automatically, no processing by software is necessary. however, care must be taken on the followi ng point. write access from the cpu or dmac appears complete at the point wher e the data are stored in the abov e write buffer. that is, at the point where the write access from the cpu or dma co ntroller has been comp leted, writing to the external device might not have been completed. to confirm the completion of writing to the external device, dummy read the normal or sdram space. completion of the dummy-read operation guarantees the completion of writing to the external device in response to previous write access. the target address for the dummy read operatio n does not have to be in the same device as the target for write access. fu rthermore, it does not have to be in the same space. 9.6.3 note on transition to software standby mode or deep standby mode when a transition to software st andby mode or deep standby mode is made after write access to the normal or sdram space, there is a possibility th at data remains in the internal write buffer of the bsc. to confirm that no data remain in the write buffer, execute a dummy read of the external device in the same way as described above.
section 9 bus state controller (bsc) rev. 2.00 sep. 07, 2007 page 286 of 1164 rej09b0321-0200
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 287 of 1164 rej09b0321-0200 section 10 bus monitor the bus monitor is a module that monitors bus errors on each bu s. when an illegal address access or a bus timeout is detected, a bus error interr upt is generated and an access canceling signal is output for the bus timeout. (the bus timeout function is used for debugging.) figure 10.1 shows a block diagram of the bus monitor. bus interface bus monitor bus monitor enable register bus monitor status register 1 sh2a cpu core bus error signal peripheral bus bus monitor status register 2 bus error control register figure 10.1 block di agram of bus monitor 10.1 register descriptions the bus monitor has the following registers. all registers are initialized by a power -on reset or in deep standby mode. table 10.1 register configuration register name abbreviation r/w initial value address access size bus monitor enable register syc been r/w h'00 h'ff400000 8, 16, 32 bus monitor status register 1 syc bests1 r/w h'00 h 'ff400004 8, 16, 32 bus monitor status register 2 syc bests2 r/w h'00 h 'ff400008 8, 16, 32 bus error control register syc besw r/w h'00 h'ff40000c 8, 16, 32
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 288 of 1164 rej09b0321-0200 10.1.1 bus monitor enable register (sycbeen) sycbeen clears the bus monitor status register and controls the detection function. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/wrrrrrrrrrrrrr/wr/wr 0000000000000000 rrrrrrrrrrrrrrrr sts clr ? toen igaen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ????? bit bit name initial value r/w description 31 stsclr 0 r/w status clear writing 1 to this bit clears the bus monitor status register. writing 0 or reading data has no effect. 0: invalid 1: bus monitor status register cleared 30 to 19 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 18 toen 0 r/w timeout detection enable this bit enables or disables the function that detects a bus timeout on each bus. 0: bus timeout detection function disabled 1: bus timeout detection function enabled 17 igaen 0 r/w illegal address access detection enable this bit enables or disables the function that detects an illegal address access on each bus. 0: illegal address access detection function disabled 1: illegal address access detection function enabled 16 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: when a bus access is performed with the detection function disabled (toen = 0), the bus may freeze.
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 289 of 1164 rej09b0321-0200 10.1.2 bus monitor status register 1 (sycbests1) sycbests1 indicates the status of slave bus (p eripheral bus (1)) regarding whether a timeout occurred, whether an illegal address access was made , or which bus master accessed the slave bus. table 10.2 shows the correspondence betw een the bus space an d the slave bus. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr rrrrrrrrrrrrrrr 0000000000000000 r ???????????????? ? pto per ? ? ? pmst[1:0] ? ? ? ? ? ? ?? bit bit name initial value r/w description 31 to 15 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 14 pto 0 r timeout this bit indicates that a timeout occurred on peripheral bus (1) when the first bus error occurred. 0: timeout not generated 1: timeout generated 13 per 0 r illegal address access this bit indicates that an illegal address access was made on peripheral bus (1) when the first bus error occurred. 0: illegal address access not made 1: illegal address access made 12 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 290 of 1164 rej09b0321-0200 bit bit name initial value r/w description 9, 8 pmst[1:0] 00 r bus master these bits indicate the bus master that accessed peripheral bus (1) when the first bus error occurred. 00: cpu 01: dmac (destination side) 10: setting prohibited 11: dmac (source side) 7 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. table 10.2 bus space and slave bus address bus space slave bus h'0000 0000 to h'4fff ffff exter nal bus space external bus h'5000 0000 to h'e800 ffff reserved (others * 1 ) h'e801 0000 to h'efff ffff reserved (others * 1 ) h'f000 0000 to h'f1ff ffff address array space in cache ? * 2 h'f200 0000 to h'f5ff ffff reserved ? * 2 h'f600 0000 to h'ff3f ffff reserved (others * 1 ) h'ff40 0000 to h'ff5f ffff on-chip periphe ral module (1) peripheral bus (1) h'ff60 0000 to h'fff7 ffff reserved (others * 1 ) h'fff8 0000 to h'fff8 7fff on-chip ram ? * 2 h'fff8 8000 to h'fffb ffff reserved ? * 2 h'fffc 0000 to h'ffff ffff on -chip peripheral module (2) peripheral bus (2) notes: 1. this means bus spaces in the slave bus space other than those for the external bus and peripheral buses (1) and (2). 2. an illegal address access error does not occur.
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 291 of 1164 rej09b0321-0200 10.1.3 bus monitor status register 2 (sycbests2) sycbests2 indicates the status of slave buses (external bus/peripheral bus (2)/others) regarding whether a timeout occurred, whether an illegal address access was made, or which bus master accessed the slave bus. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r 0000000000000000 r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r ? ??? ???????? eto eer emst[1:0] ? ? oer ? ? ? omst[1:0] ? ? sher ? ? ? shmst[1:0] bit bit name initial value r/w description 31 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 30 eto 0 r timeout this bit indicates that a timeout occurred on the external bus when the first bus error occurred. 0: timeout not generated 1: timeout generated 29 eer 0 r illegal address access this bit indicates that an illegal address access was made on the external bus when the first bus error occurred. 0: illegal address access not made 1: illegal address access made 28 to 26 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 292 of 1164 rej09b0321-0200 bit bit name initial value r/w description 25, 24 emst[1:0] 00 r bus master these bits indicate the bus master that accessed the external bus when the first bus error occurred. 00: cpu 01: dmac (destination side) 10: setting prohibited 11: dmac (source side) 23 to 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13 oer 0 r illegal address access these bits indicate the bus master that accessed other buses when the first bus error occurred. 0: illegal address access not made 1: illegal address access made 12 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 omst[1:0] 00 r/w bus master these bits indicate the bus master that accessed other buses when the first bus error occurred. 00: cpu 01: dmac (destination side) 10: setting prohibited 11: dmac (source side) 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5 sher 0 r illegal address access this bit indicates that an illegal address access was made on peripheral bus (2) when the first bus error occurred. 0: illegal address access not made 1: illegal address access made
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 293 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 shmst [1:0] 00 r bus master these bits indicate the bus master that accessed peripheral bus (2) when the first bus error occurred. 00: cpu 01: dmac (destination side) 10: setting prohibited 11: dmac (source side)
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 294 of 1164 rej09b0321-0200 10.1.4 bus error contro l register (sycbesw) sycbesw controls the notification of vari ous types of bus errors to the cpu. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 00 0000000000000 r/w r/w r/w rrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr 00 cpen 11 cpen 0 01 cpen ? r ? ??????????? ???????????????? bit bit name initial value r/w description 31 00cpen 0 r/w bus error control (cpu cpu) this bit controls notification to the cpu when a bus error is caused by the cpu. 0: not notified 1: notified 30 01cpen 0 r/w bus error control (dmac destination side cpu) this bit controls notification to the cpu when a bus error is caused by the dmac destination side. 0: not notified 1: notified 29 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 28 11cpen 0 r/w bus error control (dmac source side cpu) this bit controls notification to the cpu when a bus error is caused by the dmac source side. 0: not notified 1: notified 27 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 295 of 1164 rej09b0321-0200 10.2 bus monitor function the bus monitor function detects two types of bus error: illegal address access and bus timeout. bus error detection is performed in one bus access. even when data is transferred in multiple bus accesses such as bu rst transfer, a bus error can be detected in one bus access. 10.2.1 operation when a bus error is detected when a bus error is detected, the status is saved in the bus monitor status register 1 (sycbests1) and bus monitor status register 2 (sycbests2) and the cpu is notified of the bus error is notified to the cpu. (1) saving status in bus mo nitor status register or bu s monitor status register 2 when a bus error occurs, the status at the time (what type of error occurred and which bus was being accessed by which bus master) is saved in the bus monitor status register 1 (sycbests1) or bus monitor status register 2 (sycbests2). even if another bus error occurs after this, the value in the bus monitor status register (sycbests) or bus monitor status register 2 (sycbests2) is not updated. when multiple bus errors occur at the same time, mu ltiple status bits may be set. the bus monitor status register 1 (sycbests1) or bus monitor status register 2 (sycbests2) can be cleared by writing 1 to the status clear bit (stsclr) in the bus monitor enable register (sycbeen) from the bus master. after being cleared, the status of a bus error, if generated, is saved in the bus monitor status register 1 (sycbests1) or bus monitor status register 2 (sycbests2) again. when a clear operation and a bus error happen at the same time, the clear operation has priority and the bus error is ignored.
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 296 of 1164 rej09b0321-0200 (2) error notification to the cpu the cpu is notified of a bus error through the or condition of the timeout bits (pto/eto) and illegal address access bits (per/eer/oer/sher) in the bus monitor status register 1 (sycbests1) and bus monitor status register 2 (sycbests2). the cpu is notified of a bus error interrupt acco rding to the setting of the bus er ror control register (sycbesw). when the bus monitor status register 1 (sycbests1) and bus monitor status register 2 (sycbests2) are cleared by the cpu, the bus error interrupt signal is also negated. (3) termination of bus access when a bus error is detected, the bus access is terminated. for details, see section 10.2.4, combinations of masters and bus errors. for the detailed operations when each type of error is detected, se e section 10.2.2, illegal address access detection function and section 10.2.3, bus timeout detection function. 10.2.2 illegal address a ccess detection function the illegal address access detection function det ects attempted accesses to illegal addresses. (1) conditions of illegal add ress access error generation illegal address access errors occur when th e following illegal addresses are accessed. ? external spaces for which the operation enable b it (exenb) in the control register of the bsc is not set to "operation enabled" ? other address areas that are not mapped to any slave bus ? address areas that are mapped to the slave bus es but do not corresp ond to slave devices tables 10.3 and 10.4 show the address areas to which slave devi ces are not mapped within the spaces for peripheral buses (1) and (2). table 10.3 address areas without slave de vices in the space for peripheral bus (1) ff401000 to ff41ffff ff423000 to ff45ffff ff464000 to ff5fffff
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 297 of 1164 rej09b0321-0200 table 10.4 address areas without slave de vices in the space for peripheral bus (2) fffc0000 to fffdffff fffe0020 to fffe03ff fffe0420 to fffe07ff fffe0900 to fffe37ff fffe3830 to fffe387f fffe3910 to fffe3fff fffe4400 to fffe53ff fffe5410 to fffe57ff fffe5840 to fffe67ff fffe6804 to fffe7fff fffe8100 to fffe87ff fffe8900 to fffe8fff fffe9100 to fffe97ff fffe9900 to fffe9fff fffea100 to fffea7ff fffea900 to fffeafff fffeb100 to fffeb7ff fffeb900 to fffecfff fffed010 to fffed07f fffed090 to fffedfff fffee010 to fffee07f fffee090 to fffee0ff fffee110 to fffeffff ffff1408 to ffff14ff ffff1508 to ffff15ff ffff1608 to ffff16ff ffff1720 to ffff17ff ffff1820 to ffff18ff ffff1910 to ffffffff
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 298 of 1164 rej09b0321-0200 10.2.3 bus timeout detection function the bus timeout detection function detects bus acce sses whose cycles are ex tended to 768 cycles or more. (1) conditions of bus ti meout error generation bus timeout errors occur in the following cases. this function should be used when debugging software. ? a bus access is not completed on peripheral bus (1) ? the wait signal remains asserted du ring an external bus access (2) operation when a bus timeout error is generated the operation when a bus timeout error occurs is explained below. 1. the timeout counter starts counting from th e next cycle after the start of a bus access. 2. if the bus access is not completed in 768 cycl es, a bus timeout occurs and an access canceling signal is asserted for 256 cycles. bus signals such as address, data, bc, read/write, and burst are held. the timeout error is recorded in the bus m onitor status register 1 (sycbests1) or bus monitor status register 2 (sycbests2). a bus error interrupt is generated and sent to the cpu. 3. the bus access is terminated. 4. the cpu processes the bus error. locked buses are all released.
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 299 of 1164 rej09b0321-0200 (3) bus timeout operation in consecutive accesses for transfers where multiple bus accesses are made (such as burst transfer ), the next bus access might not be terminated when a bus timeout o ccurs. in this case, a bus timeout may occur continuously. even if a bus timeout occurs continuously, the timeout proce ss of terminating a bus access is performed in the same way as the first time. howeve r, the status is saved in the bus monitor status register 1 (syscests1) or bus monitor status register 2 (sycbests2) only the first time. 10.2.4 combinations of masters and bus errors the types of detectable bus error de pend on the master and access mode. (1) cpu transfer modes and types of bus error generated table 10.5 shows the types of bus error that may be generated by accesses from the cpu. table 10.5 cpu access types and types of bus error generated access type normal access burst access illegal address access * 1 o * 2 o * 2 * 3 bus timeout * 1 o * 2 o * 2 * 3 [legend] o: a bus error is generated. ? : a bus error is not generated. notes: 1. to enable bus error detection, the bus monitor enable register (sycbeen) should be set. 2. to notify the cpu of a bus error, the 00cpen bit in the bus error control register (sycbesw) should be set to 1. 3. the number of bus errors detected is the same as the number of accesses that resulted in an error.
section 10 bus monitor rev. 2.00 sep. 07, 2007 page 300 of 1164 rej09b0321-0200 (2) dmac transfer modes and operations of each bus table 10.6 shows the dmac transfer modes and the types of bus error that may be generated by accesses from the dmac. table 10.6 dmac transfer modes an d types of bus error generated dmac transfer mode cycle steal pipeline illegal address access * o o bus timeout * o o [legend] o: a bus error is generated. ? : a bus error is not generated. note: * to enable bus error detection, the bus monitor enable register (sycbeen) should be set. 10.3 usage note 10.3.1 operation when the cpu is not notified of a bus error table 10.7 describes the operations when bus error notification to the cpu is disabled with the bus error detection enabled (by the setting of the bus monitor enable register (sycbeen)). table 10.7 operation when the master is not notified of a bus error illegal address access illegal address access errors equal in number to the predetermined number of transfers are generated and the access is terminated each time. bus timeout bus timeouts equal in number to the predetermined number of transfers are generated and the access is terminated each time.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 301 of 1164 rej09b0321-0200 section 11 direct memory access controller (dmac) the dma controller (hereafter dmac) is a module th at handles high-speed data transfer without cpu intervention in response to requests from software, on-chip peripheral i/o modules, or external pins (external modules). the dmac itself does not distinguish between requests from on-chip peripheral i/o or external pins (external modules). the dma supports data transfer between memory units, memory an d i/o modules, and i/o modules. 11.1 features ? channel number: up to eight ch annels (with four channels capable of external requests) ? transfer requests: requests from 37 sources including software trigger, on-chip peripheral i/o, and external pins (external modules) ? maximum transfer bytes: 64 mbytes ? address space: 4 gbytes ? transfer data sizes: ? single data transfer: 8, 16, 32, 64, and 128 bits ? single operand transfer: 1, 2, 4, 8, 16, 32, 64, and 128 data ? non-stop transfer: up to the byte count "0" ? transfer mode: ? cycle-stealing tr ansfer (dual-ad dress transfer) ? pipelined transfer ( dual-address transfer) ? maximum transfer speed: ? cycle-stealing transf er: minimum of three clock cy cles per unit data transfer ? pipelined transfer: minimu m of one clock cycle pe r unit data transfer ? transfer conditions: ? unit operand transfer: a single sequence of single operand data transfer in response to a dma request ? sequential operand transfer: single operand tr ansfers are repeated until the byte count reaches "0" ? non-stop transfer: data is co ntinuously transferred until the byte count reaches "0" in response to a single dma request ? channel priority: channel 0 > channel 1 > > channel 6 > channel 7 (this priority order is fixed)
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 302 of 1164 rej09b0321-0200 ? interrupt request ? two types of interrupt requests (generat ed when the byte count reaches "0") ? interrupt request signals for each channel ? interrupt request signal common to all channels ? reload function (source address, destin ation address, byte count) settable ? rotate function settable ? dmac stop/restart/suspend function settable notes: terminologies in this section are as follows: 1. single data transfer: transfer in one r ead cycle and one write cycle by the dmac (in the case of dual address transfer) 2. single operand transfer: continuous data transfer by the dmac on one channel (amount of data to be transferred is set in a register) 3. one dma transfer: transferring a number of data, from the start address to the end address set in the byte count register 4. channel number: n = 0 to 7 5. request source number: k = 1 to 36, m = 0 to 36 6. biu: bus interface unit (peripheral module ). one of the following four kinds according to the source or destination of transfer. biu_e: external space (normal space and sdram space) biu_p: peripheral bus (1) (see figure 1.1), on-chip ram space biu_sh: peripheral bus (2) (see figure 1.1)
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 303 of 1164 rej09b0321-0200 figure 11.1 is a block diagram of the dmac : : cpu i/f dmac core dmac dma end dma acknowledge dma active dma interrupt request dma common interrupt request cpu control signal dma request transfer current register reload register ch0 dma setting data chn dma setting data ch0 dma transfer data chn dma transfer data on-chip memory dma request from outside (dreq) or on-chip peripheral circuit memory i/f (work register) memory load/store control source address register destination address register byte count register mode register dmac control circuit data buffer dmac control signal [legend] dma request transfer: arbitration of dma requests and generation of request signal to dmac core cpu i/f: read/write control of register access from cpu memory i/f: memory access control from cpu and dmac core on-chip memory: stores dmac setting data and transfer data work register: register the dmac core refers to (access from cpu prohibited) dmac control circuit: dmac control circuit data buffer: dma data buffer figure 11.1 dmac block diagram 11.2 input/output pins table 11.1 pin configuration name i/o function dreqm (m = 0 to 3) input external request for dma transfer dackm (m = 0 to 3) output dma acknowledgement of external request for dma transfer (active low) dactm (m = 0 to 3) output dma active in extern ally requested dma transfer (active low) dtendm (m = 0 to 3) output completion of externa lly requested dma transfer (active low)
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 304 of 1164 rej09b0321-0200 11.3 register descriptions the dmac has the following registers. all registers are initialized by a power-on reset or in deep standby mode. table 11.2 register configuration channel register name abbreviation r/w initial value address access size 0 dma current source address register 0 dmcsadr0 r/w undefined h'ff460000 32 dma current destination address register 0 dmcdadr0 r/w undefined h'ff460004 32 dma current byte count register 0 dmcbct0 r/w undefined h'ff460008 32 dma mode register 0 dmmod0 r/w undefined h'ff46000c 32 dma reload source address register 0 dmrsadr0 r/w undefined h'ff460200 32 dma reload destination address register 0 dmrdadr0 r/w undefined h'ff460204 32 dma reload byte count register 0 dmrbct0 r/w undefined h'ff460208 32 dma control register a0 dmcnta0 r/w h'00000000 h'ff460400 8, 16, 32 dma control register b0 dmcntb0 r/w h'00000000 h'ff460404 8, 16, 32 1 dma current source address register 1 dmcsadr1 r/w undefined h'ff460010 32 dma current destination address register 1 dmcdadr1 r/w undefined h'ff460014 32 dma current byte count register 1 dmcbct1 r/w undefined h'ff460018 32 dma mode register 1 dmmod1 r/w undefined h'ff46001c 32 dma reload source address register 1 dmrsadr1 r/w undefined h'ff460210 32 dma reload destination address register 1 dmrdadr1 r/w undefined h'ff460214 32 dma reload byte count register 1 dmrbct1 r/w undefined h'ff460218 32 dma control register a1 dmcnta1 r/w h'00000000 h'ff460408 8, 16, 32 dma control register b1 dmcntb1 r/w h'00000000 h'ff46040c 8, 16, 32
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 305 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size 2 dma current source address register 2 dmcsadr2 r/w undefined h'ff460020 32 dma current destination address register 2 dmcdadr2 r/w undefined h'ff460024 32 dma current byte count register 2 dmcbct2 r/w undefined h'ff460028 32 dma mode register 2 dmmod2 r/w undefined h'ff46002c 32 dma reload source address register 2 dmrsadr2 r/w undefined h'ff460220 32 dma reload destination address register 2 dmrdadr2 r/w undefined h'ff460224 32 dma reload byte count register 2 dmrbct2 r/w undefined h'ff460228 32 dma control register a2 dmcnta2 r/w h'00000000 h'ff460410 8, 16, 32 dma control register b2 dmcntb2 r/w h'00000000 h'ff460414 8, 16, 32 3 dma current source address register 3 dmcsadr3 r/w undefined h'ff460030 32 dma current destination address register 3 dmcdadr3 r/w undefined h'ff460034 32 dma current byte count register 3 dmcbct3 r/w undefined h'ff460038 32 dma mode register 3 dmmod3 r/w undefined h'ff46003c 32 dma reload source address register 3 dmrsadr3 r/w undefined h'ff460230 32 dma reload destination address register 3 dmrdadr3 r/w undefined h'ff460234 32 dma reload byte count register 3 dmrbct3 r/w undefined h'ff460238 32 dma control register a3 dmcnta3 r/w h'00000000 h'ff460418 8, 16, 32 dma control register b3 dmcntb3 r/w h'00000000 h'ff46041c 8, 16, 32
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 306 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size 4 dma current source address register 4 dmcsadr4 r/w undefined h'ff460040 32 dma current destination address register 4 dmcdadr4 r/w undefined h'ff460044 32 dma current byte count register 4 dmcbct4 r/w undefined h'ff460048 32 dma mode register 4 dmmod4 r/w undefined h'ff46004c 32 dma reload source address register 4 dmrsadr4 r/w undefined h'ff460240 32 dma reload destination address register 4 dmrdadr4 r/w undefined h'ff460244 32 dma reload byte count register 4 dmrbct4 r/w undefined h'ff460248 32 dma control register a4 dmcnta4 r/w h'00000000 h'ff460420 8, 16, 32 dma control register b4 dmcntb4 r/w h'00000000 h'ff460424 8, 16, 32 5 dma current source address register 5 dmcsadr5 r/w undefined h'ff460050 32 dma current destination address register 5 dmcdadr5 r/w undefined h'ff460054 32 dma current byte count register 5 dmcbct5 r/w undefined h'ff460058 32 dma mode register 5 dmmod5 r/w undefined h'ff46005c 32 dma reload source address register 5 dmrsadr5 r/w undefined h'ff460250 32 dma reload destination address register 5 dmrdadr5 r/w undefined h'ff460254 32 dma reload byte count register 5 dmrbct5 r/w undefined h'ff460258 32 dma control register a5 dmcnta5 r/w h'00000000 h'ff460428 8, 16, 32 dma control register b5 dmcntb5 r/w h'00000000 h'ff46042c 8, 16, 32
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 307 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size 6 dma current source address register 6 dmcsadr6 r/w undefined h'ff460060 32 dma current destination address register 6 dmcdadr6 r/w undefined h'ff460064 32 dma current byte count register 6 dmcbct6 r/w undefined h'ff460068 32 dma mode register 6 dmmod6 r/w undefined h'ff46006c 32 dma reload source address register 6 dmrsadr6 r/w undefined h'ff460260 32 dma reload destination address register 6 dmrdadr6 r/w undefined h'ff460264 32 dma reload byte count register 6 dmrbct6 r/w undefined h'ff460268 32 dma control register a6 dmcnta6 r/w h'00000000 h'ff460430 8, 16, 32 dma control register b6 dmcntb6 r/w h'00000000 h'ff460434 8, 16, 32 7 dma current source address register 7 dmcsadr7 r/w undefined h'ff460070 32 dma current destination address register 7 dmcdadr7 r/w undefined h'ff460074 32 dma current byte count register 7 dmcbct7 r/w undefined h'ff460078 32 dma mode register 7 dmmod7 r/w undefined h'ff46007c 32 dma reload source address register 7 dmrsadr7 r/w undefined h'ff460270 32 dma reload destination address register 7 dmrdadr7 r/w undefined h'ff460274 32 dma reload byte count register 7 dmrbct7 r/w undefined h'ff460278 32 dma control register a7 dmcnta7 r/w h'00000000 h'ff460438 8, 16, 32 dma control register b7 dmcntb7 r/w h'00000000 h'ff46043c 8, 16, 32 common dma activation control register dmscnt r/w h'00000000 h'ff460500 8, 16, 32 dma interrupt control register dmicnt r/w h'00000000 h'ff460508 8, 16, 32 dma common interrupt control register dmicnta rw h'00000000 h'ff46050c 8, 16, 32 dma interrupt status register dmists r h'00000000 h'ff460510 8, 16, 32 dma transfer end detection register dmedet r/w h'00000000 h'ff460514 8, 16, 32 dma arbitration status register dmasts r/w h'00000000 h'ff460518 8, 16, 32
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 308 of 1164 rej09b0321-0200 11.3.1 dma current source a ddress register (dmcsadr) dmcsadr is a register used to specify th e start address of th e transfer source. the value in this register is transferred to the working source-address register at the start of dma transfer. the default behavior is for the contents of the working source-address register to be returned on completion of single operand tran sfer. however, the contents of the working source address register are not returned in two cases: when the rotate setting (samod = 011) is made for the source address and when th e source-address relo ad function is enabled. in the latter case, the contents of the dma reload source address register (dmrsadrn) are returned to this register on completion of dma transfer. this register must be set before transfer is init iated, regardless of whether the reload function is enabled or disabled. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: ? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w csa csa bit bit name initial value r/w description 31 to 0 csa undefined r/w holds source address bits a31 to a0 notes: 1. set this register so that dma transfe r is performed within the correctly aligned address boundaries for the transfer sizes listed below. ? when the transfer size is set to 16 bits (szsel = "001"): (b0) = "0". ? when the transfer size is set to 32 bits (szsel = "010"): (b1, b0) = (0, 0). 2. only write to this register when singl e operand transfer is not in process on the corresponding channel (the corresponding dast s bit in the dma arbitration status register (dmasts) is "0") and dma transfe r is disabled (dmst in the dma activation control register (dmscnt) or den in dm a control register b for the channel (dmcntbn) is set to "0"). operation is not guar anteed if this register is written to when both conditions are not satisfied.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 309 of 1164 rej09b0321-0200 11.3.2 dma current destination address register (dmcdadr) dmcdadr is a register used to specify the start address of the tr ansfer destination. the value in this register is transferred to the working destination-address register at the start of dma transfer. the default behavior is for the contents of the working destination-address register to be returned on completion of each single opera nd transfer. however, the conten ts of the working destination- address register are not re turned in two cases: when the rotate setting (samod = 011) is made for the destination address and when the destination-addr ess reload function is enabled. in the latter case, the contents of the dma reload destinati on address register (dmrda drn) are returned to this register on comp letion of dma transfer. this register must be set before transfer is ini tiated, regardless of whether the reload function is enabled or disabled. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: ? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w cda cda bit bit name initial value r/w description 31 to 0 cda undefined r/w holds destination address bits a31 to a0 notes: 1. set this register so that dma transfe r is performed within the correctly aligned address boundaries for the transfer sizes listed below. ? when the transfer size is set to 16 bits (szsel = "001"): (b0) = "0". ? when the transfer size is set to 32 bits (szsel = "010"): (b1, b0) = (0, 0). 2. only write to this register when singl e operand transfer is not in process on the corresponding channel (the corresponding dast s bit in the dma arbitration status register (dmasts) is "0") and dma transfe r is disabled (dmst in the dma activation control register (dmscnt) or den in dm a control register b for the channel (dmcntbn) is set to "0"). operation is not guar anteed if this register is written to when both conditions are not satisfied.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 310 of 1164 rej09b0321-0200 11.3.3 dma current byte count register (dmcbct) dmcbct is a register used to specify the number of bytes to be transferred by dma. the value in this register is transferred to th e working byte-count regist er at the start of dma transfer, and is then decremente d by the number of bytes transferred on each unit data transfer. decrementation is thus by the following values. ? when the transfer size is set to 8 bits (szsel = "000"): ? 1 ? when the transfer size is set to 16 bits (szsel = "001"): ? 2 ? when the transfer size is set to 32 bits (szsel = "010"): ? 4 when the value in the working byte count regist er reaches h'000 0000, dma transfer ends (an end due to byte count "0"). the corresponding bit of the dma transfer end detection register (dmedet) is set to 1. if the byte count reload function is disabled, the contents of the working byte count register are returned to this register at the moment the ch annel for dma transfer sw itches or dma transfer ends. if the byte count reload function is enabled, the contents of the dma reload byte counter register (dmrbctn) are returned to this register. this register must be set before transfer is init iated, regardless of whether the reload function is enabled or disabled. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0 0 0 0 0 0 ?????????? r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ???????????????? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ?????? cbc cbc bit bit name initial value r/w description 31 to 26 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 25 to 0 cbc undefined r/w number of bytes to be dma-transferred. notes: 1. note that a setting of h'000 0000 leads to transfer of the maximum number of bytes, i.e. 64 mbytes.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 311 of 1164 rej09b0321-0200 2. set this register so that dma transfer is performed within the correctly aligned address boundaries for the transfer sizes listed below. ? when the transfer size is set to 16 bits (szsel = "001"): (b0) = "0". ? when the transfer size is set to 32 bits (szsel = "010"): (b1, b0) = (0, 0). 3. only write to this register when singl e operand transfer is not in process on the corresponding channel (the corresponding dast s bit in the dma arbitration status register (dmasts) is "0") and dma transfe r is disabled (dmst in the dma activation control register (dmscnt) or den in dm a control register b for the channel (dmcntbn) is set to "0"). operation is not guar anteed if this register is written to when both conditions are not satisfied. 11.3.4 dma reload source address register (dmrsadr) dmrsadr is used to set an address for reloadin g to the dma current source address register (dmcsadrn). to enable reloading, set the dma source address reload function enable bit (srlod) in dma control register a (dmcntan) for the channel to "1". in this case, set both the dma current source address register (dmcsa drn) and dma reload source ad dress register (dmrsadrn). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: ? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w rsa rsa bit bit name initial value r/w description 31 to 0 rsa undefined r/w holds source address bits a31 to a0 for reloading note: set this register so that dma transfer is performed within the correctly aligned address boundaries for the transfer sizes listed below. ? when the transfer size is set to 16 bits (szsel = "001"): (b0) = "0". ? when the transfer size is set to 32 bits (szsel = "010"): (b1, b0) = (0, 0).
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 312 of 1164 rej09b0321-0200 11.3.5 dma reload destination address register (dmrdadr) dmrdadr is a register used to set an address for reloading to the dma current destination address register (dmcdadrn). to enable reloading, set the dma destination address reload function enable bit (drlod) in dma control register a (dmcntan) to 1. in th is case, set both the dma current destination address register (dmcdadrn) an d dma reload destination address register (dmrdadrn). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: ? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w rda rda bit bit name initial value r/w description 31 to 0 rda undefined r/w holds destination address bits a31 to a0 for reloading note: set this register so that dma transfer is performed within the correctly aligned address boundaries for the transfer sizes listed below. ? when the transfer size is set to 16 bits (szsel = "001"): (b0) = "0". ? when the transfer size is set to 32 bits (szsel = "010"): (b1, b0) = (0, 0).
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 313 of 1164 rej09b0321-0200 11.3.6 dma reload byte count register (dmrbct) dmrbct is a register used to set the number for reloading to the dma current byte count register (dmcbctn). to enable reloading, set the dma byte count reload function enable bit (brlod) in the dma control register a (dmcntan) to 1. in this case, set both the dma current byte count register (dmcbtn) and dma reload byte co unt address register (dmrbctn). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 000000? r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??????? r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ?????? rbc rbc bit bit name initial value r/w description 31 to 26 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 25 to 0 rbc undefined r/w number of bytes to be dma-transferred after reloading note: set this register so that dma transfer is performed within the correctly aligned address boundaries for the transfer sizes listed below. ? when the transfer size is set to 16 bits (szsel = "001"): (b0) = "0". ? when the transfer size is set to 32 bits (szsel = "010"): (b1, b0) = (0, 0).
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 314 of 1164 rej09b0321-0200 11.3.7 dma mode register (dmmod) dmmod controls the amount of data, data size selection, address direction, and various types of signal outputs. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0 0 0 0 ???? 0 0000??? rrrrr/wr/wr/wr/wrrrrrr/wr/wr/w 0 ??? 0 ??? 0 0 0 0 ???? rr/wr/wr/wrr/wr/wr/wrrrrr/wr/wr/wr/w ???? opsel[3:0] ? ? ? ? ? szsel[2:0] ? samod[2:0] ? damod[2:0] ? ? ? ? sact dact dtcm[1:0] bit bit name initial value r/w description 31 to 28 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 315 of 1164 rej09b0321-0200 bit bit name initial value r/w description 27 to 24 opsel [3:0] undefined r/w number of data transfers in single operand transfer selection these bits are used to s pecify the number of single data transfers in single oper and transfer. the amount of data specified by this bit is transferred continuously. channel arbitration is not ex ecuted until this amount of data has been transferred (single operand transfer). these bits are invalid when non-stop transfer (dsel = "11") is specified in the dma transfer condition selection bits (dsel) of dma control register a (dmcntan). note: set the dma current byte count register (dmcbctn) so that dmcbctn becomes h'000 0000 on transfer of the last data of the operand transfer. ? when the transfer size is set to 8 bits (szsel = "000"): integer multiple of the number of data transferred in each single operand transfer ( 1, 2, 3, and so on) ? when the transfer size is set to 16 bits (szsel = "001"): one operand transfer data number multiplied by two ( 2, 4, 6, and so on) ? when the transfer size is set to 32 bits (szsel = "010"): one operand transfer data number multiplied by four ( 4, 8, 12, and so on) operation is not guaranteed when values other than the above are set. for details, see section 11.3.3, dma current byte count register (dmcbct) and section 11.3.6, dma reload byte count register (dmrbct).) 0000: 1 datum 0001: 2 data 0010: 4 data 0011: 8 data 0100: 16 data 0101: 32 data 0110: 64 data 0111: 128 data 1000 to 1111: setting prohibited
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 316 of 1164 rej09b0321-0200 bit bit name initial value r/w description 23 to 19 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 18 to 16 szsel[2:0] undefined r/w transfer data size selection these bits are used to s pecify the number of bits transferred in each single data transfer. the unit for transfer can be selected as byte (8 bit), word (16 bit), or longword (32 bit). for details, see section 11.9, units of transfer and positioning of bytes for transfer. set the transfer size so that it doesn't exceed the widths of the data buses supported by the source and destination for dma transfer. the bus widths of the data buses are fixed by hardware. 000: byte (8 bits) 001: word (16 bits) 010: longword (32 bits) 011 to 111: setting prohibited 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 to 12 samod [2:0] undefined r/w source address direction control these bits are used to specif y the direction of counting for the source address. 000: fixed 001: incrementation 010: decrementation 011: rotation 100 to 111: setting prohibited 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 317 of 1164 rej09b0321-0200 bit bit name initial value r/w description 10 to 8 damod [2:0] undefined r/w destination address direction control these bits are used to specif y the direction of counting for the source address. 000: fixed 001: incrementation 010: decrementation 011: rotation 100 to 111: setting prohibited 7 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 sact undefined r/w dma active signal output for source this bit is used to control the output of the dma-active signal (dact) for the source corresponding to the requesting source setting in the dctg bits. when this bit is set to "0", output of the dact signal is disabled and the signal is fixed high unless the level changes because of the dact bit setting. when this bit is set to "1", output of the dact signal is valid ("l") from the next cycl e after the start of the dmac read cycle. however, while output of the dact signal is enabled when the dma request source selection bits (dctg) are set for software triggering, a valid dact signal cannot be output when the requesting source is an on- chip peripheral circuit (dctg), regardless of the setting of the sact bits. 0: stops output of the dma-ac tive signal for the source 1: selects output of the dma-active signal for the source during read access
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 318 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 dact undefined r/w dma active signal output for destination this bit is used to control the output of the dma-active signal (dact) for the destination corresponding to the request source setting in the dctg bits. when this bit is set to "0", output of the dact signal is disabled and fixed high unless the level changes because of the sact bit setting. when this bit is set to "1", output of the dact signal is valid ("l") from the next cycl e after the start of the dmac read cycle. however, while output of the dact signal is enabled when the dma request source selection (dctg) bits are set for software triggering, a valid dact signal cannot be output when the requesting source is an on- chip peripheral circuit (dctg), regardless of the setting of the dact bit. 0: stops output of the dma-active signal for the destination 1: selects output of the dma-active signal for the destination during write access
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 319 of 1164 rej09b0321-0200 bit bit name initial value r/w description 1, 0 dtcm[1:0] undefined r/w dma end signal output control these bits are used to cont rol the output of the dma end signal (dtend) when the dma transfer end condition is detected. when the bits are set to "00", dtend signals on completion of dma transfer are disabled and the dtend line is fixed high. when these bits are set to "10", the dtend signal goes low (is active) in the cycle after the read cycle immediately preceding completion of dma transfer. when these bits are set to "10", the dtend signal is active in the cycle after the write cycle immediately preceding completion of dma transfer. when these bits are set to "11", the dtend signal is active for the period of one clock cycle at the same time as the dma transfer end interrupt (for details, see figure 11.9.) however, while output of t he dtend signal is enabled when the dma request source selection bits (dctg) are set for software triggering, a valid dtend signal cannot be output when the requesting source is an on- chip peripheral circuit (dctg), regardless of the setting of the dtend bits. 00: stops output of the dtend signal 01: the dtend signal is out put on the last read cycle 10: the dtend signa l is output on the last write cycle 11: the dtend signal is output after dma has been completed note: only write to this register when the corre sponding channel is not engaged in single operand transfer (the corresponding dasts bit in the dma arbitration status register (dmasts) is "0") and dma transfer is disabled (dmst in the dma activation control register (dmscnt) or den in dma control register b for the channel (dmcntbn) is set to "0"). operation is not guaranteed if this register is written to when both conditions are not satisfied. when sact and dact are set to 1, output of a low dact signal from the cycle following a dmac read or write cycle is enabled.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 320 of 1164 rej09b0321-0200 table 11.3 shows the dma source/destination address registers. for details on the rotation address "indexing" mode, see section 11.11, rotate function. note that when performing pipelined transfer to or from external de vices and modules that support burst access, make sure to set the direction bits to select address increm entation ("001") or rotation ("011"). table 11.3 increment/decrement for dma source/destination address registers address indexing mode samod or damod transfer data size selection bits szsel "000" (fixed) "001" (plus direction) "010" (minus direction) "011" (rotation) "000" (8 bits) 0 + 1 ? 1 + 1 "001" (16 bits) 0 + 2 ? 2 + 2 "010" (32 bits) 0 + 4 ? 4 + 4 11.3.8 dma control register a (dmcnta) dmcnta handles the selections of the transfer mode and the cond ition of transfer, control of reload functions, and selection of dma sources. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrr/wr/wrrr/wr/wrrrrrrr/wr/w 0000000000000000 r r r r r r/w r/w r/w r r r/w r/w r/w r/w r/w r/w ? ? mdsel[1:0] ? ? dsel[1:0] ? ? ? ? ? ? strg[1:0] ????? brlod srlod drlod ? ? dctg[5:0] bit bit name initial value r/w description 31, 30 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 321 of 1164 rej09b0321-0200 bit bit name initial value r/w description 29, 28 mdsel [1:0] 00 r/w dma transfer mode selection these bits are used to s pecify the dma transfer mode. setting these bits to "00" selects cycle-stealing transfer mode. setting these bits to "01" selects pipelined transfer mode. do not set these bits to "10" or "11". operation is not guaranteed if these settings are made. for details, see section 11.4.1, dma transfer mode. 00: cycle-stealing transfer 01: pipelined transfer 10: setting prohibited 11: setting prohibited note: pipelined transfer through a single biu is not possible. for details on the biu, see section 11.1, features. 27, 26 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 25, 24 dsel[1:0] 00 r/w dma transfer condition selection these bits are used to spec ify the conditions of dma transfer. setting these bits to "00" selects single operand transfer. setting these bits to "01" selects sequential operand transfer. setting these bits to "11" selects non-stop transfer. for details, see section 11.4.2, dma transfer condition. do not set these bits to "10". operation is not guaranteed if this setting is made. 00: unit operand transfer 01: sequential operand transfer 10: setting prohibited 11: non-stop transfer
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 322 of 1164 rej09b0321-0200 bit bit name initial value r/w description 23 to 18 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 17, 16 strg[1:0] 00 r/w i nput sense mode selection these bits specify input sense modes for dma request signals input to the dmac. the requesting source is that selected from among the possible sources by the dma request source selection bits (dctg). select rising edge sense by setting these bits to "00" if the software trigger (dctg = "000000") and pins dreq0 to dreq3 are selected as the source for dma requests. select falling edge sense by setting the bits to "10" when operation is with iic3, scif, ssi, rcan- et, mtu2, or adc (dctg = "000101" to "100100"). table 11.4 shows the relationships between dma request sources and the possible input sense modes. 00: rising edge 01: high level 10: falling edge 11: low level 15 to 11 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 10 brlod 0 r/w dma byte count reload function enable this bit specifies whether to reload the byte counter or not when the dma transfer end condition is detected. when this bit is cleared to "0", no reload is executed. when this bit is set to "1" and the dma transfer end condition is detected, the dma current byte counter register (dmcbctn) is reloaded with the value in the dma reload byte count register (dmrbctn). 0: byte count reload function disabled 1: byte count reload function enabled
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 323 of 1164 rej09b0321-0200 bit bit name initial value r/w description 9 srlod 0 r/w dma source address reload function enable this bit specifies whether or not the source address is reloaded when the dma transfer end condition is detected. when this bit is cleared to "0", reloading is not executed. when this bit is set to "1" and the dma transfer end condition is detected, the dma current source address register (dmcsadrn) is relo aded with the value of the dma reload source address register (dmrsadrn). 0: source address reload function disabled 1: source address reload function enabled 8 drlod 0 r/w dma destination address reload function enable this bit specifies whether or not the destination address is reloaded when the dma transfer end condition is detected. when this bit is cleared to "0", reloading is not re- executed. when this bit is set to "1" and the dma transfer end condition is detected, the dma current destination address register (dmcdadrn) is reloaded with the value of the dma reload des tination address register (dmrdadrn). 0: destination address reload function disabled 1: destination address reload function enabled 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 324 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 to 0 dctg[5:0] 000000 r/w dma request source selection these bits specify the source of dma requests. when selecting iic3, scif, rcan-et, mtu2, or adc as the source, set the dma transfer request enable bits in dreqer0 to dre qer3 of the interrupt controller. for the settings of dreqer0?3, see section 6, interrupt controller (intc). 000000: software trigger 000001: dreq0 pin 000010: dreq1 pin 000011: dreq2 pin 000100: dreq3 pin 000101: iic3 0ch rx 000110: iic3 0ch tx 000111: iic3 1ch rx 001000: iic3 1ch tx 001001: iic3 2ch rx 001010: iic3 2ch tx 001011: scif 0ch rx 001100: scif 0ch tx 001101: scif 1ch rx 001110: scif 1ch tx 001111: scif 2ch rx 010000: scif 2ch tx 010001: scif 3ch rx 010010: scif 3ch tx 010011: scif 4ch rx 010100: scif 4ch tx 010101: scif 5ch rx 010110: scif 5ch tx 010111: scif 6ch rx
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 325 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 to 0 dctg[5:0] 000000 r/w 011000: scif 6ch tx 011001: scif 7ch rx 011010: scif 7ch tx 011011: ssi 0ch 011100: ssi 1ch 011101: rcan-et 0ch 011110: rcan-et 1ch 011111: mtu2 0ch 100000: mtu2 1ch 100001: mtu2 2ch 100010: mtu2 3ch 100011: mtu2 4ch 100100: adc 100101 to 111111: setting prohibited note: only write to bits of this register other than the reload function enable bits (brlod, srlod, and drlod) when a transfer operati on is not in process on the corresponding channel (the corresponding dasts bit in the dma arbitration status register (dmasts) is "0") and dma transfer is disabled (dmst in the dma activation control register (dmscnt) or den in dma control register b for the channel (dmcntbn) is set to "0"). operation is not guaranteed if this register is written to when both conditions are not satisfied.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 326 of 1164 rej09b0321-0200 table 11.4 relationships between dma request sources and input sense mode strg bit settings dma request source 00: rising edge sense 01: high level sense 10: falling edge sense 11: low level sense dctg bit setting software trigger 000000 dreq0 pin 000001 dreq1 pin 000010 dreq2 pin 000011 dreq3 pin 000100 iic3 0ch rx 000101 iic3 0ch tx 000110 iic3 1ch rx 000111 iic3 1ch tx 001000 iic3 2ch rx 001001 iic3 2ch tx 001010 scif 0ch rx 001011 scif 0ch tx 001100 scif 1ch rx 001101 scif 1ch tx 001110 scif 2ch rx 001111 scif 2ch tx 010000 scif 3ch rx 010001 scif 3ch tx 010010 scif 4ch rx 010011 scif 4ch tx 010100 scif 5ch rx 010101 scif 5ch tx 010110 scif 6ch rx 010111 scif 6ch tx 011000 scif 7ch rx 011001 scif 7ch tx 011010
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 327 of 1164 rej09b0321-0200 strg bit settings dma request source 00: rising edge sense 01: high level sense 10: falling edge sense 11: low level sense dctg bit setting ssi 0ch 011011 ssi 1ch 011100 rcan-et 0ch 011101 rcan-et 1ch 011110 mtu2 0ch 011111 mtu2 1ch 100000 mtu2 2ch 100001 mtu2 3ch 100010 mtu2 4ch 100011 adc 100100 [legend] : setting prohibited : can be set
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 328 of 1164 rej09b0321-0200 11.3.9 dma control register b (dmcntb) dmcntb enables or disables dma transfer, clears the dma transfer enable bit, and also clears the internal state. in addition, this regi ster can check the status of a dma request. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrr/wrrrrrrrr/w 0000000000000000 rrrrrrrr/wrrrrrrrr/w ? den dreq ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? eclr dsclr bit bit name initial value r/w description 31 to 25 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 24 den 0 r/w dma transfer enable this bit is used to enable or disable dma transfer on the corresponding channel. clearing this bit to "0" disables dma transfer. setting this bit to "1" enables dma transfer. for the activation of dma transfer, see section 11.4.3, dma activation. even when this bit is clear, the input of a dma request to the dmac can change the value of the dma request bit (dreq). when the dma transfer enable clear bit (eclr) is set to "1", this bit is autom atically cleared to "0" on detection of the dma transfer end condition. clearing this bit to "0" during dna transfer can be used to stop channel oper ation at the end of the current single operand transfer. for details, see section 11.6, suspending, restarting, and stopping of dma transfer. 0: dma transfer disabled 1: dma transfer enabled
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 329 of 1164 rej09b0321-0200 bit bit name initial value r/w description 23 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 dreq 0 r/w dma request this bit is used to check whether a dma request is currently present. furthermore, when the software trigger is selected (dctg = "000000") by the dma request source selection bits (dctg), dma requests operate through this bit. the value of this bit changes according to the state of dma request input to the dmac regardless of the settings of the dmac module activation bit (dmst) and dma transfer enable bit (den). the conditions for setting and clearing the bit are determined by the dma request source selection bits (dctg) and input sense mode selection bits (strg) as described below. (a) when software triggering is selected (dctg = "000000") by the dma request source selection bits (dctg). ? condition for setting to "1" this bit is set to "1" when a "1" is written to it by software, generating the dma request. ? condition for clearing to "0" this bit is cleared to "0" by either of the below events. ? software writing a "0" to the bit ? the start of the transfer operation corresponding to the bit setting
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 330 of 1164 rej09b0321-0200 bit bit name initial value r/w description 16 dreq 0 r/w (b) when a source other than the software trigger is selected (dctg = "000000") by the dma request source selection bits (dctg) and a level sense has been selected ? condition for setting to "1" this bit is set to "1" when the dma request input level matches that specified in the input sense selection bits (strg), i.e. when a dma request exists. ? condition for clearing to "0" this bit is cleared to "0" when the level specified by the input sense selection bits (strg) and the level on the dma request input do not match, i.e. when there is no dma request. the dma request is not retained if it disappears before being accepted; that is, the dma request bit (dreq) is cleared to "0". to use the dreq bit with a level sense, continue the dma request level until the request has been accepted. note: when a requesting source other than the software trigger is selected, do not write "1" to the dma request bit (dreq). if "1" is written to this bit, operation is not guaranteed.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 331 of 1164 rej09b0321-0200 bit bit name initial value r/w description 16 dreq 0 r/w (c) when a source other than the software trigger is selected (dctg = "000000") by the dma request source selection bits (dctg) and an edge sense has been selected ? condition for setting to "1" the dreq bit is set to "1" when the edge specified by the input sense selection bits (strg) is encountered, i.e. when a dma request exists. once this bit has been set to "1", regardless of the subsequent state of the dma request signal, the dma request bit (dreq) remains set until a condition for clearing to "0" has been satisfied. ? condition for clearing to "0" this bit is cleared to "0" by either of the events listed below. ? software writing a "0" to this bit ? the start of operand transfer corresponding to the bit notes: 1. in a case where a source other than software triggering is selected, do not write "1" to the dma request bit (dreq). if "1" is written to this bit, operation is not guaranteed. 2. after setting the dma request source selection bits (dctg) and the input sense mode selection bits (strg) in dma control register a (dmcntan), be sure to clear the dma request bit (dreq) for the channel to "0" and enable dma transfer (dmst = "1" and den = "1"). 0: no dma request 1: dma requested 15 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 332 of 1164 rej09b0321-0200 bit bit name initial value r/w description 8 eclr 0 r/w dma transfer enable clear this bit specifies whether or not to clear the dma transfer enable bit (den) to "0" when the dma transfer end condition is detected. when this bit is cleared to "0", the dma transfer enable bit (den) is not cleared to "0" even when the dma transfer end condition is detected. when this bit is set to "1", the dma transfer enable bit (den) is cleared to "0" when the dma transfer end condition is detected. note: when a value is written to the dma transfer enable clear bit for a channel handling single operand transfer, operation is not guaranteed. 0: detection of the dma transfer end condition does not clear the dma transfer enable bit to 0 1: detection of the dma transfer end condition clears the dma transfer enable bit to 0 7 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 333 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 dsclr 0 r/w dma internal state clear writing a "1" to this bit stops dma transfer in the middle of a sequence of dma transfer, suspending the remainder of the transfer and initializing the internal state of the dmac. writing a "1" to this bit only clears the transfer state of the dmac internal circuit. the other registers are not initiali zed. writing "0" is invalid and a "1" written to this bit is not retained. this bit is always read as "0". note: this bit must only be written to when the corresponding channel is not in the midst of single operand transfer (dasts in the channel corresponding to the dma arbitration status register (dmasts) is "0") and dma transfer has been disabled (dmst in the dma activation control register (dmscnt) or den in dma control register b (dmcntbn) is set to "0"). operation is not guaranteed when this bit is written to while these conditions do not apply. when reading: always read as "0" when writing: 0: invalid 1: initializes the dmac's internal state note: when the software trigger is selected as the dma request source, the dma request bit (dreq) can be set to "1" regardless of the settings of the dma transfer enable bit (den) and dmac module activation bit (dmst) and whether or not a transfer operation is currently in progress. however, even if the so ftware trigger is selected as the dma request source, only clear the dma request bit (dreq) to "0" or write to the dmac internal state clearing bit (dsclr) when a transfer operation is not in process on the corresponding channel (the corresponding dasts bit in the dma arbitration status register (dmasts) is "0") and dma transfer has been disabled (dmst in the dma activation control register (dmscnt) or den in the dma control register b (dmcntbn) is set to "0"). operation is not guaranteed if this register is written to when these conditions are not satisfied.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 334 of 1164 rej09b0321-0200 11.3.10 dma activation control register (dmscnt) dmscnt controls the operation of the dmac. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr/w 0000000000000000 rrrrrrrrrrrrrrrr ? dmst ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? bit bit name initial value r/w description 31 to 17 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 16 dmst 0 r/w dmac module activation this bit is used to stop or activate the dmac module. when this bit is cleared to "0", the dmac module stops. when this bit is set to "1", the dmac module is operational. for details, see section 11.4.3, dma activation, and section 11.6, suspending, restarting, and stopping of dma transfer. 0: dmac halted 1: dmac operating 15 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 335 of 1164 rej09b0321-0200 11.3.11 dma interrupt control register (dmicnt) dmicnt controls dma interrupts for the respective channels. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/wr/wr/wr/wr/wr/wr/wr/wrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr dintm ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ????????? bit bit name initial value r/w description 31 to 24 dintm all 0 r/w dma interrupt control these bits are used to control whether dma transfer end interrupts for the respective channels should be generated for the interrupt controller. when a bit is cleared to "0", interrupt requests for the corresponding channel are not generated. when these bits are set to "1", dma transfer end interrupts for the corresponding channel are generated for the interrupt controller. for details, see section 11.5.2, dma interrupt requests. 0: interrupt disabled 1: interrupt enabled 23 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: bits 31 to 24 correspond to channels 0 to 7, respectively (31: channel 0, 30: channel 1. ?24: channel 7).
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 336 of 1164 rej09b0321-0200 11.3.12 dma common interrupt control register (dmicnta) dmicnta determines which channels contribute to the output of a common interrupt request signal. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/wr/wr/wr/wr/wr/wr/wr/wrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr dinta ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ????????? bit bit name initial value r/w description 31 to 24 dinta all 0 r/w dma common interrupt request signal control these bits are used to determine which channels contribute to the output of a common interrupt request signal. channels for which the dinta bit is set to "1" contribute to the output of a common interrupt request signal. channels for which the dinta bit is cleared to "0" do not contribute to the output of a common interrupt request signal. only the states of channels for which the corresponding dinta bit is set to "1" are reflected in the dma interrupt status register (dmists) when a common interrupt request signal has been generated. for details, see section 11.5.2, dma interrupt requests. 0: the channel does not cont ribute to the output of a common interrupt requests 1: the channel contributes to the output of a common interrupt request 23 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: bits 31 to 24 correspond to channel 0 to 7, respectively (31: channel 0, 30: channel 1, ?, 24: channel 7).
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 337 of 1164 rej09b0321-0200 11.3.13 dma interrupt status register (dmists) dmists consists of the dma interrupt request status bits. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr dists ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ????????? bit bit name initial value r/w description 31 to 24 dists all 0 r dma interrupt request status these bits are used to verify the sources of common interrupt requests for the interrupt controller. ? condition for setting to "1" when the dma common interrupt request signal control bit (dinta) for a channel is set to "1" and the dma transfer end condition is detected, the corresponding bit is set to "1". the setting of the dma interrupt control bit (dintm) does not affect this setting. ? condition for clearing to "0" a dists bit is cleared to "0" by clearing the corresponding dma transfer end condition detection bit (dedet) in the dma transfer end detection register (dmedet). for details, see section 11.5.2, dma interrupt requests. 0: no interrupt request 1: an interrupt request exists 23 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. notes: 1. this register is read-only. 2. bits 31 to 24 correspond to channels 0 to 7, respectively (31: channel 0, 30: channel 1, ?, 24: channel 7).
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 338 of 1164 rej09b0321-0200 11.3.14 dma transfer end detection register (dmedet) dmedet verifies the status of dma transfer end detection for each channel. writing 0 to the dedet bit is invalid and 1 written to the bit is not retained. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/wr/wr/wr/wr/wr/wr/wr/wrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr dedet ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?????????
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 339 of 1164 rej09b0321-0200 bit bit name initial value r/w description 31 to 24 dedet all 0 r/w values read: dma transfer end condition detection values written: dma transfer end condition detection, dma interrupt request status clear these bits are used to verify the status of dma transfer end condition detection for each channel. reading this register does not automatically clear the bits. once a bit has been se t to "1", the value is retained in the register as long as the bit is not cleared by software or a reset. ? condition for setting to "1" when the dma transfer end condition is detected, these bits are set to "1". ? condition for clearing to "0" these bits are cleared to "0" by writing a "1" to the bits to be cleared. write "0" to bits that are not to be cleared. while a bit is clear, it cannot be set to "1" by a write operation. when the dma transfer end interrupt is in use and an interrupt request generated for a given channel starts to be handled, write a "1" to the corresponding dma transfer end condition detection (dedet) bit. when the dma transfer end condition detection (dedet) bits are cleared to "0", the dma interrupt request status bit (dists) is also cleared. values read: 0: dma transfer end condition not detected 1: dma transfer end condition detected values written: 0: invalid 1: clears dma transfer end condition detection and dma interrupt request status 23 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: bits 31 to 24 correspond to channels 0 to 7, respectively (31: channel 0, 30: channel 1, ?, 24: channel 7).
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 340 of 1164 rej09b0321-0200 11.3.15 dma arbitration status register (dmasts) dmasts verifies the status of dma transfer on each channel. writing 0 to the dasts bit is invalid and 1 written to the bit is not retained. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr dasts ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?????????
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 341 of 1164 rej09b0321-0200 bit bit name initial value r/w description 31 to 24 dasts all 0 r when read: dma arbitration status when written: dma arbi tration status clear these bits are used to verify the status of dma transfer on each channel. ? condition for setting to "1" ? the bit for a channel in which operand transfer (non-stop transfer) has started is set to "1". ? condition for clearing to "0" these bits are cleared to "0" by either of the following events. ? correct completion of single operand transfer (non-stop transfer). ? a "1" is written to the bit. these bits are not cleared to "0" when dmac operation is forcibly ended by the external dma transfer forcible end signal. write "1" to these bits to clear them. note: in dma transfer to ex ternal devices, the dma arbitration status bit (dasts) can be cleared before the end of external bus access (once the last data-write oper ation has started). when read: 0: operand transfer not in progress 1: operand transfer in progress when written: 0: invalid 1: clears dma arbitration status 23 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: bits 31 to 24 correspond to channels 0 to 7, respectively (31: channel 0, 30: channel 1, ?, 24: channel 7)
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 342 of 1164 rej09b0321-0200 11.4 operation 11.4.1 dma transfer mode there are two dma transfer modes ? cycle-stealing mode and pipelined mode. these modes are selectable through the setting of the dma transf er mode select bits (mdsel) in dma control register a (dmcntan). figure 11.2 gives examples of how bus master ship alternates between the dmac and cpu in various dma transfer modes. (1) cycle-stealing transfer mode cycle-stealing tran sfer mode is selected when the dma tran sfer mode select bits are set to "00". in cycle-stealing transfer mode, the dmac leaves at least one cycle between the read and write access cycles of each single data transfer. during this interval, the cpu can access the same target biu as the source or destination of its own operations. for details on the biu, see section 11.1, features. (2) pipelined transfer mode pipelined transfer mode is sel ected when the dma transfer mode select bits are set to "01". in pipelined transfer mode, dmac activates th e bus for read or write access, or both, on consecutive cycles. therefore, th e cpu cannot access the target biu as a source or destination during single operand transfer. pipelined transfer through a single biu is not possible either.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 343 of 1164 rej09b0321-0200 dmac cpu dmac cpu (4) (5) (6) (4) (5) (6) (3) (3) (3) (3) (3) (3) system clock pipeline transfer mode (transfer between different biu) cycle steal transfer mode (transfer in the same biu) system clock read read read read write read write read write read write read write read write read write read write read write write write write (3) cpu access to other than biu on dmac read/write side is possible (4) cpu access to other than biu on dmac read side is possible (5) cpu access to other than biu on dmac read/write side is possible (6) cpu access to other than biu on dmac write side is possible dmac cpu (1) (1) (1) (1) (2) (2) (2) (2) system clock single operand transfer single operand transfer single operand transfer single operand transfer single operand transfer single operand transfer read read read read write (1) cpu access to other than biu on dmac read side is possible (2) cpu access to other than biu on dmac write side is possible cycle steal transfer mode (transfer between different biu) write write write figure 11.2 examples of the alternat ion of bus mastership between the dmac and cpu in various dma transfer modes
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 344 of 1164 rej09b0321-0200 11.4.2 dma transfer condition there are three methods of dma transfer ? the unit transfer opera tion, sequential operand transfer, and non-st op transfer. these are selectable thro ugh the setting of the dma transfer condition selection bits (dsel) in dma control re gister a (dmcntan). each of the conditions is explained below. table 11.5 and figure 11.3 are a list and chart of the dma transfer conditions. (1) unit operand transfer setting the dma transfer condition selection bits (dsel) to 00 selects this mode. a single dma request initiates continuous transfer of the number of bytes selected by the opsel bits in the dma mode register. if the byte counter does not reach 0 in si ngle operand tran sfer, the dma transfer is completed by repea ting unit transfer operations until the byte counter does reach 0. (2) sequential operand transfer setting the dma transfer condition selection bits (dsel) to 01 selects this mode. a single dma request initiates transfer in units of the number of bytes selected by the opsel bits in the dma mode register (i.e., unit transfer operations) until th e dma transfer is comple te (i.e., until the byte counter reaches zero). channel arbitration is performed on completion of each unit transfer operation. transfer on the channel for the seque ntial operand transfer automatically resumes unless there is a dma request from a higher-priority channel. (3) non-stop transfer setting the dma transfer condition selection bits (dsel) to 11 selects this mode. a single dma request initiates dma transfer that continues until the transfer is complete (i.e., until the byte counter reaches zero). there are no gaps for channel arbitration, so even dma requests from high- priority channels will not be accepted.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 345 of 1164 rej09b0321-0200 table 11.5 list of dma transfer conditions dma transfer condition select bits (dsel) dma transfer condition remarks dsel = "00" unit operand transfer ? the number of bytes selected for transfer in single operand transfer (by the opsel bits) is transferred in response to one dma request. ? channel arbitration is performed on completion of each single operand transfer. dsel = "01" sequential operand transfer ? transfer in response to a dma request proceeds in unit transfer operations until the byte counter reaches "0". ? channel arbitration is performed on completion of each single operand transfer. dsel = "11" non-stop transfer ? transfer in response to a dma request proceeds continuously until the byte counter reaches "0" by one dma request. ? once transfer has started, channel arbitration is not done until it is complete. opsel bit is disabled
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 346 of 1164 rej09b0321-0200 dtend dma request interrupt transfer data dtend dma request interrupt transfer data dtend dma request interrupt transfer data byte count operand 1 operand 2 operand 3 channel arbitration sequential operand transfer unit operand transfer channel arbitration byte count operand 1 operand 2 operand 3 channel arbitration channel arbitration byte count non-stop transfer figure 11.3 dma transfer conditions relations between the mode and conditions of dma transfer are shown in table 11.6.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 347 of 1164 rej09b0321-0200 table 11.6 relations between the mode and conditions of dma transfer. dma transfer mode condition unit operand transfer dsel = "00" sequential operand transfer dsel = "01" non-stop transfer dsel = "11" cycle-stealing transfer mdsel = "00" ok (between any two bius) ok (between any two bius) ok (between any two bius) transfer mode pipelined transfer mdsel = "01" ok (between any two bius) ok (between any two bius) mainly ok * (between any two bius other than biu_e) note: * the restriction means that non-stop transfer to the external sdram in pipelined transfer mode cannot be set up.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 348 of 1164 rej09b0321-0200 11.4.3 dma activation (1) initial settings of the dmac initial settings must be made in each of the relevant registers before the dma transfer enable bit is set (den = "1"). these settings cannot be ch anged once transfer has started. an example of dmac registers that require initial settings is given below. 1. dma mode register (dmmodn) 2. dma control register a (dmcntan) 3. dma control register b (dmcntbn) 4. dma current source address register (dmcsadrn) 5. dma reload source address register (dmrsadrn) ? when the reload function is used 6. dma current destination address register (dmcdadrn) 7. dma reload destination address register (dmrdadrn) ? when the reload function is used 8. dma current byte count register (dmcbctn) 9. dma reload byte count register (dmrbctn) ? when the reload function is used 10. dma interrupt control register (dmicnt) ? when an interrupt is used 11. dma common interrupt control register (dmicnta) ? when an interrupt is used 12. dma transfer enable bit (den) 13. dma activation control register (dmscnt) (2) dma activation dma transfer for a channel is enabled by set ting the dma transfer enable bit (den) in dma control register b for the channel and the dmac module activation bit (dmst) in the dmac activation register (dmscnt) to "1". when multiple dma transfer requ ests are present, there is no complex mechanism for the determination of channel priority. the dma request that corresponds to the highest priority channel is simply accepted and dma transfer on that channel starts. whether a dma request on a given channel is or is not present can be verifi ed by testing the value of the dma request bit (dreq) in dma control register b (dmcntbn) for that channel. when a dma request is accepted and dma transf er starts, the dma arbitration status bit (dasts) for the corresponding channel in the dma arbitration status register (dmasts) is set to "1".
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 349 of 1164 rej09b0321-0200 11.5 completion of dma transfer and interrupts 11.5.1 completion of dma transfer when the value h'0000 0000 is transferred from the working byte count register to the dma current byte count register (dmcbctn) (all data has been transferred) , the dma transfer end condition is fulfilled and one dma transfer is complete. the operations following detection of the dma transfer end condition are as follows. ? dma transfer end condition the dma transfer end condition detection bit (dedet) for the corresponding channel in the dma transfer end detection regist er (dmedet) is set to "1". ? interrupt request generation an interrupt request is generated for the interr upt controller according to the settings of the dma interrupt control register (dmicnt) and the dma common interrupt control register (dmicnta). ? output of dma end signal the dma end signal (dtendm) is output according the setting of the dma end signal output control bit (dtcm) in the dma mode register (dmmodn) for the channel. ? clearing the dma transfer enable bit (den) if the dma transfer enable clear bit (eclr) in dma control register b (dmcntbn) is set to "1", the den bit in the dma control register b (dmcntbn) is cleared to "0", suspending any subsequent dma transfer for the channel. if the dma transfer enable clear bit (eclr) is clear ("0"), the den bit is not cleared. ? reloading the source address register if the dma source address reload function enable bit (srlod) in the dma control register a (dmcntan) is set to "1", the dma current sour ce address register (dmcsadrn) is reloaded with the value in the dma reload source address register (dmrsadrn). ? reloading the destination address register if the dma destination address reload function enable bit (drlod) in dma control register a (dmcntan) is set to "1", the dma current destination address register (dmcdadrn) is reloaded with the value in the dma reload destination address register (dmrdadrn). ? reloading the byte count register
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 350 of 1164 rej09b0321-0200 if the dma byte count reload function enable bit (brlod) in the dma control register a (dmcntan) is set to "1", the dma current byte count register (dmcbctn) is reloaded with the value in the dma reload byte count register (dmrbctn). note: if reloading is not to be executed, set eclr = "1" to ensure that the den bit is cleared. 11.5.2 dma interrupt requests the dmac generates two types of interrupt request signal for the interrupt controller. one consists of the interrupt request signals for the individual channels (dmint_n) and the other is the common interrupt request signal in which the interrupt request signals from all channels are pooled to produce a common interrupt request signal (dminta_n). figure 11.4 is a block diagram showing how the per-channel and common interrupt requests are generated. when a dma transfer ends and the dma interrupt control bit (dintm) for the corresponding channel in the dma interrupt control register (dmi cnt) is set to "1", interrupt requests for the corresponding channel are generated. only those channels for which the dma common interrupt request signal control bit (dinta) in the dma common interrupt control register (dmicnta) is set to "1" contribute to the output of common interrupt request. once generated, an interrupt request is cleared to "0" by writing a "1" to the corresponding dma transfer end condition detection bit (dedet).
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 351 of 1164 rej09b0321-0200 ch0 ch1 ch2 ch0 ch1 ch2 chn dmint0_n dmint1_n dmint2_n dmintn_n dminta_n chn ch0 ch1 ch2 chn dma interrupt control register dma transfer end detection register dma interrupt control register dma interrupt status register to interrupt controller (intc) figure 11.4 block diagram showing generation of the per-channel an d common interrupt request signals
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 352 of 1164 rej09b0321-0200 11.5.3 dma end signal output the form in which the dma end signal (dtendm) is output differs with the setting of the dma end signal output control bit (dtcm) in the dma mode register (dmmodn) for the corresponding channel. ? when dtcm is set to "00", output of the dtend signal is not valid so the signal remains fixed at the "h" level when an d after the dma transfer ends. ? when dtcm is set to "01", the dtend signal becomes active (low) one cycle after the start of the read cycle immediately before the end of dma transfer (the read cycle for the last data transfer). ? when dtcm is set to "10", the dtend signal becomes active for one cycle after the write cycle immediately before the end of dma transfer (the write cycle for the last data transfer). ? when dtcm is set to "11", the dtend signal becomes active for one clock cycle at the same time as the dma transfer end interrupt is generated. output of the dtend signal is not valid in the case of dma requests from external peripheral circuits, so the signal remains fixed to "h" regardless of the setting of this bit. charts of the timing of dma end signal output are given in figure 11.5. note: the bsc is provided with a write buffer. wr iting data to this buffer while writing to the external devices stops bus access in the chip. b ecause of this, in dma transfer to or from external devices, the dtend signal become disabled ("h") before the end of external bus access. in this case the dtend signal is not synchronized with th e external bus access.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 353 of 1164 rej09b0321-0200 ckio rd1 rd2 rd1 rd2 dma (s) dma (d) dtend (00) dack dmint_n dtend (01) dtend (11) dtend (10) wr1 wr2 wr1 wr2 high high ckio dma (s) dma (d) dtend (00) dack dmint_n dtend (01) dtend (11) dtend (10) wr1 wr2 wr3 wr4 rd1 rd2 rd3 rd4 wr1 wr2 wr3 wr4 rd1 rd2 rd3 rd4 one dma transfer one dma transfer single operand transfer (read 1 wait) single operand transfer (read 1 wait) single operand transfer (read 0 wait) single operand transfer (read 0 wait) dtcm setting dtcm setting last read of one dma transfer last write of one dma transfer end of one dma transfer last read of one dma transfer last write of one dma transfer end of one dma transfer cycle-stealing transfer mode pipelined transfer mode dma (s): internal access cycle on dmac source side dma (d): internal access cycle on dmac destination side [legend] figure 11.5 timing of dma end signal output
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 354 of 1164 rej09b0321-0200 11.6 suspending, restarting, and stopping of dma transfer 11.6.1 suspending and re starting dma transfer transfer on all channels of th e dmac can be suspended by cl earing the dmst bit in the dma activation control register (dmscnt) to "0". transfer on a specific channel can also be suspended by clearing the dma transfer enab le bit (den) in dma control register b (dmcntbn) for that channel. if the dmst bit or the corresponding den bit is cleared to "0" while singl e operand transfer or sequential operand transfer is in progress, transfer is suspende d on completion of the current single operand transfer regardless of the transfer mode (whether transfer is in cycle-stealing or pipelined mode). when transfer in the no n-stop transfer condition is in progress, dma transfer is not suspended and continues to completion (until the byte counter reaches "0") even if the dmst bit or corresponding den bit is cleared to "0". to restart dma transfer on a channel for which transfer has been suspended, set (to "1") whichever of dmst and the corresponding den bit has been cleared. 11.6.2 stopping dma transfer on any channel to stop transfer on any channel, suspend transfer on that channel and then initialize the interior state of the dmac for that channel by setting the dmac internal state clear bit (dsclr) in the corresponding dma control register b (dmcntbn). in this case, on ly the transfer state of the dmac internal circuits is initialized; the registers retain their values.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 355 of 1164 rej09b0321-0200 11.7 dma requests 11.7.1 sources of dma requests the 37 sources of dma requests include the software trigger and various dma request signal inputs. the dma request source for each ch annel is specified by the dm a request source select bits (dtcg) in the corresponding dma control register a (dmcntan). 11.7.2 synchronous circuits for dma request signals for each channel of the dmac, a synchronous circuit is incorporated to manage dma requests, which are asynchronously input. as a result, a blank period of a few clock cycles appears between activation of the dma request an d actual reflection of the request in the dma request bits (dreq) of dma control register b (dmcntbn). figure 11.6 shows an example of timing between the input of a dma request and the dma request bit. system clock dma request input dma request bit dma request bit is on input of the valid edge dma request bit is maintained regardless of changes in the level of the dma request input level sense setting (low level sense) edge sense setting (falling edge sense) [legend] : sampling point for dma request system clock dma request input dma request bit dma request bit is set when the active level has been sampled at the end of two clock periods. dma request bit is cleared one cycle after sampling of the inactive level. figure 11.6 example of timing between dma request input and dma request bit
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 356 of 1164 rej09b0321-0200 11.7.3 sense mode for dma requests when pins dreq0 to dreq3 (dctg = "000001" to "000100") are specified by the dma request source selection bits (dtcg), either level sense or edge sense might be required. make the appropriate setting ("01" or "11" for level sense and "00" or "10" for edge sense) in the input sense selection bits (strg) of dma control register a (dmcntan). when the software trigger (dctg = "000000") is se lected as a dma request source, set these bits to "00" to select the rising-edge sense. when iic3, scif, ssi, rcan-et, mtu2, or adc (dctg = "000101" to "100101") is selected, set the bits to "10" to select the falling-edge sense. table 11.4 shows the relationships between the dma request sources and input sense mode. below are further details on level- and edge-sense operation. (1) level sense when a level sense is specified (strg = "01" or "11"), one level of the dma request signal indicates the dma request. since dma requests de tected in this way are not retained in the dmac, maintain the requesting level until accepta nce of the dma request has been confirmed. figure 11.7 is an example of dma request recep tion processing when a level sense has been selected. read write system clock dma state dma acknowledge output start of single operand transfer dma request input (low level sense) dma request bit [legend] : sampling point for dma request maintain dma request level until dma acknowledge output is activated to indicate acceptance of the request figure 11.7 example of dma request reception processing for a level sense when a level sense has been selected, dma request bit for the channel is masked over the period from the start of the last write access of single op erand transfer until four clock pulses (system
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 357 of 1164 rej09b0321-0200 clock) after the end of the single operand transf er. this provides a margin in which continued requests for dma transfer on the same channel are rejected. figure 11.8 shows the period over which dma request bit is masked when a level sense has been selected. system clock dma state dma acknowledge output single operand transfer dma request input (low level sense) dma request bit [legend] : sampling point for dma requests start of channel arbitration (period of masking for the dma request bit) the period of the unit transfer operation in this example is short; non-recognition of the dma request during the masking period prevents a dma request that is cleared too late from affecting the next channel-arbitration period. read write figure 11.8 period over whic h dma request bit is masked when a level sense is selected therefore, for a channel on which level sense has been selected, even when the dma request signal level is maintained (requesting further dm a transfer) well after the dma request has been accepted and handled, dma requests on other channels, if they exist, are accepted. this is because the dma request on the channel on which level sens e has been selected is not considered to exist during the dma request bit masking period. in the case of sequential operand transfer, masking is only applied from the end of operand transfer, i.e. when the byte count is 0. the dma reques t is not masked while the byte count is non-zero, so channel arbitration is executed without masking of the dma request during the actual unit transfer operation. in the case of non-stop transfer, masking is only en abled from the end of the transfer operation, i.e. when the byte count is 0.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 358 of 1164 rej09b0321-0200 if the dma transfer is not done sequentially, th e dma request must be canceled within three cycles after the end of single operand transfer. (2) edge sense when an edge sense is specified (strg = "00" or "10"), the rising or falling edge of the dma request signal indicates a dma request. when the selected edge is detected, the dma re quest bit (dreq) in the dma control register b (dmcntbn) is set to "1". after that, the valu e in the dma request bit (dreq) is retained regardless of shifts in the level of the dma request signal. after the dma request has been accepted and the dam acknowledge signal output, the dma request bit (dreq) is automatically cleared to "0". since dma requests are internally retained for a channel in edge sense mode, further occurrences of the selected edge of the dma request signa l are ignored since the dma request bit (dreq) has already been set back to "1". figure 11.9 is an example of dma request recepti on processing when an edge sense is selected. read write read system clock dma state dma acknowledge output the dma request bit is set on detection of the selected edge. the dma request is thus maintained despite further changes in the level of the dma request signal. start of single operand transfer dma request input (falling edge sense) dma request bit [legend] : sampling point for dma requests the dma request bit is set on detection of the selected edge. the dma request is thus maintained despite further changes in the level of the dma request signal. when the dma request is accepted, the dma acknowledge signal is activated and the dma request bit is cleared. figure 11.9 example of dma request reception processing when an edge sense is selected
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 359 of 1164 rej09b0321-0200 11.8 determining dma channel priority 11.8.1 channel priority order channel priority is allocated in descending order from channel 0; that is priority follows the below relation, where p indicates priority. p channel 0 > p channel 1 > p channel 3 ? p channel 6 > p channel 7 . this order is fixed. 11.8.2 operation during multiple dma requests the dmac determines the priority every time single operand transfer is performed. when a dma request with a higher priority is generated during transfer for one channel, the transfer for the higher-p riority channel only starts after the end of the current operand transfer. figure 11.10 shows overall operation when multip le dma requests are generated. the thick lines in the figure indicate the periods over which the dma request signals are at the low level. here channels 0, 2 and 3 are set to a level sense and channel 1 is set to an edge sense. 1. since the channel 2 request is masked, it is regarded as non-existent. thus, transfer on channel 3 starts up. 2. since channel 0 has the highest priority, transfer on this channel starts up. 3. since channel 2 has the higher priority of the requests at this point, transfer on this channel restarts. 4. transfer on channel 3 is restarted as there are no other requests at this point. 5. when the dma requests are simultaneously generated for channels 0, 1, and 3, transfer on channel 0 starts up because it has the highest priority. 6. after the transfer on channel 0 is complete, transfer on channe l 1 starts up because it has the second highest priority. 7. a further dma request (the selected edge) is received on channel 1 while dma transfer is in progress. transfer on channel 1 is thus restarted after completion of the current round of transfer on channel 1. no masking period applies in the case of edge sensing. 8. on completion of the transfer on channel 1, tr ansfer on channel 3 starts up since there are no other requests. 9. no transfer starts up immediately after the en d of the unit transfer operation on channel, since channel 3 requests are masked and there are no other requests. transfer on channel 3 only restarts after the end of the masking period.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 360 of 1164 rej09b0321-0200 ch2dma ch3dma ch0dma ch2dma ch3dma ch0dma ch1dma ch1dma ch3dma ch3dma dma request (ch 1) dma request (ch 2) dma receive channel notes: 1. channels 0, 2 and 3 are set to level sensing. 2. channel 1 is set to edge sensing. 3. thick lines indicate periods where the corresponding dreq bits are set. dma request (ch 0) dma request (ch 3) masked period masked period masked period (1) (2) (3) (4) (5) (6) (7) (8) (9) figure 11.10 overall operation during multiple dma requests 11.8.3 output of the dma acknowledge and dna active signals the settings of the dma active signal output control bits for the source and destination (sact or dact) in the corresponding dma mode register control the output of the dma active signal (dact) for a channel. when sact is set to 1, the dact signal is activated in respon se to read access. when dact is set to 1, the dact signal is activated in response to write access. when both sact and dact are set to 1, the dact signal is activated in response to read and write access. however, dact signals are not activated for dm a requests from external peripheral circuits, regardless of the setting of this bit. the dma acknowledge signal (dack) is output throughout each single operand transfer. figure 11.11 is the timing chart for dma acknowledge and dma active signal output. note: the bsc is provided with a write buffer. wr iting data to this buffer while writing to the external devices stops bus access in the chip. b ecause of this, in dma transfer to or from external devices, the dact or dack signal become disabled ("h") before the end of external bus access. in this ca se, these signals are not synchr onized with the external bus access.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 361 of 1164 rej09b0321-0200 ckio dma (s) dma (d) dact (sact = 1, dact = 0) dact (sact = 0, dact = 0) dact (sact = 0, dact = 1) dack dact (sact = 1, dact = 1) ckio dma (s) dma (d) dact (sact = 1, dact = 0) dact (sact = 0, dact = 0) dact (sact = 0, dact = 1) dack dac t (sact = 1, dact = 1) rd1 rd2 rd3 rd3 wr1 wr2 wr3 wr3 rd1 rd2 wr1 wr2 dma (s): internal cycles of source-side access by the dmac dma (d): internal cycles of destination-side access by the dmac [legend] cycle-stealing transfer mode single operand transfer (read 0 wait) single operand transfer (read 0 wait) pipeline transfer mode high high figure 11.11 timing of dma acknowledge and dna active signal output
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 362 of 1164 rej09b0321-0200 11.9 units of transfer and positioning of bytes for transfer the number of bits (transfer data size) for a single data transfer can be selected from among the byte (8 bits), word (16 bits), and the longword (32 bits). figure 11.12 is an example of dma data-byte control for a 32-bit wide bus. this transfer data size cannot exceed either of the data bus bit wi dths supported by the source and destination for dma transfer. the data bus widths are fixed by the hardware. state of address bits state of address bits state of address bits state of address bits h'ff00 4000 h'ff00 4001 h'ff00 8002 h'ff00 8004 h'ff00 4002 h'ff00 4003 h'0040 0203 d0 tod31 d0 to d31 d0 to d31 d0 to d31 h'0040 0204 h'ff60 0806 h'ff60 0808 h'0040 0205 h'0040 0206 source side source side 8-bit transfer destination side dmac internal 32-bit data buffers destination side : byte/bytes being handled 16-bit transfer dmac internal 32-bit data buffers figure 11.12 example of dma data -byte control for 32-bit bus width
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 363 of 1164 rej09b0321-0200 11.10 reload function reloading can be set up for each transfer parameter (source address, destination address, or byte count) of a channel through the setting of the individual reload function enable bits in the corresponding dma control register a (dmcntan). when the dma transfer end condition is detected, dma transfer parameters specified for reloading are automatically reloaded. (1) reload and current registers if reloading is not in use, only place the data in the current register. when reloading is in use, place data in both the reload and current registers. do not write to the current register during single op erand transfer. if data is written to the register during continuous operation, further operation is not guaranteed. although the reload register can be set during single operand transfer , ensure that this is not the la st single operand transfer of a dma transfer. if the setting is executed after that point, the new setting may not be reloaded on completion of the dma transfer. (2) continuous transfer to dispersed areas the reload function enables continuous transfer to dispersed areas. writing to the dma reload source/destination address register (dmrsadrn/ dmrdadrn) or the dma reload byte count register (dmrbctn) before the completion of transfer provides a way of preparing the parameters for the next tran sfer without aff ecting the current dma transfer (current registers). this enables the use of a single channel for the continuous transfer of multiple transfer blocks consisting of different numbers of bytes to and from different transfer areas over a single channel. figure 11.13 shows an example of the transfer of blocks between dispersed areas with the aid of the reload function.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 364 of 1164 rej09b0321-0200 aaaa an bbbb bn bbbb bn bbbb bn aaaa an cccc cn cccc cn cccc cn bbbb bn bbbb cccc aaaa blocks allocated to dispersed locations start < dmac register state > software processing destination address register reload byte count register current reload current reload current reload current reload current start of dmac transfer address undefined undefined block a byte number an block b byte number bn block c byte number cn interrupt on block a transfer end end start start end end block b transfer setting: automatic load block c transfer setting: automatic load block a, b, c transfer end (1) block a setting (2) block b setting (3) reload function enable bit set (5) block c setting (4) dma transfer enable set (6) reload function enable bit set figure 11.13 example of transferring blocks between dispersed areas by using the reload function.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 365 of 1164 rej09b0321-0200 11.11 rotate function when rotation is selected as the address "inde xing" mode, the address is incremented. on completion of single operand tran sfer, the value in a working source or working destination address register for which rotation has been se lected returns to the value of the source or destination address register (dmcsadrn or dmcdadrn) for the corresponding channel. figure 11.14 is an example of transfer using the rotate function (source: rotation, destination: incrementation). number of transfers in single operand transfer: 8 bytes current source address setting value source data for transfer 8 data (32 bytes) current destination address setting value total data transferred interrupt request dma end number of bytes for transfer: 96 bytes data transfer operand transfer block 1 8 data (32 bytes) block 2 8 data (32 bytes) block 3 8 data (32 bytes) data transferred in single operand transfer data transferred in single operand transfer data transferred in single operand transfer operand transfer operand transfer figure 11.14 example of transf er using the rotate function (source: rotate, dest ination: increment)
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 366 of 1164 rej09b0321-0200 11.12 transfer speed transfer speeds are calculated as shown below. (1) conditions for calculation ? dma transfer mode: cycle-stealing tran sfer mode/pipelined transfer mode ? transfer unit (one data size): properly aligned 32-bit data ? operating clock: 60 mhz ? number of cycles for access to external devices: four cycles for reading; and two cycles for writing. (2) formulae used in calculation ? cycle-stealing tr ansfer mode (data size in unit data transfer) / (number of read cycles + number of write cycles + one idle cycle) operating clock ? pipelined transfer mode (data size in unit data transfer) / (whichever is larger of number of read or write cycles) operating clock note: during transfer in the pipelined transf er mode, most read and write cycles overlap. an example of the calculation of transfer speed is given below. (a) transfer between on-chip ram maximum speed of transfer between on-chip ram (0 wait) and on-chip ram (0 wait). ? cycle-stealing tr ansfer mode 4 bytes / (1 read cycle + 1 write cycle + 1 idle cycle) 60 mhz = 79.8 mbytes/sec ? pipelined transfer mode pipelined transfer through a single biu is not possible. see section 11.4.1 (2), pipelined transfer mode.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 367 of 1164 rej09b0321-0200 (b) transfer to external devices maximum transfer speed from an on-chip cpu bloc k as the source (0 wait) to an external device (2 write cycles). ? cycle-stealing tr ansfer mode 4 bytes / (1 read cycle + 2 write cycles + 1 idle cycle) 60 mhz = 60 mbytes/sec ? pipelined transfer mode 4 bytes / (2 write cycles) 60 mhz = 120 mbytes/sec maximum transfer speed from an external device (4 read cycles) to an on-chip cpu block source (0 wait) ? cycle-stealing tr ansfer mode 4 bytes / (4 read cycles + 1 write cycle + 1 idle cycle) 60 mhz = 39.6 mbytes/sec ? pipelined transfer mode 4 bytes / (4 read cycles) 60 mhz = 60 mbytes/sec maximum transfer speed from an external device (4 read cycles) to an external device (2 write cycles) ? cycle-stealing tr ansfer mode 4 bytes / (4 read cycles + 2 write cycles + 1 idle cycle) 60 mhz = 34.2 mbytes/sec ? pipelined transfer mode no pipelined transfer is possibl e between the external devices. note: access to external devices is controlled by the settings of the bsc control registers. for details, see section 9, bus state controller (bsc). 11.13 usage note 11.13.1 note on making a transition to software standby mode or deep standby mode if the sleep instruction is executed to make a transition to software standby mode or deep standby mode during transfer by the dmac, the dmac stops its operation without waiting for the completion of the transfer. th us, the dma transfer is not guar anteed. therefore, when making a transition to software standby mode or deep standby mode, wait for the completion of the dma transfer or stop the dm a transfer to execute the sleep instruction.
section 11 direct memory access controller (dmac) rev. 2.00 sep. 07, 2007 page 368 of 1164 rej09b0321-0200
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 369 of 1164 rej09b0321-0200 section 12 multi-function timer pulse unit 2 (mtu2) this lsi has an on-chip multi-function timer pulse unit 2 (mtu2) that comprises six 16-bit timer channels. 12.1 features ? up to 16 pulse input/output lines and three pulse input lines ? selection of eight counter input clocks for each channel (four clocks for channel 5) ? the following operations can be set for channels 0 to 4: ? waveform output at compare match ? input capture function ? counter clear operation ? multiple timer counters (tcnt) can be written to simultaneously ? simultaneous clearing by compare match and input capture is possible ? register simultaneous input/output is possible by synchronous counter operation ? a maximum 12-phase pwm output is possible in combination with synchronous operation ? buffer operation settable for channels 0, 3, and 4 ? phase counting mode settable independently for each of channels 1 and 2 ? cascade connection operation ? fast access via internal 16-bit bus ? 28 interrupt sources ? automatic transfer of register data ? a/d converter start trigger can be generated ? module standby mode can be settable ? a total of six-phase waveform output, which includes complementary pwm output, and positive and negative phases of reset pwm output by interlocking operation of channels 3 and 4, is possible. ? ac synchronous motor (brushless dc motor) drive mode using complementary pwm output and reset pwm output is settable by interlocking operation of channels 0, 3, and 4, and the selection of two types of waveform outputs (chopping and level) is possible. ? dead time compensation counter available in channel 5 ? in complementary pwm mode, interrupts at the crest and trough of the counter value and a/d converter start triggers can be skipped.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 370 of 1164 rej09b0321-0200 table 12.1 mtu2 functions item channel 0 channel 1 channel 2 channel 3 channel 4 channel 5 count clock p /1 p /4 p /16 p /64 tclka tclkb tclkc tclkd p /1 p /4 p /16 p /64 p /256 tclka tclkb p /1 p /4 p /16 p /64 p /1024 tclka tclkb tclkc p /1 p /4 p /16 p /64 p /256 p /1024 tclka tclkb p /1 p /4 p /16 p /64 p /256 p /1024 tclka tclkb p /1 p /4 p /16 p /64 general registers tgra_0 tgrb_0 tgre_0 tgra_1 tgrb_1 tgra_2 tgrb_2 tgra_3 tgrb_3 tgra_4 tgrb_4 tgru_5 tgrv_5 tgrw_5 general registers/ buffer registers tgrc_0 tgrd_0 tgrf_0 ? ? tgrc_3 tgrd_3 tgrc_4 tgrd_4 ? i/o pins tioc0a tioc0b tioc0c tioc0d tioc1a tioc1b tioc2a tioc2b tioc3a tioc3b tioc3c tioc3d tioc4a tioc4b tioc4c tioc4d input pins tic5u tic5v tic5w counter clear function tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture 0 output ? 1 output ? compare match output toggle output ? input capture function synchronous operation ? pwm mode 1 ? pwm mode 2 ? ? ? complementary pwm mode ? ? ? ? reset pwm mode ? ? ? ? ac synchronous motor drive mode ? ? ?
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 371 of 1164 rej09b0321-0200 item channel 0 channel 1 channel 2 channel 3 channel 4 channel 5 phase counting mode ? ? ? ? buffer operation ? ? ? dead time compensation counter function ? ? ? ? ? dmac activation tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture tgr compare match or input capture and tcnt overflow or underflow tgr compare match or input capture a/d converter start trigger tgra_0 compare match or input capture tgre_0 compare match tgra_1 compare match or input capture tgra_2 compare match or input capture tgra_3 compare match or input capture tgra_4 compare match or input capture tcnt_4 underflow (trough) in complemen- tary pwm mode ?
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 372 of 1164 rej09b0321-0200 item channel 0 channel 1 channel 2 channel 3 channel 4 channel 5 interrupt sources 7 sources ? compare match or input capture 0a ? compare match or input capture 0b ? compare match or input capture 0c ? compare match or input capture 0d ? compare match 0e ? compare match 0f ? overflow 4 sources ? compare match or input capture 1a ? compare match or input capture 1b ? overflow ? underflow 4 sources ? compare match or input capture 2a ? compare match or input capture 2b ? overflow ? underflow 5 sources ? compare match or input capture 3a ? compare match or input capture 3b ? compare match or input capture 3c ? compare match or input capture 3d ? overflow 5 sources ? compare match or input capture 4a ? compare match or input capture 4b ? compare match or input capture 4c ? compare match or input capture 4d ? overflow or underflow 3 sources ? compare match or input capture 5u ? compare match or input capture 5v ? compare match or input capture 5w
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 373 of 1164 rej09b0321-0200 item channel 0 channel 1 channel 2 channel 3 channel 4 channel 5 a/d converter start request delaying function ? ? ? ? ? a/d converter start request at a match between tadcor a_4 and tcnt_4 ? a/d converter start request at a match between tadcor b_4 and tcnt_4 ? interrupt skipping function ? ? ? ? skips tgra_3 compare match interrupts ? skips tciv_4 interrupts ? [legend] : possible ?: not possible figure 12.1 shows a block diagram of the mtu2.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 374 of 1164 rej09b0321-0200 input/output pins channel 3: tioc3a tioc3b tioc3c tioc3d channel 4: tioc4a tioc4b tioc4c tioc4d input pins channel 5: tic5u tic5v tic5w interrupt request signals channel 3: tgia_3 tgib_3 tgic_3 tgid_3 tciv_3 channel 4: tgia_4 tgib_4 tgic_4 tgid_4 tciv_4 channel 5: tgiu_5 tgiv_5 tgiw_5 clock input internal clock: p /1 p /4 p /16 p /64 p /256 p /1024 external clock: tclka tclkb tclkc tclkd interrupt request signals channel 0: tgia_0 tgib_0 tgic_0 tgid_0 tgie_0 tgif_0 tciv_0 channel 1: tgia_1 tgib_1 tciv_1 tciu_1 channel 2: tgia_2 tgib_2 tciv_2 tciu_2 input/output pins channel 0: tioc0a tioc0b tioc0c tioc0d channel 1: tioc1a tioc1b channel 2: tioc2a tioc2b peripheral bus a/d converter conversion start signal tcnt tgra tgrb tgrc tgrd tmdr tcr tiorl tiorh tsr tier channel 3 tcnt tgra tgrb tgrc tgrd tmdr tcr tiorl tiorh tsr tier channel 4 tcnts tcbr tddr tcdr toer tocr tgcr bus i/f common tcnt tgra tgrb tmdr tcr tior tsr tier tsyr tstr channel 2 tcnt tgra tgrb tmdr tcr tior tsr tier channel 1 tcnt tgra tgrb tgrc tgrd tgre tgrf tmdr tcr tiorl tiorh tsr tier channel 0 tcntu tgru tcntv tgrv tcntw tgrw tcr tior tier tsr channel 5 control logic module data bus control logic for channels 0 to 2 control logic for channels 3 and 4 [legend] tstr: timer start register tsyr: timer synchronous register tcr: timer control register tmdr: timer mode register tior: timer i/o control register tiorh: timer i/o control register h tiorl: timer i/o control register l tier: timer interrupt enable register tgcr: timer gate control register toer: timer output master enable register tocr: timer output control register tsr: timer status register tcnt: timer counter tcnts: timer subcounter tcdr: timer cycle data register tcbr: timer cycle buffer register tddr: timer dead time data register tgra: timer general register a tgrb: timer general register b tgrc: timer general register c tgrd: timer general register d tgre: timer general register e tgrf: timer general register f tgru: timer general register u tgrv: timer general register v tgrw: timer general register w figure 12.1 block diagram of mtu2
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 375 of 1164 rej09b0321-0200 12.2 input/output pins table 12.2 pin configuration channel pin name i/o function common tclka input external clock a input pin (channel 1 phase counting mode a phase input) tclkb input external clock b input pin (channel 1 phase counting mode b phase input) tclkc input external clock c input pin (channel 2 phase counting mode a phase input) tclkd input external clock d input pin (channel 2 phase counting mode b phase input) 0 tioc0a i/o tgra_0 input capture inpu t/output compare output/pwm output pin tioc0b i/o tgrb_0 input capture inpu t/output compare output/pwm output pin tioc0c i/o tgrc_0 input capture inpu t/output compare output/pwm output pin tioc0d i/o tgrd_0 input capture inpu t/output compare output/pwm output pin 1 tioc1a i/o tgra_1 input capture inpu t/output compare output/pwm output pin tioc1b i/o tgrb_1 input capture inpu t/output compare output/pwm output pin 2 tioc2a i/o tgra_2 input capture inpu t/output compare output/pwm output pin tioc2b i/o tgrb_2 input capture inpu t/output compare output/pwm output pin 3 tioc3a i/o tgra_3 input capture inpu t/output compare output/pwm output pin tioc3b i/o tgrb_3 input capture inpu t/output compare output/pwm output pin tioc3c i/o tgrc_3 input capture inpu t/output compare output/pwm output pin tioc3d i/o tgrd_3 input capture inpu t/output compare output/pwm output pin 4 tioc4a i/o tgra_4 input capture inpu t/output compare output/pwm output pin tioc4b i/o tgrb_4 input capture inpu t/output compare output/pwm output pin tioc4c i/o tgrc_4 input capture inpu t/output compare output/pwm output pin tioc4d i/o tgrd_4 input capture inpu t/output compare output/pwm output pin 5 tic5u input tgru_5 input captur e input/external pulse input pin tic5v input tgrv_5 input captur e input/external pulse input pin tic5w input tgrw_5 input captur e input/external pulse input pin note: for the pin configuration in complementar y pwm mode, see table 12.54 in section 12.4.8, complementary pwm mode.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 376 of 1164 rej09b0321-0200 12.3 register descriptions the mtu2 has the following register s. for details on register addre sses and register states during each process, refer to section 28, list of registers. to distinguis h registers in each channel, an underscore and the channel number are added as a suffix to the register name; tcr for channel 0 is expressed as tcr_0. table 12.3 register configuration channel register name abbreviation r/w initial value address access size timer control register_0 tcr _0 r/w h'00 h'fffe4300 8, 16, 32 timer mode register_0 tmdr_0 r/w h'00 h'fffe4301 8 timer i/o control register h_0 tiorh_0 r/w h'00 h'fffe4302 8, 16 timer i/o control register l_0 tiorl_0 r/w h'00 h'fffe4303 8 timer interrupt enable register_0 tier_0 r/w h'00 h'fffe4304 8, 16, 32 timer status register_0 tsr_0 r/w h'c0 h'fffe4305 8 timer counter_0 tcnt _0 r/w h'0000 h'fffe4306 16 timer general register a_0 tgra_0 r/w h'ffff h'fffe4308 16, 32 timer general register b_0 tgrb_0 r/w h'ffff h'fffe430a 16 timer general register c_0 tgrc_0 r/w h'ffff h'fffe430c 16, 32 timer general register d_0 tgrd_0 r/w h'ffff h'fffe430e 16 timer general register e_0 tgre_0 r/w h'ffff h'fffe4320 16, 32 timer general register f_0 tgrf_0 r/w h'ffff h'fffe4322 16 timer interrupt enable register 2_0 tier2_0 r/w h'00 h'fffe4324 8, 16 timer status register 2_ 0 tsr2_0 r/w h'c0 h'fffe4325 8 0 timer buffer operation transfer mode register_0 tbtm_0 r/w h'00 h'fffe4326 8
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 377 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size timer control register_1 t cr_1 r/w h'00 h'fffe4380 8, 16 timer mode register_1 tmdr_1 r/w h'00 h'fffe4381 8 timer i/o control register_1 tior_1 r/w h'00 h'fffe4382 8 timer interrupt enable register_1 tier_1 r/w h'00 h'fffe4384 8, 16, 32 timer status register_1 tsr_1 r/w h'c0 h'fffe4385 8 timer counter_1 tcnt _1 r/w h'0000 h'fffe4386 16 timer general register a_1 tgra_1 r/w h'ffff h'fffe4388 16, 32 timer general register b_1 tgrb_1 r/w h'ffff h'fffe438a 16 1 timer input capture control register ticcr r/w h'00 h'fffe4390 8 timer control register_2 t cr_2 r/w h'00 h'fffe4000 8, 16 timer mode register_2 tmdr_2 r/w h'00 h'fffe4001 8 timer i/o control register_2 tior_2 r/w h'00 h'fffe4002 8 timer interrupt enable register_2 tier_2 r/w h'00 h'fffe4004 8, 16, 32 timer status register_2 tsr_2 r/w h'c0 h'fffe4005 8 timer counter_2 tcnt _2 r/w h'0000 h'fffe4006 16 timer general register a_2 tgra_2 r/w h'ffff h'fffe4008 16, 32 2 timer general register b_2 tgrb_2 r/w h'ffff h'fffe400a 16
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 378 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size timer control register_3 tcr _3 r/w h'00 h'fffe4200 8, 16, 32 timer mode register_3 tmdr_3 r/w h'00 h'fffe4202 8, 16 timer i/o control register h_3 tiorh_3 r/w h'00 h'fffe4204 8, 16, 32 timer i/o control register l_3 tiorl_3 r/w h'00 h'fffe4205 8 timer interrupt enable register_3 tier_3 r/w h'00 h'fffe4208 8, 16 timer counter_3 tcnt_3 r/w h'0000 h'fffe4210 16, 32 timer general register a_3 tgra_3 r/w h'ffff h'fffe4218 16, 32 timer general register b_3 tgrb_3 r/w h'ffff h'fffe421a 16 timer general register c_3 tgrc_3 r/w h'ffff h'fffe4224 16, 32 timer general register d_3 tgrd_3 r/w h'ffff h'fffe4226 16 timer status register_3 tsr_3 r/w h'c0 h'fffe422c 8, 16 3 timer buffer operation transfer mode register_3 tbtm_3 r/w h'00 h'fffe4238 8, 16
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 379 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size timer control register_4 tcr_4 r/w h'00 h'fffe4201 8 timer mode register_4 tmdr_4 r/w h'00 h'fffe4203 8 timer i/o control register h_4 tiorh_4 r/w h'00 h'fffe4206 8, 16 timer i/o control register l_4 tiorl_4 r/w h'00 h'fffe4207 8 timer interrupt enable register_4 tier_4 r/w h'00 h'fffe4209 8 timer counter_4 tcnt _4 r/w h'0000 h'fffe4212 16 timer general register a_4 tgra_4 r/w h'ffff h'fffe421c 16, 32 timer general register b_4 tgrb_4 r/w h'ffff h'fffe421e 16 timer general register c_4 tgrc_4 r/w h'ffff h'fffe4228 16, 32 timer general register d_4 tgrd_4 r/w h'ffff h'fffe422a 16 timer status register_4 tsr_4 r/w h'c0 h'fffe422d 8 timer buffer operation transfer mode register_4 tbtm_4 r/w h'00 h'fffe4239 8 timer a/d converter start request cycle set register a_4 tadcora_4 r/w h'ffff h'fffe4244 16, 32 timer a/d converter start request cycle set register b_4 tadcorb_4 r/w h'ffff h'fffe4246 16 timer a/d converter start request cycle set buffer register a_4 tadcobra_4 r/w h'ffff h'fffe4248 16, 32 4 timer a/d converter start request cycle set buffer register b_4 tadcobrb_4 r/w h'ffff h'fffe424a 16
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 380 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size timer counter u_5 tcntu _5 r/w h'0000 h'fffe4080 16, 32 timer general register u_5 tgru_5 r/w h'ffff h'fffe4082 16 timer control register u _5 tcru_5 r/w h'00 h'fffe4084 8 timer i/o control register u_5 tioru_5 r/w h'00 h'fffe4086 8 timer counter v_5 tcntv _5 r/w h'0000 h'fffe4090 16, 32 timer general register v_5 tgrv_5 r/w h'ffff h'fffe4092 16 timer control register v_ 5 tcrv_5 r/w h'00 h'fffe4094 8 timer i/o control register v_5 tiorv_5 r/w h'00 h'fffe4096 8 timer counter w_5 tcntw_5 r/w h'0000 h'fffe40a0 16, 32 timer general register w_5 tgrw_5 r/w h'ffff h'fffe40a2 16 timer control register w _5 tcrw_5 r/w h'00 h'fffe40a4 8 timer i/o control register w_5 tiorw_5 r/w h'00 h'fffe40a6 8 timer status register_5 tsr_5 r/w h'00 h'fffe40b0 8 timer interrupt enable register_5 tier_5 r/w h'00 h'fffe40b2 8 timer start register_5 tstr_5 r/w h'00 h'fffe40b4 8 5 timer compare match clear register tcntcmpclr r/w h'00 h'fffe40b6 8 timer start register tstr r/w h'00 h'fffe4280 8, 16 timer synchronous register tsyr r/w h'00 h'fffe4281 8 timer counter synchronous start register tcsystr r/w h'00 h'fffe4282 8 common timer read/write enable register trwer r/w h'01 h'fffe4284 8
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 381 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size timer output master enable register toer r/w h'c0 h'fffe420a 8 timer gate control register tgcr r/w h'80 h'fffe420d 8 timer output control register 1 tocr1 r/w h'00 h'fffe420e 8, 16 timer output control register 2 tocr2 r/w h'00 h'fffe420f 8 timer cycle data register tcdr r/w h'ffff h'fffe4214 16, 32 timer dead time data register tddr r/w h'ffff h'fffe4216 16 timer subcounter tcnt s r h'0000 h'fffe4220 16, 32 timer cycle buffer register tcbr r/w h'ffff h'fffe4222 16 timer interrupt skipping set register titcr r/w h'00 h'fffe4230 8, 16 timer interrupt skipping counter titcnt r h'00 h'fffe4231 8 timer buffer transfer set register tbter r/w h'00 h'fffe4232 8 timer dead time enable register tder r/w h'01 h'fffe4234 8 timer output level buffer register tolbr r/w h'00 h'fffe4236 8 timer a/d converter start request control register tadcr r/w h'0000 h'fffe4240 16 common to 3 and 4 timer waveform control register twcr r/w h'00 h'fffe4260 8
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 382 of 1164 rej09b0321-0200 12.3.1 timer control register (tcr) the tcr registers are 8-bit readab le/writable registers that cont rol the tcnt operation for each channel. the mtu2 has a total of eight tcr regi sters, one each for channels 0 to 4 and three (tcru_5, tcrv_5, and tcrw_5) for channel 5. tcr register settings should be conducted only when tcnt operation is stopped. bit: initial value: r/w: 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w cclr[2:0] ckeg[1:0] tpsc[2:0] bit bit name initial value r/w description 7 to 5 cclr[2:0] 000 r/w counter clear 0 to 2 these bits select the tcnt counter clearing source. see tables 12.4 and 12.5 for details. 4, 3 ckeg[1:0] 00 r/w clock edge 0 and 1 these bits select the input clock edge. when the input clock is counted using both edges, the input clock period is halved (e.g. p /4 both edges = p /2 rising edge). if phase counting mode is used on channels 1 and 2, this setting is ignored and the phase counting mode setting has priority. internal clock edge selection is valid when the input clock is p /4 or slower. when p /1, or the overflow/underflow of another channel is selected for the input clock, although values can be written, counter operation compiles with the initial value. 00: count at rising edge 01: count at falling edge 1x: count at both edges 2 to 0 tpsc[2:0] 000 r/w time prescaler 0 to 2 these bits select the tcnt counter clock. the clock source can be selected independently for each channel. see tables 12.6 to 12.10 for details. [legend] x: don't care
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 383 of 1164 rej09b0321-0200 table 12.4 cclr0 to cclr2 (channels 0, 3, and 4) channel bit 7 cclr2 bit 6 cclr1 bit 5 cclr0 description 0, 3, 4 0 0 0 tcnt clearing disabled 1 tcnt cleared by tgra compare match/input capture 1 0 tcnt cleared by tgrb compare match/input capture 1 tcnt cleared by counter clearing for another channel performing synchronous clearing/ synchronous operation * 1 1 0 0 tcnt clearing disabled 1 tcnt cleared by tgrc compare match/input capture * 2 1 0 tcnt cleared by tgrd compare match/input capture * 2 1 tcnt cleared by counter clearing for another channel performing synchronous clearing/ synchronous operation * 1 notes: 1. synchronous operation is set by setting the sync bit in tsyr to 1. 2. when tgrc or tgrd is used as a buffer re gister, tcnt is not cleared because the buffer register setting has priority, and comp are match/input capture does not occur. table 12.5 cclr0 to cclr2 (channels 1 and 2) channel bit 7 reserved * 2 bit 6 cclr1 bit 5 cclr0 description 1, 2 0 0 0 tcnt clearing disabled 1 tcnt cleared by tgra compare match/input capture 1 0 tcnt cleared by tgrb compare match/input capture 1 tcnt cleared by counter clearing for another channel performing synchronous clearing/ synchronous operation * 1 notes: 1. synchronous operation is select ed by setting the sync bit in tsyr to 1. 2. bit 7 is reserved in channels 1 and 2. it is always read as 0 and cannot be modified.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 384 of 1164 rej09b0321-0200 table 12.6 tpsc0 to tpsc2 (channel 0) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 0 0 0 0 internal clock: counts on p /1 1 internal clock: counts on p /4 1 0 internal clock: counts on p /16 1 internal clock: counts on p /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input 1 0 external clock: counts on tclkc pin input 1 external clock: counts on tclkd pin input table 12.7 tpsc0 to tpsc2 (channel 1) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 1 0 0 0 internal clock: counts on p /1 1 internal clock: counts on p /4 1 0 internal clock: counts on p /16 1 internal clock: counts on p /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input 1 0 internal clock: counts on p /256 1 counts on tcnt_2 overflow/underflow note: this setting is ignored when channel 1 is in phase counting mode.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 385 of 1164 rej09b0321-0200 table 12.8 tpsc0 to tpsc2 (channel 2) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 2 0 0 0 internal clock: counts on p /1 1 internal clock: counts on p /4 1 0 internal clock: counts on p /16 1 internal clock: counts on p /64 1 0 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input 1 0 external clock: counts on tclkc pin input 1 internal clock: counts on p /1024 note: this setting is ignored when channel 2 is in phase counting mode. table 12.9 tpsc0 to tp sc2 (channels 3 and 4) channel bit 2 tpsc2 bit 1 tpsc1 bit 0 tpsc0 description 3, 4 0 0 0 internal clock: counts on p /1 1 internal clock: counts on p /4 1 0 internal clock: counts on p /16 1 internal clock: counts on p /64 1 0 0 internal clock: counts on p /256 1 internal clock: counts on p /1024 1 0 external clock: counts on tclka pin input 1 external clock: counts on tclkb pin input
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 386 of 1164 rej09b0321-0200 table 12.10 tpsc1 and tpsc0 (channel 5) channel bit 1 tpsc1 bit 0 tpsc0 description 5 0 0 internal clock: counts on p /1 1 internal clock: counts on p /4 1 0 internal clock: counts on p /16 1 internal clock: counts on p /64 note: bits 7 to 2 are reserved in channel 5. t hese bits are always read as 0. the write value should always be 0. 12.3.2 timer mode register (tmdr) the tmdr registers are 8-bit readab le/writable registers that are used to set the operating mode of each channel. the mtu2 has five tmdr registers, one each for channels 0 to 4. tmdr register settings should be changed only when tcnt operation is stopped. bit: initial value: r/w: 7654321 0 00000000 r r/w r/w r/w r/w r/w r/w r/w ? bfe bfb bfa md[3:0] bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 bfe 0 r/w buffer operation e specifies whether tgre_0 and tgrf_0 are to operate in the normal way or to be used together for buffer operation. when tgrf is used as a buffer register, tgrf compare match is generated. in channels 1 to 4, this bit is reserved. it is always read as 0 and the write value should always be 0. 0: tgre_0 and tgrf_0 operate normally 1: tgre_0 and tgrf_0 used together for buffer operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 387 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 bfb 0 r/w buffer operation b specifies whether tgrb is to operate in the normal way, or tgrb and tgrd are to be used together for buffer operation. when tgrd is used as a buffer register, tgrd input captur e/output compare is not generated in other than co mplementary pwm mode. tgrd compare match is generated in complementary pwm mode. when compare match occurs during the tb period in complementary pwm mode, tgrd is set. therefore, set the tgied bit in the timer interrupt enable register_3/4 (tier_3/4) to 0. in channels 1 and 2, which have no tgrd, bit 5 is reserved. it is always read as 0 and cannot be modified. 0: tgrb and tgrd operate normally 1: tgrb and tgrd used together for buffer operation 4 bfa 0 r/w buffer operation a specifies whether tgra is to operate in the normal way, or tgra and tgrc are to be used together for buffer operation. when tgrc is used as a buffer register, tgrc input captur e/output compare is not generated in other than co mplementary pwm mode. tgrc compare match is generated in complementary pwm mode. when compare match for channel 4 occurs during the tb period in complementary pwm mode, tgfc is set. therefore, set the tgiec bit in the timer interrupt enable register_4 (tier_4) to 0. in channels 1 and 2, which have no tgrc, bit 4 is reserved. it is always read as 0 and cannot be modified. 0: tgra and tgrc operate normally 1: tgra and tgrc used together for buffer operation 3 to 0 md[3:0] 0000 r/w modes 0 to 3 these bits are used to set the timer operating mode. see table 12.11 for details.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 388 of 1164 rej09b0321-0200 table 12.11 setting of operation mode by bits md0 to md3 bit 3 md3 bit 2 md2 bit 1 md1 bit 0 md0 description 0 0 0 0 normal operation 1 setting prohibited 1 0 pwm mode 1 1 pwm mode 2 * 1 1 0 0 phase counting mode 1 * 2 1 phase counting mode 2 * 2 1 0 phase counting mode 3 * 2 1 phase counting mode 4 * 2 1 0 0 0 reset synchronous pwm mode * 3 1 setting prohibited 1 x setting prohibited 1 0 0 setting prohibited 1 complementary pwm mode 1 (transmit at crest) * 3 1 0 complementary pwm mode 2 (transmit at trough) * 3 1 complementary pwm mode 2 (transmit at crest and trough) * 3 [legend] x: don't care notes: 1. pwm mode 2 cannot be set for channels 3 and 4. 2. phase counting mode cannot be set for channels 0, 3, and 4. 3. reset synchronous pwm mode, complementary pwm mode can only be set for channel 3. when channel 3 is set to reset synchronous pwm mode or complementary pwm mode, the channel 4 settings become ine ffective and automatically conform to the channel 3 settings. however, do not set ch annel 4 to reset synchronous pwm mode or complementary pwm mode. reset synchronous pwm mode and complementary pwm mode cannot be set for channels 0, 1, and 2.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 389 of 1164 rej09b0321-0200 12.3.3 timer i/o cont rol register (tior) the tior registers are 8-bit read able/writable registers that cont rol the tgr registers. the mtu2 has a total of eleven tior regist ers, two each for channels 0, 3, and 4, one each for channels 1 and 2, and three (tioru_5, tiorv_5, and tiorw_5) for channel 5. tior should be set while tmdr is set in normal operation, pwm mode, or phase counting mode. the initial output specified by tior is valid when the counter is stopped (the cst bit in tstr is cleared to 0). note also that, in pwm mode 2, the output at the point at which the counter is cleared to 0 is specified. when tgrc or tgrd is designated for buffer operation, this setting is invalid and the register operates as a buffer register. ? tiorh_0, tior_1, tior_2, tiorh_3, tiorh_4 bit: initial value: r/w: 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w iob[3:0] ioa[3:0] bit bit name initial value r/w description 7 to 4 iob[3:0] 0000 r/w i/o control b0 to b3 specify the function of tgrb. see the following tables. tiorh_0: table 12.12 tior_1: table 12.14 tior_2: table 12.15 tiorh_3: table 12.16 tiorh_4: table 12.18 3 to 0 ioa[3:0] 0000 r/w i/o control a0 to a3 specify the function of tgra. see the following tables. tiorh_0: table 12.20 tior_1: table 12.22 tior_2: table 12.23 tiorh_3: table 12.24 tiorh_4: table 12.26
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 390 of 1164 rej09b0321-0200 ? tiorl_0, tiorl_3, tiorl_4 bit: initial value: r/w: 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w iod[3:0] ioc[3:0] bit bit name initial value r/w description 7 to 4 iod[3:0] 0000 r/w i/o control d0 to d3 specify the function of tgrd. see the following tables. tiorl_0: table 12.13 tiorl_3: table 12.17 tiorl_4: table 12.19 3 to 0 ioc[3:0] 0000 r/w i/o control c0 to c3 specify the function of tgrc. see the following tables. tiorl_0: table 12.21 tiorl_3: table 12.25 tiorl_4: table 12.27 ? tioru_5, tiorv_5, tiorw_5 bit: initial value: r/w: 7654321 0 00000000 r r r r/w r/w r/w r/w r/w ? ? ? ioc[4:0] bit bit name initial value r/w description 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 to 0 ioc[4:0] 00000 r/w i/o control c0 to c4 specify the function of tgru_5, tgrv_5, and tgrw_5. for details, see table 12.28.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 391 of 1164 rej09b0321-0200 table 12.12 tiorh_0 (channel 0) description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_0 function tioc0b pin function 0 output retained * 0 1 initial output is 0 0 output at compare match 0 initial output is 0 1 output at compare match 0 1 1 initial output is 0 toggle output at compare match 0 0 output retained 1 initial output is 1 0 output at compare match 0 initial output is 1 1 output at compare match 0 1 1 1 output compare register initial output is 1 toggle output at compare match 0 input capture at rising edge 0 1 input capture at falling edge 0 1 x input capture at both edges 1 1 x x input capture register capture input source is channel 1/count clock input capture at tcnt _1 count-up/count-down [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 392 of 1164 rej09b0321-0200 table 12.13 tiorl_0 (channel 0) description bit 7 iod3 bit 6 iod2 bit 5 iod1 bit 4 iod0 tgrd_0 function tioc0d pin function 0 0 0 0 output retained * 1 1 initial output is 0 0 output at compare match 1 0 output compare register * 2 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture at both edges 1 x x input capture register * 2 capture input source is channel 1/count clock input capture at tcnt _1 count-up/count-down [legend] x: don't care notes: 1. after power-on reset, 0 is output until tior is set. 2. when the bfb bit in tmdr_0 is set to 1 and tgrd_0 is used as a buffer register, this setting is invalid and input captur e/output compare is not generated.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 393 of 1164 rej09b0321-0200 table 12.14 tior_1 (channel 1) description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_1 function tioc1b pin function 0 0 0 0 output retained 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture at both edges 1 x x input capture register input capture at generat ion of tgrc_0 compare match/input capture [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 394 of 1164 rej09b0321-0200 table 12.15 tior_2 (channel 2) description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_2 function tioc2b pin function 0 0 0 0 output retained 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register input capture at both edges [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 395 of 1164 rej09b0321-0200 table 12.16 tiorh_3 (channel 3) description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_3 function tioc3b pin function 0 0 0 0 output retained * 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register input capture at both edges [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 396 of 1164 rej09b0321-0200 table 12.17 tiorl_3 (channel 3) description bit 7 iod3 bit 6 iod2 bit 5 iod1 bit 4 iod0 tgrd_3 function tioc3d pin function 0 0 0 0 output retained * 1 1 output compare register * 2 initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register * 2 input capture at both edges [legend] x: don't care notes: 1. after power-on rese t, 0 is output until tior is set. 2. when the bfb bit in tmdr_3 is set to 1 and tgrd_3 is used as a buffer register, this setting is invalid and input captur e/output compare is not generated.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 397 of 1164 rej09b0321-0200 table 12.18 tiorh_4 (channel 4) description bit 7 iob3 bit 6 iob2 bit 5 iob1 bit 4 iob0 tgrb_4 function tioc4b pin function 0 0 0 0 output retained * 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register input capture at both edges [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 398 of 1164 rej09b0321-0200 table 12.19 tiorl_4 (channel 4) description bit 7 iod3 bit 6 iod2 bit 5 iod1 bit 4 iod0 tgrd_4 function tioc4d pin function 0 0 0 0 output retained * 1 1 output compare register * 2 initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register * 2 input capture at both edges [legend] x: don't care notes: 1. after power-on reset, 0 is output until tior is set. 2. when the bfb bit in tmdr_4 is set to 1 and tgrd_4 is used as a buffer register, this setting is invalid and input captur e/output compare is not generated.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 399 of 1164 rej09b0321-0200 table 12.20 tiorh_0 (channel 0) description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_0 function tioc0a pin function 0 0 0 0 output retained * 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture at both edges 1 x x input capture register capture input source is channel 1/count clock input capture at tcnt _1 count-up/count-down [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 400 of 1164 rej09b0321-0200 table 12.21 tiorl_0 (channel 0) description bit 3 ioc3 bit 2 ioc2 bit 1 ioc1 bit 0 ioc0 tgrc_0 function tioc0c pin function 0 0 0 0 output retained * 1 1 output compare register * 2 initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture at both edges 1 x x input capture register * 2 capture input source is channel 1/count clock input capture at tcnt _1 count-up/count-down [legend] x: don't care notes: 1. after power-on reset, 0 is output until tior is set. 2. when the bfa bit in tmdr_0 is set to 1 and tgrc_0 is used as a buffer register, this setting is invalid and input captur e/output compare is not generated.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 401 of 1164 rej09b0321-0200 table 12.22 tior_1 (channel 1) description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_1 function tioc1a pin function 0 0 0 0 output retained 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 0 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture at both edges 1 x x input capture register input capture at generati on of channel 0/tgra_0 compare match/input capture [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 402 of 1164 rej09b0321-0200 table 12.23 tior_2 (channel 2) description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_2 function tioc2a pin function 0 0 0 0 output retained 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register input capture at both edges [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 403 of 1164 rej09b0321-0200 table 12.24 tiorh_3 (channel 3) description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_3 function tioc3a pin function 0 0 0 0 output retained * 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register input capture at both edges [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 404 of 1164 rej09b0321-0200 table 12.25 tiorl_3 (channel 3) description bit 3 ioc3 bit 2 ioc2 bit 1 ioc1 bit 0 ioc0 tgrc_3 function tioc3c pin function 0 0 0 0 output retained * 1 1 output compare register * 2 initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register * 2 input capture at both edges [legend] x: don't care notes: 1. after power-on reset, 0 is output until tior is set. 2. when the bfa bit in tmdr_3 is set to 1 and tgrc_3 is used as a buffer register, this setting is invalid and input captur e/output compare is not generated.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 405 of 1164 rej09b0321-0200 table 12.26 tiorh_4 (channel 4) description bit 3 ioa3 bit 2 ioa2 bit 1 ioa1 bit 0 ioa0 tgra_4 function tioc4a pin function 0 0 0 0 output retained * 1 output compare register initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register input capture at both edges [legend] x: don't care note: * after power-on reset, 0 is output until tior is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 406 of 1164 rej09b0321-0200 table 12.27 tiorl_4 (channel 4) description bit 3 ioc3 bit 2 ioc2 bit 1 ioc1 bit 0 ioc0 tgrc_4 function tioc4c pin function 0 0 0 0 output retained * 1 1 output compare register * 2 initial output is 0 0 output at compare match 1 0 initial output is 0 1 output at compare match 1 initial output is 0 toggle output at compare match 1 0 0 output retained 1 initial output is 1 0 output at compare match 1 0 initial output is 1 1 output at compare match 1 initial output is 1 toggle output at compare match 1 x 0 0 input capture at rising edge 1 input capture at falling edge 1 x input capture register * 2 input capture at both edges [legend] x: don't care notes: 1. after power-on reset, 0 is output until tior is set. 2. when the bfa bit in tmdr_4 is set to 1 and tgrc_4 is used as a buffer register, this setting is invalid and input captur e/output compare is not generated.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 407 of 1164 rej09b0321-0200 table 12.28 tioru_5, tiorv_5, and tiorw_5 (channel 5) description bit 4 ioc4 bit 3 ioc3 bit 2 ioc2 bit 1 ioc1 bit 0 ioc0 tgru_5, tgrv_5, and tgrw_5 function tic5u, tic5v, and tic5w pin function 0 0 0 0 0 compare match 1 setting prohibited 1 x setting prohibited 1 x x setting prohibited 1 x x x compare match register setting prohibited 1 0 0 0 0 setting prohibited 1 input capture at rising edge 1 0 input capture at falling edge 1 input capture at both edges 1 x x setting prohibited 1 0 0 0 setting prohibited 1 measurement of low pulse width of external input signal capture at trough 1 0 measurement of low pulse width of external input signal capture at crest 1 measurement of low pulse width of external input signal capture at crest and trough 1 0 0 setting prohibited 1 measurement of high pulse width of external input signal capture at trough 1 0 measurement of high pulse width of external input signal capture at crest 1 input capture register measurement of high pulse width of external input signal capture at crest and trough [legend] x: don't care
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 408 of 1164 rej09b0321-0200 12.3.4 timer compare match clear register (tcntcmpclr) tcntcmpclr is an 8-bit readable/writable regist er that specifies reques ts to clear tcntu_5, tcntv_5, and tcntw_5. the mtu2 ha s one tcntcmpclr in channel 5. bit: initial value: r/w: 7654321 0 00000000 r r r r r r/w r/w r/w ????? cmp clr5u cmp clr5v cmp clr5w bit bit name initial value r/w description 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 cmpclr5u 0 r/w tcnt compare clear 5u enables or disables requests to clear tcntu_5 at tgru_5 compare match or input capture. 0: disables tcntu_5 to be cleared to h'0000 at tcntu_5 and tgru_5 compare match or input capture 1: enables tcntu_5 to be cleared to h'0000 at tcntu_5 and tgru_5 compare match or input capture 1 cmpclr5v 0 r/w tcnt compare clear 5v enables or disables requests to clear tcntv_5 at tgrv_5 compare match or input capture. 0: disables tcntv_5 to be cleared to h'0000 at tcntv_5 and tgrv_5 compare match or input capture 1: enables tcntv_5 to be cleared to h'0000 at tcntv_5 and tgrv_5 compare match or input capture
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 409 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 cmpclr5w 0 r/w tcnt compare clear 5w enables or disables requests to clear tcntw_5 at tgrw_5 compare match or input capture. 0: disables tcntw_5 to be cleared to h'0000 at tcntw_5 and tgrw_5 compare match or input capture 1: enables tcntw_5 to be cleared to h'0000 at tcntw_5 and tgrw_5 compare match or input capture 12.3.5 timer interrupt enable register (tier) the tier registers are 8-bit read able/writable registers that cont rol enabling or disabling of interrupt requests for each channel. the mtu2 has seven tier registers, two for channel 0 and one each for channels 1 to 5. ? tier_0, tier_1, tier _2, tier_3, tier_4 76543210 bit: initial value: r/w: 00000000 r/w r/w r/w r/w r/w r/w r/w r/w ttge ttge2 tcieu tciev tgied tgiec tgieb tgiea bit bit name initial value r/w description 7 ttge 0 r/w a/d converter start request enable enables or disables generat ion of a/d converter start requests by tgra input capture/compare match. 0: a/d converter start request generation disabled 1: a/d converter start request generation enabled
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 410 of 1164 rej09b0321-0200 bit bit name initial value r/w description 6 ttge2 0 r/w a/d converter start request enable 2 enables or disables generat ion of a/d converter start requests by tcnt_4 underflow (trough) in complementary pwm mode. in channels 0 to 3, bit 6 is reserved. it is always read as 0 and the write value should always be 0. 0: a/d converter start request generation by tcnt_4 underflow (trough) disabled 1: a/d converter start request generation by tcnt_4 underflow (trough) enabled 5 tcieu 0 r/w underflow interrupt enable enables or disables interrupt requests (tciu) by the tcfu flag when the tcfu fl ag in tsr is set to 1 in channels 1 and 2. in channels 0, 3, and 4, bit 5 is reserved. it is always read as 0 and the write value should always be 0. 0: interrupt requests (tciu) by tcfu disabled 1: interrupt requests (tciu) by tcfu enabled 4 tciev 0 r/w overflow interrupt enable enables or disables interrupt requests (tciv) by the tcfv flag when the tcfv flag in tsr is set to 1. 0: interrupt requests (tciv) by tcfv disabled 1: interrupt requests (tciv) by tcfv enabled 3 tgied 0 r/w tgr interrupt enable d enables or disables interrupt requests (tgid) by the tgfd bit when the tgfd bit in tsr is set to 1 in channels 0, 3, and 4. in channels 1 and 2, bit 3 is reserved. it is always read as 0 and the write value should always be 0. 0: interrupt requests (tgid ) by tgfd bit disabled 1: interrupt requests (tgid) by tgfd bit enabled
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 411 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 tgiec 0 r/w tgr interrupt enable c enables or disables interrupt requests (tgic) by the tgfc bit when the tgfc bit in tsr is set to 1 in channels 0, 3, and 4. in channels 1 and 2, bit 2 is reserved. it is always read as 0 and the write value should always be 0. 0: interrupt requests (tgic ) by tgfc bit disabled 1: interrupt requests (tgic) by tgfc bit enabled 1 tgieb 0 r/w tgr interrupt enable b enables or disables interrupt requests (tgib) by the tgfb bit when the tgfb bit in tsr is set to 1. 0: interrupt requests (tgib) by tgfb bit disabled 1: interrupt requests (tgib) by tgfb bit enabled 0 tgiea 0 r/w tgr interrupt enable a enables or disables interrupt requests (tgia) by the tgfa bit when the tgfa bit in tsr is set to 1. 0: interrupt requests (tgia) by tgfa bit disabled 1: interrupt requests (tgia) by tgfa bit enabled
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 412 of 1164 rej09b0321-0200 ? tier2_0 bit: initial value: r/w: 7654321 0 00000000 r/w r r r r r r/w r/w ttge2 ????? tgief tgiee bit bit name initial value r/w description 7 ttge2 0 r/w a/d converter start request enable 2 enables or disables generat ion of a/d converter start requests by compare match between tcnt_0 and tgre_0. 0: a/d converter start r equest generation by compare match between tcnt_0 and tgre_0 disabled 1: a/d converter start r equest generation by compare match between tcnt_0 and tgre_0 enabled 6 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 tgief 0 r/w tgr interrupt enable f enables or disables interrupt requests by compare match between t cnt_0 and tgrf_0. 0: interrupt requests (tgif) by tgfe bit disabled 1: interrupt requests (tgif) by tgfe bit enabled 0 tgiee 0 r/w tgr interrupt enable e enables or disables interrupt requests by compare match between tcnt_0 and tgre_0. 0: interrupt requests (tgie) by tgee bit disabled 1: interrupt requests (tgie) by tgee bit enabled
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 413 of 1164 rej09b0321-0200 ? tier_5 bit: initial value: r/w: 7654321 0 00000000 r r r r r r/w r/w r/w ????? tgie 5u tgie 5v tgie 5w bit bit name initial value r/w description 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 tgie5u 0 r/w tgr interrupt enable 5u enables or disables interrupt requests (tgiu_5) by compare match between tcntu_5 and tgru_5. 0: interrupt requests (tgiu_5) disabled 1: interrupt requests (tgiu_5) enabled 1 tgie5v 0 r/w tgr interrupt enable 5v enables or disables interrupt requests (tgiv_5) by compare match between tcntv_5 and tgrv_5. 0: interrupt requests (tgiv_5) disabled 1: interrupt requests (tgiv_5) enabled 0 tgie5w 0 r/w tgr interrupt enable 5w enables or disables interrupt requests (tgiw_5) by compare match between tcntw_5 and tgrw_5. 0: interrupt requests (tgiw_5) disabled 1: interrupt requests (tgiw_5) enabled
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 414 of 1164 rej09b0321-0200 12.3.6 timer status register (tsr) the tsr registers are 8-bit readable/writable regist ers that indicate the status of each channel. the mtu2 has seven tsr registers, two for channel 0 and one each for channels 1 to 5. ? tsr_0, tsr_1, tsr_2, tsr_3, tsr_4 bit: initial value: r/w: 7654321 0 11000000 r r r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: writing 0 to this bit after reading it as 1 clears the flag and is the only allowed way. 1. tcfd ? tcfu tcfv tgfd tgfc tgfb tgfa 111111 bit bit name initial value r/w description 7 tcfd 1 r count direction flag status flag that shows the direction in which tcnt counts in channels 1 to 4. in channel 0, bit 7 is reserved. it is always read as 1 and the write value should always be 1. 0: tcnt counts down 1: tcnt counts up 6 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 5 tcfu 0 r/(w) * 1 underflow flag status flag that indicate s that tcnt underflow has occurred when channels 1 and 2 are set to phase counting mode. only 0 can be written, for flag clearing. in channels 0, 3, and 4, bit 5 is reserved. it is always read as 0 and the write value should always be 0. [setting condition] ? when the tcnt value underflows (changes from h'0000 to h'ffff) [clearing condition] ? when 0 is written to tcfu after reading tcfu = 1 * 2
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 415 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 tcfv 0 r/(w) * 1 overflow flag status flag that indicates that tcnt overflow has occurred. only 0 can be written, for flag clearing. [setting condition] ? when the tcnt value overflows (changes from h'ffff to h'0000) in channel 4, when the tcnt_4 value underflows (changes from h'0001 to h'0000) in complementary pwm mode, this flag is also set. [clearing condition] ? when 0 is written to tcfv after reading tcfv = 1 * 2 3 tgfd 0 r/(w) * 1 input capture/output compare flag d status flag that indicates the occurrence of tgrd input capture or compare match in channels 0, 3, and 4. only 0 can be written, for flag clearing. in channels 1 and 2, bit 3 is reserved. it is always read as 0 and the write value should always be 0. [setting conditions] ? when tcnt = tgrd and tgrd is functioning as output compare register ? when tcnt value is transferred to tgrd by input capture signal and tgrd is functioning as input capture register [clearing condition] ? when 0 is written to tgfd after reading tgfd = 1 * 2
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 416 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 tgfc 0 r/(w) * 1 input capture/output compare flag c status flag that indicates the occurrence of tgrc input capture or compare match in channels 0, 3, and 4. only 0 can be written, for flag clearing. in channels 1 and 2, bit 2 is reserved. it is always read as 0 and the write value should always be 0. [setting conditions] ? when tcnt = tgrc and tgrc is functioning as output compare register ? when tcnt value is transferred to tgrc by input capture signal and tgrc is functioning as input capture register [clearing condition] ? when 0 is written to tgfc after reading tgfc = 1 * 2 1 tgfb 0 r/(w) * 1 input capture/output compare flag b status flag that indicates t he occurrence of tgrb input capture or compare match. only 0 can be written, for flag clearing. [setting conditions] ? when tcnt = tgrb and tgrb is functioning as output compare register ? when tcnt value is transferred to tgrb by input capture signal and tgrb is functioning as input capture register [clearing condition] ? when 0 is written to tgfb after reading tgfb = 1 * 2
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 417 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 tgfa 0 r/(w) * 1 input capture/output compare flag a status flag that indicates t he occurrence of tgra input capture or compare match. only 0 can be written, for flag clearing. [setting conditions] ? when tcnt = tgra and tgra is functioning as output compare register ? when tcnt value is transferred to tgra by input capture signal and tgra is functioning as input capture register [clearing conditions] ? when dmac is activated by tgia interrupt ? when 0 is written to tgfa after reading tgfa = 1 * 2 notes: 1. writing 0 to this bit after reading it as 1 clears the flag and is the only allowed way. 2. when writing to the timer status register (tsr), write 0 to the bit to be cleared after reading 1. write 1 to other bits. but 1 is not actually written and the previous value is held.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 418 of 1164 rej09b0321-0200 ? tsr2_0 bit: initial value: r/w: 7654321 0 11000000 rrrrrr note: writing 0 to this bit after reading it as 1 clears the flag and is the only allowed way. 1. ?????? tgff tgfe r/(w) * r/(w) * 11 bit bit name initial value r/w description 7, 6 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. 5 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 tgff 0 r/(w) * 1 compare match flag f status flag that indicates the occurrence of compare match between t cnt_0 and tgrf_0. [setting condition] ? when tcnt_0 = tgrf _0 and tgrf_0 is functioning as compare register [clearing condition] ? when 0 is written to tgff after reading tgff = 1 * 2 0 tgfe 0 r/(w) * 1 compare match flag e status flag that indicates the occurrence of compare match between tcnt_0 and tgre_0. [setting condition] ? when tcnt_0 = tgre_0 and tgre_0 is functioning as compare register [clearing condition] ? when 0 is written to tgfe after reading tgfe = 1 * 2 notes: 1. writing 0 to this bit after reading it as 1 clears the flag and is the only allowed way. 2. when writing to the timer status register (tsr), write 0 to the bit to be cleared after reading 1. write 1 to other bits. but 1 is not actually written and the previous value is held.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 419 of 1164 rej09b0321-0200 ? tsr_5 bit: initial value: r/w: 7654321 0 00000000 r r r r r r/(w) * 1 r/(w) * 1 r/(w) * 1 note: 1. writing 0 to this bit after reading it as 1 clears the flag and is the only allowed way. ????? cmf u5 cmf v5 cmf w5 bit bit name initial value r/w description 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 cmfu5 0 r/(w) * 1 compare match/input capture flag u5 status flag that indicate s the occurrence of tgru_5 input capture or compare match. [setting conditions] ? when tcntu_5 = tgru_5 and tgru_5 is functioning as output compare register ? when tcntu_5 value is transferred to tgru_5 by input capture signal while tgru_5 is functioning as input capture register ? when tcntu_5 value is transferred to tgru_5 while tgru_5 is functioning as a register for measuring the pulse width of the external input signal * 2 . [clearing condition] ? when 0 is written to cmfu5 after reading cmfu5 = 1
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 420 of 1164 rej09b0321-0200 bit bit name initial value r/w description 1 cmfv5 0 r/(w) * 1 compare match/input capture flag v5 status flag that indicates t he occurrence of tgrv_5 input capture or compare match. [setting conditions] ? when tcntv_5 = tgrv_5 and tgrv_5 is functioning as output compare register ? when tcntv_5 value is transferred to tgrv_5 by input capture signal while tgrv_5 is functioning as input capture register ? when tcntv_5 value is transferred to tgrv_5 while tgrv_5 is functioning as a register for measuring the pulse width of the external input signal * 2 . [clearing condition] ? when 0 is written to cmfv5 after reading cmfv5 = 1 0 cmfw5 0 r/(w) * 1 compare match/input capture flag w5 status flag that indicate s the occurrence of tgrw_5 input capture or compare match. [setting conditions] ? when tcntw_5 = tgrw_5 and tgrw_5 is functioning as output compare register ? when tcntw_5 value is transferred to tgrw_5 by input capture signal while tgrw_5 is functioning as input capture register ? when tcntw_5 value is transferred to tgrw_5 while tgrw_5 is functioning as a register for measuring the pulse width of the external input signal * 2 . [clearing condition] ? when 0 is written to cmfw5 after reading cmfw5 = 1 notes: 1 . writing 0 to this bit after reading it as 1 clears the flag and is the only allowed way. 2. timing to transfer is set by the ioc bit in the timer i/o control register u_5/v_5/w_5 (tioru_5/v_5/w_5).
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 421 of 1164 rej09b0321-0200 12.3.7 timer buffer operation transfer mode register (tbtm) tbtm is an 8-bit readable/writable register that specifies the timing for transferring data from the buffer register to the timer general register in pwm mode. the mtu2 has three tbtm registers, one each for channels 0, 3, and 4. bit: initial value: r/w: 7654321 0 00000000 r r r r r r/w r/w r/w ? ? ? ? ? ttse ttsb ttsa bit bit name initial value r/w description 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 ttse 0 r/w timing select e specifies the timing for transferring data from tgrf_0 to tgre_0 when they are used together for buffer operation. for channels 3 and 4, bit 2 is reserved. it is always read as 0 and the write value should always be 0. do not set this bit to 1 when channel 0 is to be used in a mode other than pwm mode. 0: when compare match e occurs in channel 0 1: when tcnt_0 is cleared 1 ttsb 0 r/w timing select b specifies the timing for transferring data from tgrd to tgrb in each channel when they are used together for buffer operation. do not set this bit to 1 when the channel is to be used in a mode other than pwm mode. 0: when compare match b occurs in each channel 1: when tcnt is cleared in each channel
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 422 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 ttsa 0 r/w timing select a specifies the timing for transferring data from tgrc to tgra in each channel when they are used together for buffer operation. do not set this bit to 1 when the channel is to be used in a mode other than pwm mode. 0: when compare match a occurs in each channel 1: when tcnt is cleared in each channel 12.3.8 timer input capture control register (ticcr) ticcr is an 8-bit readable/writable register that specifies input capture conditions when tcnt_1 and tcnt_2 are cascaded. the mtu2 has one ticcr in channel 1. bit: initial value: r/w: 7654321 0 00000000 r r r r r/w r/w r/w r/w ? ? ? ? i2be i2ae i1be i1ae bit bit name initial value r/w description 7 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 i2be 0 r/w input capture enable specifies whether to include the tioc2b pin in the tgrb_1 input capture conditions. 0: does not include the tioc2b pin in the tgrb_1 input capture conditions 1: includes the tioc2b pin in the tgrb_1 input capture conditions
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 423 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 i2ae 0 r/w input capture enable specifies whether to include the tioc2a pin in the tgra_1 input capture conditions. 0: does not include the tioc2a pin in the tgra_1 input capture conditions 1: includes the tioc2a pin in the tgra_1 input capture conditions 1 i1be 0 r/w input capture enable specifies whether to include the tioc1b pin in the tgrb_2 input capture conditions. 0: does not include the tioc1b pin in the tgrb_2 input capture conditions 1: includes the tioc1b pin in the tgrb_2 input capture conditions 0 i1ae 0 r/w input capture enable specifies whether to include the tioc1a pin in the tgra_2 input capture conditions. 0: does not include the tioc1a pin in the tgra_2 input capture conditions 1: includes the tioc1a pin in the tgra_2 input capture conditions 12.3.9 timer a/d converter start request control register (tadcr) tadcr is a 16-bit readable/writable register that enables or disables a/d converter start requests and specifies whether to link a/d converter start requests with interrupt skipping operation. the mtu2 has one tadcr in channel 4. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000 * 00 * 0 * 0 * 0 * 0 * r/w r/w r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w note: do not set to 1 when complementary pwm mode is not selected. * bf[1:0] ? ? ? ? ? ? ut4ae dt4ae ut4be dt4be ita3ae ita4ve itb3ae itb4ve
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 424 of 1164 rej09b0321-0200 bit bit name initial value r/w description 15, 14 bf[1:0] 00 r/w tadcobra_4/tadcobrb_4 transfer timing select select the timing for transferring data from tadcobra_4 and tadcobrb_4 to tadcora_4 and tadcorb_4. for details, see table 12.29. 13 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 ut4ae 0 r/w up-count trg4an enable enables or disables a/d converter start requests (trg4an) during tcnt_4 up-count operation. 0: a/d converter start requests (trg4an) disabled during tcnt_4 up-count operation 1: a/d converter start requests (trg4an) enabled during tcnt_4 up-count operation 6 dt4ae 0 * r/w down-count trg4an enable enables or disables a/d converter start requests (trg4an) during tcnt_4 down-count operation. 0: a/d converter start requests (trg4an) disabled during tcnt_4 down-count operation 1: a/d converter start requests (trg4an) enabled during tcnt_4 down-count operation 5 ut4be 0 r/w up-count trg4bn enable enables or disables a/d converter start requests (trg4bn) during tcnt_4 up-count operation. 0: a/d converter start requests (trg4bn) disabled during tcnt_4 up-count operation 1: a/d converter start requests (trg4bn) enabled during tcnt_4 up-count operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 425 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 dt4be 0 * r/w down-count trg4bn enable enables or disables a/d converter start requests (trg4bn) during tcnt_4 down-count operation. 0: a/d converter start requests (trg4bn) disabled during tcnt_4 down-count operation 1: a/d converter start requests (trg4bn) enabled during tcnt_4 down-count operation 3 ita3ae 0 * r/w tgia_3 interrupt skipping link enable select whether to link a/d converter start requests (trg4an) with tgia_3 interrupt skipping operation. 0: does not link with tgia_3 interrupt skipping 1: links with tgia_3 interrupt skipping 2 ita4ve 0 * r/w tciv_4 interrupt skipping link enable select whether to link a/d converter start requests (trg4an) with tciv_4 inte rrupt skipping operation. 0: does not link with tciv_4 interrupt skipping 1: links with tciv_4 interrupt skipping 1 itb3ae 0 * r/w tgia_3 interrupt skipping link enable select whether to link a/d converter start requests (trg4bn) with tgia_3 interrupt skipping operation. 0: does not link with tgia_3 interrupt skipping 1: links with tgia_3 interrupt skipping 0 itb4ve 0 * r/w tciv_4 interrupt skipping link enable select whether to link a/d converter start requests (trg4bn) with tciv_4 inte rrupt skipping operation. 0: does not link with tciv_4 interrupt skipping 1: links with tciv_4 interrupt skipping notes: 1. tadcr must not be accessed in eight bits; it should always be accessed in 16 bits. 2. when interrupt skipping is disabled (the t3aen and t4ven bits in the timer interrupt skipping set register (titcr) are cleared to 0 or the skipping count set bits (3acor and 4vcor) in titcr are cleared to 0), do not link a/d converter start requests with interrupt skipping operation (clear the ita3 ae, ita4ve, itb3ae, and itb4ve bits in the timer a/d converter start request control register (tadcr) to 0). 3. if link with interrupt skipping is enabl ed while interrupt skipping is disabled, a/d converter start requests will not be issued. * do not set to 1 when complementary pwm mode is not selected.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 426 of 1164 rej09b0321-0200 table 12.29 setting of transfer timing by bf1 and bf0 bits bit 7 bit 6 bf1 bf0 description 0 0 does not transfer data from the cycle set buffer register to the cycle set register. 0 1 transfers data from the cycle set buffer register to the cycle set register at the cres t of the tcnt_4 count. * 1 1 0 transfers data from the cycle set buffer register to the cycle set register at the troug h of the tcnt_4 count. * 2 1 1 transfers data from the cycle set buffer register to the cycle set register at the crest and trough of the tcnt_4 count. * 2 notes: 1. data is transferred from the cycle set bu ffer register to the cycle set register when the crest of the tcnt_4 count is reached in complementary pwm mode, when compare match occurs between tcnt_3 and tgra_3 in reset-synchronized pwm mode, or when compare match occurs between t cnt_4 and tgra_4 in pwm mode 1 or normal operation mode. 2. these settings are prohibited when co mplementary pwm mode is not selected. 12.3.10 timer a/d converter start reque st cycle set registers (tadcora_4 and tadcorb_4) tadcora_4 and tadcorb_4 are 16-bit readable/w ritable registers. when the tcnt_4 count reaches the value in tadcora_4 or tadcorb_4, a corresponding a/d converter start request will be issued. tadcora_4 and tadcorb_4 are initialized to h'ffff. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w note: tadcora_4 and tadcorb_4 must not be accessed in eight bits; they should always be accessed in 16 bits.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 427 of 1164 rej09b0321-0200 12.3.11 timer a/d converter start request cycle set buffer registers (tadcobra_4 and tadcobrb_4) tadcobra_4 and tadcobrb_4 are 16-bit readable /writable registers. when the crest or trough of the tcnt_4 count is reached, these re gister values are transferred to tadcora_4 and tadcorb_4, respectively. tadcobra_4 and tadcobrb_4 are initialized to h'ffff. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w note: tadcobra_4 and tadcobrb_4 must not be accessed in eight bits; they should always be accessed in 16 bits. 12.3.12 timer counter (tcnt) the tcnt counters are 16-bit readable/writable counters. the mtu2 has eight tcnt counters, one each for channels 0 to 4 and three (tcntu _5, tcntv_5, and tcnt w_5) for channel 5. the tcnt counters are initiali zed to h'0000 by a reset. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w note: the tcnt counters must not be accessed in eight bits; they should always be accessed in 16 bits.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 428 of 1164 rej09b0321-0200 12.3.13 timer general register (tgr) the tgr registers are 16-b it readable/writable registers. the mt u2 has 21 tgr registers, six for channel 0, two each for channels 1 and 2, four eac h for channels 3 and 4, and three for channel 5. tgra, tgrb, tgrc, and tgrd function as either output compare or input capture registers. tgrc and tgrd for channels 0, 3, and 4 can also be designated for operation as buffer registers. tgr buffer register combinations are tgra and tgrc, and tgrb and tgrd. tgre_0 and tgrf_0 function as compare registers. when the tcnt_0 count matches the tgre_0 value, an a/d converter start request can be issued. tgrf can also be designated for operation as a buffer register. tgr buffer register combination is tgre and tgrf. tgru_5, tgrv_5, and tgrw_5 function as compar e match, input capture, or external pulse width measurement registers. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w note: the tgr registers must not be accessed in eight bits; they should always be accessed in 16 bits. tgr registers are initialized to h'ffff.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 429 of 1164 rej09b0321-0200 12.3.14 timer start register (tstr) tstr is an 8-bit readable/writable register that selects operation/stoppage of tcnt for channels 0 to 4. tstr_5 is an 8-bit readable/writable register that selects operation/stoppage of tcntu_5, tcntv_5, and tcntw_5 for channel 5. when setting the operating mode in tmdr or setting the count clock in tcr, first stop the tcnt counter. ? tstr bit: initial value: r/w: 7654321 0 00000000 r/w r/w r r r r/w r/w r/w cst4 cst3 ? ? ? cst2 cst1 cst0 bit bit name initial value r/w description 7 cst4 0 r/w 6 cst3 0 r/w counter start 4 and 3 these bits select operat ion or stoppage for tcnt. if 0 is written to the cst bit during operation with the tioc pin designated for output, the counter stops but the tioc pin output compare output level is retained. if tior is written to when the cst bit is cleared to 0, the pin output level will be changed to the set initial output value. 0: tcnt_4 and tcnt_3 co unt operation is stopped 1: tcnt_4 and tcnt_3 per forms count operation 5 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 430 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 cst2 0 r/w 1 cst1 0 r/w 0 cst0 0 r/w counter start 2 to 0 these bits select operat ion or stoppage for tcnt. if 0 is written to the cst bit during operation with the tioc pin designated for output, the counter stops but the tioc pin output compare output level is retained. if tior is written to when the cst bit is cleared to 0, the pin output level will be changed to the set initial output value. 0: tcnt_2 to tcnt_0 coun t operation is stopped 1: tcnt_2 to tcnt_0 per forms count operation ? tstr_5 bit: initial value: r/w: 7654321 0 00000000 r r r r r r/w r/w r/w ????? cstu5 cstv5 cstw5 bit bit name initial value r/w description 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 cstu5 0 r/w counter start u5 selects operation or stoppage for tcntu_5. 0: tcntu_5 count op eration is stopped 1: tcntu_5 perfo rms count operation 1 cstv5 0 r/w counter start v5 selects operation or stoppage for tcntv_5. 0: tcntv_5 count op eration is stopped 1: tcntv_5 perfo rms count operation 0 cstw5 0 r/w counter start w5 selects operation or stoppage for tcntw_5. 0: tcntw_5 count op eration is stopped 1: tcntw_5 performs count operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 431 of 1164 rej09b0321-0200 12.3.15 timer synchronous register (tsyr) tsyr is an 8-bit readable/writable register th at selects independent operation or synchronous operation for the channel 0 to 4 tcnt counters. a channel performs synchronous operation when the corresponding bit in tsyr is set to 1. bit: initial value: r/w: 7654321 0 00000000 r/w r/w r r r r/w r/w r/w sync4 sync3 ??? sync2 sync1 sync0 bit bit name initial value r/w description 7 sync4 0 r/w 6 sync3 0 r/w timer synchronous operation 4 and 3 these bits are used to select whether operation is independent of or synchronized with other channels. when synchronous operation is selected, the tcnt synchronous presetting of multiple channels, and synchronous clearing by counter clearing on another channel, are possible. to set synchronous operation, the sync bits for at least two channels must be set to 1. to set synchronous clearing, in addition to the sync bit, the tcnt clearing source must also be set by means of bits cclr0 to cclr2 in tcr. 0: tcnt_4 and tcnt_3 oper ate independently (tcnt presetting/clearing is unrelated to other channels) 1: tcnt_4 and tcnt_3 performs synchronous operation tcnt synchronous presetting/synchronous clearing is possible 5 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 432 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 sync2 0 r/w 1 sync1 0 r/w 0 sync0 0 r/w timer synchronous operation 2 to 0 these bits are used to select whether operation is independent of or synchronized with other channels. when synchronous operation is selected, the tcnt synchronous presetting of multiple channels, and synchronous clearing by counter clearing on another channel, are possible. to set synchronous operation, the sync bits for at least two channels must be set to 1. to set synchronous clearing, in addition to the sync bit, the tcnt clearing source must also be set by means of bits cclr0 to cclr2 in tcr. 0: tcnt_2 to tcnt_0 operat es independently (tcnt presetting /clearing is unrelated to other channels) 1: tcnt_2 to tcnt_0 perfo rms synchronous operation tcnt synchronous presetting/synchronous clearing is possible
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 433 of 1164 rej09b0321-0200 12.3.16 timer counter synchron ous start register (tcsystr) tcsystr is an 8-bit readable/writable register that specifies synchron ous start of the mtu2 counters. bit: initial value: r/w: 7654321 0 00000000 r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * rrr note: only 1 can be written to set the register. * sch0 sch1 sch2 sch3 sch4 ? ? ? bit bit name initial value r/w description 7 sch0 0 r/(w) * synchronous start controls synchronous star t of tcnt_0 in the mtu2. 0: does not specify synchronous start for tcnt_0 in the mtu2 1: specifies synchronous st art for tcnt_0 in the mtu2 [clearing condition] ? when 1 is set to the cst0 bit of tstr in mtu2 while sch0 = 1 6 sch1 0 r/(w) * synchronous start controls synchronous star t of tcnt_1 in the mtu2. 0: does not specify synchronous start for tcnt_1 in the mtu2 1: specifies synchronous st art for tcnt_1 in the mtu2 [clearing condition] ? when 1 is set to the cst1 bit of tstr in mtu2 while sch1 = 1
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 434 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 sch2 0 r/(w) * synchronous start controls synchronous star t of tcnt_2 in the mtu2. 0: does not specify synchronous start for tcnt_2 in the mtu2 1: specifies synchronous st art for tcnt_2 in the mtu2 [clearing condition] ? when 1 is set to the cst2 bit of tstr in mtu2 while sch2 = 1 4 sch3 0 r/(w) * synchronous start controls synchronous star t of tcnt_3 in the mtu2. 0: does not specify synchronous start for tcnt_3 in the mtu2 1: specifies synchronous st art for tcnt_3 in the mtu2 [clearing condition] ? when 1 is set to the cst3 bit of tstr in mtu2 while sch3 = 1 3 sch4 0 r/(w) * synchronous start controls synchronous star t of tcnt_4 in the mtu2. 0: does not specify synchronous start for tcnt_4 in the mtu2 1: specifies synchronous st art for tcnt_4 in the mtu2 [clearing condition] ? when 1 is set to the cst4 bit of tstr in mtu2 while sch4 = 1 2 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. note: * only 1 can be written to set the register.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 435 of 1164 rej09b0321-0200 12.3.17 timer read/write enable register (trwer) trwer is an 8-bit readable/writable register that enables or disables access to the registers and counters which have write-protec tion capability against accidental modification in channels 3 and 4. bit: initial value: r/w: 7654321 0 00000001 rrrrrrrr/w ???????rwe bit bit name initial value r/w description 7 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 rwe 1 r/w read/write enable enables or disables access to the registers which have write-protection capability against accidental modification. 0: disables read/write access to the registers 1: enables read/write access to the registers [clearing condition] ? when 0 is written to the rwe bit after reading rwe = 1 ? registers and counters having write-protectio n capability against accidental modification 22 registers: tcr_3, tcr_4, tmdr_3, tmdr_4, tiorh_3, tiorh_4, tiorl_3, tiorl_4, tier_3, tier_4, tgra_3, tg ra_4, tgrb_3, tgrb_4, toer, tocr1, tocr2, tgcr, tcdr, tddr, tcnt_3, and tcnt_4.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 436 of 1164 rej09b0321-0200 12.3.18 timer output master enable register (toer) toer is an 8-bit readable/writable register that enables/disables output settings for output pins tioc4d, tioc4c, tioc3d, tioc4b, tioc4a, and tioc3b. these pins do not output correctly if the toer bits have not been set. set toer of channel 3 and channel 4 prior to setting tior of channel 3 and channel 4. bit: initial value: r/w: 7654321 0 11000000 r r r/w r/w r/w r/w r/w r/w ? ? oe4d oe4c oe3d oe4b oe4a oe3b bit bit name initial value r/w description 7, 6 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. 5 oe4d 0 r/w master enable tioc4d this bit enables/disables the tioc4d pin mtu2 output. 0: mtu2 output is disabled (inactive level) * 1: mtu2 output is enabled 4 oe4c 0 r/w master enable tioc4c this bit enables/disables the tioc4c pin mtu2 output. 0: mtu2 output is disabled (inactive level) * 1: mtu2 output is enabled 3 oe3d 0 r/w master enable tioc3d this bit enables/disables the tioc3d pin mtu2 output. 0: mtu2 output is disabled (inactive level) * 1: mtu2 output is enabled 2 oe4b 0 r/w master enable tioc4b this bit enables/disables the tioc4b pin mtu2 output. 0: mtu2 output is disabled (inactive level) * 1: mtu2 output is enabled 1 oe4a 0 r/w master enable tioc4a this bit enables/disables the tioc4a pin mtu2 output. 0: mtu2 output is disabled (inactive level) * 1: mtu2 output is enabled
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 437 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 oe3b 0 r/w master enable tioc3b this bit enables/disables the tioc3b pin mtu2 output. 0: mtu2 output is disabled (inactive level) * 1: mtu2 output is enabled note: * the inactive level is determined by the se ttings in timer output control registers 1 and 2 (tocr1 and tocr2). for details, refer to section 12.3.19, timer output control register 1 (tocr1), and sect ion 12.3.20, timer output co ntrol register 2 (tocr2). set these bits to 1 to enable mtu2 output in other than complementary pwm or reset- synchronized pwm mode. if these bits are set to 0, low level is output. 12.3.19 timer output control register 1 (tocr1) tocr1 is an 8-bit readable/writable register that enables/disables pwm synchronized toggle output in complementary pwm mode/reset synchronized pwm mode, and controls output level inversion of pwm output. bit: initial value: r/w: 7654321 0 00000000 r r/w r r r/(w) * 1 r/w r/w r/w note: 1. this bit can be set to 1 only once after a power-on reset. after 1 is written, 0 cannot be written to the bit. ? psye ? ? tocl tocs olsn olsp bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 psye 0 r/w pwm synchronous output enable this bit selects the enable /disable of toggle output synchronized with the pwm period. 0: toggle output is disabled 1: toggle output is enabled 5, 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 438 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3 tocl 0 r/(w) * 1 toc register write protection * 2 this bit selects the enable/disable of write access to the tocs, olsn, and olsp bits in tocr1. 0: write access to the tocs, olsn, and olsp bits is enabled 1: write access to the tocs, olsn, and olsp bits is disabled 2 tocs 0 r/w toc select this bit selects either the tocr1 or tocr2 setting to be used for the output level in complementary pwm mode and reset-synchronized pwm mode. 0: tocr1 setting is selected 1: tocr2 setting is selected 1 olsn 0 r/w output level select n * 3 this bit selects the reverse phase output level in reset- synchronized pwm mode/complementary pwm mode. see table 12.30. 0 olsp 0 r/w output level select p * 3 this bit selects the positive phase output level in reset- synchronized pwm mode/complementary pwm mode. see table 12.31. notes: 1. this bit can be set to 1 only once afte r a power on reset. after 1 is written, 0 cannot be written to the bit. 2. setting the tocl bit to 1 prevents accid ental modification when the cpu goes out of control. 3. clearing the tocs bit to 0 makes this bit setting valid. table 12.30 output level select function bit 1 function compare match output olsn initial output active level up count down count 0 high level low level high level low level 1 low level high level low level high level note: the reverse phase waveform initial output val ue changes to active level after elapse of the dead time after count start.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 439 of 1164 rej09b0321-0200 table 12.31 output level select function bit 0 function compare match output olsp initial output active level up count down count 0 high level low level low level high level 1 low level high level high level low level figure 12.2 shows an example of complementary pwm mode output (1 phase) when olsn = 1 and olsp = 1. tcnt_3 and tcnt_4 values tgra_3 tgra_4 tddr h'0000 time tcnt_4 tcnt_3 positive phase output reverse phase output active level compare match output (up count) initial output initial output active level compare match output (down count) compare match output (down count) compare match output (up count) active level figure 12.2 complementary pwm mode output level example
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 440 of 1164 rej09b0321-0200 12.3.20 timer output control register 2 (tocr2) tocr2 is an 8-bit readable/writable register that controls output level inversion of pwm output in complementary pwm mode and reset-synchronized pwm mode. bit: initial value: r/w: 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w bf[1:0] ols3n ols3p ols2n ols2p ols1n ols1p bit bit name initial value r/w description 7, 6 bf[1:0] 00 r/w tolbr bu ffer transfer timing select these bits select the timing for transferring data from tolbr to tocr2. for details, see table 12.32. 5 ols3n 0 r/w output level select 3n * this bit selects the output level on tioc4d in reset- synchronized pwm mode/complementary pwm mode. see table 12.33. 4 ols3p 0 r/w output level select 3p * this bit selects the output level on tioc4b in reset- synchronized pwm mode/complementary pwm mode. see table 12.34. 3 ols2n 0 r/w output level select 2n * this bit selects the output level on tioc4c in reset- synchronized pwm mode/complementary pwm mode. see table 12.35. 2 ols2p 0 r/w output level select 2p * this bit selects the output level on tioc4a in reset- synchronized pwm mode/complementary pwm mode. see table 12.36. 1 ols1n 0 r/w output level select 1n * this bit selects the output level on tioc3d in reset- synchronized pwm mode/complementary pwm mode. see table 12.37.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 441 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 ols1p 0 r/w output level select 1p * this bit selects the output level on tioc3b in reset- synchronized pwm mode/complementary pwm mode. see table 12.38. note: * setting the tocs bit in tocr1 to 1 makes this bit setting valid. table 12.32 setting of bits bf1 and bf0 bit 7 bit 6 description bf1 bf0 complementary pwm mode reset-synchronized pwm mode 0 0 does not transfer data from the buffer register (tolbr) to tocr2. does not transfer data from the buffer register (tolbr) to tocr2. 0 1 transfers data from the buffer register (tolbr) to tocr2 at the crest of the tcnt_4 count. transfers data from the buffer register (tolbr) to tocr2 when tcnt_3/tcnt_4 is cleared 1 0 transfers data from the buffer register (tolbr) to tocr2 at the trough of the tcnt_4 count. setting prohibited 1 1 transfers data from the buffer register (tolbr) to tocr2 at the crest and trough of the tcnt_4 count. setting prohibited table 12.33 tioc4d output level select function bit 5 function compare match output ols3n initial output active level up count down count 0 high level low level high level low level 1 low level high level low level high level note: the reverse phase waveform initial output va lue changes to the active level after elapse of the dead time after count start.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 442 of 1164 rej09b0321-0200 table 12.34 tioc4b output level select function bit 4 function compare match output ols3p initial output active level up count down count 0 high level low level low level high level 1 low level high level high level low level table 12.35 tioc4c output level select function bit 3 function compare match output ols2n initial output active level up count down count 0 high level low level high level low level 1 low level high level low level high level note: the reverse phase waveform initial output va lue changes to the active level after elapse of the dead time after count start. table 12.36 tioc4a output level select function bit 2 function compare match output ols2p initial output active level up count down count 0 high level low level low level high level 1 low level high level high level low level table 12.37 tioc3d output level select function bit 1 function compare match output ols1n initial output active level up count down count 0 high level low level high level low level 1 low level high level low level high level note: the reverse phase waveform initial output va lue changes to the active level after elapse of the dead time after count start.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 443 of 1164 rej09b0321-0200 table 12.38 tioc3b output level select function bit 0 function compare match output ols1p initial output active level up count down count 0 high level low level low level high level 1 low level high level high level low level 12.3.21 timer output leve l buffer register (tolbr) tolbr is an 8-bit readable/writa ble register that functions as a buffer for tocr2 and specifies the pwm output level in complementary pwm mode and reset-synchronized pwm mode. bit: initial value: r/w: 7654321 0 00000000 r r r/w r/w r/w r/w r/w r/w ?? ols3n ols3p ols2n ols2p ols1n ols1p bit bit name initial value r/w description 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5 ols3n 0 r/w specifies the buffer value to be transferred to the ols3n bit in tocr2. 4 ols3p 0 r/w specifies the buffer value to be transferred to the ols3p bit in tocr2. 3 ols2n 0 r/w specifies the buffer value to be transferred to the ols2n bit in tocr2. 2 ols2p 0 r/w specifies the buffer value to be transferred to the ols2p bit in tocr2. 1 ols1n 0 r/w specifies the buffer value to be transferred to the ols1n bit in tocr2. 0 ols1p 0 r/w specifies the buffer value to be transferred to the ols1p bit in tocr2. figure 12.3 shows an example of the pwm output level setting procedure in buffer operation.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 444 of 1164 rej09b0321-0200 set bit tocs set tocr2 set tolbr [1] [2] [3] [1] set bit tocs in tocr1 to 1 to enable the tocr2 setting. [2] use bits bf1 and bf0 in tocr2 to select the tolbr buffer transfer timing. use bits ols3n to ols1n and ols3p to ols1p to specify the pwm output levels. [3] the tolbr initial setting must be the same value as specified in bits ols3n to ols1n and ols3p to ols1p in tocr2. figure 12.3 pwm output level se tting procedure in buffer operation 12.3.22 timer gate cont rol register (tgcr) tgcr is an 8-bit readable/writable register that controls the waveform output necessary for brushless dc motor control in reset-synchronized pwm mode/complementary pwm mode. these register settings are ineffect ive for anything other than complementary pwm mode/reset- synchronized pwm mode. bit: initial value: r/w: 7654321 0 10000000 r r/w r/w r/w r/w r/w r/w r/w ? bdc n p fb wf vf uf bit bit name initial value r/w description 7 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 6 bdc 0 r/w brushless dc motor this bit selects whether to make the functions of this register (tgcr) effective or ineffective. 0: ordinary output 1: functions of this register are made effective
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 445 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 n 0 r/w reverse phase output (n) control this bit selects whether the level output or the reset- synchronized pwm/complementary pwm output while the reverse pins (tioc3d, tioc4c, and tioc4d) are output. 0: level output 1: reset synchronized pwm/complementary pwm output 4 p 0 r/w positive phase output (p) control this bit selects whether the level output or the reset- synchronized pwm/complementary pwm output while the positive pin (tioc3b, tioc4a, and tioc4b) are output. 0: level output 1: reset synchronized pwm/complementary pwm output 3 fb 0 r/w external feedback signal enable this bit selects whether the switching of the output of the positive/reverse phase is carried out automatically with the mtu2/channel 0 tgra, tgrb, tgrc input capture signals or by writing 0 or 1 to bits 2 to 0 in tgcr. 0: output switching is exte rnal input (input sources are channel 0 tgra, tgrb, tgrc input capture signal) 1: output switching is carri ed out by software (tgcr's uf, vf, wf settings). 2 wf 0 r/w 1 vf 0 r/w 0 uf 0 r/w output phase switch 2 to 0 these bits set the positive phase/negative phase output phase on or off state. the sett ing of these bits is valid only when the fb bit in this register is set to 1. in this case, the setting of bits 2 to 0 is a substitute for external input. see table 12.39.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 446 of 1164 rej09b0321-0200 table 12.39 output level select function function bit 2 bit 1 bit 0 tioc3b tioc4a tioc4b tioc3d tioc4c tioc4d wf vf uf u phase v phase w phase u phase v phase w phase 0 0 0 off off off off off off 1 on off off off off on 1 0 off on off on off off 1 off on off off off on 1 0 0 off off on off on off 1 on off off off on off 1 0 off off on on off off 1 off off off off off off 12.3.23 timer subcounter (tcnts) tcnts is a 16-bit read-only counter that is used only in complementary pwm mode. the initial value of tcnts is h'0000. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrrrrrrrrr note: accessing the tcnts in 8-bit units is prohibited. always access in 16-bit units.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 447 of 1164 rej09b0321-0200 12.3.24 timer dead time data register (tddr) tddr is a 16-bit register, used only in complementary pwm mode that specifies the tcnt_3 and tcnt_4 counter offset values. in comp lementary pwm mode, when the tcnt_3 and tcnt_4 counters are cleared and then restarted, the tddr register value is loaded into the tcnt_3 counter and the count operation starts. the initial value of tddr is h'ffff. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w note: accessing the tddr in 8-bit units is prohibited. always access in 16-bit units. 12.3.25 timer cycle data register (tcdr) tcdr is a 16-bit register used only in complementary pwm mode. set half the pwm carrier sync value as the tcdr register value. this register is constantly compared with the tcnts counter in complementary pwm mode, and when a match oc curs, the tcnts counter switches direction (decrement to increment). the initial value of tcdr is h'ffff. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w note: accessing the tcdr in 8-bit units is prohibited. always access in 16-bit units.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 448 of 1164 rej09b0321-0200 12.3.26 timer cycle buffer register (tcbr) tcbr is a 16-bit register used only in comple mentary pwm mode. it functions as a buffer register for the tcdr register. the tcbr register values are transferred to the tcdr register with the transfer timing set in the tmdr register. the initial value of tcbr is h'ffff. bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w note: accessing the tcbr in 8-bit units is prohibited. always access in 16-bit units. 12.3.27 timer interrupt ski pping set register (titcr) titcr is an 8-bit readable/writable register that enables or disables interrupt skipping and specifies the interrupt skipping count. the mtu2 has one titcr. bit: initial value: r/w: 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w t3aen 3acor[2:0] t4ven 4vcor[2:0] bit bit name initial value r/w description 7 t3aen 0 r/w t3aen enables or disables tgia_3 interrupt skipping. 0: tgia_3 interrupt skipping disabled 1: tgia_3 interrupt skipping enabled 6 to 4 3acor[2:0] 000 r/w t hese bits specify the tgia_3 interrupt skipping count within the range from 0 to 7. * for details, see table 12.40. 3 t4ven 0 r/w t4ven enables or disables tciv_4 interrupt skipping. 0: tciv_4 interrupt skipping disabled 1: tciv_4 interrupt skipping enabled
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 449 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 to 0 4vcor[2:0] 000 r/w t hese bits specify the tciv_4 interrupt skipping count within the range from 0 to 7. * for details, see table 12.41. note: * when 0 is specified for the interrupt skipping count, no interrupt skipping will be performed. before changing the interrupt ski pping count, be sure to clear the t3aen and t4ven bits to 0 to clear the skipping counter (titcnt). table 12.40 setting of interrupt skippin g count by bits 3acor2 to 3acor0 bit 6 bit 5 bit 4 3acor2 3acor1 3acor0 description 0 0 0 does not skip tgia_3 interrupts. 0 0 1 sets the tgia_3 interrupt skipping count to 1. 0 1 0 sets the tgia_3 interrupt skipping count to 2. 0 1 1 sets the tgia_3 interrupt skipping count to 3. 1 0 0 sets the tgia_3 interrupt skipping count to 4. 1 0 1 sets the tgia_3 interrupt skipping count to 5. 1 1 0 sets the tgia_3 interrupt skipping count to 6. 1 1 1 sets the tgia_3 interrupt skipping count to 7. table 12.41 setting of interrupt skippin g count by bits 4vcor2 to 4vcor0 bit 2 bit 1 bit 0 4vcor2 4vcor1 4vcor0 description 0 0 0 does not skip tciv_4 interrupts. 0 0 1 sets the tciv_4 interrupt skipping count to 1. 0 1 0 sets the tciv_4 interrupt skipping count to 2. 0 1 1 sets the tciv_4 interrupt skipping count to 3. 1 0 0 sets the tciv_4 interrupt skipping count to 4. 1 0 1 sets the tciv_4 interrupt skipping count to 5. 1 1 0 sets the tciv_4 interrupt skipping count to 6. 1 1 1 sets the tciv_4 interrupt skipping count to 7.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 450 of 1164 rej09b0321-0200 12.3.28 timer interrupt ski pping counter (titcnt) titcnt is an 8-bit readable/writable counter. the mtu2 has one titcnt. titcnt retains the value even after tcnt_3 or tcnt_4 stops counting. bit: initial value: r/w: 7654321 0 00000000 rrrrrrrr ? 3acnt[2:0] ? 4vcnt[2:0] bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. 6 to 4 3acnt[2:0] 000 r tgia_3 interrupt counter while the t3aen bit in titcr is set to 1, the count in these bits is incremented every time a tgia_3 interrupt occurs. [clearing conditions] ? when the 3acnt2 to 3acnt0 value in titcnt matches the 3acor2 to 3acor0 value in titcr ? when the t3aen bit in titcr is cleared to 0 ? when the 3acor2 to 3acor0 bits in titcr are cleared to 0 3 ? 0 r reserved this bit is always read as 0. 2 to 0 4vcnt[2:0] 000 r tciv_4 interrupt counter while the t4ven bit in titcr is set to 1, the count in these bits is incremented every time a tciv_4 interrupt occurs. [clearing conditions] ? when the 4vcnt2 to 4vcnt0 value in titcnt matches the 4vcor2 to 4vcor2 value in titcr ? when the t4ven bit in titcr is cleared to 0 ? when the 4vcor2 to 4vcor2 bits in titcr are cleared to 0 note: clear the t3aen and t4ven bits in tit cr to 0, to clear the value of titcnt.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 451 of 1164 rej09b0321-0200 12.3.29 timer buffer transfer set register (tbter) tbter is an 8-bit readable/writable register that enables or disables transfer from the buffer registers* used in complementary pwm mode to the temporary registers an d specifies whether to link the transfer with interrupt skipping operation. the mtu2 has one tbter. bit: initial value: r/w: 7654321 0 00000000 rrrrrrr/wr/w ? ? ? ? ? ? bte[1:0] bit bit name initial value r/w description 7 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 bte[1:0] 00 r/w thes e bits enable or disable transfer from the buffer registers * used in complementary pwm mode to the temporary registers and specify whether to link the transfer with interrupt skipping operation. for details, see table 12.42. note: * applicable buffer registers: tgrc_3, tgrd_3, tgrc_4, tgrd_4, and tcbr
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 452 of 1164 rej09b0321-0200 table 12.42 setting of bits bte1 and bte0 bit 1 bit 0 bte1 bte0 description 0 0 enables transfer from the buffer r egisters to the temporary registers * 1 and does not link the transfer wit h interrupt skipping operation. 0 1 disables transfer from the buffer r egisters to the temporary registers. 1 0 links transfer from the buffer regi sters to the temporary registers with interrupt skipping operation. * 2 1 1 setting prohibited notes: 1. data is transferred a ccording to the md3 to md0 bit se tting in tmdr. for details, refer to section 12.4.8, complementary pwm mode. 2. when interrupt skipping is disabled (the t3aen and t4ven bits are cleared to 0 in the timer interrupt skipping set register (titcr) or the skipping count set bits (3acor and 4vcor) in titcr are cleared to 0)), be su re to disable link of buffer transfer with interrupt skipping (clear the bte1 bit in the ti mer buffer transfer set register (tbter) to 0). if link with interrupt skipping is enabled while interrupt skipping is disabled, buffer transfer will not be performed.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 453 of 1164 rej09b0321-0200 12.3.30 timer dead time enable register (tder) tder is an 8-bit readable/writable register that controls dead time generation in complementary pwm mode. the mtu2 has one tder in channel 3. tder must be modified only while tcnt stops. bit: initial value: r/w: 7654321 0 00000001 r r r r r r r r/(w) ??????? tder bit bit name initial value r/w description 7 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 tder 1 r/(w) dead time enable specifies whether to generate dead time. 0: does not generate dead time 1: generates dead time * [clearing condition] ? when 0 is written to tder after reading tder = 1 note: * tddr must be set to 1 or a larger value.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 454 of 1164 rej09b0321-0200 12.3.31 timer waveform control register (twcr) twcr is an 8-bit readable/writable register that controls the waveform when synchronous counter clearing occurs in tcnt_3 and tcnt_4 in complementary pwm mode and specifies whether to clear the counters at tgra_3 compare match. the cce bit and wre bit in twcr must be modified only while tcnt stops. bit: initial value: r/w: 7654321 0 note: do not set to 1 when complementary pwm mode is not selected. * 0 * 0000000 r/(w) r r r r r r r/(w) cce??????wre bit bit name initial value r/w description 7 cce 0 * r/(w) compare match clear enable specifies whether to clear counters at tgra_3 compare match in complementary pwm mode. 0: does not clear counters at tgra_3 compare match 1: clears counters at tgra_3 compare match [setting condition] ? when 1 is written to cce after reading cce = 0 6 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 455 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 wre 0 r/(w) waveform retain enable selects the waveform output when synchronous counter clearing occurs in complementary pwm mode. the output waveform is retained only when synchronous clearing occurs within the tb interval at the trough in complementary pwm mode. when synchronous clearing occurs outside this interval, the initial value specified in tocr is output regardless of the wre bit setting. the initial value is also output when synchronous clearing occurs in the tb interval at the trough immediately after tcnt_3 and tcnt_4 start operation. for the tb interval at the trough in complementary pwm mode, see figure 12.40. 0: outputs the initial va lue specified in tocr 1: retains the waveform output immediately before synchronous clearing [setting condition] ? when 1 is written to wre after reading wre = 0 note: * do not set to 1 when complementary pwm mode is not selected. 12.3.32 bus master interface the timer counters (tcnt), general registers (tgr), timer subcounter (tcnts), timer cycle buffer register (tcbr), time r dead time data register (tddr), timer cycle data register (tcdr), timer a/d converter start request control regist er (tadcr), timer a/d converter start request cycle set registers (tadcor), and timer a/d conv erter start request cycle set buffer registers (tadcobr) are 16-bit registers. a 16-bit data bus to the bus master enables 16-bit read/writes. 8- bit read/write is not possible. always access in 16-bit units. all registers other than the above registers are 8-b it registers. these are connected to the cpu by a 16-bit data bus, so 16-bit read/writes and 8-bit read/writes are both possible.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 456 of 1164 rej09b0321-0200 12.4 operation 12.4.1 basic functions each channel has a tcnt and tgr register. tcnt performs up-counting, an d is also capable of free-running operation, cycle counting, and exte rnal event counting. each tgr can be used as an input captur e register or output compare register. always select mtu2 external pins set function using the pin function controller (pfc). (1) counter operation when one of bits cst0 to cst4 in tstr or bits cstu5, cstv5, and cstw5 in tstr_5 is set to 1, the tcnt counter for the corresponding ch annel begins counting. tcnt can operate as a free-running counter, periodic counter, for example. (a) example of count operation setting procedure figure 12.4 shows an example of the count operation setting procedure. operation selection select counter clock periodic counter select counter clearing source select output compare register set period free-running counter start count operation start count operation [1] [2] [3] [4] [5] [5] [1] select the counter clock with bits tpsc2 to tpsc0 in tcr. at the same time, select the input clock edge with bits ckeg1 and ckeg0 in tcr. [2] for periodic counter operation, select the tgr to be used as the tcnt clearing source with bits cclr2 to cclr0 in tcr. [3] designate the tgr selected in [2] as an output compare register by means of tior. [4] set the periodic counter cycle in the tgr selected in [2]. [5] set the cst bit in tstr to 1 to start the counter operation. figure 12.4 example of coun ter operation setting procedure
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 457 of 1164 rej09b0321-0200 (b) free-running count operation and periodic count operation: immediately after a reset, the mtu2's tcnt counte rs are all designated as free-running counters. when the relevant bit in tstr is set to 1 the corresponding tcnt counter starts up-count operation as a free-running counter. when tcnt overflows (from h'ffff to h'0000), the tcfv bit in tsr is set to 1. if the value of the corresp onding tciev bit in tier is 1 at this point, the mtu2 requests an interrupt. after overflow, tcnt starts counting up again from h'0000. figure 12.5 illustrates free-running counter operation. tcnt value h'ffff h'0000 cst bit tcfv time figure 12.5 free-running counter operation when compare match is selected as the tcnt cl earing source, the tcnt co unter for the relevant channel performs periodic count operation. the tgr register for setting the period is designated as an output compare register, and counter clearing by compare match is selected by means of bits cclr0 to cclr2 in tcr. after the settings have been made, tcnt starts up-count operation as a periodic counter when the corresponding bit in tstr is set to 1. when the count value matches the value in tgr, the tgf bit in tsr is set to 1 and tcnt is cleared to h'0000. if the value of the corresponding tgie bit in tier is 1 at this point, the mtu2 requests an interrupt. after a compare match, tcnt starts counting up again from h'0000. figure 12.6 illustrates periodic counter operation.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 458 of 1164 rej09b0321-0200 tcnt value tgr h'0000 cst bit tgf time counter cleared by tgr compare match flag cleared by software or dmac activation figure 12.6 periodic counter operation (2) waveform output by compare match the mtu2 can perform 0, 1, or toggle output from the corresponding output pin using compare match. (a) example of setting procedure for waveform output by compare match figure 12.7 shows an example of the setting procedure for waveform output by compare match output selection select waveform output mode set output timing start count operation [1] [2] [3] [1] select initial value 0 output or 1 output, and compare match output value 0 output, 1 output, or toggle output, by means of tior. the set initial value is output at the tioc pin until the first compare match occurs. [2] set the timing for compare match generation in tgr. [3] set the cst bit in tstr to 1 to start the count operation. figure 12.7 example of setting procedu re for waveform output by compare match
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 459 of 1164 rej09b0321-0200 (b) examples of waveform output operation: figure 12.8 shows an example of 0 output/1 output. in this example, tcnt has been designated as a free-running counter, and settings have been made such that 1 is output by compare match a, and 0 is output by compare match b. when the set level and the pin level coincide, the pin level does not change. tcnt value h'ffff h'0000 tioca tiocb time tgra tgrb no change no change no change no change 1 output 0 output figure 12.8 example of 0 output/1 output operation figure 12.9 shows an example of toggle output. in this example, tcnt has b een designated as a periodic co unter (with counter clearing on compare match b), and settings have been made such that the output is toggled by both compare match a and compare match b. tcnt value h'ffff h'0000 tiocb tioca time tgrb tgra toggle output toggle output counter cleared by tgrb compare match figure 12.9 example of toggle output operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 460 of 1164 rej09b0321-0200 (3) input capture function: the tcnt value can be transferred to tgr on detection of the tioc pin input edge. rising edge, falling edge, or both edges can be selected as the detected edge. for channels 0 and 1, it is also possible to specify another channel's co unter input clock or compare match signal as the input capture source. note: when another channel's counter input clock is used as the input capture input for channels 0 and 1, p /1 should not be selected as the counter input clock used for input capture input. input capture will not be generated if p /1 is selected. (a) example of input capture operation setting procedure figure 12.10 shows an example of the i nput capture operati on setting procedure. input selection select input capture input start count [1] [2] [1] designate tgr as an input capture register by means of tior, and select rising edge, falling edge, or both edges as the input capture source and input signal edge. [2] set the cst bit in tstr to 1 to start the count operation. figure 12.10 example of input ca pture operation setting procedure
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 461 of 1164 rej09b0321-0200 (b) example of input capture operation: figure 12.11 shows an example of input capture operation. in this example both rising and falling edges have been selected as the tioca pin input capture input edge, the falling edge has been selected as the tiocb pin input capture input edge, and counter clearing by tgrb input capture has been designated for tcnt. tcnt value h'0180 h'0000 tioca tgra h'0010 h'0005 counter cleared by tiocb input (falling edge) h'0160 h'0005 h'0160 h'0010 tgrb h'0180 tiocb time figure 12.11 example of input capture operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 462 of 1164 rej09b0321-0200 12.4.2 synchronous operation in synchronous operation, the values in a number of tcnt counters can be rewritten simultaneously (synchronous presetting). also, a number of tcnt counters can be cleared simultaneously by making the appropriate setting in tcr (synchronous clearing). synchronous operation enables tgr to be incr emented with respect to a single time base. channels 0 to 4 can all be designated for synchronous operation. channel 5 cannot be used for synchronous operation. (1) example of synchronous operation setting procedure: figure 12.12 shows an example of the synchronous operation setting procedure. no yes set synchronous operation clearing source generation channel? select counter clearing source start count set synchronous counter clearing start count [1] [3] [5] [4] [5] [2] synchronous operation selection [1] set to 1 the sync bits in tsyr corresponding to the channels to be designated for synchronous operation. [2] when the tcnt counter of any of the channels designated for synchronous operation is written to, the same value is simultaneously written to the other tcnt counters. [3] use bits cclr2 to cclr0 in tcr to specify tcnt clearing by input capture/output compare, etc. [4] use bits cclr2 to cclr0 in tcr to designate synchronous clearing for the counter clearing source. [5] set to 1 the cst bits in tstr for the relevant channels, to start the count operation. set tcnt synchronous presetting synchronous clearing figure 12.12 example of synchronous operation setting procedure
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 463 of 1164 rej09b0321-0200 (2) example of synchronous operation figure 12.13 shows an example of synchronous operation. in this example, synchronous operation and pwm mode 1 have been designated for channels 0 to 2, tgrb_0 compare match has been set as the channel 0 counter clearing source, and synchronous clearing has been set for the channel 1 and 2 counter clearing source. three-phase pwm waveforms are output from pins tioc0a, tioc1a, and tioc2a. at this time, synchronous presetting, and synchron ous clearing by tgrb_0 compare match, are performed for channel 0 to 2 tcnt counters, an d the data set in tgrb_0 is used as the pwm cycle. for details of pwm modes, see section 12.4.5, pwm modes. tcnt_0 to tcnt_2 values h'0000 tioc0a tioc1a tgrb_0 synchronous clearing by tgrb_0 compare match tgra_2 tgra_1 tgrb_2 tgra_0 tgrb_1 tioc2a time figure 12.13 example of synchronous operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 464 of 1164 rej09b0321-0200 12.4.3 buffer operation buffer operation, provided for channels 0, 3, and 4, enables tgrc and tgrd to be used as buffer registers. in channel 0, tgrf can also be used as a buffer register. buffer operation differs depending on whether tgr has been designated as an input capture register or as a compare match register. note: tgre_0 cannot be designat ed as an input capture regist er and can only operate as a compare match register. table 12.43 shows the register combinations used in buffer operation. table 12.43 register combinat ions in buffer operation channel timer general re gister buffer register 0 tgra_0 tgrc_0 tgrb_0 tgrd_0 tgre_0 tgrf_0 3 tgra_3 tgrc_3 tgrb_3 tgrd_3 4 tgra_4 tgrc_4 tgrb_4 tgrd_4 ? when tgr is an output compare register when a compare match occurs, the value in the bu ffer register for the corresponding channel is transferred to the timer general register. this operation is illustrated in figure 12.14. buffer register timer general register tcnt comparator compare match signal figure 12.14 compare match buffer operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 465 of 1164 rej09b0321-0200 ? when tgr is an inpu t capture register when input capture occurs, the value in tcnt is transferred to tgr and the value previously held in the timer general register is transferred to the buffer register. this operation is illustrated in figure 12.15. buffer register timer general register tcnt input capture signal figure 12.15 input capture buffer operation (1) example of buffer operation setting procedure figure 12.16 shows an example of the buffer operation setting procedure. buffer operation select tgr function set buffer operation start count [1] [2] [3] [1] designate tgr as an input capture register or output compare register by means of tior. [2] designate tgr for buffer operation with bits bfa and bfb in tmdr. [3] set the cst bit in tstr to 1 start the count operation. figure 12.16 example of buffe r operation setting procedure
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 466 of 1164 rej09b0321-0200 (2) examples of buffer operation (a) when tgr is an output compare register figure 12.17 shows an operation example in which pwm mode 1 has been designated for channel 0, and buffer operation has been designated for tgra and tgrc. the settings used in this example are tcnt clearing by compare match b, 1 output at compare match a, and 0 output at compare match b. in this example, the ttsa bit in tbtm is cleared to 0. as buffer operation has been se t, when compare match a occurs the output changes and the value in buffer register tgrc is simultaneously transferred to timer general register tgra. this operation is repeated each time that compare match a occurs. for details of pwm modes, see section 12.4.5, pwm modes. tcnt value tgrb_0 h'0000 tgrc_0 tgra_0 h'0200 h'0520 tioca h'0200 h'0450 h'0520 h'0450 tgra_0 h'0450 h'0200 transfer time figure 12.17 example of buffer operation (1)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 467 of 1164 rej09b0321-0200 (b) when tgr is an input capture register figure 12.18 shows an operation example in which tgra has been designated as an input capture register, and buffer operation has been designated for tgra and tgrc. counter clearing by tgra input capture has been set for tcnt, and both rising and falling edges have been selected as the tioca pin input capture input edge. as buffer operation has been set, when the tcnt value is stored in tgra upon the occurrence of input capture a, the value previously stored in tgra is simultaneously transferred to tgrc. tcnt value h'09fb h'0000 tgrc time h'0532 tioca tgra h'0f07 h'0532 h'0f07 h'0532 h'0f07 h'09fb figure 12.18 example of buffer operation (2)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 468 of 1164 rej09b0321-0200 (3) selecting timing for transfer from buffe r registers to timer general registers in buffer operation: the timing for transfer from buff er registers to timer general re gisters can be selected in pwm mode 1 or 2 for channel 0 or in pwm mode 1 for channels 3 and 4 by setting the buffer operation transfer mode registers (tbt m_0, tbtm_3, and tbtm_4). either compare match (initial setting) or tcnt clearing can be selected for th e transfer timing. tcnt clearing as transfer timing is one of the following cases. ? when tcnt overflows (h'ffff to h'0000) ? when h'0000 is written to tcnt during counting ? when tcnt is cleared to h'0000 under the condition specified in the cclr2 to cclr0 bits in tcr note: tbtm must be modified only while tcnt stops. figure 12.19 shows an operation example in which pwm mode 1 is designated for channel 0 and buffer operation is designated for tgra_0 and tg rc_0. the settings used in this example are tcnt_0 clearing by compare match b, 1 output at compare match a, and 0 output at compare match b. the ttsa bit in tbtm_0 is set to 1. tcnt_0 value h'0000 tgra_0 time tioca tgrc_0 h'0520 h'0520 h'0450 h'0450 h'0200 h'0520 h'0450 h'0200 h'0200 tgrb_0 tgra_0 transfer figure 12.19 example of buffer operation when tcnt_0 clearing is selected for tgrc_0 to tgra_0 transfer timing
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 469 of 1164 rej09b0321-0200 12.4.4 cascaded operation in cascaded operation, two 16-bit counters for different channels are used together as a 32-bit counter. this function works by counting the channel 1 counter clock upon overflow/underflow of tcnt_2 as set in bits tpsc0 to tpsc2 in tcr. underflow occurs only when the lower 16-bit tcnt is in phase-counting mode. table 12.44 shows the register combinations used in cascaded operation. note: when phase counting mode is set for channel 1, the counter clock setting is invalid and the counters operates independen tly in phase counting mode. table 12.44 cascaded combinations combination upper 16 bits lower 16 bits channels 1 and 2 tcnt_1 tcnt_2 for simultaneous input capture of tcnt_1 and tcnt_2 during cascaded operation, additional input capture input pins can be specified by the input capture control register (ticcr). for input capture in cascade connection, refer to section 12.7.22, simultaneous capture of tcnt_1 and tcnt_2 in cascade connection. table 12.45 show the ticcr setting and input capture input pins. table 12.45 ticcr setting and input capture input pins target input capture ticcr setti ng input capture input pins i2ae bit = 0 (initial value) tioc1a input capture from tcnt_1 to tgra_1 i2ae bit = 1 tioc1a, tioc2a i2be bit = 0 (initial value) tioc1b input capture from tcnt_1 to tgrb_1 i2be bit = 1 tioc1b, tioc2b i1ae bit = 0 (initial value) tioc2a input capture from tcnt_2 to tgra_2 i1ae bit = 1 tioc2a, tioc1a i1be bit = 0 (initial value) tioc2b input capture from tcnt_2 to tgrb_2 i1be bit = 1 tioc2b, tioc1b
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 470 of 1164 rej09b0321-0200 (1) example of cascaded op eration setting procedure figure 12.20 shows an example of the setting procedure for cascaded operation. cascaded operation set cascading start count [1] [2] [1] set bits tpsc2 to tpsc0 in the channel 1 tcr to b'1111 to select tcnt_2 overflow/ underflow counting. [2] set the cst bit in tstr for the upper and lower channel to 1 to start the count operation. figure 12.20 cascaded op eration setting procedure (2) cascaded operation example (a) figure 12.21 illustrates the operation when tcnt_2 overflow/underflow counting has been set for tcnt_1 and phase counting mode has been designated for channel 2. tcnt_1 is incremented by tcnt_2 overflow and decremented by tcnt_2 underflow. tclkc tcnt_2 fffd tcnt_1 0001 tclkd fffe ffff 0000 0001 0002 0001 0000 ffff 0000 0000 figure 12.21 cascaded operation example (a)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 471 of 1164 rej09b0321-0200 (3) cascaded operation example (b) figure 12.22 illustrates the operation when tcnt_1 and tcnt_2 have been cascaded and the i2ae bit in ticcr has been set to 1 to include the tioc2a pin in the tgra_1 input capture conditions. in this example, the ioa0 to ioa3 bits in tior_1 have selected the tioc1a rising edge for the input capture timing while the ioa0 to ioa3 bits in tior_2 have selected the tioc2a rising edge for the input capture timing. under these conditions, the rising edge of both tioc1a and tioc2a is used for the tgra_1 input capture condition. for the tgra_2 input capt ure condition, the tioc2a rising edge is used. tcnt_2 value h'0000 tgra_1 tgra_2 time tioc1a tioc2a tcnt_1 h'0514 h'0513 h'0512 h'0513 h'0512 h'c256 h'c256 h'ffff h'6128 as i1ae in ticcr is 0, data is not captured in tgra_2 at the tioc1a input timing. figure 12.22 cascaded operation example (b)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 472 of 1164 rej09b0321-0200 (4) cascaded operation example (c) figure 12.23 illustrates the operation when tcnt_1 and tcnt_2 have been cascaded and the i2ae and i1ae bits in ticcr have been set to 1 to include the tioc2a and tioc1a pins in the tgra_1 and tgra_2 input capture conditions, respect ively. in this example, the ioa0 to ioa3 bits in both tior_1 and tior_2 have selected both the rising and falling edges for the input capture timing. under these conditions, the ored result of tioc1a and tioc2a input is used for the tgra_1 and tgra_2 input capture conditions. tcnt_2 value h'0000 tgra_1 tgra_2 time tioc1a tioc2a tcnt_1 h'0514 h'0514 h'0513 h'0512 h'0513 h'0512 h'c256 h'c256 h'ffff h'6128 h'6128 h'2064 h'2064 h'9192 h'9192 figure 12.23 cascaded operation example (c)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 473 of 1164 rej09b0321-0200 (5) cascaded operation example (d) figure 12.24 illustrates the operation when tcnt_1 and tcnt_2 have been cascaded and the i2ae bit in ticcr has been set to 1 to include the tioc2a pin in the tgra_1 input capture conditions. in this example, the ioa0 to ioa3 bits in tior_1 have selected tgra_0 compare match or input capture occurrence for the input capture timing while the ioa0 to ioa3 bits in tior_2 have selected the tioc2a risi ng edge for the input capture timing. under these conditions, as tior_1 has selected tgra_0 compare match or input capture occurrence for the input capture timing, the tioc2a edge is not used for tgra_1 input capture condition although the i2ae bit in ticcr has been set to 1. tcnt_2 value h'0000 h'0000 tgra_1 tgra_2 time tioc1a tioc2a tcnt_1 h'0513 h'0512 h'0513 h'd000 h'ffff h'd000 tcnt_0 value time tgra_0 compare match between tcnt_0 and tgra_0 figure 12.24 cascaded operation example (d)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 474 of 1164 rej09b0321-0200 12.4.5 pwm modes in pwm mode, pwm waveforms are output from the output pins. the output level can be selected as 0, 1, or toggle output in respon se to a compare match of each tgr. tgr registers settings can be used to output a pwm waveform in the range of 0% to 100% duty. designating tgr compare match as the counter clearin g source enables the period to be set in that register. all channels can be designated for pwm mode independently. synchronous operation is also possible. there are two pwm modes, as described below. 1. pwm mode 1 pwm output is generated from the tioca and tiocc pins by pairing tgra with tgrb and tgrc with tgrd. the output specified by bits io a0 to ioa3 and ioc0 to ioc3 in tior is output from the tioca and tiocc pins at compare matches a and c, and the output specified by bits iob0 to iob3 and iod0 to iod3 in tior is output at compare matches b and d. the initial output value is the value set in tgra or tgrc. if the set values of paired tgrs are identical, the output value does not change when a compare match occurs. in pwm mode 1, a maximum 8-phase pwm output is possible. 2. pwm mode 2 pwm output is generated using one tgr as the cycle register and the others as duty registers. the output specified in tior is performed by means of compare matches. upon counter clearing by a synchronization regi ster compare match, the output va lue of each pin is the initial value set in tior. if the set values of the cy cle and duty registers ar e identical, the output value does not change when a compare match occurs. in pwm mode 2, a maximum 8-phase pwm output is possible in combination use with synchronous operation.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 475 of 1164 rej09b0321-0200 the correspondence between pwm output pins and registers is shown in table 12.46. table 12.46 pwm output registers and output pins output pins channel registers pwm mode 1 pwm mode 2 tgra_0 tioc0a tgrb_0 tioc0a tioc0b tgrc_0 tioc0c 0 tgrd_0 tioc0c tioc0d tgra_1 tioc1a 1 tgrb_1 tioc1a tioc1b tgra_2 tioc2a 2 tgrb_2 tioc2a tioc2b tgra_3 cannot be set tgrb_3 tioc3a cannot be set tgrc_3 cannot be set 3 tgrd_3 tioc3c cannot be set tgra_4 cannot be set tgrb_4 tioc4a cannot be set tgrc_4 cannot be set 4 tgrd_4 tioc4c cannot be set note: in pwm mode 2, pwm output is not possible fo r the tgr register in which the period is set.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 476 of 1164 rej09b0321-0200 (1) example of pwm mode setting procedure: figure 12.25 shows an example of the pwm mode setting procedure. pwm mode select counter clock select counter clearing source select waveform output level set tgr set pwm mode start count [1] [2] [3] [4] [5] [6] [1] select the counter clock with bits tpsc2 to tpsc0 in tcr. at the same time, select the input clock edge with bits ckeg1 and ckeg0 in tcr. [2] use bits cclr2 to cclr0 in tcr to select the tgr to be used as the tcnt clearing source. [3] use tior to designate the tgr as an output compare register, and select the initial value and output value. [4] set the cycle in the tgr selected in [2], and set the duty in the other tgr. [5] select the pwm mode with bits md3 to md0 in tmdr. [6] set the cst bit in tstr to 1 to start the count operation. figure 12.25 example of pwm mode setting procedure (2) examples of pwm mode operation figure 12.26 shows an example of pwm mode 1 operation. in this example, tgra compare match is set as the tcnt clearing source, 0 is set for the tgra initial output value and output value, and 1 is set as the tgrb output value. in this case, the value set in tgra is used as the period, and the values set in the tgrb registers are used as the duty levels.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 477 of 1164 rej09b0321-0200 tcnt value tgra h'0000 tioca time tgrb counter cleared by tgra compare match figure 12.26 example of pwm mode operation (1) figure 12.27 shows an example of pwm mode 2 operation. in this example, synchronous operation is designated for channels 0 and 1, tgrb_1 compare match is set as the tcnt clearing source, and 0 is set for the initial output value and 1 for the output value of the other tgr registers (tgra_0 to tgrd_0, tgra_1), outputting a 5-phase pwm waveform. in this case, the value set in tgrb_1 is used as th e cycle, and the values set in the other tgrs are used as the duty levels. tcnt value tgrb_1 h'0000 tioc0a counter cleared by tgrb_1 compare match time tgra_1 tgrd_0 tgrc_0 tgrb_0 tgra_0 tioc0b tioc0c tioc0d tioc1a figure 12.27 example of pwm mode operation (2)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 478 of 1164 rej09b0321-0200 figure 12.28 shows examples of pwm waveform output with 0% duty and 100% duty in pwm mode. tcnt value tgra h'0000 tioca time tgrb 0% duty tgrb rewritten tgrb rewritten tgrb rewritten tcnt value tgra h'0000 tioca time tgrb 100% duty tgrb rewritten tgrb rewritten tgrb rewritten output does not change when cycle register and duty register compare matches occur simultaneously tcnt value tgra h'0000 tioca time tgrb 100% duty tgrb rewritten tgrb rewritten tgrb rewritten output does not change when cycle register and duty register compare matches occur simultaneously 0% duty figure 12.28 example of pwm mode operation (3)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 479 of 1164 rej09b0321-0200 12.4.6 phase counting mode in phase counting mode, the phase difference betw een two external clock inputs is detected and tcnt is incremented/decremented accordingly. th is mode can be set for channels 1 and 2. when phase counting mode is set, an external cl ock is selected as the counter input clock and tcnt operates as an up/down-counter regardless of the setting of bits tpsc0 to tpsc2 and bits ckeg0 and ckeg1 in tcr. however, the functions of bits cclr0 and cclr1 in tcr, and of tior, tier, and tgr, are valid, and input capture /compare match and interrupt functions can be used. this can be used for two-phase encoder pulse input. if overflow occurs when tcnt is counting up, the tcfv flag in tsr is set; if underflow occurs when tcnt is counting down, the tcfu flag is set. the tcfd bit in tsr is the count direction flag. reading the tcfd flag reveals whether tcnt is counting up or down. table 12.47 shows the correspondence between external clock pins and channels. table 12.47 phase counting mode clock input pins external clock pins channels a-phase b-phase when channel 1 is set to phase counting mode tclka tclkb when channel 2 is set to phase counting mode tclkc tclkd
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 480 of 1164 rej09b0321-0200 (1) example of phase counting mode setting procedure figure 12.29 shows an example of the phase counting mode setting procedure. phase counting mode select phase counting mode start count [1] [2] [1] select phase counting mode with bits md3 to md0 in tmdr. [2] set the cst bit in tstr to 1 to start the count operation. figure 12.29 example of phase counting mode setting procedure
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 481 of 1164 rej09b0321-0200 (2) examples of phase counting mode operation in phase counting mode, tcnt counts up or down according to the phase difference between two external clocks. there are four modes, according to the count conditions. (a) phase counting mode 1 figure 12.30 shows an example of phase counting mode 1 operation, and table 12.48 summarizes the tcnt up/down-count conditions. tcnt value time tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) up-count down-count figure 12.30 example of phase counting mode 1 operation table 12.48 up/down-count condit ions in phase counting mode 1 tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) operation high level up-count low level low level high level high level down-count low level high level low level [legend] : rising edge : falling edge
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 482 of 1164 rej09b0321-0200 (b) phase counting mode 2 figure 12.31 shows an example of phase counting mode 2 operation, and table 12.49 summarizes the tcnt up/down-count conditions. time down-count up-count tcnt value tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) figure 12.31 example of phase counting mode 2 operation table 12.49 up/down-count condit ions in phase counting mode 2 tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) operation high level don't care low level don't care low level don't care high level up-count high level don't care low level don't care high level don't care low level down-count [legend] : rising edge : falling edge
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 483 of 1164 rej09b0321-0200 (c) phase counting mode 3 figure 12.32 shows an example of phase counting mode 3 operation, and table 12.50 summarizes the tcnt up/down-count conditions. time up-count down-count tcnt value tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) figure 12.32 example of phase counting mode 3 operation table 12.50 up/down-count condit ions in phase counting mode 3 tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) operation high level don't care low level don't care low level don't care high level up-count high level down-count low level don't care high level don't care low level don't care [legend] : rising edge : falling edge
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 484 of 1164 rej09b0321-0200 (d) phase counting mode 4 figure 12.33 shows an example of phase counting mode 4 operation, and table 12.51 summarizes the tcnt up/down-count conditions. time up-count down-count tcnt value tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) figure 12.33 example of phase counting mode 4 operation table 12.51 up/down-count condit ions in phase counting mode 4 tclka (channel 1) tclkc (channel 2) tclkb (channel 1) tclkd (channel 2) operation high level up-count low level low level don't care high level high level down-count low level high level don't care low level [legend] : rising edge : falling edge
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 485 of 1164 rej09b0321-0200 (3) phase counting mode application example: figure 12.34 shows an example in which channel 1 is in phase counting mode, and channel 1 is coupled with channel 0 to input servo motor 2-phase encoder pulses in order to detect position or speed. channel 1 is set to phase counting mode 1, and the encoder pulse a-phase and b-phase are input to tclka and tclkb. channel 0 operates with tcnt counter clearing by tgrc_0 compare match; tgra_0 and tgrc_0 are used for the compare match function an d are set with the speed control period and position control period. tgrb_0 is used for input capture, with tgrb_0 and tgrd_0 operating in buffer mode. the channel 1 counter input clock is designated as the tgrb_0 input capture source, and the pulse widths of 2-phase encoder 4-multiplication pulses are detected. tgra_1 and tgrb_1 for channel 1 are designated for input capture, and channel 0 tgra_0 and tgrc_0 compare matches are selected as the inpu t capture source and store the up/down-counter values for the control periods. this procedure enables the accurate detection of position and speed. tcnt_1 tcnt_0 channel 1 tgra_1 (speed period capture) tgra_0 (speed control period) tgrb_1 (position period capture) tgrc_0 (position control period) tgrb_0 (pulse width capture) tgrd_0 (buffer operation) channel 0 tclka tclkb edge detection circuit + - + - figure 12.34 phase counting mode application example
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 486 of 1164 rej09b0321-0200 12.4.7 reset-synchronized pwm mode in the reset-synchronized pwm mode, three-phase output of positive and negative pwm waveforms that share a common wave transition point can be obtained by combining channels 3 and 4. when set for reset-synchronized pwm mode, the tioc3b, tioc3d, tioc4a, tioc4c, tioc4b, and tioc4d pins function as pwm output pins and tcnt_3 functions as an upcounter. table 12.52 shows the pwm output pins used. table 12.53 shows the settings of the registers. table 12.52 output pins for reset-synchronized pwm mode channel output pin description 3 tioc3b pwm output pin 1 tioc3d pwm output pin 1' (negativ e-phase waveform of pwm output 1) 4 tioc4a pwm output pin 2 tioc4c pwm output pin 2' (negativ e-phase waveform of pwm output 2) tioc4b pwm output pin 3 tioc4d pwm output pin 3' (negativ e-phase waveform of pwm output 3) table 12.53 register settings fo r reset-synchronized pwm mode register description of setting tcnt_3 initial setting of h'0000 tcnt_4 initial setting of h'0000 tgra_3 set count cycle for tcnt_3 tgrb_3 sets the turning point for pwm wavefo rm output by the tioc3b and tioc3d pins tgra_4 sets the turning point for pwm wavefo rm output by the tioc4a and tioc4c pins tgrb_4 sets the turning point for pwm wavefo rm output by the tioc4b and tioc4d pins
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 487 of 1164 rej09b0321-0200 (1) procedure for selecting the reset-synchronized pwm mode figure 12.35 shows an example of procedure fo r selecting the reset synchronized pwm mode. stop counting select counter clock and counter clear source set tgr reset-synchronized pwm mode brushless dc motor control setting set tcnt enable waveform output set reset-synchronized pwm mode pwm cycle output enabling, pwm output level setting start count operation reset-synchronized pwm mode [1] clear the cst3 and cst4 bits in the tstr to 0 to halt the counting of tcnt. the reset-synchronized pwm mode must be set up while tcnt_3 and tcnt_4 are halted. [2] set bits tpsc2 to tpsc0 and ckeg1 and ckeg0 in the tcr_3 to select the counter clock and clock edge for channel 3. set bits cclr2 to cclr0 in the tcr_3 to select tgra compare-match as a counter clear source. [3] when performing brushless dc motor control, set bit bdc in the timer gate control register (tgcr) and set the feedback signal input source and output chopping or gate signal direct output. [4] reset tcnt_3 and tcnt_4 to h'0000. [5] tgra_3 is the period register. set the waveform period value in tgra_3. set the transition timing of the pwm output waveforms in tgrb_3, tgra_4, and tgrb_4. set times within the compare-match range of tcnt_3. x tgra_3 (x: set value). [6] select enabling/disabling of toggle output synchronized with the pmw cycle using bit psye in the timer output control register (tocr1), and set the pwm output level with bits olsp and olsn. when specifying the pwm output level by using tolbr as a buffer for tocr2, see figure 12.3. [7] set bits md3 to md0 in tmdr_3 to b'1000 to select the reset-synchronized pwm mode. do not set to tmdr_4. [8] set the enabling/disabling of the pwm waveform output pin in toer. [9] set the port control register and the port i/o register. [10] set the cst3 bit in the tstr to 1 to start the count operation. [1] [2] [3] [4] [5] [6] [7] [8] pfc setting [9] [10] note: the output waveform starts to toggle operation at the point of tcnt_3 = tgra_3 = x by setting x = tgra, i.e., cycle = duty. figure 12.35 procedure for sel ecting reset-synchronized pwm mode
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 488 of 1164 rej09b0321-0200 (2) reset-synchronized pwm mode operation figure 12.36 shows an example of operation in the reset-synchronized pwm mode. tcnt_3 and tcnt_4 operate as upcounters. the counter is cleared when a tcnt_3 and tgra_3 compare- match occurs, and then begins incrementing from h'0000. the pwm output pin output toggles with each occurrence of a tgrb_3, tgra_4, tgrb_4 compare-match, and upon counter clears. tgra_3 tgrb_3 tgrb_4 h'0000 tgra_4 tioc3b tioc3d tioc4a tioc4c tioc4b tioc4d time tcnt_3 and tcnt_4 values figure 12.36 reset-synchronized pwm mode operation example (when tocr's olsn = 1 and olsp = 1)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 489 of 1164 rej09b0321-0200 12.4.8 complementary pwm mode in the complementary pwm mode, three-phase output of non-overlapping positive and negative pwm waveforms can be obtained by combining channels 3 and 4. pwm waveforms without non- overlapping interval is also available. in complementary pwm mode, tioc3b, tioc3d, tioc4a, tioc4b, tioc4c, and tioc4d pins function as pwm output pins, the tioc3a pin can be set for toggle output synchronized with the pwm period. tcnt_3 and tcnt_4 function as up/down counters. table 12.54 shows the pwm output pins used. table 12.55 shows the settings of the registers used. table 12.54 output pins fo r complementary pwm mode channel output pin description 3 tioc3a toggle output synchroni zed with pwm period (or i/o port) tioc3b pwm output pin 1 tioc3c i/o port * tioc3d pwm output pin 1' (non-overlapping negative-phas e waveform of pwm output 1; pwm output without non-overlapping interval is also available) 4 tioc4a pwm output pin 2 tioc4b pwm output pin 3 tioc4c pwm output pin 2' (non-overlapping negative-phas e waveform of pwm output 2; pwm output without non-overlapping interval is also available) tioc4d pwm output pin 3' (non-overlapping negative-phas e waveform of pwm output 3; pwm output without non-overlapping interval is also available) note: * avoid setting the tioc3c pin as a time r i/o pin in the complementary pwm mode.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 490 of 1164 rej09b0321-0200 table 12.55 register settings for complementary pwm mode channel counter/register descri ption read/write from cpu 3 tcnt_3 start of up-count from value set in dead time register maskable by trwer setting * tgra_3 set tcnt_3 upper limit value (1/2 carrier cycle + dead time) maskable by trwer setting * tgrb_3 pwm output 1 compare register maskable by trwer setting * tgrc_3 tgra_3 buffer register always readable/writable tgrd_3 pwm output 1/tgrb_3 buffer register always readable/writable 4 tcnt_4 up-count start, initialized to h'0000 maskable by trwer setting * tgra_4 pwm output 2 compare register maskable by trwer setting * tgrb_4 pwm output 3 compare register maskable by trwer setting * tgrc_4 pwm output 2/tgra_4 buffer register always readable/writable tgrd_4 pwm output 3/tgrb_4 buffer register always readable/writable timer dead time data register (tddr) set tcnt_4 and tcnt_3 offset value (dead time value) maskable by trwer setting * timer cycle data register (tcdr) set tcnt_4 upper limit value (1/2 carrier cycle) maskable by trwer setting * timer cycle buffer register (tcbr) tcdr buffer register always readable/writable subcounter (tcnts) subcounter for dead time generation read-only temporary register 1 (temp1) pwm output 1/tgrb_3 temporary register not readable/writable temporary register 2 (temp2) pwm output 2/tgra_4 temporary register not readable/writable temporary register 3 (temp3) pwm output 3/tgrb_4 temporary register not readable/writable note: * access can be enabled or disabled according to the setting of bit 0 (rwe) in trwer (timer read/write enable register).
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 491 of 1164 rej09b0321-0200 tgrc_3 tddr tcnt_3 tgrd_3 tgrd_4 tgrc_4 tgrb_3 temp 1 tgra_4 temp 2 tgrb_4 temp 3 tcnts tcnt_4 tgra_3 tcdr tcbr comparator comparator match signal match signal output controller pwm cycle output pwm output 1 pwm output 2 pwm output 3 pwm output 4 pwm output 5 pwm output 6 : registers that can always be read or written from the cpu : registers that cannot be read or written from the cpu (except for tcnts, which can only be read) : registers that can be read or written from the cpu (but for which access disabling can be set by trwer) tgra_3 compare- match interrupt tcnt_4 underflow interrupt figure 12.37 block diagram of channels 3 and 4 in complementary pwm mode
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 492 of 1164 rej09b0321-0200 (1) example of complementary pwm mode setting procedure an example of the complementary pwm mode setting procedure is shown in figure 12.38. complementary pwm mode stop count operation counter clock, counter clear source selection brushless dc motor control setting tcnt setting inter-channel synchronization setting tgr setting enable/disable dead time generation [1] clear bits cst3 and cst4 in the timer start register (tstr) to 0, and halt timer counter (tcnt) operation. perform complementary pwm mode setting when tcnt_3 and tcnt_4 are stopped. [2] set the same counter clock and clock edge for channels 3 and 4 with bits tpsc2 to tpsc0 and bits ckeg1 and ckeg0 in the timer control register (tcr). use bits cclr2 to cclr0 to set synchronous clearing only when restarting by a synchronous clear from another channel during complementary pwm mode operation. [3] when performing brushless dc motor control, set bit bdc in the timer gate control register (tgcr) and set the feedback signal input source and output chopping or gate signal direct output. [4] set the dead time in tcnt_3. set tcnt_4 to h'0000. [5] set only when restarting by a synchronous clear from another channel during complementary pwm mode operation. in this case, synchronize the channel generating the synchronous clear with channels 3 and 4 using the timer synchro register (tsyr). [6] set the output pwm duty in the duty registers (tgrb_3, tgra_4, tgrb_4) and buffer registers (tgrd_3, tgrc_4, tgrd_4). set the same initial value in each corresponding tgr. [7] this setting is necessary only when no dead time should be generated. make appropriate settings in the timer dead time enable register (tder) so that no dead time is generated. [8] set the dead time in the dead time register (tddr), 1/2 the carrier cycle in the carrier cycle data register (tcdr) and carrier cycle buffer register (tcbr), and 1/2 the carrier cycle plus the dead time in tgra_3 and tgrc_3. when no dead time generation is selected, set 1 in tddr and 1/2 the carrier cycle + 1 in tgra_3 and tgrc_3. [9] select enabling/disabling of toggle output synchronized with the pwm cycle using bit psye in the timer output control register 1 (tocr1), and set the pwm output level with bits olsp and olsn. when specifying the pwm output level by using tolbr as a buffer for tocr_2, see figure 12.3. [10] select complementary pwm mode in timer mode register 3 (tmdr_3). do not set in tmdr_4. [11] set enabling/disabling of pwm waveform output pin output in the timer output master enable register (toer). [12] set the port control register and the port i/o register. [13] set bits cst3 and cst4 in tstr to 1 simultaneously to start the count operation. [1] [2] [3] [4] [5] [6] [7] [8] [9] [11] dead time, carrier cycle setting pwm cycle output enabling, pwm output level setting complementary pwm mode setting enable waveform output start count operation [10] pfc setting [12] [13] figure 12.38 example of complementary pwm mode setting procedure
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 493 of 1164 rej09b0321-0200 (2) outline of complementary pwm mode operation in complementary pwm mode, 6-phase pwm output is possible. figure 12.39 illustrates counter operation in complementary pwm mode, and figure 12.40 shows an example of complementary pwm mode operation. (a) counter operation in complementary pwm mode, three counters?tcnt_3, tcnt_4, and tcnts?perform up/down-count operations. tcnt_3 is automatically initialized to the value set in tddr when complementary pwm mode is selected and the cst bit in tstr is 0. when the cst bit is set to 1, tcnt_3 counts up to the value set in tgra_3, then switches to down-counting when it matches tgra_3. when the tcnt3 value matches tddr, the counter switches to up-counting, and the operation is repeated in this way. tcnt_4 is initialized to h'0000. when the cst bit is set to 1, tcnt_4 counts up in synchronization with tcnt_3, and switches to down-counting when it matches tcdr. on reaching h'00 00, tcnt4 switches to up-counting, and the operation is re peated in this way. tcnts is a read-only counter. it need not be initialized. when tcnt_3 matches tcdr during tcnt_3 and tcnt_4 up/down-counting, down-counting is started, and when tcnts matches tcdr, th e operation switches to up-counting. when tcnts matches tgra_3, it is cleared to h'0000. when tcnt_4 matches tddr during tcnt_3 and tcnt_4 down-counting, up-counting is started, and when tcnts matches tddr, the operation switches to down-counting. when tcnts reaches h'0000, it is set with the value in tgra_3. tcnts is compared with the compare register and temporary register in which the pwm duty is set during the count operation only.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 494 of 1164 rej09b0321-0200 counter value tgra_3 tcdr tddr h'0000 tcnt_4 tcnts tcnt_3 tcnt_3 tcnt_4 tcnts time figure 12.39 complementary pwm mode counter operation (b) register operation in complementary pwm mode, nine registers are used, comprising compar e registers, buffer registers, and temporary registers. figure 12.40 shows an example of complementary pwm mode operation. the registers which are constantly compared with the counters to perform pwm output are tgrb_3, tgra_4, and tgrb_4. when these registers match the counter, the value set in bits olsn and olsp in the timer output control register (tocr) is output. the buffer registers for th ese compare registers are tgrd_3, tgrc_4, and tgrd_4. between a buffer register and compare register there is a temporary register. the temporary registers cannot be accessed by the cpu. data in a compare register is changed by writing the new data to the corresponding buffer register. the buffer registers can be read or written at any time. the data written to a buffer register is constantly transferred to the tempor ary register in the ta interval. data is not transferred to the temporary register in the tb interval. data written to a buffer register in this interval is transferred to th e temporary register at th e end of the tb interval. the value transferred to a temporary register is transferred to the compare register when tcnts for which the tb interval ends matches tgra_3 when counting up, or h'0000 when counting down. the timing for transfer from the temporary register to the co mpare register can be selected with bits md3 to md0 in the timer mode regist er (tmdr). figure 12.4 0 shows an example in which the mode is selected in which the change is made in the trough. in the tb interval (tb1 in figure 12.40) in whic h data transfer to the temporary register is not performed, the temporary register has the same function as the compare register, and is compared
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 495 of 1164 rej09b0321-0200 with the counter. in this interval, therefore, there are two compare match registers for one-phase output, with the compare register containing the pre-change data, and the temporary register containing the new data. in this interval, the three counters?tcnt_3, tcnt_4, and tcnts? and two registers?compare register and temporary register?are compared, and pwm output controlled accordingly. tgra_3 tcdr tgra_4 tgrc_4 tddr h'0000 buffer register tgrc_4 temporary register temp2 compare register tgra_4 output waveform output waveform tb2 ta tb1 ta tb2 ta tcnt_3 tcnt_4 tcnts (output waveform is active-low) h'6400 h'0080 h'6400 h'6400 h'0080 h'0080 transfer from temporary register to compare register transfer from temporary register to compare register figure 12.40 example of complementary pwm mode operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 496 of 1164 rej09b0321-0200 (c) initialization in complementary pwm mode, there ar e six registers that must be in itialized. in addition, there is a register that specifies whether to generate dead time (it should be used only when dead time generation should be disabled). before setting complementary pwm mode with bits md3 to md0 in the timer mode register (tmdr), the following initial register values must be set. tgrc_3 operates as the buffer re gister for tgra_3, and should be set with 1/2 the pwm carrier cycle + dead time td. the timer cycle buffer regist er (tcbr) operates as the buffer register for the timer cycle data register (tcdr), and should be set with 1/2 the pwm carrier cycle. set dead time td in the timer dead time data register (tddr). when dead time is not needed, the tder bit in the timer dead time enable register (tder) should be cleared to 0, tgrc_3 and tgra_3 should be set to 1/2 the pwm carrier cycle + 1, and tddr should be set to 1. set the respective initial pwm duty values in buffer registers tgrd_3 , tgrc_4, and tgrd_4. the values set in the five buffe r registers excluding tddr are tr ansferred simultaneously to the corresponding compare re gisters when complementary pwm mode is set. set tcnt_4 to h'0000 before setting complementary pwm mode. table 12.56 registers and count ers requiring initialization register/counter set value tgrc_3 1/2 pwm carrier cycle + dead time td (1/2 pwm carrier cycle + 1 when dead time generation is disabled by tder) tddr dead time td (1 when dead time generation is disabled by tder) tcbr 1/2 pwm carrier cycle tgrd_3, tgrc_4, tgrd_4 initial pwm duty value for each phase tcnt_4 h'0000 note: the tgrc_3 set value must be the sum of 1/2 the pwm carrier cycle set in tcbr and dead time td set in tddr. when dead time generation is disabled by tder, tgrc_3 must be set to 1/2 the pwm carrier cycle + 1.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 497 of 1164 rej09b0321-0200 (d) pwm output level setting in complementary pwm mode, the pwm pulse output level is set with bits olsn and olsp in timer output control register 1 (tocr1) or bits ols1p to ols3p and ols1n to ols3n in timer output control register 2 (tocr2). the output level can be set for each of the three positive phases and three negative phases of 6- phase output. complementary pwm mode should be cleared before setting or changing output levels. (e) dead time setting in complementary pwm mode, pwm pulses are output with a non-overlapping relationship between the positive and negative phases. this non-overlap time is called the dead time. the non-overlap time is set in the timer dead time data register (tddr). the value set in tddr is used as the tcnt_3 counter start value, and creates non-overlap betw een tcnt_3 and tcnt_4. complementary pwm mode should be cleared before changing the contents of tddr. (f) dead time suppressing dead time generation is suppressed by clearing the tder bit in the timer dead time enable register (tder) to 0. tder can be cleared to 0 only when 0 is written to it after reading tder = 1. tgra_3 and tgrc_3 should be set to 1/2 pwm carrier cycle + 1 and the timer dead time data register (tddr) should be set to 1. by the above settings, pwm waveforms without dead time can be obtained. figure 12.41 shows an example of operation without dead time.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 498 of 1164 rej09b0321-0200 tgra_3 =tcdr + 1 tcdr tgra_4 tgrc_4 tddr=1 h'0000 buffer register tgrc_4 temporary register temp2 compare register tgra_4 output waveform output waveform t a t b1 t a t b2 t a tcnt_3 tcnt_4 tcnts output waveform is active-low. data1 data2 data1 data2 data1 data2 transfer from temporary register to compare register transfer from temporary register to compare register figure 12.41 example of operation without dead time
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 499 of 1164 rej09b0321-0200 (g) pwm cycle setting in complementary pwm mode, the pwm pulse cycle is set in tw o registers?tgra_3, in which the tcnt_3 upper limit value is set, and tcdr, in which the tcnt_4 upper limit value is set. the settings should be made so as to achieve the following relationship between these two registers: with dead time: tgra_3 set value = tcdr set value + tddr set value without dead time: tgra_3 set value = tcdr set value + 1 the tgra_3 and tcdr settings are made by setting the values in buffer registers tgrc_3 and tcbr. the values set in tgrc_3 and tcbr ar e transferred simultaneously to tgra_3 and tcdr in accordance with the tran sfer timing selected with bits md3 to md0 in the timer mode register (tmdr). the updated pwm cycle is reflected from the next cy cle when the data update is performed at the crest, and from the cu rrent cycle when performed in the trough. figure 12.42 illustrates the operation when the pwm cycle is updated at the crest. see the following section, register data updatin g, for the method of updating the data in each buffer register. counter value tgrc_3 update tgra_3 update tgra_3 tcnt_3 tcnt_4 time figure 12.42 example of pwm cycle updating
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 500 of 1164 rej09b0321-0200 (h) register data updating in complementary pwm mode, the buff er register is used to update the data in a compare register. the update data can be written to the buffer regi ster at any time. there are five pwm duty and carrier cycle registers that ha ve buffer registers and can be updated during operation. there is a temporary register between each of these registers and its buffer register. when subcounter tcnts is not counting, if buffer register data is updated, the temporary register value is also rewritten. transfer is not performed from buffer register s to temporary registers when tcnts is counting; in this case, the value written to a buffer register is transferred after tcnts halts. the temporary register value is transferred to th e compare register at the data update timing set with bits md3 to md0 in the timer mode regist er (tmdr). figure 12.4 3 shows an example of data updating in complementary pwm mode. th is example shows the mode in which data updating is performed at both the counter crest and trough. when rewriting buffer register data, a write to tgrd_4 must be performed at the end of the update. data transfer from the buffer registers to the temporary registers is performed simultaneously for all five registers after the write to tgrd_4. a write to tgrd_4 must be performed after writing data to the registers to be updated, even when not updating all five registers, or when updating the tgrd_4 data. in this case, the data written to tgrd_4 should be the same as the data prior to the write operation.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 501 of 1164 rej09b0321-0200 data update timing: counter crest and trough transfer from temporary register to compare register transfer from temporary register to compare register transfer from temporary register to compare register transfer from temporary register to compare register transfer from temporary register to compare register transfer from temporary register to compare register counter value tgra_3 tgrc_4 tgra_4 h'0000 br data1 data2 data3 data4 data5 data6 data1 data1 data2 data3 data4 data6 data2 data3 data4 data5 data6 temp_r gr time : compare register : buffer register figure 12.43 example of data update in complementary pwm mode
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 502 of 1164 rej09b0321-0200 (i) initial output in complementary pwm mode in complementary pwm mode, the initial output is determined by the setting of bits olsn and olsp in timer output control register 1 (tocr1) or bits ols1n to ols3n and ols1p to ols3p in timer output control register 2 (tocr2). this initial output is the pwm pulse non-active level, and is output from when complementary pwm mode is set with the timer mode register (tmdr) until tcnt_4 exceeds the value set in the dead time register (tddr). figure 12.44 shows an example of the initial output in complementary pwm mode. an example of the waveform when the initial pwm duty value is smaller than the tddr value is shown in figure 12.45. timer output control register settings olsn bit: 0 (initial output: high; active level: low) olsp bit: 0 (initial output: high; active level: low) tcnt_3 and tcnt_4 values tgra_4 tddr tcnt_3 tcnt_4 initial output dead time time active level active level tcnt_3 and tcnt_4 count start (tstr setting) complementary pwm mode (tmdr setting) positive phase output negative phase output figure 12.44 example of initial ou tput in complementary pwm mode (1)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 503 of 1164 rej09b0321-0200 timer output control register settings olsn bit: 0 (initial output: high; active level: low) olsp bit: 0 (initial output: high; active level: low) tcnt_3 and tcnt_4 values tgra_4 tddr tcnt_3 tcnt_4 initial output time active level tcnt_3 and tcnt_4 count start (tstr setting) complementary pwm mode (tmdr setting) positive phase output negative phase output figure 12.45 example of initial output in complementary pwm mode (2)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 504 of 1164 rej09b0321-0200 (j) 10. complementary pwm mode pwm output generation method in complementary pwm mode, 3-phase output is performed of pwm waveforms with a non- overlap time between the positive and negative phas es. this non-overlap ti me is called the dead time. a pwm waveform is generated by output of the output level selected in the timer output control register in the event of a compare-match between a counter and data register. while tcnts is counting, data register and temporary register values are simultaneously compared to create consecutive pwm pulses from 0 to 100%. the relative timing of on and off compare-match occurrence may vary, but the comp are-match that turns off each ph ase takes precedence to secure the dead time and ensure that the positive phase and negative phase on times do not overlap. figures 12.46 to 12.48 show examples of waveform generation in complementary pwm mode. the positive phase/negative phase off timing is generated by a compare-match with the solid-line counter, and the on timing by a compare-match with the dotted-line counter operating with a delay of the dead time behind the solid-line counter. in the t1 period, compare-match a that turns off the negative phase has the highest priority, and compare-matches occurring prior to a are ignored. in the t2 period, compare-match c that turns off the positive phase has the highest priority, and compare-matches occurring prior to c are ignored. in normal cases, compare-matches occur in the order a b c d (or c d a' b' ), as shown in figure 12.46. if compare-matches deviate from the a b c d order, since the time for which the negative phase is off is less than twice the dead time, the figure shows the positive phase is not being turned on. if compare-matches deviate from the c d a' b' order, since the time for which the positive phase is off is less than twice the dead time, the figure shows the negative phase is not being turned on. if compare-match c occurs first following compare-match a , as shown in figure 12.47, compare- match b is ignored, and the negative phase is turned off by compare-match d . this is because turning off of the positive phase has prior ity due to the occurrence of compare-match c (positive phase off timing) before compare-match b (positive phase on timing) (consequently, the waveform does not change since the positive phase goes from off to off). similarly, in the example in figure 12.48, compare-match a' with the new data in the temporary register occurs before compare-match c , but other compare-matches occurring up to c , which turns off the positive phase, are ignored. as a result, the negative phase is not turned on. thus, in complementary pwm mode, compare-matches at turn-off timings take precedence, and turn-on timing compare-matches that occur befo re a turn-off timing compare-match are ignored.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 505 of 1164 rej09b0321-0200 t2 period t1 period t1 period ab c a' b' d tgra_3 tcdr tddr h'0000 positive phase negative phase figure 12.46 example of complementary pwm mode waveform output (1) t2 period t1 period t1 period tgra_3 tcdr tddr h'0000 positive phase negative phase c d a a b b figure 12.47 example of complementary pwm mode waveform output (2)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 506 of 1164 rej09b0321-0200 ab c a' b' d t1 period t2 period t1 period tgra_3 tcdr tddr h'0000 positive phase negative phase figure 12.48 example of complementary pwm mode waveform output (3) a b c d a' b' t2 period t1 period t1 period tgra_3 tcdr tddr h'0000 positive phase negative phase figure 12.49 example of complementary pwm mode 0% and 100% waveform output (1)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 507 of 1164 rej09b0321-0200 t2 period t1 period t1 period tgra_3 tcdr tddr h'0000 positive phase negative phase a c d a b b figure 12.50 example of complementary pwm mode 0% and 100% waveform output (2) t2 period t1 period t1 period a b c d tgra_3 tcdr tddr h'0000 positive phase negative phase figure 12.51 example of complementary pwm mode 0% and 100% waveform output (3)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 508 of 1164 rej09b0321-0200 tgra_3 tcdr tddr h'0000 positive phase negative phase t2 period t1 period t1 period a b c b' d a' figure 12.52 example of complementary pwm mode 0% and 100% waveform output (4) cad b t2 period t1 period t1 period tgra_3 tcdr tddr h'0000 positive phase negative phase figure 12.53 example of complementary pwm mode 0% and 100% waveform output (5)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 509 of 1164 rej09b0321-0200 (k) 11. complementary pwm mode 0% and 100% duty output in complementary pwm mode, 0% and 100% duty cycles can be output as required. figures 12.49 to 12.53 show output examples. 100% duty output is performed when the data register value is set to h'0000. the waveform in this case has a positive phase with a 100% on-state. 0% duty output is performed when the data register value is set to the same value as tgra_3 . the waveform in this case has a positive phase with a 100% off-state. on and off compare-matches occur simultaneously, but if a turn-on compare-match and turn-off compare-match for the same phase occur simultaneously, both compare-matches are ignored and the waveform does not change. (l) 12. toggle output sync hronized with pwm cycle in complementary pwm mode, toggle output can be performed in synchronization with the pwm carrier cycle by setting the psye bit to 1 in the timer output control register (tocr). an example of a toggle output waveform is shown in figure 12.54. this output is toggled by a compare-match between tcnt_3 and tgra_3 and a compare-match between tcnt4 and h'0000. the output pin for this toggle output is the tioc3a pin. the initial output is 1. tgra_3 h'0000 toggle output tioc3a pin tcnt_4 tcnt_3 figure 12.54 example of toggle output waveform synchronized with pwm output
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 510 of 1164 rej09b0321-0200 (m) counter clearing by another channel in complementary pwm mode, by setting a mode for synchronization with another channel by means of the timer synchronous register (tsyr), and selecting synchronous clearing with bits cclr2 to cclr0 in the timer control register (tcr), it is possible to have tcnt_3, tcnt_4, and tcnts cleared by another channel. figure 12.55 illustrates the operation. use of this function enables counter clearing and restarting to be performed by means of an external signal. tgra_3 tcdr tddr h'0000 channel 1 input capture a tcnt_1 tcnt_3 tcnt_4 tcnts synchronous counter clearing by channel 1 input capture a figure 12.55 counter clearing sy nchronized with another channel
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 511 of 1164 rej09b0321-0200 (n) output waveform control at synchronou s counter clearing in complementary pwm mode setting the wre bit in twcr to 1 suppresses in itial output when synchronous counter clearing occurs in the tb interval at the trough in comp lementary pwm mode and controls abrupt change in duty cycle at synchr onous counter clearing. initial output suppression is applicable only when synchronous clearing occurs in the tb interval at the trough as indicated by (10) or (11) in figure 12.56. when synchronous clearing occurs outside that interval, the initial value specified by the ols bits in tocr is output. even in the tb interval at the trough, if synchr onous clearing occurs in the initial value output period (indicated by (1) in figure 12.56) immediat ely after the counters start operat ion, initial value output is not suppressed. in the mtu2, synchronous clearing generated in ch annels 0 to 2 in the mtu2 can cause counter clearing. tb interval tb interval tb interval tgra_3 tgrb_3 tcdr tcnt_3 tcnt_4 tddr h'0000 positive phase negative phase output waveform is active-low (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) counter start figure 12.56 timing for synchronous counter clearing
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 512 of 1164 rej09b0321-0200 ? example of procedure for setting output waveform control at synchronous counter clearing in complementary pwm mode an example of the procedure for setting output waveform control at synchronous counter clearing in complementary pwm mode is shown in figure 12.57. stop count operation output waveform control at synchronous counter clearing set twcr and complementary pwm mode start count operation output waveform control at synchronous counter clearing [1] [2] [3] [1] clear bits cst3 and cst4 in the timer start register (tstr) to 0, and halt timer counter (tcnt) operation. perform twcr setting while tcnt_3 and tcnt_4 are stopped. [2] read bit wre in twcr and then write 1 to it to suppress initial value output at counter clearing. [3] set bits cst3 and cst4 in tstr to 1 to start count operation. figure 12.57 example of procedure for setting output waveform control at synchronous counter clearing in complementary pwm mode ? examples of output waveform control at synchronous counter clearing in complementary pwm mode figures 12.58 to 12.61 show examples of output waveform control in which the mtu2 operates in complementary pwm mode and synchronous counter clearing is generated while the wre bit in twcr is set to 1. in the examples shown in figures 12.58 to 12.61, synchronous counter clearing occurs at timing (3), (6), (8), and (11) shown in figure 12.56, respectively.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 513 of 1164 rej09b0321-0200 tgra_3 tgrb_3 tcdr tddr h'0000 positive phase negative phase output waveform is active-low. synchronous clearing tcnt_3 (mtu2) tcnt_4 (mtu2) bit wre = 1 figure 12.58 example of synchronous clearing in dead time during up-counting (timing (3) in figure 12.56; bit wre of twcr in mtu2 is 1) positive phase negative phase output waveform is active-low. synchronous clearing bit wre = 1 tcnt_3 (mtu2) tcnt_4 (mtu2) tgra_3 tgrb_3 tcdr tddr h'0000 figure 12.59 example of synchronous clearing in interval tb at crest (timing (6) in figure 12.56; bit wre of twcr in mtu2 is 1)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 514 of 1164 rej09b0321-0200 positive phase negative phase output waveform is active-low. synchronous clearing bit wre = 1 tcnt_3 (mtu2) tcnt_4 (mtu2) tgra_3 tgrb_3 tcdr tddr h'0000 figure 12.60 example of synchronous clearing in dead time during down-counting (timing (8) in figure 12.56; bit wre of twcr is 1) positive phase negative phase output waveform is active-low. synchronous clearing bit wre = 1 tgra_3 tgrb_3 tcdr tddr h'0000 initial value output is suppressed. tcnt_3 (mtu2) tcnt_4 (mtu2) figure 12.61 example of synchronous clearing in interval tb at trough (timing (11) in figure 12.56; bit wre of twcr is 1)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 515 of 1164 rej09b0321-0200 (o) counter clearing by tgra_3 compare match in complementary pwm mode, by setting the cce bit in the timer waveform control register (twcr), it is possible to have tcnt_3, tcnt _4, and tcnts cleared by tgra_3 compare match. figure 12.62 illustrates an operation example. notes: 1. use this function only in complementary pwm mode 1 (transfer at crest). 2. do not specify synchronous clearing by another channel (do not set the sync0 to sync4 bits in the timer synchronous register (tsyr) to 1). 3. do not set the pwm duty value to h'0000. 4. do not set the psye bit in timer output control register 1 (tocr1) to 1. tgra_3 tgrb_3 tcdr tddr h'0000 output waveform output waveform output waveform is active-high. counter cleared by tgra_3 compare match figure 12.62 example of counter clea ring operation by tgra_3 compare match
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 516 of 1164 rej09b0321-0200 (p) example of ac synchronous motor (bru shless dc motor) driv e waveform output in complementary pwm mode, a brushless dc motor can easily be controlled using the timer gate control register (tgcr). figures 12.63 to 12.66 show examples of brushless dc motor drive waveforms created using tgcr. when output phase switching for a 3-phase brushless dc motor is performed by means of external signals detected with a hall element, etc., clear the fb bit in tgcr to 0. in this case, the external signals indicating the polarity position are input to channel 0 timer input pins tioc0a, tioc0b, and tioc0c (set with pfc). when an edge is detected at pin tioc0a, tioc0b, or tioc0c, the output on/off state is switched automatically. when the fb bit is 1, the output on/off state is switched when the uf, vf, or wf bit in tgcr is cleared to 0 or set to 1. the drive waveforms are output from the complementary pwm mode 6-phase output pins. with this 6-phase output, in the case of on output, it is possible to use complementary pwm mode output and perform chopping output by setting the n bit or p bit to 1. when the n bit or p bit is 0, level output is selected. the 6-phase output active level (on output level) can be set with the olsn and olsp bits in the timer output control register (tocr) regardless of the setting of the n and p bits. external input tioc0a pin tioc0b pin tioc0c pin tioc3b pin tioc3d pin tioc4a pin tioc4c pin tioc4b pin tioc4d pin 6-phase output when bdc = 1, n = 0, p = 0, fb = 0, output active level = high figure 12.63 example of output phase switching by external input (1)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 517 of 1164 rej09b0321-0200 external input tioc0a pin tioc0b pin tioc0c pin tioc3b pin tioc3d pin tioc4a pin tioc4c pin tioc4b pin tioc4d pin 6-phase output when bdc = 1, n = 1, p = 1, fb = 0, output active level = high figure 12.64 example of output phase switching by external input (2) tgcr uf bit vf bit wf bit tioc3b pin tioc3d pin tioc4a pin tioc4c pin tioc4b pin tioc4d pin 6-phase output when bdc = 1, n = 0, p = 0, fb = 1, output active level = high figure 12.65 example of output phase switching by means of uf, vf, wf bit settings (1)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 518 of 1164 rej09b0321-0200 tgcr uf bit vf bit wf bit tioc3b pin tioc3d pin tioc4a pin tioc4c pin tioc4b pin tioc4d pin 6-phase output when bdc = 1, n = 1, p = 1, fb = 1, output active level = high figure 12.66 example of output phase switching by means of uf, vf, wf bit settings (2) (q) a/d converter start request setting in complementary pwm mode, an a/d converter start request can be issued using a tgra_3 compare-match, tcnt_4 underflow (trough), or compare-match on a channel other than channels 3 and 4. when start requests using a tgra_3 compare-matc h are specified, a/d conversion can be started at the crest of the tcnt_3 count. a/d converter start requests can be set by setting the ttge bit to 1 in the timer interrupt enable register (tier). to issue an a/d converter start request at a tcnt_4 underflow (trough), set the ttge2 bit in tier_4 to 1.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 519 of 1164 rej09b0321-0200 (3) interrupt skipping in complementary pwm mode: interrupts tgia_3 (at the crest) and tciv_4 (at the trough) in channels 3 and 4 can be skipped up to seven times by making settings in the timer interrupt skipping set register (titcr). transfers from a buffer register to a temporary re gister or a compare regi ster can be skipped in coordination with interrupt skipping by making se ttings in the timer buff er transfer register (tbter). for the linkage with buffer registers, re fer to description (c), buffer transfer control linked with interrupt skipping, below. a/d converter start requests generated by the a/d converter start request delaying function can also be skipped in coordination with interrupt skipping by making settings in the timer a/d converter request control register (tadcr). for th e linkage with the a/d converter start request delaying function, refer to section 12.4.9, a/d converter start request delaying function. the setting of the timer interrupt skipping setting register (titcr) must be done while the tgia_3 and tciv_4 interrupt requests are disabled by the settings of registers tier_3 and tier_4 along with under the conditions in which tgfa_3 and tcfv_4 flag settings by compare match never occur. before changing the skipping count, be sure to clear the t3aen and t4ven bits to 0 to clear the skipping counter. (a) example of interrupt skippi ng operation setting procedure figure 12.67 shows an example of the interrupt skipping operation setting procedure. figure 12.68 shows the periods during which interrupt skipping count can be changed. clear interrupt skipping counter interrupt skipping set skipping count and enable interrupt skipping note: the setting of titcr must be done while the tgia_3 and tciv_4 interrupt requests are disabled by the settings of registers tier_3 and tier_4 along with under the conditions in which tgfa_3 and tcfv_4 flag settings by compare match never occur. before changing the skipping count, be sure to clear the t3aen and t4ven bits to 0 to clear the skipping counter. [1] [2] [1] set bits t3aen and t4ven in the timer interrupt skipping set register (titcr) to 0 to clear the skipping counter. [2] specify the interrupt skipping count within the range from 0 to 7 times in bits 3acor2 to 3acor0 and 4vcor2 to 4vcor0 in titcr, and enable interrupt skipping through bits t3aen and t4ven. figure 12.67 example of interrupt skipping operation setting procedure
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 520 of 1164 rej09b0321-0200 tcnt_3 tcnt_4 period during which changing skipping count can be performed period during which changing skipping count can be performed period during which changing skipping count can be performed period during which changing skipping count can be performed figure 12.68 periods during which interrupt skipping count can be changed (b) example of interrupt skipping operation figure 12.69 shows an example of tgia_3 interrupt skipping in which the interrupt skipping count is set to three by the 3acor bit and the t3aen bit is set to 1 in the timer interrupt skipping set register (titcr). tgia_3 interrupt flag set signal skipping counter tgfa_3 flag interrupt skipping period 00 01 02 03 00 01 02 03 interrupt skipping period figure 12.69 example of in terrupt skipping operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 521 of 1164 rej09b0321-0200 (c) buffer transfer control linked with interrupt skipping in complementary pwm mode, whet her to transfer data from a buffer register to a temporary register and whether to link the transfer with in terrupt skipping can be specified with the bte1 and bte0 bits in the timer buffer transfer set register (tbter). figure 12.70 shows an example of operation when buffer transfer is suppressed (bte1 = 0 and bte0 = 1). while this setting is valid, data is no t transferred from the bu ffer register to the temporary register. figure 12.71 shows an example of operation when bu ffer transfer is linked with interrupt skipping (bte1 = 1 and bet0 = 0). while this setting is va lid, data is not transferred from the buffer register outside the buffer transfer-enabled period. note that the buffer transfer-enabled period depends on the t3aen and t4ven bit settings in the timer interrupt skipping set register (titcr). figure 12.72 shows the relationship between the t3aen and t4ven bit settings in titcr and buffer transfer-enabled period. note: this function must always be used in combination with interrupt skipping. when interrupt skipping is disabled (the t3aen and t4ven bits in the timer interrupt skipping set register (titcr) are cleared to 0 or the skipping count set bits (3acor and 4vcor) in titcr are cleared to 0), make su re that buffer transfer is not linked with interrupt skipping (clear the bte1 bit in the timer buffer transfer set register (tbter) to 0). if buffer transfer is linked with interrupt skipping while interrupt skipping is disabled, buffer transfer is never performed.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 522 of 1164 rej09b0321-0200 buffer register temporary register general register tcnt_3 tcnt_4 data1 data2 data * data2 data * data2 (1) (2) (3) buffer transfer is suppressed note: * when buffer transfer at the crest is selected. data1 bit bte1 in tbter bit bte0 in tbter (1) no data is transferred from the buffer register to the temporary register in the buffer transfer-disabled period (bits bte1 and bte0 in tbter are set to 0 and 1, respectively). (2) data is transferred from the temporary register to the general register even in the buffer transfer-disabled period. (3) after buffer transfer is enabled, data is transferred from the buffer register to the temporary register. [legend] figure 12.70 example of operation when buffer transfer is suppressed (bte1 = 0 and bte0 = 1)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 523 of 1164 rej09b0321-0200 buffer register temporary register general register tcnt_3 tcnt_4 data1 data2 data * data * data2 data * data2 note: * buffer transfer at the crest is selected. the skipping count is set to three. t3aen is set to 1. buffer transfer- enabled period figure 12.71 example of operation when buffer transfer is linked with interrupt skipping (bte1 = 1 and bte0 = 0) note: * the skipping count is set to three. buffer transfer-enabled period (t3aen is set to 1) buffer transfer-enabled period (t4ven is set to 1) buffer transfer-enabled period (t3aen and t4ven are set to 1) 00 123 0123 0123 0123 skipping counter 3acnt skipping counter 4vcnt figure 12.72 relationship between bits t3aen and t4ven in titcr and buffer transfer-enabled period
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 524 of 1164 rej09b0321-0200 (4) complementary pwm mode output protection function complementary pwm mode output has the following protection functions. (a) register and counter misw rite prevention function with the exception of the buffer registers, which can be rewritten at any time, access by the cpu can be enabled or disabled for the mode regist ers, control registers, compare registers, and counters used in complementary pwm mode by means of the rwe bit in the timer read/write enable register (trwer). the ap plicable registers are some (21 in total) of the registers in channels 3 and 4 shown in the following: ? tcr_3 and tcr_4, tmdr_3 and tmdr_4, tiorh_3 and tiorh_4, tiorl_3 and tiorl_4, tier_3 and tier_4, tcnt_3 and tcnt_4, tgra_3 and tgra_4, tgrb_3 and tgrb_4, toer, tocr, tgcr, tcdr, and tddr. this function enables miswriting due to cpu runa way to be prevented by disabling cpu access to the mode registers, control registers, and counters. when the applicable registers are read in the access-disabled state, u ndefined values are returned. writin g to these registers is ignored.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 525 of 1164 rej09b0321-0200 12.4.9 a/d converter start request delaying function a/d converter start requests can be issued in channel 4 by making settings in the timer a/d converter start request control register (tadcr) , timer a/d converter start request cycle set registers (tadcora_4 and tadcorb_4), and tim er a/d converter start request cycle set buffer registers (tadcobra _4 and tadcobrb_4). the a/d converter start request delaying function compares tcnt_4 with tadcora_4 or tadcorb_4, and when their values match, the function issues a respect ive a/d converter start request (trg4an or trg4bn). a/d converter start requests (trg4an and trg4bn) can be skipped in coordination with interrupt skipping by making settings in the ita3ae, ita4ve, itb3ae, and itb4ve bits in tadcr. (a) example of procedure for specifying a/d co nverter start request delaying function figure 12.73 shows an example of procedure for specifying the a/d converter start request delaying function. set a/d converter start request cycle a/d converter start request delaying function ? set the timing of transfer from cycle set buffer register ? set linkage with interrupt skipping ? enable a/d converter start request delaying function a/d converter start request delaying function notes: 1. perform tadcr setting while tcnt_4 is stopped. 2. do not set bf1 to 1 when complementary pwm mode is not selected. 3. do not set ita3ae, ita4ve, itb3ae, itb4ve, dt4ae, or dt4be to 1 when complementary pwm mode is not selected. [1] [2] [1] set the cycle in the timer a/d converter start request cycle buffer register (tadcobra_4 or tadcobrb_4) and timer a/d converter start request cycle register (tadcora_4 or tadcorb_4). (the same initial value must be specified in the cycle buffer register and cycle register.) [2] use bits bf1 and bf2 in the timer a/d converter start request control register (tadcr) to specify the timing of transfer from the timer a/d converter start request cycle buffer register to a/d converter start request cycle register. ? specify whether to link with interrupt skipping through bits ita3ae, ita4ve, itb3ae, and itb4ve. ? use bits tu4ae, dt4ae, ut4be, and dt4be to enable a/d conversion start requests (trg4an or trg4bn). figure 12.73 example of proce dure for specifying a/d converter start request delaying function
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 526 of 1164 rej09b0321-0200 (b) basic operation example of a/d conv erter start request delaying function figure 12.74 shows a basic example of a/d conve rter request signal (trg4an) operation when the trough of tcnt_4 is specified for the buffer tr ansfer timing and an a/d converter start request signal is output during tcnt_4 down-counting. tadcora_4 tadcobra_4 tcnt_4 transfer from cycle buffer register to cycle register transfer from cycle buffer register to cycle register transfer from cycle buffer register to cycle register a/d converter start request (trg4an) (complementary pwm mode) figure 12.74 basic example of a/d convert er start request signal (trg4an) operation (c) buffer transfer the data in the timer a/d converter start request cycle set registers (tadcora_4 and tadcorb_4) is updated by writing data to the timer a/d converter start request cycle set buffer registers (tadcobra_4 and tadcobrb_4). data is transferred from the buffer registers to the respective cycle set registers at the timing selected with the bf1 and bf0 bits in the timer a/d converter start request control register (tadcr_4). (d) a/d converter start request delaying function linked with interrupt skipping a/d converter start requests (trg4an and trg4bn) can be issued in coordination with interrupt skipping by making settings in the ita3ae, ita4ve, itb3ae, and itb4ve bits in the timer a/d converter start request control register (tadcr). figure 12.75 shows an example of a/d converter start request signal (trg4an) operation when trg4an output is enabled during tcnt_4 up-counting and down-counting and a/d converter start requests are linked with interrupt skipping.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 527 of 1164 rej09b0321-0200 figure 12.76 shows another example of a/d conve rter start request sign al (trg4an) operation when trg4an output is enabled during tcnt_4 up-counting and a/d converter start requests are linked with interrupt skipping. note: this function must be used in combination with interrupt skipping. when interrupt skipping is disabled (the t3aen and t4ven bits in the timer interrupt skipping set register (titcr) are cleared to 0 or the skipping count set bits (3acor and 4vcor) in titcr are cleared to 0), make su re that a/d converter start requests are not linked with interrupt skipping (clear the ita3ae, ita4ve, itb3ae, and itb4ve bits in the timer a/d converter start request control register (tadcr) to 0). tadcora_4 tcnt_4 a/d converter start request (trg4an) note: * when the interrupt skipping count is set to two. tgia_3 interrupt skipping counter tciv_4 interrupt skipping counter tgia_3 a/d request-enabled period tciv_4 a/d request-enabled period when linked with tgia_3 and tciv_4 interrupt skipping when linked with tgia_3 interrupt skipping when linked with tciv_4 interrupt skipping 00 01 00 01 02 00 01 00 01 02 (ut4ae/dt4ae = 1) figure 12.75 example of a/d converter star t request signal (trg4an) operation linked with interrupt skipping
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 528 of 1164 rej09b0321-0200 a/d converter start request (trg4an) note: * when the interrupt skipping count is set to two. tgia_3 interrupt skipping counter tciv_4 interrupt skipping counter tgia_3 a/d request-enabled period tciv_4 a/d request-enabled period when linked with tgia_3 and tciv_4 interrupt skipping when linked with tgia_3 interrupt skipping when linked with tciv_4 interrupt skipping tadcora_4 tcnt_4 00 01 00 01 02 00 01 00 01 02 ut4ae = 1 dt4ae = 0 figure 12.76 example of a/d converter star t request signal (trg4an) operation linked with interrupt skipping
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 529 of 1164 rej09b0321-0200 12.4.10 external puls e width measurement the pulse widths of up to three external input lines can be measured in channel 5. (1) example of external pulse wi dth measurement setting procedure select counter clock external pulse width measurement select pulse width measuring conditions start count operation notes: 1. do not set bits cmpclr5u, cmpclr5v, or cmpclr5w in tcntcmpclr to 1. 2. do not set bits tgie5u, tgie5v, or tgie5w in tier_5 to 1. 3. the value in tcnt is not captured in tgr. [1] use bits tpsc1 and tpsc0 in tcr to select the counter clock. [2] in tior, select the high level or low level for the pulse width measuring condition. [3] set bits cst in tstr to 1 to start count operation. [1] [2] [3] figure 12.77 example of external pu lse width measurement setting procedure (2) example of external pulse width measurement 0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 tic5u tcnt5_u p figure 12.78 example of external pulse width measurement (measuring high pulse width)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 530 of 1164 rej09b0321-0200 12.4.11 dead time compensation by measuring the delay of the output waveform and reflecting it to duty, the external pulse width measurement function can be used as the dead time compensation function while the complementary pwm is in operation. tdead tdelay upper arm signal lower arm signal inverter output detection signal dead time delay signal figure 12.79 delay in dead time in complementary pwm operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 531 of 1164 rej09b0321-0200 (1) example of dead time co mpensation setting procedure figure 12.80 shows an example of dead time compensation setting procedure by using three counters in channel 5. tcnt_5 input capture occurs external pulse width measurement complementary pwm mode interrupt processing notes: the pfc settings must be completed in advance. * as an interrupt flag is set under the capture condition specified in tior, do not enable interrupt requests in tier_5. start count operation in channels 3 to 5 [3] [4] * [5] [1] [2] [1] place channels 3 and 4 in complementary pwm mode. for details, refer to section 12.4.8, complementary pwm mode. [2] specify the external pulse width measurement function for the target tior in channel 5. for details, refer to section 12.4.10, external pulse width measurement. [3] set bits cst3 and cst4 in tstr and bits cst5u, cst5v, and cst5w in tstr2 to 1 to start count operation. [4] when the capture condition specified in tior is satisfied, the tcnt_5 value is captured in tgr_5. [5] for u-phase dead time compensation, when an interrupt is generated at the crest (tgia_3) or trough (tciv_4) in complementary pwm mode, read the tgru_5 value, calculate the difference in time in tgrb_3, and write the corrected value to tgrd_3 in the interrupt processing. for the v phase and w phase, read the tgrv_5 and tgrw_5 values and write the corrected values to tgrc_4 and tgrd_4, respectively, in the same way as for u-phase compensation. the tcnt_5 value should be cleared through the tcntcmpclr setting or by software. figure 12.80 example of dead ti me compensation setting procedure mtu ch3/4 ch5 complementary pwm output dead time delay input inverter output monitor signals -+ u v w u v w u v w motor level conversion dc figure 12.81 example of moto r control circuit configuration
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 532 of 1164 rej09b0321-0200 12.4.12 tcnt capture at crest and/or trough in complementary pwm operation the tcnt value is captured in tgr at either the crest or trough or at both the crest and trough during complementary pwm operation. the timing for capturing in tgr can be selected by tior. figure 12.82 is an operating ex ample in which tcnt is used as a free-running counter without being cleared, and the tcnt value is captured in tgr at the specified timing (either crest or trough, or both crest and trough). tdead tdelay upper arm signal lower arm signal inverter output monitor signal dead time delay signal tgra_4 3de7 3e5b 3e5b 3ed3 3ed3 3f37 3f37 3faf 3faf 3de7 tcnt[15:0] tgr[15:0] up-count/down-count signal (udflg) figure 12.82 tcnt capturing at crest and/or trough in complementary pwm operation
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 533 of 1164 rej09b0321-0200 12.5 interrupt sources 12.5.1 interrupt sou rces and priorities there are three kinds of mtu2 interrupt source; tgr input capture/compare match, tcnt overflow, and tcnt underflow. each interrupt source has its own status flag and enable/disabled bit, allowing the generation of interrupt request signals to be enabled or disabled individually. when an interrupt request is generated, the corresponding status flag in tsr is set to 1. if the corresponding enable/disable bit in tier is set to 1 at this time, an interrupt is requested. the interrupt request is cleared by cl earing the status flag to 0. relative channel priorities can be changed by the interrupt controller, however the priority order within a channel is fixed. for details, s ee section 6, interrupt controller (intc). table 12.57 lists the mtu2 interrupt sources. table 12.57 mtu2 interrupts channel name interrupt source interrupt flag dmac activation priority 0 tgia_0 tgra_0 input capture/co mpare match tgfa_0 possible high tgib_0 tgrb_0 input capture/com pare match tgfb_0 not possible tgic_0 tgrc_0 input capture/comp are match tgfc_0 not possible tgid_0 tgrd_0 input capture/comp are match tgfd_0 not possible tciv_0 tcnt_0 overflow tcfv_0 not possible tgie_0 tgre_0 compare ma tch tgfe_0 not possible tgif_0 tgrf_0 compare match tgff_0 not possible 1 tgia_1 tgra_1 input capture/co mpare match tgfa_1 possible tgib_1 tgrb_1 input capture/com pare match tgfb_1 not possible tciv_1 tcnt_1 overflow tcfv_1 not possible tciu_1 tcnt_1 underflow tcfu_1 not possible 2 tgia_2 tgra_2 input capture/co mpare match tgfa_2 possible tgib_2 tgrb_2 input capture/com pare match tgfb_2 not possible tciv_2 tcnt_2 overflow tcfv_2 not possible tciu_2 tcnt_2 underflow tcfu_2 not possible low
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 534 of 1164 rej09b0321-0200 channel name interrupt source interrupt flag dmac activation priority 3 tgia_3 tgra_3 input capture/co mpare match tgfa_3 possible high tgib_3 tgrb_3 input capture/com pare match tgfb_3 not possible tgic_3 tgrc_3 input capture/comp are match tgfc_3 not possible tgid_3 tgrd_3 input capture/comp are match tgfd_3 not possible tciv_3 tcnt_3 overflow tcfv_3 not possible 4 tgia_4 tgra_4 input capture/co mpare match tgfa_4 possible tgib_4 tgrb_4 input capture/com pare match tgfb_4 not possible tgic_4 tgrc_4 input capture/comp are match tgfc_4 not possible tgid_4 tgrd_4 input capture/comp are match tgfd_4 not possible tciv_4 tcnt_4 overflow/under flow tcfv_4 not possible 5 tgiu_5 tgru_5 input capture/comp are match tgfu_5 not possible tgiv_5 tgrv_5 input capture/com pare match tgfv_5 not possible tgiw_5 tgrw_5 input capture/comp are match tgfw_5 not possible low note: this table shows the initia l state immediately after a reset. the relative channel priorities can be changed by the interrupt controller. (1) input capture/comp are match interrupt an interrupt is requested if the tgie bit in tier is set to 1 when the tgf flag in tsr is set to 1 by the occurrence of a tgr input capture/compare match on a part icular channel. the interrupt request is cleared by clearing the tgf flag to 0. the mtu2 has 21 input capture/compare match interrupts, six for channel 0, four each for channe ls 3 and 4, two each for channels 1 and 2, and three for channel 5. the tgfe_0 and tgff_0 flags in channel 0 are not set by the occurrence of an input capture. (2) overflow interrupt an interrupt is requested if the tciev bit in tier is set to 1 when the tcfv flag in tsr is set to 1 by the occurrence of tcnt overflow on a channe l. the interrupt request is cleared by clearing the tcfv flag to 0. the mt u2 has five overflow interrupts, one for each channel. (3) underflow interrupt an interrupt is requested if the tcieu bit in tier is set to 1 when the tcfu flag in tsr is set to 1 by the occurrence of tcnt underflow on a channe l. the interrupt request is cleared by clearing the tcfu flag to 0. the mtu2 has two underflow interrupts, one each for channels 1 and 2.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 535 of 1164 rej09b0321-0200 12.5.2 dmac activation the dmac can be activated by the tgra input ca pture/compare match interrupt in each channel. for details, see section 11, direct memory access controller (dmac). in the mtu2, a total of five tgra input capture/ compare match interrupts can be used as dmac activation sources, one each for channels 0 to 4. 12.5.3 a/d converter activation the a/d converter can be activated by one of the following three methods in the mtu2. table 12.58 shows the relationship between interrupt sources and a/d converter start request signals. (1) a/d converter activation by tgra input capture/compare match or at tcnt_4 trough in complementary pwm mode the a/d converter can be activated by the occurrence of a tgra input capture/compare match in each channel. in addition, if complementary pwm operation is performed while the ttge2 bit in tier_4 is set to 1, the a/d converter can be ac tivated at the trough of tcnt_4 count (tcnt_4 = h'0000). a/d converter start request signal trgan is issued to the a/d converter under either one of the following conditions. ? when the tgfa flag in tsr is set to 1 by the occurrence of a tgra input capture/compare match on a particular channel while the ttge bit in tier is set to 1 ? when the tcnt_4 count reaches the trough (tcnt_4 = h'0000) during complementary pwm operation while the ttge2 bit in tier_4 is set to 1 when either condition is satisfied, if a/d co nverter start signal tr gan from the mtu2 is selected as the trigger in the a/d c onverter, a/d conversion will start.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 536 of 1164 rej09b0321-0200 (2) a/d converter activation by compare match between tcnt_0 and tgre_0 the a/d converter can be activated by generating a/d converter start request signal trg0n when a compare match occurs between tcnt_0 and tgre_0 in channel 0. when the tgfe flag in tsr2_0 is set to 1 by the occurrence of a compare match between tcnt_0 and tgre_0 in channel 0 while the ttge2 bit in tier2_0 is set to 1, a/d converter start request tgr0n is issued to the a/d converter. if a/d converter start signal tgr0n from the mtu2 is selected as the trigger in the a/ d converter, a/d conversion will start. (3) a/d converter activation by a/d conv erter start request delaying function the a/d converter can be activated by generating a/d converter start request signal trg4an or trg4bn when the tcnt_4 count matches the tadcora or tadcorb value if the tad4ae or tad4be bit in the a/d converter start request control register (tadcr) is set to 1. for details, refer to section 12.4.9, a/d converter start request delaying function. a/d conversion will start if a/d converter start sign al trg4an from the mtu2 is selected as the trigger in the a/d converter when trg4an is generated or if trg4bn from the mtu2 is selected as the trigger in the a/d c onverter when trg4bn is generated. table 12.58 interrupt sources and a/ d converter start request signals target registers interrupt source a/d converter start request signal tgra_0 and tcnt_0 tgra_1 and tcnt_1 tgra_2 and tcnt_2 tgra_3 and tcnt_3 tgra_4 and tcnt_4 input capture/compare match tcnt_4 tcnt_4 trough in complementary pwm mode trgan tgre_0 and tcnt_0 trg0n tadcora and tcnt_4 trg4an tadcorb and tcnt_4 compare match trg4bn
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 537 of 1164 rej09b0321-0200 12.6 operation timing 12.6.1 input/output timing (1) tcnt count timing figures 12.83 and 12.84 show tcnt count timing in internal clock operation, and figure 12.85 shows tcnt count timing in external clock operation (normal mode), and figure 12.86 shows tcnt count timing in external clock operation (phase counting mode). tcnt tcnt input clock internal clock p falling edge rising edge n - 1 n n + 1 figure 12.83 count timing in internal clock operation (channels 0 to 4) tcnt tcnt input clock internal clock p rising edge n - 1 n figure 12.84 count timing in internal clock operation (channel 5) p tcnt tcnt input clock external clock falling edge rising edge n - 1 n n + 1 figure 12.85 count timing in extern al clock operation (channels 0 to 4)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 538 of 1164 rej09b0321-0200 p external clock tcnt input clock tcnt rising edge falling edge n - 1 n n - 1 figure 12.86 count timing in external clock operation (phase counting mode) (2) output compare output timing a compare match signal is generated in the final state in which tcnt and tgr match (the point at which the count value matched by tcnt is updated). when a compare match signal is generated, the output value set in tior is output at the output compare output pin (tioc pin). after a match between tcnt and tgr, the compare match signal is not generated until the tcnt input clock is generated. figure 12.87 shows output compare output timing (normal mode and pwm mode) and figure 12.88 shows output compare output timing (complementary pwm mode and reset synchronous pwm mode). tgr tcnt tcnt input clock n n n + 1 compare match signal tioc pin p figure 12.87 output compare output timing (normal mode/pwm mode)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 539 of 1164 rej09b0321-0200 tcnt input clock tcnt n n + 1 tgr compare match signal tioc pin n p figure 12.88 output compare output timing (complementary pwm mode/res et synchronous pwm mode) (3) input capture signal timing figure 12.89 shows input capture signal timing. tcnt input capture input n n + 1 n + 2 n n + 2 tgr input capture signal p figure 12.89 input capture input signal timing
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 540 of 1164 rej09b0321-0200 (4) timing for counter clearing by compare match/input capture figures 12.90 and 12.91 show the timing when counter clearing on compare match is specified, and figure 12.92 shows the timing when counter clearing on input capture is specified. p tcnt counter clear signal compare match signal tgr n n h'0000 figure 12.90 counter clear timing (com pare match) (channel 0 to channel 4) p tcnt counter clear signal compare match signal tgr n n - 1 h'0000 figure 12.91 counter clear timi ng (compare match) (channel 5) tcnt counter clear signal input capture signal tgr n h'0000 n p figure 12.92 counter clear timing (inp ut capture) (channel 0 to channel 5)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 541 of 1164 rej09b0321-0200 (5) buffer operation timing figures 12.93 to 12.95 show the timing in buffer operation. tgra, tgrb compare match buffer signal tcnt tgrc, tgrd n n n n n + 1 p figure 12.93 buffer operat ion timing (compare match) tgra, tgrb tcnt input capture signal tgrc, tgrd n n n n + 1 n n n + 1 p figure 12.94 buffer operation timing (input capture)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 542 of 1164 rej09b0321-0200 tgra, tgrb, tgre tcnt clear signal buffer transfer signal tcnt p tgrc, tgrd, tgrf n n n n h'0000 figure 12.95 buffer transfer timing (when tcnt cleared) (6) buffer transfer timing (complementary pwm mode) figures 12.96 to 12.98 show the buffer transfer timing in complementary pwm mode. buffer register tgrd_4 write signal temporary register transfer signal tcnts p temporary register n n n n h'0000 figure 12.96 transfer timing from buffer register to temporary register (tcnts stop)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 543 of 1164 rej09b0321-0200 buffer register tgrd_4 write signal tcnts p temporary register n n n n p - x p h'0000 figure 12.97 transfer timing from buffer register to temporary register (tcnts operating) temporary register buffer transfer signal tcnts p compare register n n n p - 1 p h'0000 figure 12.98 transfer timing from temporary register to compare register
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 544 of 1164 rej09b0321-0200 12.6.2 interrupt signal timing (1) tgf flag setting timing in case of compare match figures 12.99 and 12.100 show the timing for setting of the tgf flag in tsr on compare match, and tgi interrupt request signal timing. tgr tcnt tcnt input clock n n n + 1 compare match signal tgf flag tgi interrupt p figure 12.99 tgi interrupt timing (compare match) (c hannels 0 to 4) tgr tcnt tcnt input clock n n - 1 n compare match signal tgf flag tgi interrupt p figure 12.100 tgi interrupt timi ng (compare match) (channel 5)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 545 of 1164 rej09b0321-0200 (2) tgf flag setting timing in case of input capture figures 12.101 and 12.102 show the timing for setting of the tgf flag in tsr on input capture, and tgi interrupt request signal timing. tgr tcnt input capture signal n n tgf flag tgi interrupt p figure 12.101 tgi interrupt timing (input capture) (channels 0 to 4) tgr tcnt input capture signal n n tgf flag tgi interrupt p figure 12.102 tgi interrupt timing (input capture) (channel 5)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 546 of 1164 rej09b0321-0200 (3) tcfv flag/tcfu flag setting timing figure 12.103 shows the timing for setting of the tcfv flag in tsr on overflow, and tciv interrupt request signal timing. figure 12.104 shows the timing for setting of the tcfu flag in tsr on underflow, and tciu interrupt request signal timing. overflow signal tcnt (overflow) tcnt input clock h'ffff h'0000 tcfv flag tciv interrupt p figure 12.103 tciv interrupt setting timing underflow signal tcnt (underflow) tcnt input clock h'0000 h'ffff tcfu flag tciu interrupt p figure 12.104 tciu interrupt setting timing
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 547 of 1164 rej09b0321-0200 (4) status flag clearing timing after a status flag is read as 1 by the cpu, it is cleared by writing 0 to it. figures 12.105 and 12.106 show the timing for status flag clearing by the cpu, and figure 12.107 show the timing for status flag clearing by the dmac. status flag write signal address tsr address interrupt request signal tsr write cycle t1 t2 p figure 12.105 timing for status flag clearing by cpu (channels 0 to 4) status flag write signal address tsr address interrupt request signal tsr write cycle t1 t2 p figure 12.106 timing for status flag clearing by cpu (channel 5)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 548 of 1164 rej09b0321-0200 interrupt request signal status flag address p , b source addess flag clear signal dmac read cycle destination addres dmac write cycyle figure 12.107 timing for status flag clearing by dmac activation (channels 0 to 4) 12.7 usage notes 12.7.1 module standby mode setting mtu2 operation can be disabled or enabled using the standby control register. the initial setting is for mtu2 operation to be halted. register access is enabled by clearing module standby mode. for details, refer to section 25, power-down modes. 12.7.2 input clock restrictions the input clock pulse width must be at least 1.5 st ates in the case of single-edge detection, and at least 2.5 states in the case of both-edge detection. the mtu2 will not operat e properly at narrower pulse widths. in phase counting mode, the phase difference and ove rlap between the two inpu t clocks must be at least 1.5 states, and the pulse width must be at l east 2.5 states. figure 12.108 shows the input clock conditions in phase counting mode.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 549 of 1164 rej09b0321-0200 overlap phase differ- ence phase differ- ence overlap tclka (tclkc) tclkb (tclkd) pulse width pulse width pulse width pulse width notes: phase difference and overlap pulse width : 1.5 states or more : 2.5 states or more figure 12.108 phase differ ence, overlap, and pulse widt h in phase counting mode 12.7.3 caution on period setting when counter clearing on compare match is set, tcnt is cleared in the final state in which it matches the tgr value (the point at which the count value matched by tcnt is updated). consequently, the actual counter frequency is given by the following formula: ? channels 0 to 4 f = p (n + 1) ? channel 5 f = p n where f: counter frequency p : mtu2 peripheral clock operating frequency n: tgr set value
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 550 of 1164 rej09b0321-0200 12.7.4 contention between tc nt write and clear operations if the counter clear signal is generated in the t2 state of a tcnt write cy cle, tcnt clearing takes precedence and the tcnt write is not performed. figure 12.109 shows the timing in this case. counter clear signal write signal address tcnt address tcnt tcnt write cycle t1 t2 n h'0000 p figure 12.109 conten tion between tcnt writ e and clear operations 12.7.5 contention be tween tcnt write and increment operations if incrementing occurs in the t2 state of a tcnt write cycle, the tcnt write takes precedence and tcnt is not incremented. figure 12.110 shows the timing in this case. tcnt input clock write signal address tcnt address tcnt tcnt write cycle t1 t2 nm tcnt write data p figure 12.110 contenti on between tcnt write and increment operations
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 551 of 1164 rej09b0321-0200 12.7.6 contention between tgr write and compare match if a compare match occurs in the t2 state of a tg r write cycle, the tgr wr ite is executed and the compare match signal is also generated. figure 12.111 shows the timing in this case. compare match signal write signal address tgr address tcnt tgr write cycle t1 t2 nm tgr write data tgr n n + 1 p figure 12.111 contention betw een tgr write and compare match
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 552 of 1164 rej09b0321-0200 12.7.7 contention between buffer register write and compare match if a compare match occurs in the t2 state of a tgr write cycle, the data that is transferred to tgr by the buffer operation is the data before write. figure 12.112 shows the timing in this case. address write signal compare match signal compare match buffer signal tgr write cycle t1 t2 buffer register address n n m buffer register write data buffer register tgr p figure 12.112 contenti on between buffer register write and compare match
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 553 of 1164 rej09b0321-0200 12.7.8 contention between buff er register write and tcnt clear when the buffer transfer timing is set at the tcnt clear by the buffer tr ansfer mode register (tbtm), if tcnt clear occurs in the t2 state of a tgr write cycle, the data that is transferred to tgr by the buffer operation is the data before write. figure 12.113 shows the timing in this case. address write signal tcnt clear signal buffer transfer signal tgr write cycle t1 t2 buffer register address n n m buffer register write data buffer register tgr p figure 12.113 contenti on between buffer regist er write and tcnt clear
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 554 of 1164 rej09b0321-0200 12.7.9 contention between tgr read and input capture if an input capture signal is generated in the t1 stat e of a tgr read cycle, the data that is read will be the data in the buffer before input capture transfer for channels 0 to 4, and the data after input capture transfer for channel 5. figures 12.114 and 12.115 show the timing in this case. input capture signal read signal address tgr read cycle t1 t2 tgr internal data bus tgr address p n nm figure 12.114 contention between tgr re ad and input capture (channels 0 to 4) input capture signal read signal address tgr read cycle t1 t2 tgr internal data bus tgr address p m nm figure 12.115 contention between tg r read and input capture (channel 5)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 555 of 1164 rej09b0321-0200 12.7.10 contention between tgr write and input capture if an input capture signal is generated in the t2 state of a tgr write cycle, the input capture operation takes precedence and the write to tgr is not performed for channels 0 to 4. for channel 5, write to tgr is performed and the input capture signal is generated. figures 12.116 and 12.117 show the timing in this case. input capture signal write signal address tcnt tgr write cycle t1 t2 m tgr m tgr address p figure 12.116 contention between tgr write and input capture (channels 0 to 4) input capture signal write signal address tcnt tgr write cycle t1 t2 n tgr m tgr address p tgr write data figure 12.117 contention between tgr write and in put capture (channel 5)
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 556 of 1164 rej09b0321-0200 12.7.11 contention between buffer register write and input capture if an input capture signal is generated in the t2 st ate of a buffer register write cycle, the buffer operation takes precedence and the write to the buffer register is not performed. figure 12.118 shows the timing in this case. input capture signal write signal address tcnt buffer register write cycle t1 t2 n tgr n m m buffer register buffer register address p figure 12.118 contenti on between buffer register write and input capture 12.7.12 tcnt_2 write and overflow/underf low contention in cascade connection with timer counters tcnt_1 and tcnt_2 in a cascade connection, when a contention occurs during tcnt_1 count (during a tcnt_2 overflow/underflow) in the t2 state of the tcnt_2 write cycle, the write to tcnt_2 is conducted, and the tcnt_1 count signal is disabled. at this point, if there is match with tgra_1 and th e tcnt_1 value, a compare signal is issued. furthermore, when the tcnt_1 count clock is sel ected as the input capture source of channel 0, tgra_0 to tgrd_0 carry out the input capture operation. in addition, when the compare match/input capture is selected as the input ca pture source of tgrb_1, tgrb_1 carries out input capture operation. the timing is shown in figure 12.119. for cascade connections, be sure to synchronize settings for channels 1 and 2 when setting tcnt clearing.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 557 of 1164 rej09b0321-0200 t1 t2 h'fffe h'ffff n n + 1 h'ffff m m n p qp m disabled tcnt_2 write data tcnt_2 address tcnt write cycle address write signal tcnt_2 tgra_2 to tgrb_2 ch2 compare- match signal a/b tcnt_1 input clock tcnt_1 tgra_1 ch1 compare- match signal a tgrb_1 ch1 input capture signal b tcnt_0 tgra_0 to tgrd_0 ch0 input capture signal a to d p figure 12.119 tcnt_2 write and over flow/underflow contention with cascade connection
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 558 of 1164 rej09b0321-0200 12.7.13 counter value during co mplementary pwm mode stop when counting operation is suspended with tcnt_3 and tcnt_4 in complementary pwm mode, tcnt_3 has the timer dead time register (tddr) value, and tcnt_4 is held at h'0000. when restarting complementary pwm mode, counting begins automatically from the initialized state. this explanatory diagram is shown in figure 12.120. when counting begins in another operating mode, be sure that tcnt_3 and tcnt_4 are set to the initial values. tgra_3 tcdr tddr h'0000 tcnt_3 tcnt_4 complementary pwm mode operation complementary pwm mode operation counter operation stop complementary pmw restart figure 12.120 counter value during complementary pwm mode stop 12.7.14 buffer operation setting in complementary pwm mode in complementary pwm mode, conduct rewrites by buffer operation for the pwm cycle setting register (tgra_3), timer cycle data register (tcdr), and duty setting registers (tgrb_3, tgra_4, and tgrb_4). in complementary pwm mode, channel 3 and chan nel 4 buffers operate in accordance with bit settings bfa and bfb of tmdr_3. when the bfa bit in tmdr_3 is set to 1, tgrc_3 functions as a buffer register for tgra_3. at the same tim e, tgrc_4 functions as the buffer register for tgra_4, and tcbr functions as the tcdr's buffer register.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 559 of 1164 rej09b0321-0200 12.7.15 reset sync pwm mode buffer operation and compare match flag when setting buffer operation for reset sync pw m mode, set the bfa and bfb bits in tmdr_4 to 0. the tioc4c pin will be unable to produce its waveform output if the bfa bit in tmdr_4 is set to 1. in reset sync pwm mode, the channel 3 and channel 4 buffers operate in accordance with the bfa and bfb bit settings of tmdr_3. for example, if the bfa bit in tmdr_3 is set to 1, tgrc_3 functions as the buffer register for tgra_3. at the same time, tgrc_4 functions as the buffer register for tgra_4. the tgfc bit and tgfd bit in tsr_3 and tsr_4 are not set when tgrc_3 and tgrd_3 are operating as buffer registers. figure 12.121 shows an example of operations for tgr_3, tgr_4, tioc3, and tioc4, with tmdr_3's bfa and bfb bits set to 1, and tmdr_4's bfa and bfb bits set to 0. tgra_3 tgrc_3 tgrb_3, tgra_4, tgrb_4 tgrd_3, tgrc_4, tgrd_4 h'0000 tioc3a tioc3b tioc3d tioc4a tioc4c tioc4b tioc4d tgfc tgfd tgra_3, tgrc_3 tgrb_3, tgrd_3, tgra_4, tgrc_4, tgrb_4, tgrd_4 buffer transfer with compare match a3 tcnt3 not set not set point a point b figure 12.121 buffer operation and compare-match flags in reset synchronous pwm mode
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 560 of 1164 rej09b0321-0200 12.7.16 overflow flags in reset synchronous pwm mode when set to reset synchronous pwm mode, tcnt_3 and tcnt_4 start counting when the cst3 bit in tstr is set to 1. at this point, tcnt_4's count clock source and count edge obey the tcr_3 setting. in reset synchronous pwm mode, with cycle register tgra_3's set value at h'ffff, when specifying tgr3a compare-match for the counter clear source, tcnt_3 and tcnt_4 count up to h'ffff, then a compare-match occurs with tgra_3, and tcnt_3 and tcnt_4 are both cleared. at this point, tsr's overflow flag tcfv bit is not set. figure 12.122 shows a tcfv bit operation example in reset synchronous pwm mode with a set value for cycle register tgra_3 of h'ffff, when a tgra_3 compare-match has been specified without synchronous setting for the counter clear source. tgra_3 (h'ffff) h'0000 tcfv_3 tcfv_4 tcnt_3 = tcnt_4 counter cleared by compare match 3a not set not set figure 12.122 reset synchronous pwm mode overflow flag
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 561 of 1164 rej09b0321-0200 12.7.17 contention between overflo w/underflow and counter clearing if overflow/underflow and counter clearing occur simultaneously, the tcfv/tcfu flag in tsr is not set and tcnt clearing takes precedence. figure 12.123 shows the operation timing when a tgr compare match is sp ecified as the clearing source, and when h'ff ff is set in tgr. counter clear signal tcnt tcnt input clock h'ffff h'0000 tgf tcfv disabled p figure 12.123 contention betw een overflow and counter clearing
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 562 of 1164 rej09b0321-0200 12.7.18 contention between tcnt write and overflow/underflow if there is an up-count or down-count in the t2 state of a tcnt write cycle, and overflow/underflow occurs, the tcnt write takes precedence and the tcfv/tcfu flag in tsr is not set. figure 12.124 shows the operation timing when there is contention between tcnt write and overflow. disabled write signal address tcnt address tcnt tcnt write cycle t1 t2 h'ffff m tcnt write data tcfv flag p figure 12.124 cont ention between tcnt write and overflow 12.7.19 cautions on transition from normal operation or pwm mode 1 to reset- synchronized pwm mode when making a transition from channel 3 or 4 normal operation or pwm mode 1 to reset- synchronized pwm mode, if the counter is halted with the output pins (tioc3b, tioc3d, tioc4a, tioc4c, tioc4b, tioc4d) in the high-level state, followed by the transition to reset- synchronized pwm mode and operation in that mode, the initial pin output will not be correct. when making a transition from normal operation to reset-synchronized pwm mode, write h'11 to registers tiorh_3, tiorl_3, tiorh_4, and tiorl_4 to initialize the output pins to low level output, then set an initial register value of h'00 before making the mode transition. when making a transition from pwm mode 1 to reset-synchronized pwm mode, first switch to normal operation, then initialize the output pins to low level output and set an initial register value of h'00 before making the transition to reset-synchronized pwm mode.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 563 of 1164 rej09b0321-0200 12.7.20 output level in complementary pwm mode and reset-synchronized pwm mode when channels 3 and 4 are in complementary pwm mode or reset-synchronized pwm mode, the pwm waveform output level is set with the olsp and olsn bits in the timer output control register (tocr). in the case of complementary pwm mode or reset-synchronized pwm mode, tior should be set to h'00. 12.7.21 interrupts in module standby mode if module standby mode is entered when an interrupt has been requested, it will not be possible to clear the cpu interrupt source or the dmac activation source. interrupts should therefore be disabled before entering module standby mode. 12.7.22 simultaneous capture of tcnt _1 and tcnt_2 in cascade connection when timer counters 1 and 2 (tcnt_1 and tcnt_2) are operated as a 32-bit counter in cascade connection, the cascade counter value cannot be ca ptured successfully even if input-capture input is simultaneously done to tioc1a and tioc2a or to tioc1b an d tioc2b. this is because the input timing of tioc1a and tioc2a or of tioc1b and tioc2b may not be the same when external input-capture signals to be input into tcnt_1 and tcnt_2 are taken in synchronization with the internal clock. for example, tcnt_1 (the counter for upper 16 bits) does not capture the count-up value by overflow from tcnt_2 (the counter for lower 16 bits) but captures the count value before the count-up. in this case, the values of tcnt_1 = h'fff1 and tcnt_2 = h'0000 should be transferred to tgra_1 and tgra_2 or to tgrb_1 and tgrb_2, but the values of tcnt_1 = h'fff0 and tcnt_2 = h'0000 are erroneously transferred.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 564 of 1164 rej09b0321-0200 12.8 mtu2 output pin initialization 12.8.1 operating modes the mtu2 has the following six operating modes. waveform output is possible in all of these modes. ? normal mode (channels 0 to 4) ? pwm mode 1 (channels 0 to 4) ? pwm mode 2 (channels 0 to 2) ? phase counting modes 1 to 4 (channels 1 and 2) ? complementary pwm mode (channels 3 and 4) ? reset-synchronized pwm mode (channels 3 and 4) the mtu2 output pin initialization method for each of these modes is described in this section. 12.8.2 reset start operation the mtu2 output pins (tioc*) are initialized low by a power-on reset. since mtu2 pin function selection is performed by the pin function controller (pfc), when the pfc is set, the mtu2 pin states at that point are output to the ports. when mtu2 output is selected by th e pfc immediately after a power-on reset, the mtu2 output initial leve l, low, is output directly at the port. when the active level is low, the system will operate at this point, and therefore the pfc setting should be made after initialization of the mtu2 output pins is completed. note: channel number and port notation are substituted for *.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 565 of 1164 rej09b0321-0200 12.8.3 operation in case of re-setting due to error during operation, etc. if an error occurs during mtu2 operation, mtu2 output should be cut by the system. cutoff is performed by switching the pin output to port output with the pfc and outputting the inverse of the active level. the pin initialization procedures for re-setting due to an error during operation, etc., and the procedures for rest arting in a different mode after re-setting, are shown below. the mtu2 has six operating modes, as stated above. there are thus 36 mode transition combinations, but some transitions are not available with certain channel and mode combinations. possible mode transition combinations are shown in table 12.59. table 12.59 mode transition combinations after before normal pwm1 pwm2 pcm cpwm rpwm normal (1) (2) (3) (4) (5) (6) pwm1 (7) (8) (9) (10) (11) (12) pwm2 (13) (14) (15) (16) none none pcm (17) (18) (19) (20) none none cpwm (21) (22) none none (23) (24) (25) rpwm (26) (27) none none (28) (29) [legend] normal: normal mode pwm1: pwm mode 1 pwm2: pwm mode 2 pcm: phase counting modes 1 to 4 cpwm: complementary pwm mode rpwm: reset-synchronized pwm mode
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 566 of 1164 rej09b0321-0200 12.8.4 overview of initialization procedures and mode transitions in case of error during operation, etc. ? when making a transition to a mode (normal, pwm1, pwm2, pcm) in which the pin output level is selected by the timer i/o control register (tior) setting, initialize the pins by means of a tior setting. ? in pwm mode 1, since a waveform is not output to the tioc*b (tioc *d) pin, setting tior will not initialize the pins. if initialization is re quired, carry it out in normal mode, then switch to pwm mode 1. ? in pwm mode 2, since a waveform is not output to the cycle register pin, setting tior will not initialize the pins. if initialization is required, carry it out in normal mode, then switch to pwm mode 2. ? in normal mode or pwm mode 2, if tgrc an d tgrd operate as buffer registers, setting tior will not initialize the buffer register pins. if initialization is required, clear buffer mode, carry out initialization, then set buffer mode again. ? in pwm mode 1, if either tgrc or tgrd operat es as a buffer register , setting tior will not initialize the tgrc pin. to initialize the tgrc pin, clear buffer mode, carry out initialization, then set buffer mode again. ? when making a transition to a mode (cpwm, rpwm) in which the pin output level is selected by the timer output control register (tocr) setting, switch to normal mode and perform initialization with tior, then restore tior to its initial value, and temporarily disable channel 3 and 4 output with the timer output master enable register (toer). then operate the unit in accordance with the mode setting procedure (tocr sett ing, tmdr setting, toer setting). note: channel number is substituted for * indicated in this article. pin initialization procedures are described below fo r the numbered combinations in table 12.59. the active level is assumed to be low. (1) operation when error occurs during normal mode operation, and operation is restarted in normal mode
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 567 of 1164 rej09b0321-0200 figure 12.125 shows an explanatory diagram of the case where an error oc curs in normal mode and operation is restarted in normal mode after re-setting. 1 power-on reset 2 tmdr (normal) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (normal) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) mtu2 module output tioc * a tioc * b port output pb, pc, pd * 1 high-z high-z pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. figure 12.125 error occurrence in no rmal mode, recovery in normal mode 1. after a power-on reset, mtu2 output is low and ports are in the high-impedance state. 2. after a power-on reset, the tmdr setting is for normal mode. 3. for channels 3 and 4, enable output with toer before initializing the pins with tior. 4. initialize the pins with tior. (the example shows initial high output, with low output on compare-match occurrence.) 5. set mtu2 output with the pfc. 6. the count operation is started by tstr. 7. output goes low on compare-match occurrence. 8. an error occurs. 9. set port output with the pfc and output the inverse of the active level. 10. the count operation is stopped by tstr. 11. not necessary when restarting in normal mode. 12. initialize the pins with tior. 13. set mtu2 output with the pfc. 14. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 568 of 1164 rej09b0321-0200 (2) operation when error occurs during normal mode operation, and operation is restarted in pwm mode 1 figure 12.126 shows an explanatory diagram of the case where an error oc curs in normal mode and operation is restarted in pwm mode 1 after re-setting. 1 power-on reset pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (normal) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (pwm1) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) mtu2 module output tioc * a tioc * b port output not initialized (tioc * b) high-z high-z figure 12.126 error occurrence in no rmal mode, recovery in pwm mode 1 1 to 10 are the same as in figure 12.125. 11. set pwm mode 1. 12. initialize the pins with tior. (in pwm mode 1, the tioc*b side is not initialized. if initialization is required, initialize in norm al mode, then switch to pwm mode 1.) 13. set mtu2 output with the pfc. 14. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 569 of 1164 rej09b0321-0200 (3) operation when error occurs during normal mode operation, and operation is restarted in pwm mode 2 figure 12.127 shows an explanatory diagram of the case where an error oc curs in normal mode and operation is restarted in pwm mode 2 after re-setting. 1 power-on reset pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (normal) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (pwm2) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) mtu2 module output tioc * a tioc * b port output not initialized (cycle register) high-z high-z figure 12.127 error occurrence in no rmal mode, recovery in pwm mode 2 1 to 10 are the same as in figure 12.125. 11. set pwm mode 2. 12. initialize the pins with tior. (in pwm mode 2, the cycle register pins are not initialized. if initialization is required, initialize in norm al mode, then switch to pwm mode 2.) 13. set mtu2 output with the pfc. 14. operation is restarted by tstr. note: pwm mode 2 can only be set for channels 0 to 2, and therefore toer setting is not necessary.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 570 of 1164 rej09b0321-0200 (4) operation when error occurs during normal mode operation, and operation is restarted in phase counting mode figure 12.128 shows an explanatory diagram of the case where an error oc curs in normal mode and operation is restarted in phase counting mode after re-setting. 1 power-on reset pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (normal) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (pcm) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) mtu2 module output tioc * a tioc * b port output high-z high-z figure 12.128 error occurrence in normal mode, recovery in phase counting mode 1 to 10 are the same as in figure 12.125. 11. set phase counting mode. 12. initialize the pins with tior. 13. set mtu2 output with the pfc. 14. operation is restarted by tstr. note: phase counting mode can only be set for ch annels 1 and 2, and therefore toer setting is not necessary.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 571 of 1164 rej09b0321-0200 (5) operation when error occurs during normal mode operation, and operation is restarted in complementary pwm mode figure 12.129 shows an explanatory diagram of the case where an error oc curs in normal mode and operation is restarted in comple mentary pwm mode after re-setting. 1 power-on reset 2 tmdr (normal) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tior (0 init 0 out) 12 tior ( disabled ) 13 toer (0) 14 tocr 15 tmdr (cpwm) (16) toer (1) (17) pfc (mtu2) (18) tstr (1) mtu2 module output tioc3a tioc3b tioc3d port output pb17 pb16 pb19 high-z high-z high-z figure 12.129 error occu rrence in normal mode, recovery in complementary pwm mode 1 to 10 are the same as in figure 12.125. 11. initialize the normal mode waveform generation section with tior. 12. disable operation of the normal mode waveform generation section with tior. 13. disable channel 3 and 4 output with toer. 14. select the complementary pwm output level and cyclic output enabling/disabling with tocr. 15. set complementary pwm. 16. enable channel 3 and 4 output with toer. 17. set mtu2 output with the pfc. 18. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 572 of 1164 rej09b0321-0200 (6) operation when error occurs during normal mode operation, and operation is restarted in reset-synchronized pwm mode figure 12.130 shows an explanatory diagram of the case where an error oc curs in normal mode and operation is restarted in reset-synchronized pwm mode after re-setting. 1 power-on reset 2 tmdr (normal) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tior (0 init 0 out) 12 tior ( disabled ) 13 toer (0) 14 tocr 15 tmdr (rpwm) 16 toer (1) 17 pfc (mtu2) 18 tstr (1) mtu2 module output tioc3a tioc3b tioc3d port output pb17 pb16 pb19 high-z high-z high-z figure 12.130 error o ccurrence in normal mode, recovery in reset-synchronized pwm mode 1 to 13 are the same as in figure 12.125. 14. select the reset-synchronized pwm output level and cyclic output enabling/disabling with tocr. 15. set reset-synchronized pwm. 16. enable channel 3 and 4 output with toer. 17. set mtu2 output with the pfc. 18. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 573 of 1164 rej09b0321-0200 (7) operation when error occurs during pwm mode 1 operation, and operation is restarted in normal mode figure 12.131 shows an explanatory diagram of the case where an error occurs in pwm mode 1 and operation is restarted in normal mode after re-setting. 1 power-on reset pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pwm1) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (normal) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) mtu2 module output tioc * a tioc * b port output not initialized (tioc * b) high-z high-z figure 12.131 error occurrence in pw m mode 1, recovery in normal mode 1. after a power-on reset, mtu2 output is low and ports are in the high-impedance state. 2. set pwm mode 1. 3. for channels 3 and 4, enable output with toer before initializing the pins with tior. 4. initialize the pins with tior. (the example shows initial high output, with low output on compare-match occurrence. in pwm mode 1, the tioc*b side is not initialized.) 5. set mtu2 output with the pfc. 6. the count operation is started by tstr. 7. output goes low on compare-match occurrence. 8. an error occurs. 9. set port output with the pfc and output the inverse of the active level. 10. the count operation is stopped by tstr. 11. set normal mode. 12. initialize the pins with tior. 13. set mtu2 output with the pfc. 14. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 574 of 1164 rej09b0321-0200 (8) operation when error occurs during pwm mode 1 operation, and operation is restarted in pwm mode 1 figure 12.132 shows an explanatory diagram of the case where an error occurs in pwm mode 1 and operation is restarted in pwm mode 1 after re-setting. 1 power-on reset pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pwm1) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (pwm1) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) mtu2 module output tioc * a tioc * b port output not initialized (tioc * b) not initialized (tioc * b) high-z high-z figure 12.132 error occurrence in pwm mode 1, recovery in pwm mode 1 1 to 10 are the same as in figure 12.131. 11. not necessary when restarting in pwm mode 1. 12. initialize the pins with tior. (in pwm mode 1, the tioc*b side is not initialized.) 13. set mtu2 output with the pfc. 14. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 575 of 1164 rej09b0321-0200 (9) operation when error occurs during pwm mode 1 operation, and operation is restarted in pwm mode 2 figure 12.133 shows an explanatory diagram of the case where an error occurs in pwm mode 1 and operation is restarted in pwm mode 2 after re-setting. 1 power-on reset pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pwm1) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (pwm2) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) mtu2 module output tioc * a tioc * b port output not initialized (tioc * b) not initialized (cycle register) high-z high-z figure 12.133 error occurrence in pwm mode 1, recovery in pwm mode 2 1 to 10 are the same as in figure 12.131. 11. set pwm mode 2. 12. initialize the pins with tior. (in pwm mode 2, the cycle register pins are not initialized.) 13. set mtu2 output with the pfc. 14. operation is restarted by tstr. note: pwm mode 2 can only be set for channels 0 to 2, and therefore toer setting is not necessary.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 576 of 1164 rej09b0321-0200 (10) operation when error occurs during pwm mode 1 operation, and operation is restarted in phase counting mode figure 12.134 shows an explanatory diagram of the case where an error occurs in pwm mode 1 and operation is restarted in phase counting mode after re-setting. 1 power-on reset pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pwm1) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (pcm) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) mtu2 module output tioc * a tioc * b port output not initialized (tioc * b) high-z high-z figure 12.134 error occurrence in pwm mo de 1, recovery in phase counting mode 1 to 10 are the same as in figure 12.131. 11. set phase counting mode. 12. initialize the pins with tior. 13. set mtu2 output with the pfc. 14. operation is restarted by tstr. note: phase counting mode can only be set for ch annels 1 and 2, and therefore toer setting is not necessary.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 577 of 1164 rej09b0321-0200 (11) operation when error occurs during pwm mode 1 operation, and operation is restarted in complementary pwm mode figure 12.135 shows an explanatory diagram of the case where an error occurs in pwm mode 1 and operation is restarted in comple mentary pwm mode after re-setting. 1 power-on reset 2 tmdr (pwm1) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (normal) 12 tior (0 init 0 out) 13 tior ( disabled ) 14 toer (0) 15 tocr 16 tmdr (cpwm) 17 toer (1) 18 pfc (mtu2) 19 tstr (1) mtu2 module output tioc3a tioc3b tioc3d port output pb17 pb16 pb19 not initialized (tioc3b) not initialized (tioc3d) high-z high-z high-z figure 12.135 error occurrence in pwm mode 1, recovery in complementary pwm mode 1 to 10 are the same as in figure 12.131. 11. set normal mode for initialization of the normal mode waveform generation section. 12. initialize the pwm mode 1 waveform generation section with tior. 13. disable operation of the pwm mode 1 waveform generation section with tior. 14. disable channel 3 and 4 output with toer. 15. select the complementary pwm output level and cyclic output enabling/disabling with tocr. 16. set complementary pwm. 17. enable channel 3 and 4 output with toer. 18. set mtu2 output with the pfc. 19. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 578 of 1164 rej09b0321-0200 (12) operation when error occurs during pwm mode 1 operation, and operation is restarted in reset-synchronized pwm mode figure 12.136 shows an explanatory diagram of the case where an error occurs in pwm mode 1 and operation is restarted in reset-synchronized pwm mode after re-setting. 1 power-on reset 2 tmdr (pwm1) 3 toer (1) 5 pfc (mtu2) 4 tior (1 init 0 out) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (normal) 12 tior (0 init 0 out) 13 tior ( disabled ) 14 toer (0) 15 tocr 16 tmdr (rpwm) 17 toer (1) 18 pfc (mtu2) 19 tstr (1) mtu2 module output tioc3a tioc3b tioc3d port output pb17 pb16 pb19 not initialized (tioc3b) not initialized (tioc3d) high-z high-z high-z figure 12.136 error occurrence in pwm mode 1, recovery in reset-synchronized pwm mode 1 to 14 are the same as in figure 12.135. 15. select the reset-synchronized pwm output level and cyclic output enabling/disabling with tocr. 16. set reset-synchronized pwm. 17. enable channel 3 and 4 output with toer. 18. set mtu2 output with the pfc. 19. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 579 of 1164 rej09b0321-0200 (13) operation when error occurs during pwm mode 2 operation, and operation is restarted in normal mode figure 12.137 shows an explanatory diagram of the case where an error occurs in pwm mode 2 and operation is restarted in normal mode after re-setting. 1 power-on reset mtu2 module output tioc * a tioc * b port output pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pwm2) 3 tior (1 init 0 out) 5 tstr (1) 4 pfc (mtu2) 6 match 7 error occurs 8 pfc (port) 9 tstr (0) 10 tmdr (normal) 11 tior (1 init 0 out) 12 pfc (mtu2) 13 tstr (1) not initialized (cycle register) high-z high-z figure 12.137 error occurrence in pw m mode 2, recovery in normal mode 1. after a reset, mtu2 output is low an d ports are in the high-impedance state. 2. set pwm mode 2. 3. initialize the pins with tior. (the example shows initial high output, with low output on compare-match occurrence. in pwm mode 2, the cycle register pins are not initialized. in the example, tioc *a is the cycle register.) 4. set mtu2 output with the pfc. 5. the count operation is started by tstr. 6. output goes low on compare-match occurrence. 7. an error occurs. 8. set port output with the pfc and output the inverse of the active level. 9. the count operation is stopped by tstr. 10. set normal mode. 11. initialize the pins with tior. 12. set mtu2 output with the pfc. 13. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 580 of 1164 rej09b0321-0200 (14) operation when error occurs during pwm mode 2 operation, and operation is restarted in pwm mode 1 figure 12.138 shows an explanatory diagram of the case where an error occurs in pwm mode 2 and operation is restarted in pwm mode 1 after re-setting. 1 power-on reset mtu2 module output tioc * a tioc * b port output pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pwm2) 3 tior (1 init 0 out) 5 tstr (1) 4 pfc (mtu2) 6 match 7 error occurs 8 pfc (port) 9 tstr (0) 10 tmdr (pwm1) 11 tior (1 init 0 out) 12 pfc (mtu2) 13 tstr (1) not initialized (tioc * b) not initialized (cycle register) high-z high-z figure 12.138 error occurrence in pwm mode 2, recovery in pwm mode 1 1 to 9 are the same as in figure 12.137. 10. set pwm mode 1. 11. initialize the pins with tior. (in pwm mode 1, the tioc*b side is not initialized.) 12. set mtu2 output with the pfc. 13. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 581 of 1164 rej09b0321-0200 (15) operation when error occurs during pwm mode 2 operation, and operation is restarted in pwm mode 2 figure 12.139 shows an explanatory diagram of the case where an error occurs in pwm mode 2 and operation is restarted in pwm mode 2 after re-setting. 1 power-on reset mtu2 module output tioc * a tioc * b port output pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pwm2) 3 tior (1 init 0 out) 5 tstr (1) 4 pfc (mtu2) 6 match 7 error occurs 8 pfc (port) 9 tstr (0) 10 tmdr (pwm2) 11 tior (1 init 0 out) 12 pfc (mtu2) 13 tstr (1) not initialized (cycle register) not initialized (cycle register) high-z high-z figure 12.139 error occurrence in pwm mode 2, recovery in pwm mode 2 1 to 9 are the same as in figure 12.137. 10. not necessary when restarting in pwm mode 2. 11. initialize the pins with tior. (in pwm mode 2, the cycle register pins are not initialized.) 12. set mtu2 output with the pfc. 13. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 582 of 1164 rej09b0321-0200 (16) operation when error occurs during pwm mode 2 operation, and operation is restarted in phase counting mode figure 12.140 shows an explanatory diagram of the case where an error occurs in pwm mode 2 and operation is restarted in phase counting mode after re-setting. 1 power-on reset mtu2 module output tioc * a tioc * b port output pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pwm2) 3 tior (1 init 0 out) 5 tstr (1) 4 pfc (mtu2) 6 match 7 error occurs 8 pfc (port) 9 tstr (0) 10 tmdr (pcm) 11 tior (1 init 0 out) 12 pfc (mtu2) 13 tstr (1) not initialized (cycle register) high-z high-z figure 12.140 error occurrence in pwm mo de 2, recovery in phase counting mode 1 to 9 are the same as in figure 12.137. 10. set phase counting mode. 11. initialize the pins with tior. 12. set mtu2 output with the pfc. 13. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 583 of 1164 rej09b0321-0200 (17) operation when error oc curs during phase counting mode operation, and operation is restarted in normal mode figure 12.141 shows an explanatory diagram of the case where an error oc curs in phase counting mode and operation is restarted in normal mode after re-setting. 1 power-on reset mtu2 module output tioc * a tioc * b port output pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pcm) 3 tior (1 init 0 out) 5 tstr (1) 4 pfc (mtu2) 6 match 7 error occurs 8 pfc (port) 9 tstr (0) 10 tmdr (normal) 11 tior (1 init 0 out) 12 pfc (mtu2) 13 tstr (1) high-z high-z figure 12.141 error occurrence in phase counting mode, recovery in normal mode 1. after a power-on reset, mtu2 output is low and ports are in the high-impedance state. 2. set phase counting mode. 3. initialize the pins with tior. (the example shows initial high output, with low output on compare-match occurrence.) 4. set mtu2 output with the pfc. 5. the count operation is started by tstr. 6. output goes low on compare-match occurrence. 7. an error occurs. 8. set port output with the pfc and output the inverse of the active level. 9. the count operation is stopped by tstr. 10. set in normal mode. 11. initialize the pins with tior. 12. set mtu2 output with the pfc. 13. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 584 of 1164 rej09b0321-0200 (18) operation when error oc curs during phase counting mode operation, and operation is restarted in pwm mode 1 figure 12.142 shows an explanatory diagram of th e case where an error occu rs in phase counting mode and operation is restarted in pwm mode 1 after re-setting. 1 power-on reset mtu2 module output tioc * a tioc * b port output pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pcm) 3 tior (1 init 0 out) 5 tstr (1) 4 pfc (mtu2) 6 match 7 error occurs 8 pfc (port) 9 tstr (0) 10 tmdr (pwm1) 11 tior (1 init 0 out) 12 pfc (mtu2) 13 tstr (1) not initialized (tioc * b) high-z high-z figure 12.142 error occurrence in phase counting mode, recovery in pwm mode 1 1 to 9 are the same as in figure 12.141. 10. set pwm mode 1. 11. initialize the pins with tior. (in pwm mode 1, the tioc *b side is not initialized.) 12. set mtu2 output with the pfc. 13. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 585 of 1164 rej09b0321-0200 (19) operation when error oc curs during phase counting mode operation, and operation is restarted in pwm mode 2 figure 12.143 shows an explanatory diagram of th e case where an error occu rs in phase counting mode and operation is restarted in pwm mode 2 after re-setting. 1 power-on reset mtu2 module output tioc * a tioc * b port output pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. 2 tmdr (pcm) 3 tior (1 init 0 out) 5 tstr (1) 4 pfc (mtu2) 6 match 7 error occurs 8 pfc (port) 9 tstr (0) 10 tmdr (pwm2) 11 tior (1 init 0 out) 12 pfc (mtu2) 13 tstr (1) high-z high-z not initialized (cycle register) figure 12.143 error occurrence in phase counting mode, recovery in pwm mode 2 1 to 9 are the same as in figure 12.141. 10. set pwm mode 2. 11. initialize the pins with tior. (in pwm mode 2, the cycle register pins are not initialized.) 12. set mtu2 output with the pfc. 13. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 586 of 1164 rej09b0321-0200 (20) operation when error oc curs during phase counting mode operation, and operation is restarted in phase counting mode figure 12.144 shows an explanatory diagram of th e case where an error occu rs in phase counting mode and operation is restarted in phase counting mode after re-setting. 2 tmdr (pcm) 3 tior (1 init 0 out) 5 tstr (1) 4 pfc (mtu2) 6 match 7 error occurs 8 pfc (port) 9 tstr (0) 10 tmdr (pcm) 11 tior (1 init 0 out) 12 pfc (mtu2) 13 tstr (1) high-z high-z 1 power-on reset mtu2 module output tioc * a tioc * b port output pb, pc, pd * 1 pb, pc, pd * 2 notes: 1. this pin is multiplexed with tioc * a. 2. this pin is multiplexed with tioc * b. figure 12.144 error occur rence in phase counting mode, recovery in phase counting mode 1 to 9 are the same as in figure 12.141. 10. not necessary when restar ting in phase counting mode. 11. initialize the pins with tior. 12. set mtu2 output with the pfc. 13. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 587 of 1164 rej09b0321-0200 (21) operation when error occurs during complementary pwm mode operation, and operation is restarted in normal mode figure 12.145 shows an explanatory diagram of the case where an error occurs in complementary pwm mode and operation is restarted in normal mode after re-setting. 1 power-on reset 2 tocr 3 tmdr (cpwm) 5 pfc (mtu2) 4 toer (1) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (normal) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) mtu2 module output tioc3a tioc3b tioc3d port output pb17 pb16 pb19 high-z high-z high-z figure 12.145 error occurren ce in complementary pwm mode, recovery in normal mode 1. after a power-on reset, mtu2 output is low and ports are in the high-impedance state. 2. select the complementary pwm output level and cyclic output enabling/disabling with tocr. 3. set complementary pwm. 4. enable channel 3 and 4 output with toer. 5. set mtu2 output with the pfc. 6. the count operation is started by tstr. 7. the complementary pwm waveform is output on compare-match occurrence. 8. an error occurs. 9. set port output with the pfc and output the inverse of the active level. 10. the count operation is stopped by tstr. (mtu2 output becomes the complementary pwm output initial value.) 11. set normal mode. (mtu2 output goes low.) 12. initialize the pins with tior. 13. set mtu2 output with the pfc. 14. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 588 of 1164 rej09b0321-0200 (22) operation when error occurs during complementary pwm mode operation, and operation is restarted in pwm mode 1 figure 12.146 shows an explanatory diagram of the case where an error occurs in complementary pwm mode and operation is restarted in pwm mode 1 after re-setting. 1 power-on reset mtu2 module output pb17 pb16 pb19 2 tocr 3 tmdr (cpwm) 5 pfc (mtu2) 4 toer (1) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (pwm1) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) tioc3a tioc3b tioc3d port output not initialized (tioc3b) not initialized (tioc3d) high-z high-z high-z figure 12.146 error occurren ce in complementary pwm mode, recovery in pwm mode 1 1 to 10 are the same as in figure 12.145. 11. set pwm mode 1. (mtu2 output goes low.) 12. initialize the pins with tior. (in pwm mode 1, the tioc *b side is not initialized.) 13. set mtu2 output with the pfc. 14. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 589 of 1164 rej09b0321-0200 (23) operation when error occurs during complementary pwm mode operation, and operation is restarted in complementary pwm mode figure 12.147 shows an explanatory diagram of the case where an error occurs in complementary pwm mode and operation is restarted in complementary pwm mode after re-setting (when operation is restarted using the cycle and duty settings at the time the counter was stopped). 1 power-on reset mtu2 module output pb17 pb16 pb19 2 tocr 3 tmdr (cpwm) 5 pfc (mtu2) 4 toer (1) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 pfc (mtu2) 12 tstr (1) 13 match tioc3a tioc3b tioc3d port output high-z high-z high-z figure 12.147 error occurren ce in complementary pwm mode, recovery in complementary pwm mode 1 to 10 are the same as in figure 12.145. 11. set mtu2 output with the pfc. 12. operation is restarted by tstr. 13. the complementary pwm waveform is output on compare-match occurrence.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 590 of 1164 rej09b0321-0200 (24) operation when error occurs during complementary pwm mode operation, and operation is restarted in complementary pwm mode figure 12.148 shows an explanatory diagram of the case where an error occurs in complementary pwm mode and operation is restarted in complementary pwm mode after re-setting (when operation is restarted using completely new cycle and duty settings). 1 power-on reset mtu2 module output pb17 pb16 pb19 2 tocr 3 tmdr (cpwm) 5 pfc (mtu2) 4 toer (1) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (normal) 12 toer (0) 13 tocr 14 tmdr (cpwm) 15 toer (1) 16 pfc (mtu2) 17 tstr (1) tioc3a tioc3b tioc3d port output high-z high-z high-z figure 12.148 error occurren ce in complementary pwm mode, recovery in complementary pwm mode 1 to 10 are the same as in figure 12.145. 11. set normal mode and make new settings. (mtu2 output goes low.) 12. disable channel 3 and 4 output with toer. 13. select the complementary pwm mode output level and cyclic output enabling/disabling with tocr. 14. set complementary pwm. 15. enable channel 3 and 4 output with toer. 16. set mtu2 output with the pfc. 17. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 591 of 1164 rej09b0321-0200 (25) operation when error occurs during complementary pwm mode operation, and operation is restarted in reset-synchronized pwm mode figure 12.149 shows an explanatory diagram of the case where an error occurs in complementary pwm mode and operation is restarted in reset-synchronized pwm mode. 1 power-on reset mtu2 module output pb17 pb16 pb19 2 tocr 3 tmdr (cpwm) 5 pfc (mtu2) 4 toer (1) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (normal) 12 toer (0) 13 tocr 14 tmdr (rpwm) 15 toer (1) 16 pfc (mtu2) 17 tstr (1) tioc3a tioc3b tioc3d port output high-z high-z high-z figure 12.149 error occurren ce in complementary pwm mode, recovery in reset-synchronized pwm mode 1 to 10 are the same as in figure 12.145. 11. set normal mode. (mtu2 output goes low.) 12. disable channel 3 and 4 output with toer. 13. select the reset-synchronized pwm mode output level and cyclic output enabling/disabling with tocr. 14. set reset-synchronized pwm. 15. enable channel 3 and 4 output with toer. 16. set mtu2 output with the pfc. 17. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 592 of 1164 rej09b0321-0200 (26) operation when error oc curs during reset-synchronized pwm mode operation, and operation is restarted in normal mode figure 12.150 shows an explanatory diagram of the case where an error occurs in reset- synchronized pwm mode and operation is restarted in normal mode after re-setting. 1 power-on reset mtu2 module output pb17 pb16 pb19 2 tocr 3 tmdr (rpwm) 5 pfc (mtu2) 4 toer (1) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (normal) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) tioc3a tioc3b tioc3d port output high-z high-z high-z figure 12.150 error occurrence in reset-synchronized pwm mode, recovery in normal mode 1. after a power-on reset, mtu2 output is low and ports are in the high-impedance state. 2. select the reset-synchronized pwm output level and cyclic output enabling/disabling with tocr. 3. set reset-synchronized pwm. 4. enable channel 3 and 4 output with toer. 5. set mtu2 output with the pfc. 6. the count operation is started by tstr. 7. the reset-synchronized pwm waveform is output on compare-match occurrence. 8. an error occurs. 9. set port output with the pfc and output the inverse of the active level. 10. the count operation is stopped by tstr. (mtu2 output becomes the reset-synchronized pwm output initial value.) 11. set normal mode. (mtu2 positive phase output is low, and negative phase output is high.) 12. initialize the pins with tior. 13. set mtu2 output with the pfc. 14. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 593 of 1164 rej09b0321-0200 (27) operation when error oc curs during reset-synchronized pwm mode operation, and operation is restarted in pwm mode 1 figure 12.151 shows an explanatory diagram of the case where an error occurs in reset- synchronized pwm mode and operation is re started in pwm mode 1 after re-setting. 1 power-on reset mtu2 module output pb17 pb16 pb19 2 tocr 3 tmdr (rpwm) 5 pfc (mtu2) 4 toer (1) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 tmdr (pwm1) 12 tior (1 init 0 out) 13 pfc (mtu2) 14 tstr (1) tioc3a tioc3b tioc3d port output not initialized (tioc3b) not initialized (tioc3d) high-z high-z high-z figure 12.151 error occurrence in reset-synchronized pwm mode, recovery in pwm mode 1 1 to 10 are the same as in figure 12.150. 11. set pwm mode 1. (mtu2 positive phase output is low, and negative phase output is high.) 12. initialize the pins with tior. (in pwm mode 1, the tioc *b side is not initialized.) 13. set mtu2 output with the pfc. 14. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 594 of 1164 rej09b0321-0200 (28) operation when error oc curs during reset-synchronized pwm mode operation, and operation is restarted in complementary pwm mode figure 12.152 shows an explanatory diagram of the case where an error occurs in reset- synchronized pwm mode and operation is restarted in complementary pwm mode after re- setting. 1 power-on reset mtu2 module output pb17 pb16 pb19 2 tocr 3 tmdr (rpwm) 5 pfc (mtu2) 4 toer (1) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 toer (0) 12 tocr 13 tmdr (cpwm) 14 toer (1) 15 pfc (mtu2) 16 tstr (1) tioc3a tioc3b tioc3d port output high-z high-z high-z figure 12.152 error occurrence in reset-synchronized pwm mode, recovery in complementary pwm mode 1 to 10 are the same as in figure 12.150. 11. disable channel 3 and 4 output with toer. 12. select the complementary pwm output level and cyclic output enabling/disabling with tocr. 13. set complementary pwm. (the mtu2 cyclic output pin goes low.) 14. enable channel 3 and 4 output with toer. 15. set mtu2 output with the pfc. 16. operation is restarted by tstr.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 595 of 1164 rej09b0321-0200 (29) operation when error oc curs during reset-synchronized pwm mode operation, and operation is restarted in reset-synchronized pwm mode figure 12.153 shows an explanatory diagram of the case where an error occurs in reset- synchronized pwm mode and operation is restarted in reset-synchronized pwm mode after re- setting. 1 power-on reset 2 tocr 3 tmdr (rpwm) 5 pfc (mtu2) 4 toer (1) 6 tstr (1) 7 match 8 error occurs 9 pfc (port) 10 tstr (0) 11 pfc (mtu2) 12 tstr (1) 13 match mtu2 module output tioc3a tioc3b tioc3d port output pb17 pb16 pb19 high-z high-z high-z high-z high-z high-z figure 12.153 error occurrence in reset-synchronized pwm mode, recovery in reset-synchronized pwm mode 1 to 10 are the same as in figure 12.150. 11. set mtu2 output with the pfc. 12. operation is restarted by tstr. 13. the reset-synchronized pwm waveform is output on compare-match occurrence.
section 12 multi-function timer pulse unit 2 (mtu2) rev. 2.00 sep. 07, 2007 page 596 of 1164 rej09b0321-0200
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 597 of 1164 rej09b0321-0200 section 13 8-bit timers (tmr) this lsi has an on-chip 2-channel 8-bit timer based on an 8-bit counter. it can be used to count external events and, using compar e-match signals with two registers, as a multifunction timer in a variety of applications, such as the generation of counter resets, interrupt requests, and pulse output with a user-defined duty cycle. figure 13.1 shows a block diagram of the 8-bit timer. 13.1 features ? selection of seven clock sources the counters can be driven by one of six internal clock signals (p /8, p /64, p /8192, p /2, p /32, or p /1024) or an external clock input. ? selection of three ways to clear the counters the counters can be cleared on compare match a or b, or by an external reset signal. ? timer output control by a combination of two compare match signals the timer output signal in each channel is controlled by a combination of two independent compare match signals, enabling the timer to output pulses with a desired duty cycle or pwm output. ? cascading of two channels (tmr_0 and tmr_1) operation as a 16-bit timer is possible, using tmr_0 for the upper 8 bits and tmr_1 for the lower 8 bits (16-bit count mode). tmr_1 can be used to count tmr_0 compare matches (compare match count mode). ? three interrupt sources compare match a, compare match b, and overflow interrupts can be requested independently. ? generation of trigger to start a/d converter conversion
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 598 of 1164 rej09b0321-0200 cmia0 cmia1 cmib0 cmib1 ovi0 ovi1 tmo0 tmo1 tmci0 tmci1 tmri0 tmri1 tcora_1: tcnt_1: tcorb_1: tcsr_1: tcr_1: tccr_1: tcora_0: tcnt_0: tcorb_0: tcsr_0: tcr_0: tccr_0: p /8 p /64 p /8192 p /2 p /32 p /1024 counter clock 1 counter clock 0 compare match a1 compare match a0 overflow 1 overflow 0 counter clear 0 counter clear 1 compare match b1 compare match b0 comparator a_0 comparator a_1 tcora_0 tcorb_0 tcsr_0 tccr_0 tcora_1 tcnt_1 tcorb_1 tcsr_1 tccr_1 tcr_0 tcr_1 tcnt_0 comparator b_0 comparator b_1 a/d conversion start request signal peripheral bus time constant register a_1 timer counter_1 time constant register b_1 timer control/status register_1 timer control register_1 timer counter control register_1 time constant register a_0 timer counter_0 time constant register b_0 timer control/status register_0 timer control register_0 timer counter control register_0 interrupt signals internal clocks clock select control logic external clocks [legend] figure 13.1 block di agram of 8-bit timer
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 599 of 1164 rej09b0321-0200 13.2 input/output pins table 13.1 shows the pin configuration of the tmr. table 13.1 pin configuration channel name sy mbol i/o function 0 timer output pin tmo0 output outputs compare match timer clock input pin tmci0 input inputs external clock for counter timer reset input pin tmri0 input inputs external reset to counter 1 timer output pin tmo1 output outputs compare match timer clock input pin tmci1 input inputs external clock for counter timer reset input pin tmri1 input inputs external reset to counter 13.3 register descriptions the tmr has the following registers. channel 0: ? timer counter_0 (tcnt_0) ? time constant register a_0 (tcora_0) ? time constant register b_0 (tcorb_0) ? timer control register_0 (tcr_0) ? timer counter control register_0 (tccr_0) ? timer control/status register_0 (tcsr_0) channel 1: ? timer counter_1 (tcnt_1) ? time constant register a_1 (tcora_1) ? time constant register b_1 (tcorb_1) ? timer control register_1 (tcr_1) ? timer counter control register_1 (tccr_1) ? timer control/status register_1 (tcsr_1)
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 600 of 1164 rej09b0321-0200 13.3.1 timer counter (tcnt) tcnt is an 8-bit readable/writable up-counter. tcnt_0 and tcnt_1 comprise a single 16-bit register so they can be accessed together by a word transfer instruction. bits cks2 to cks0 in tcr and bits icks1 and icks0 in tccr are used to select a clock. tcnt can be cleared by an external reset input signal, compare match a signal, or compare match b signal. which signal is to be used for clearing is selected by bits cclr1 and cclr0 in tcr. when tcnt overflows from h'ff to h'00, bit ovf in tcsr is set to 1. tcnt is initialized to h'00. 0 1 2 3 4 5 6 7 000 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: 0 1 2 3 4 5 6 7 000 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w tcnt_0 tcnt_1 13.3.2 time constant register a (tcora) tcora is an 8-bit readable/writable register. tcora_0 and tcora_1 comprise a single 16-bit register so they can be accessed together by a wo rd transfer inst ruction. the value in tcora is continually compared with the value in tcnt. when a match is detected, the corresponding cmfa flag in tcsr is set to 1. note however that comparison is disabled during the t2 state of a tcora write cycle. the timer output from the tmo pin can be freely controlled by this compare match signal (compare match a) and the settings of bits os1 and os0 in tcsr. tcora is initialized to h'ff. 0 1 2 3 4 5 6 7 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: 0 1 2 3 4 5 6 7 r/w r/w r/w r/w r/w r/w r/w r/w tcora_0 tcora_1
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 601 of 1164 rej09b0321-0200 13.3.3 time constant register b (tcorb) tcorb is an 8-bit readable/writable register. tcorb_0 and tcorb_1 comprise a single 16-bit register so they can be accessed together by a wo rd transfer inst ruction. tcorb is continually compared with the value in tcnt . when a match is detected, th e corresponding cmfb flag in tcsr is set to 1. note however that comparison is disabled during the t2 state of a tcorb write cycle. the timer output from the tmo pin can be freely controlled by this compare match signal (compare match b) and the settings of bits os3 and os2 in tcsr. tcorb is initialized to h'ff. 0 1 2 3 4 5 6 7 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: 0 1 2 3 4 5 6 7 r/w r/w r/w r/w r/w r/w r/w r/w tcorb_0 tcorb_1 13.3.4 timer control register (tcr) tcr selects the tcnt clock source and the condition for clearing tcnt, and enables/disables interrupt requests. 0 0 0 0 0 0 0 0 0 cks[2:0] cclr[1:0] ovie cmiea cmieb 1 2 3 4 5 6 7 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit bit name initial value r/w description 7 cmieb 0 r/w compare match interrupt enable b selects whether cmfb interrupt requests (cmib) are enabled or disabled when the cmfb flag in tcsr is set to 1. 0: cmfb interrupt requests (cmib) are disabled 1: cmfb interrupt requests (cmib) are enabled
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 602 of 1164 rej09b0321-0200 bit bit name initial value r/w description 6 cmiea 0 r/w compare match interrupt enable a selects whether cmfa interrupt requests (cmia) are enabled or disabled when the cmfa flag in tcsr is set to 1. 0: cmfa interrupt requests (cmia) are disabled 1: cmfa interrupt requests (cmia) are enabled 5 ovie 0 r/w timer overflow interrupt enable selects whether ovf interrupt requests (ovi) are enabled or disabled when the ovf flag in tcsr is set to 1. 0: ovf interrupt requests (ovi) are disabled 1: ovf interrupt requests (ovi) are enabled 4, 3 cclr[1:0] 00 r/w counter clear 1 and 0 * these bits select the method by which tcnt is cleared. 00: clearing is disabled 01: cleared by compare match a 10: cleared by compare match b 11: cleared at rising edge (tmris in tccr is cleared to 0) of the external reset input or when the external reset input is high (tmris in tccr is set to 1) 2 to 0 cks[2:0] 000 r/w clock select 2 to 0 * these bits select the clock input to tcnt and count condition. see table 13.2. note: * to use an external reset or external clock, the function of the corresponding pin should be selected using the pin function controller (pfc). for details, see section 23, pin function controller (pfc).
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 603 of 1164 rej09b0321-0200 13.3.5 timer counter co ntrol register (tccr) tccr selects the tcnt internal clock source and controls external reset input. 0 1 2 3 4 5 6 7 icks[1:0] ? tmris ? ? ? ? 000 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: bit bit name initial value r/w description 7 to 4 ? all 0 r/w reserved these bits are always read as 0. the write value should always be 0. 3 tmris 0 r/w timer reset input select selects an external reset input when the cclr1 and cclr0 bits in tcr are b'11. 0: cleared at rising edge of the external reset 1: cleared when the external reset is high 2 ? 0 r/w reserved this bit is always read as 0. the write value should always be 0 1, 0 icks[1:0] 00 r/w internal clock select 1 and 0 these bits in combination with bits cks2 to cks0 in tcr select the internal clock. see table 13.2.
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 604 of 1164 rej09b0321-0200 table 13.2 clock input to tcnt and count condition tcr tccr channel bit 2 cks2 bit 1 cks1 bit 0 cks0 bit 1 icks1 bit 0 icks0 description tmr_0 0 0 0 ? ? clock input prohibited. 0 0 1 0 0 uses internal clock. counts at rising edge of p /8. 0 1 uses internal clock. counts at rising edge of p /2. 1 0 uses internal clock. counts at falling edge of p /8. 1 1 uses internal clock. counts at falling edge of p /2. 0 1 0 0 0 uses internal clock. counts at rising edge of p /64. 0 1 uses internal clock. counts at rising edge of p /32. 1 0 uses internal clock. counts at falling edge of p /64. 1 1 uses internal clock. counts at falling edge of p /32. 0 1 1 0 0 uses internal clock. counts at rising edge of p /8192. 0 1 uses internal clock. counts at rising edge of p /1024. 1 0 uses internal clock. counts at falling edge of p /8192. 1 1 uses internal clock. counts at falling edge of p /1024. 1 0 0 ? ? counts at tcnt_1 overflow signal * 1 . tmr_1 0 0 0 ? ? clock input prohibited. 0 0 1 0 0 uses internal clock. counts at rising edge of p /8. 0 1 uses internal clock. counts at rising edge of p /2. 1 0 uses internal clock. counts at falling edge of p /8. 1 1 uses internal clock. counts at falling edge of p /2. 0 1 0 0 0 uses internal clock. counts at rising edge of p /64. 0 1 uses internal clock. counts at rising edge of p /32. 1 0 uses internal clock. counts at falling edge of p /64. 1 1 uses internal clock. counts at falling edge of p /32. 0 1 1 0 0 uses internal clock. counts at rising edge of p /8192. 0 1 uses internal clock. counts at rising edge of p /1024. 1 0 uses internal clock. counts at falling edge of p /8192. 1 1 uses internal clock. counts at falling edge of p /1024. 1 0 0 ? ? counts at tcnt_0 compare match a * 1 .
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 605 of 1164 rej09b0321-0200 tcr tccr channel bit 2 cks2 bit 1 cks1 bit 0 cks0 bit 1 icks1 bit 0 icks0 description all 1 0 1 ? ? uses external clock. counts at rising edge * 2 . 1 1 0 ? ? uses external clock. counts at falling edge * 2 . 1 1 1 ? ? uses external clock. counts at both rising and falling edges * 2 . notes: 1. if the clock input of tmr_0 is the t cnt_1 overflow signal and that of tmr_1 is the tcnt_0 compare match signal, no incrementi ng clock is generated. do not use this setting. 2. to use the external clock, the function of the corresponding pin should be selected using the pin function controller (pfc). for details, see section 23, pin function controller (pfc). 13.3.6 timer control/s tatus register (tcsr) tcsr displays status flags, and controls compare match output. ? tcsr_0 0 0 0 0 0 0 0 0 0 os[1:0] os[3:2] adte ovf cmfa cmfb 1 2 3 4 5 6 7 r/(w) * r/(w) * r/(w) * r/w r/w r/w r/w r/w bit: initial value: r/w: note: * only 0 can be written to this bit, to clear the flag. ? tcsr_1 0 0 0 0 0 0 0 0 0 os[1:0] os[3:2] ? ovf cmfa cmfb 1 2 3 4 5 6 7 r/(w) * r/(w) * r/(w) * r r/w r/w r/w r/w bit: initial value: r/w: note: * only 0 can be written to this bit, to clear the flag.
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 606 of 1164 rej09b0321-0200 ? tcsr_0 bit bit name initial value r/w description 7 cmfb 0 r/(w) * 1 compare match flag b [setting condition] ? when tcnt matches tcorb [clearing condition] ? when writing 0 after reading cmfb = 1 6 cmfa 0 r/(w) * 1 compare match flag a [setting condition] ? when tcnt matches tcora [clearing condition] ? when writing 0 after reading cmfa = 1 5 ovf 0 r/(w) * 1 timer overflow flag [setting condition] ? when tcnt overflows from h'ff to h'00 [clearing condition] ? when writing 0 after reading ovf = 1 4 adte 0 r/w a/d trigger enable selects enabling or disabling of a/d converter start requests by compare match a. 0: a/d converter start requests by compare match a are disabled 1: a/d converter start requests by compare match a are enabled 3, 2 os[3:2] 00 r/w output select 3 and 2 * 2 these bits select a method of tmo pin output when compare match b of tcorb and tcnt occurs. 00: no change when compare match b occurs 01: 0 is output when compare match b occurs 10: 1 is output when compare match b occurs 11: output is inverted when compare match b occurs (toggle output)
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 607 of 1164 rej09b0321-0200 bit bit name initial value r/w description 1, 0 os[1:0] 00 r/w output select 1 and 0 * 2 these bits select a method of tmo pin output when compare match a of tcora and tcnt occurs. 00: no change when compare match a occurs 01: 0 is output when compare match a occurs 10: 1 is output when compare match a occurs 11: output is inverted when compare match a occurs (toggle output) notes: 1. only 0 can be written to bi ts 7 to 5, to clear these flags. 2. timer output is disabled when bits os3 to os0 are all 0. timer output is 0 until the first compare match occurs after resetting. ? tcsr_1 bit bit name initial value r/w description 7 cmfb 0 r/(w) * 1 compare match flag b [setting condition] ? when tcnt matches tcorb [clearing condition] ? when writing 0 after reading cmfb = 1 6 cmfa 0 r/(w) * 1 compare match flag a [setting condition] ? when tcnt matches tcora [clearing condition] ? when writing 0 after reading cmfa = 1 5 ovf 0 r/(w) * 1 timer overflow flag [setting condition] ? when tcnt overflows from h'ff to h'00 [clearing condition] ? when writing 0 after reading ovf = 1
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 608 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 ? 0 r reserved this is a read-only bit and cannot be modified. 3, 2 os[3:2] 00 r/w output select 3 and 2 * 2 these bits select a method of tmo pin output when compare match b of tcorb and tcnt occurs. 00: no change when compare match b occurs 01: 0 is output when compare match b occurs 10: 1 is output when compare match b occurs 11: output is inverted when compare match b occurs (toggle output) 1, 0 os[1:0] 00 r/w output select 1 and 0 * 2 these bits select a method of tmo pin output when compare match a of tcora and tcnt occurs. 00: no change when compare match a occurs 01: 0 is output when compare match a occurs 10: 1 is output when compare match a occurs 11: output is inverted when compare match a occurs (toggle output) notes: 1. only 0 can be written to bi ts 7 to 5, to clear these flags. 2. timer output is disabled when bits os3 to os0 are all 0. timer output is 0 until the first compare match occurs after resetting.
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 609 of 1164 rej09b0321-0200 13.4 operation 13.4.1 pulse output figure 13.2 shows an example of the 8-bit timer being used to generate a pulse output with a desired duty cycle. the control bits are set as follows: 1. in tcr, clear bit cclr1 to 0 and set bit ccl r0 to 1 so that tcnt is cleared at a tcora compare match. 2. in tcsr, set bits os3 to os0 to b'0110, causing the output to change to 1 at a tcora compare match and to 0 at a tcorb compare match. with these settings, the 8-bit timer provides pulses output at a cycle determined by tcora with a pulse width determined by tcorb. no software intervention is required. the output level of the 8-bit timer holds 0 until the first compare match occurs after a reset. tcnt h'ff counter clear tcora tcorb h'00 tmo figure 13.2 example of pulse output
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 610 of 1164 rej09b0321-0200 13.4.2 reset input figure 13.3 shows an example of the 8-bit timer being used to generate a pulse which is output after a desired delay time from a tmri inpu t. the control bits are set as follows: 1. set both bits cclr1 and cclr0 in tcr to 1 and set the tmris bit in tccr to 1 so that tcnt is cleared at the high level input of the tmri signal. 2. in tcsr, set bits os3 to os0 to b'0110, causing the output to change to 1 at a tcora compare match and to 0 at a tcorb compare match. with these settings, the 8-bit timer provides pulses output at a desired delay time from a tmri input determined by tcora and with a pulse width determined by tcorb and tcora. tcnt tcorb tcora h'00 tmri tmo figure 13.3 example of reset input
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 611 of 1164 rej09b0321-0200 13.5 operation timing 13.5.1 tcnt count timing figure 13.4 shows the tcnt count timing for internal clock input. figure 13.5 shows the tcnt count timing for external clock input. note that the external clock pulse width must be at least 1.5 states for incrementation at a single edge, and at l east 2.5 states for increm entation at both edges. the counter will not increment correctly if the pulse width is less than these values. p internal clock tcnt input clock tcnt n ? 1 n n + 1 figure 13.4 count timing for internal clock input at falling edge p external clock input pin tcnt input clock tcnt n ? 1 n n + 1 figure 13.5 count timing for external clock input at falling and rising edges
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 612 of 1164 rej09b0321-0200 13.5.2 timing of cmfa and cm fb setting at compare match the cmfa and cmfb flags in tcsr are set to 1 by a compare match signal generated when the tcor and tcnt values match. the compare match si gnal is generated at the last state in which the match is true, just before the timer counter is updated. therefore, when the tcor and tcnt values match, the compare match signal is not generated until the next tcnt clock input. figure 13.6 shows this timing. p tcnt n n + 1 tcor n compare match signal cmf figure 13.6 timing of cmf setting at compare match 13.5.3 timing of timer output at compare match when a compare match signal is generated, the timer output changes as specified by bits os3 to os0 in tcsr. figure 13.7 shows the timing when the timer output is toggled by the compare match a signal. p compare match a signal timer output pin figure 13.7 timing of toggled timer output at compare match a
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 613 of 1164 rej09b0321-0200 13.5.4 timing of counter clear by compare match tcnt is cleared when compare match a or b occurs, depending on the settings of bits cclr1 and cclr0 in tcr. figure 13.8 shows the timing of this operation. p n h'00 compare match signal tcnt figure 13.8 timing of co unter clear by compare match 13.5.5 timing of tc nt external reset tcnt is cleared at the rising edge or high level of an external reset input, depending on the settings of bits cclr1 and cclr0 in tcr. the clear pulse width must be at least 2 states. figures 13.9 and 13.10 show the timing of this operation. p clear signal external reset input pin tcnt n h'00 n ? 1 figure 13.9 timing of clearan ce by external reset (rising edge) p clear signal external reset input pin tcnt n h'00 n ? 1 figure 13.10 timing of clearan ce by external reset (high level)
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 614 of 1164 rej09b0321-0200 13.5.6 timing of overf low flag (ovf) setting the ovf bit in tcsr is set to 1 when tcnt overflows (changes from h'ff to h'00). figure 13.11 shows the timing of this operation. p ovf overflow signal tcnt h'ff h'00 figure 13.11 timing of ovf setting 13.6 operation with cascaded connection if bits cks2 to cks0 in either tcr_0 or tcr_1 are set to b'100, the 8-bit timers of the two channels are cascaded. with this configuration, a single 16-bit timer could be used (16-bit counter mode) or compare matches of the 8-bit channel 0 could be counted by the timer of channel 1 (compare match count mode). 13.6.1 16-bit counter mode when bits cks2 to cks0 in tcr_0 are set to b' 100, the timer functions as a single 16-bit timer with channel 0 occupying the upper 8 bits and channel 1 occupying the lower 8 bits. (1) setting of compare match flags ? the cmf flag in tcsr_0 is set to 1 when a 16-bit compare match event occurs. ? the cmf flag in tcsr_1 is set to 1 when a lower 8-bit compare match event occurs. (2) counter clear specification ? if the cclr1 and cclr0 bits in tcr_0 have been set for counter clear at compare match, the 16-bit counter (tcnt_0 and tcnt_1 together) is cleared when a 16-b it compare match event occurs. the 16-bit counter (tcnt0 and tcnt1 toge ther) is cleared even if counter clear by the tmri0 pin has been set. ? the settings of the cclr1 and cclr0 bits in tc r_1 are ignored. the lower 8 bits cannot be cleared independently.
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 615 of 1164 rej09b0321-0200 (3) pin output ? control of output from the tmo0 pin by bits os3 to os0 in tcsr_0 is in accordance with the 16-bit compare match conditions. ? control of output from the tmo1 pin by bits os3 to os0 in tcsr_1 is in accordance with the lower 8-bit compare match conditions. 13.6.2 compare match count mode when bits cks2 to cks0 in tcr_1 are set to b'100, tcnt_1 counts compare match a for channel 0. channels 0 and 1 are controlled independently. conditions such as setting of the cmf flag, generation of interrupts, output from the tmo pin, and counter clear are in accordance with the settings for each channel. 13.7 interrupt sources 13.7.1 interrupt sources there are three interrupt sources for the 8-bit timer (tmr_0 or tmr_1): cmia, cmib, and ovi. their interrupt sources and priorities are shown in table 13.3. each interrupt source is enabled or disabled by the corresponding interrupt enable bit in tcr or tcsr, and independent interrupt requests are sent for each to the interrupt controller. table 13.3 8-bit timer (tmr_0 or tmr_1) interrupt sources name interrupt source interrupt flag priority cmia0 tcora_0 compare match cmfa high cmib0 tcorb_0 compare match cmfb ovi0 tcnt_0 overflow ovf low cmia1 tcora_1 compare match cmfa high cmib1 tcorb_1 compare match cmfb ovi1 tcnt_1 overflow ovf low
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 616 of 1164 rej09b0321-0200 13.7.2 a/d converter activation the a/d converter can be activated only by tmr_0 compare match a. if the adte bit in tcsr_0 is set to 1 when the cmfa flag in tcsr_0 is set to 1 by the occurrence of tmr_0 compare match a, a request to start a/d conversion is sent to the a/d converter. if the 8-bit timer conve rsion start trigger has been select ed on the a/d converter side at this time, a/d conversion is started. 13.8 usage notes 13.8.1 notes on setting cycle if the compare match is selected for counter clear, tc nt is cleared at the last state in the cycle in which the values of tcnt and tcor match. tcnt updates the counter value at this last state. therefore, the counter frequency is obtained by the following formula. f = p /(n + 1) f: counter frequency p : operating frequency n: tcor value 13.8.2 conflict between tcnt write and clear if a counter clear signal is generated during the t 2 state of a tcnt write cycle, the clear takes priority and the write is not performed as shown in figure 13.12. p address tcnt address internal write signal counter clear signal tcnt n h'00 t 1 t 2 tcnt write cycle by cpu figure 13.12 conflict between tcnt write and clear
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 617 of 1164 rej09b0321-0200 13.8.3 conflict between tc nt write and increment if a tcnt input clock pulse is generated during the t 2 state of a tcnt write cycle, the write takes priority and the counter is not incremented as shown in figure 13.13. p address tcnt address internal write signal tcnt input clock tcnt n m t 1 t 2 tcnt write cycle by cpu counter write data figure 13.13 conflict between tcnt write and increment 13.8.4 conflict between tcor write and compare match if a compare match event occurs during the t 2 state of a tcor write cycle, the tcor write takes priority and the compare match signal is inhibited as shown in figure 13.14. p address tcor address internal write signal tcnt tcor n m t 1 t 2 tcor write cycle by cpu tcor write data n n + 1 compare match signal inhibited figure 13.14 conflict between tcor write and compare match
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 618 of 1164 rej09b0321-0200 13.8.5 conflict between compare matches a and b if compare match events a and b occur at the same time, the 8-bit timer operates in accordance with the priorities for the output statuses set fo r compare match a and comp are match b, as shown in table 13.4. table 13.4 timer output priorities output setting priority toggle output high 1-output 0-output no change low 13.8.6 switching of internal clocks and tcnt operation tcnt may be incremented erroneously depending on when the internal clock is switched. table 13.5 shows the relationship between the timing at which the internal clock is switched (by writing to bits cks1 and cks0) and the tcnt operation. when the tcnt clock is generated from an internal clock, the rising or falling edge of the internal clock pulse are always monitored. table 13.5 assu mes that the falling edge is selected. if the signal levels of the clocks before and after switching change from high to low as shown in item 3, the change is considered as the falling edge. th erefore, a tcnt clock pulse is generated and tcnt is incremented. this is similar to when the rising edge is selected. the erroneous incrementation of tcnt can also happen when switching between rising and falling edges of the internal clock, and when switching between internal and external clocks.
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 619 of 1164 rej09b0321-0200 table 13.5 switching of internal clock and tcnt operation no. timing to change cks1 and cks0 bits tcnt clock operation 1 switching from low to low * 1 clock before switchover clock after switchover tcnt input clock tcnt cks bits changed n n + 1 2 switching from low to high * 2 clock before switchover clock after switchover tcnt input clock tcnt cks bits changed n n + 1 n + 2 3 switching from high to low * 3 clock before switchover clock after switchover tcnt input clock tcnt cks bits changed n n + 1 n + 2 * 4
section 13 8-bit timers (tmr) rev. 2.00 sep. 07, 2007 page 620 of 1164 rej09b0321-0200 no. timing to change cks1 and cks0 bits tcnt clock operation 4 switching from high to high clock before switchover clock after switchover tcnt input clock tcnt cks bits changed n n + 1 n + 2 notes: 1. includes switching from low to stop, and from stop to low. 2. includes switching from stop to high. 3. includes switching from high to stop. 4. generated because the chan ge of the signal levels is considered as a falling edge; tcnt is incremented. 13.8.7 mode setting wi th cascaded connection if 16-bit counter mode and compare match count mode are specified at the same time, input clocks for tcnt_0 and tcnt_1 are not generated, and the counter stops. do not specify 16-bit counter mode and compare match count mode simultaneously. 13.8.8 module standby setting operation of the tmr can be disabled or enabled using the standby control register. the initial setting is for operation of the tmr to be halted. register access is enab led by clearing module standby mode. for details, see section 25, power-down modes. 13.8.9 interrupts in module standby mode if module standby mode is entered when an interrup t has been requested, it will not be possible to clear the cpu interrupt source. interrupts should therefore be disabled before entering module standby mode.
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 621 of 1164 rej09b0321-0200 section 14 watchdog timer (wdt) this lsi includes the watchdog timer (wdt), which externally outputs an overflow signal ( wdtovf ) on overflow of the counter when the value of the counter has not been updated because of a system malfunction. the wdt can simu ltaneously generate an internal reset signal for the entire lsi. the wdt is a single channel timer that counts up the clock oscillation settling period when the system leaves software standby mode or the temporary standby periods that occur when the clock frequency is changed. it can also be used as a general watchdog timer or interval timer. 14.1 features ? can be used to ensure the clock oscillation settling time the wdt is used in leaving software standby mode or the temporary standby periods that occur when the clock frequency is changed. ? can switch between watchdog timer mode and interval timer mode. ? outputs wdtovf signal in watchdog timer mode when the counter overflows in watchdog timer mode, the wdtovf signal is output externally. it is possible to select whether to reset the lsi internally when this happens. either the power-on reset or manual reset signal can be selected as the internal reset type. ? interrupt generation in interval timer mode an interval timer interrupt is generated when the counter overflows. ? choice of eight counter input clocks eight clocks (p 1 to p 1/16384) that are obtained by dividing the peripheral clock can be selected.
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 622 of 1164 rej09b0321-0200 figure 14.1 shows a block diagram of the wdt. wdtovf wtcsr wtcnt wrcsr wdt standby control bus interface divider clock selector clock standby mode peripheral clock standby cancellation reset control clock selection overflow internal reset request * interrupt control interrupt request [legend] wtcsr: wtcnt: wrcsr: watchdog timer control/status register watchdog timer counter watchdog reset control/status register note: * the internal reset signal can be generated by making a register setting. figure 14.1 block diagram of wdt 14.2 input/output pin table 14.1 shows the pin configuration of the wdt. table 14.1 pin configuration pin name symbol i/o function watchdog timer overflow wdtovf output outputs the count er overflow signal in watchdog timer mode
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 623 of 1164 rej09b0321-0200 14.3 register descriptions the wdt has the follo wing registers. table 14.2 register configuration register name abbreviation r/w initial value address access size watchdog timer counter wtcnt r/w h'00 h'fffe0002 16 * watchdog timer control/status register wtcsr r/w h'18 h'fffe0000 16 * watchdog reset control/status register wrcsr r/w h'1f h'fffe0004 16 * note: * for the access size, see section 14.3.4, notes on register access. 14.3.1 watchdog timer counter (wtcnt) wtcnt is an 8-bit readable/writable register that is incremented by cycles of the selected clock signal. when an overflow occurs, it generates a watchdog timer overflow signal ( wdtovf ) in watchdog timer mode and an interrupt in interval timer mode. wtcnt is initialized to h'00 by a power-on reset caused by the res pin or in deep standby mode or software standby mode. use word access to write to wtcn t, writing h'5a in the upper byte. use byte access to read from wtcnt. note: the method for writing to wtcnt differs from that for other registers to prevent erroneous writes. see section 14.3.4, no tes on register access, for details. 0 1 2 3 4 5 6 7 0 0 0 r/w r/w r/w 0 0 0 r/w r/w r/w 0 0 r/w r/w bit: initial value: r/w:
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 624 of 1164 rej09b0321-0200 14.3.2 watchdog timer contro l/status register (wtcsr) wtcsr is an 8-bit readable/writable register composed of bits to select the clock used for the count, overflow flags, and timer enable bit. wtcsr is initialized to h'18 by a power-on reset caused by the res pin or in deep standby mode or software standby mode. when used to count the clock oscill ation settling time for canceling software standby mode, it retains its value after counter overflow. use word access to write to wtcsr, writing h'a5 in the upper byte. use byte access to read from wtcsr. note: the method for writing to wtcsr differs from that for other registers to prevent erroneous writes. see section 14.3.4, notes on register access, for details. 0 1 2 3 4 5 6 7 0 0 0 r/w r/w r/(w) 0 1 1 r/w r r 0 0 r/w r/w bit: initial value: r/w: iovf wt/ it tme ? ? cks[2:0] bit bit name initial value r/w description 7 iovf 0 r/(w) interval timer overflow indicates that wtcnt has overflowed in interval timer mode. this flag is not set in watchdog timer mode. 0: no overflow 1: wtcnt overflow in interval timer mode [clearing condition] ? when 0 is written to iovf after reading iovf 6 wt/ it 0 r/w timer mode select selects whether to use the wdt as a watchdog timer or an interval timer. 0: use as interval timer mode 1: use as watchdog timer mode note: when the wtcnt overflows in watchdog timer mode, the wdtovf signal is output externally. if this bit is modified when the wdt is running, the up-count may not be performed correctly.
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 625 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 tme 0 r/w timer enable starts and stops timer operation. clear this bit to 0 when using the wdt in software standby mode or when changing the clock frequency. 0: timer disabled count-up stops and wtcnt value is retained 1: timer enabled 4, 3 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. clock select these bits select the clock to be used for the wtcnt count from the eight types obtainable by dividing the peripheral clock (p ). the overflow period that is shown inside the parenthesis in the table is the value when the peripheral clock (p ) is 25 mhz. bits 2 to 0 clock ratio overflow cycle 000: 1 p 10.2 s 001: 1/64 p 655.4 s 010: 1/128 p 1.3 ms 011: 1/256 p 2.6 ms 100: 1/512 p 5.2 ms 101: 1/1024 p 10.5 ms 110: 1/4096 p 41.9 ms 111: 1/16384 p 167.8 ms 2 to 0 cks[2:0] 000 r/w note: if bits cks[2:0] are modified when the wdt is running, the up-count may not be performed correctly. ensure that these bits are modified only when the wdt is not running.
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 626 of 1164 rej09b0321-0200 14.3.3 watchdog reset control/status register (wrcsr) wrcsr is an 8-bit readable/writable register that controls output of the internal reset signal generated by watchdog timer counter (wtcnt) overflow. wrcsr is initialized to h'1f by input of a reset signal from the res pin or in deep standby mode, but is not initialized by the internal reset signal generated by overflow of the wdt. wrcsr is initialized to h'1f in software standby mode. note: the method for writing to wrcsr differs from that for other registers to prevent erroneous writes. see section 14.3.4, notes on register access, for details. 0 1 2 3 4 5 6 7 ? ? ? ? ? rsts rste wovf 11111 0 0 0 r r r r r r/w r/w r/(w) bit: initial value: r/w: bit bit name initial value r/w description 7 wovf 0 r/(w) watchdog timer overflow indicates that the wtcnt has overflowed in watchdog timer mode. this bit is not set in interval timer mode. 0: no overflow 1: wtcnt has overflowed in watchdog timer mode [clearing condition] ? when 0 is written to wovf after reading wovf 6 rste 0 r/w reset enable selects whether to generate a signal to reset the lsi internally if wtcnt overflows in watchdog timer mode. in interval timer mode, this setting is ignored. 0: not reset when wtcnt overflows * 1: reset when wtcnt overflows note: * lsi not reset internally, but wtcnt and wtcsr reset within wdt.
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 627 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 rsts 0 r/w reset select selects the type of reset when the wtcnt overflows in watchdog timer mode. in interval timer mode, this setting is ignored. 0: power-on reset 1: manual reset 4 to 0 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. 14.3.4 notes on register access the watchdog timer counter (wtcnt), watchdog timer control/status register (wtcsr), and watchdog reset control/status register (wrcsr) are more difficult to write to than other registers. the procedures for reading or writing to these registers are given below. (1) writing to wtcnt and wtcsr these registers must be written by a word transfer in struction. they cannot be written by a byte or longword transfer instruction. when writing to wtcnt, set the upper byte to h'5a and transfer the lower byte as the write data, as shown in figure 14.2. when writing to wtcsr, set the upper byte to h'a5 and transfer the lower byte as the write data. this transfer proc edure writes the lower byte data to wtcnt or wtcsr. h'5a 15 8 7 0 h'a5 15 8 7 0 write data address: h'fffe0002 wtcnt write write data address: h'fffe0000 wtcsr write figure 14.2 writing to wtcnt and wtcsr
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 628 of 1164 rej09b0321-0200 (2) writing to wrcsr wrcsr must be written by a word access to address h'fffe0004. it cannot be written by byte transfer or longword transfer instructions. procedures for writing 0 to wovf (bit 7) and for writing to rste (bit 6) and rsts (bit 5) are different, as shown in figure 14.3. to write 0 to the wovf bit, the write data must be h'a5 in the upper byte and h'00 in the lower byte. this clears the wovf bit to 0. the rste and rsts bits are not affected. to write to the rste and rsts bits, the upper byte must be h'5a and the lower byte must be the write data. the values of bits 6 and 5 of the lower byte are transferred to the rste and rsts bits, respectively. the wovf bit is not affected. address: h'fffe0004 address: h'fffe0004 h'a5 h'00 15 8 7 0 h'5a 15 8 7 0 writing 0 to the wovf bit writing to the rste and rsts bits write data figure 14.3 writing to wrcsr (3) reading from wtcnt, wtcsr, and wrcsr wtcnt, wtcsr, and wrcsr are read in a meth od similar to other registers. wtcsr is allocated to address h'fffe00 00, wtcnt to address h'fffe0002, and wrcsr to address h'fffe0004. byte transfer instructions must be used for reading from these registers.
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 629 of 1164 rej09b0321-0200 14.4 wdt usage 14.4.1 canceling so ftware standby mode the wdt can be used to cancel software standby mode with an interrupt such as an nmi interrupt. the procedure is described below. (the wdt does not operate when resets are used for canceling, so keep the res or mres pin low until clock oscillation settles.) 1. before making a transition to software standby mode, always clear the tme bit in wtcsr to 0. when the tme bit is 1, an erroneous reset or interval timer interrupt may be generated when the count overflows. 2. set the type of count clock used in the cks[2:0] bits in wtcsr and the initial value of the counter in wtcnt. these values should ensure that the time till count overflow is longer than the clock oscillation settling time. 3. after setting the stby bit to 1 and the deep bit to 0 in the standby control register (stbcr: see section 25, power-down m odes), the execution of a sleep instruction places the system in software standby mode and clock operation then stops. 4. the wdt starts counting by detecti ng the edge change of the nmi signal. 5. when the wdt count overflow s, the cpg starts supplying the clock and this lsi resumes operation. the wovf flag in wrcsr is not set when this happens. 14.4.2 changing the frequency to change the frequency used by the pll, use the wdt. when changing the frequency only by switching the divider, do not use the wdt. 1. before changing the frequency, always clear the tme bit in wtcsr to 0. when the tme bit is 1, an erroneous reset or interval timer inte rrupt may be generated when the count overflows. 2. set the type of count clock used in the cks[2:0] bits in wtcsr and the initial value of the counter in wtcnt. these values should ensure that the time till count overflow is longer than the clock oscillation settling time. note that, the wdt counts up by the clock to be set. 3. when the frequency control register (frqcr) is written to, this lsi stops temporarily. the wdt starts counting. 4. when the wdt count overflows, the cpg resu mes supplying the clock and this lsi resumes operation. the wovf flag in wrcsr is not set when this happens. 5. the counter stops at the value of h'00. 6. before changing wtcnt after execution of the frequency change instruction, always confirm that the value of wtcnt is h'00 by reading from wtcnt.
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 630 of 1164 rej09b0321-0200 14.4.3 using watchdog timer mode 1. set the wt/ it bit in wtcsr to 1, the type of count clock in the cks[2:0] bits in wtcsr, whether this lsi is to be reset internally or not in the rste bit in wrcsr, the reset type if it is generated in the rsts bit in wrcsr, and the initial value of the counter in wtcnt. 2. set the tme bit in wtcsr to 1 to start the count in watchdog timer mode. 3. while operating in watchdog timer mode, rewrit e the counter periodically to h'00 to prevent the counter from overflowing. 4. when the counter overflows, the wdt sets the wovf flag in wrcsr to 1, and the wdtovf signal is output externally (figure 14.4). the wdtovf signal can be used to reset the system. the wdtovf signal is output for 64 p clock cycles. 5. if the rste bit in wrcsr is set to 1, a signal to reset the inside of this lsi can be generated simultaneously with the wdtovf signal. either power-on reset or manual reset can be selected for this interrupt by the rsts bit in wrcsr. the internal reset signal is output for 128 p clock cycles. 6. when a wdt overflow reset is generated simultaneously with a reset input on the res pin, the res pin reset takes priority, and the wovf bit in wrcsr is cleared to 0. h'ff h'00 overflow h'00 written in wtcnt internal reset signal * wdtovf signal wtcnt value wdtovf and internal reset generated wt/ it : tme: timer mode select bit timer enable bit h'00 written in wtcnt time 128 p clock cycles 64 p clock cycles note: * internal reset signal occurs only when the rste bit is set to 1. [legend] wt/ it = 1 tme = 1 wt/ it = 1 tme = 1 wovf = 1 figure 14.4 operation in watchdog timer mode
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 631 of 1164 rej09b0321-0200 14.4.4 using interval timer mode when operating in interval timer mode, interval tim er interrupts are generated at every overflow of the counter. this enables interrupts to be generated at set periods. 1. clear the wt/ it bit in wtcsr to 0, set the type of count clock in the cks[2:0] bits in wtcsr, and set the initial value of the counter in wtcnt. 2. set the tme bit in wtcsr to 1 to start the count in interval timer mode. 3. when the counter overflows, the wdt sets the iovf bit in wtcsr to 1 and an interval timer interrupt request is sent to the intc. the counter then resumes counting. h'ff iti iti iti iti h'00 wtcnt value iti: interval timer interrupt request generation wt/ it = 0 tme = 1 time overflow overflow overflow overflow [legend] figure 14.5 operation in interval timer mode
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 632 of 1164 rej09b0321-0200 14.5 usage notes pay attention to the following points when using the wdt in either the interval timer or watchdog timer mode. 14.5.1 timer variation after timer operation has started, the period from the power-on reset point to the first count up timing of wtcnt varies depending on the time period that is set by the tme bit of wtcsr. the shortest such time period is thus one cycle of the peripheral clock, p , while the longest is the result of frequency division according to the value in the cks[2:0] bits. the timing of subsequent incrementation is in accord with the selected frequency division ratio. accordingly, this time difference is referred to as timer variation. this also applies to the timing of the first incr ementation after wtcnt has been written to during timer operation. 14.5.2 prohibition against setting h'ff to wtcnt when the value in wtcnt reaches h'ff, the wdt assumes that an overflow has occurred. accordingly, when h'ff is set in wtcnt, an in terval timer interrupt or wdt reset will occur immediately, regardless of the current clock selection by the cks[2:0] bits. 14.5.3 system reset by wdtovf signal if the wdtovf signal is input to the res pin of this lsi, this lsi cannot be initialized correctly. avoid input of the wdtovf signal to the res pin of this lsi through glue logic circuits. to reset the entire system with the wdtovf signal, use the circuit shown in figure 14.6. res wdtovf reset input reset signal to entire system (low active) (low active) figure 14.6 example of system reset circuit using wdtovf signal
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 633 of 1164 rej09b0321-0200 14.5.4 manual reset in watchdog timer mode when a manual reset occurs in watchdog timer mode, the bus cycle is continued. if a manual reset occurs during dmac burst transfer, manual reset exception handling will be pended until the cpu acquires the bus mastership. however, if the duration from generation of the ma nual reset to the bus cycle end is equal to or longer than the duration of the internal manual reset activated, the occurrence of the internal manual reset source is ignored instead of being pe nded, and the manual rese t exception handling is not executed.
section 14 watchdog timer (wdt) rev. 2.00 sep. 07, 2007 page 634 of 1164 rej09b0321-0200
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 635 of 1164 rej09b0321-0200 section 15 realtime clock (rtc) this lsi has a realtime clock (rtc) with its own 32.768-khz crystal oscillator. 15.1 features ? clock and calendar functions (bcd format): seconds, minutes, hours, date, day of the week, month, and year ? 1-hz to 64-hz timer (binary format) 64-hz counter indicates the state of the rtc divider circuit between 64 hz and 1 hz ? start/stop function ? 30-second adjust function ? alarm interrupt: frame comparison of seconds, minutes, hours, date, day of the week, month, and year can be used as conditions for the alarm interrupt ? periodic interrupts: the interrupt cycle may be 1/256 second, 1/64 second, 1/16 second, 1/4 second, 1/2 second, 1 second, or 2 seconds ? carry interrupt: a carry interrupt indicates when a carry occurs during a counter read ? automatic leap year adjustment
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 636 of 1164 rej09b0321-0200 figure 15.1 shows the block diagram of rtc. rhrcnt rseccnt: rmincnt: rhrcnt: rwkcnt: rdaycnt: rmoncnt: ryrcnt: r64cnt: rcr1: second counter (8 bits) minute counter (8 bits) hour counter (8 bits) day of week counter (8 bits) date counter (8 bits) month counter (8 bits) year counter (16 bits) 64-hz counter (8 bits) rtc control register 1 (8 bits) rmincnt interrupt control circuit rdaycnt ryrcnt rmoncnt oscillator circuit rtc_x1 rtc_x2 rcr2 rcr3 rwkcnt rhrar rminar rdayar rwkar externally connected circuit prescaler 32.768 khz 128 hz arm prd cup rcr1 rtc operation control circuit r64cnt rseccnt rsecar count interrupt signals rsecar: rminar: rhrar: rwkar: rdayar: rmonar: ryrar: rcr2: rcr3: second alarm register (8 bits) minute alarm registger (8 bits) hour alarm register (8 bits) day of week alarm register (8 bits) date alarm register (8 bits) month alarm register (8 bits) year alarm register (16 bits) rtc control register 2 (8 bits) rtc control register 3 (8 bits) rmonar ryrar [legend] bus interface peripheral bus figure 15.1 rtc block diagram
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 637 of 1164 rej09b0321-0200 15.2 input/output pin table 15.1 shows the rtc pin configuration. table 15.1 pin configuration name abbreviation i/o description rtc oscillator crystal pin rtc_x1 input connects 32.768-khz crystal resonator for rtc rtc oscillator crystal pin rtc_x2 output connects 32.768-khz crystal resonator for rtc 15.3 register descriptions the rtc has the following registers. table 15.2 register configuration register name abbreviation r/w initial value address access size 64-hz counter r64cnt r h'xx h'fffe0800 8 second counter rseccnt r/w h'xx h'fffe0802 8 minute counter rmincnt r/w h'xx h'fffe0804 8 hour counter rhrcnt r/w h'xx h'fffe0806 8 day of week counter rwkcnt r/w h'0x h'fffe0808 8 date counter rdaycnt r/w h'xx h'fffe080a 8 month counter rmoncnt r/w h'xx h'fffe080c 8 year counter ryrcnt r/w h'xxxx h'fffe080e 16 second alarm register rsecar r/w h'xx h'fffe0810 8 minute alarm register rminar r/w h'xx h'fffe0812 8 hour alarm register rhrar r/w h'xx h'fffe0814 8 day of week alarm register rwkar r/w h'0x h'fffe0816 8 date alarm register rdayar r/w h'xx h'fffe0818 8 month alarm register rmonar r/w h'xx h'fffe081a 8 year alarm register ryrar r/w h'xxxx h'fffe0820 16
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 638 of 1164 rej09b0321-0200 register name abbreviation r/w initial value address access size rtc control register 1 rcr1 r/w h'00 h'fffe081c 8 rtc control register 2 rcr2 r/w h'09 h'fffe081e 8 rtc control register 3 rcr3 r/w h'00 h'fffe0824 8 15.3.1 64-hz counter (r64cnt) r64cnt indicates the state of the divider circuit between 64 hz and 1 hz. reading this register, when carry from 128-hz divider stage is generated, sets the cf bit in the rtc control register 1 (rcr1) to 1 so that the carrying and reading 64 hz counter are performed at the same time is indicated. in this case, the r64cnt should be read again after writing 0 to the cf bit in rcr1 since the read value is not valid. after the reset bit or adj bit in the rtc control register 2 (rcr2) is set to 1, the rtc divider circuit is initialized and r64cnt is initialized to h'00. r64cnt is not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r r r r r r r r bit: initial value: r/w: ? ??????? 1hz 2hz 4hz 8hz 16hz 32hz 64hz bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 1 hz undefined r 5 2 hz undefined r 4 4 hz undefined r 3 8 hz undefined r 2 16 hz undefined r 1 32 hz undefined r 0 64 hz undefined r indicate the state of the divider circuit between 64 hz and 1 hz.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 639 of 1164 rej09b0321-0200 15.3.2 second counter (rseccnt) rseccnt is used for setting/counting in the bcd-c oded second section. the count operation is performed by a carry fo r each second of the 64 - hz counter. the assignable range is from 00 through 59 (practically in bcd), otherwise operation errors occur. carry out write processing after stoppin g the count operation through the setting of the start bit in rcr2. rseccnt is not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r/w r/w r/w r/w r/w r/w r/w r bit: initial value: r/w: ? ??????? 10 seconds 1 second bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 to 4 10 seconds undefined r/w c ounting ten's position of seconds counts on 0 to 5 for 60-seconds counting. 3 to 0 1 second undefined r/w counting one's position of seconds counts on 0 to 9 once per second. when a carry is generated, 1 is added to the ten's position.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 640 of 1164 rej09b0321-0200 15.3.3 minute counter (rmincnt) rmincnt is used for setting/counting in the bcd-coded minute section. the count operation is performed by a carry for each minute of the second counter. the assignable range is from 00 through 59 (practically in bcd), otherwise operation errors occur. carry out write processing after stopping the count operation through the setting of the start bit in rcr2. rmincnt is not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r/w r/w r/w r/w r/w r/w r/w r bit: initial value: r/w: ? ??????? 10 minutes 1 minute bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0.the write value should always be 0. 6 to 4 10 minutes undefined r/w c ounting ten's position of minutes counts on 0 to 5 for 60-minutes counting. 3 to 0 1 minute undefined r/w c ounting one's position of minutes counts on 0 to 9 once per second. when a carry is generated, 1 is added to the ten's position.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 641 of 1164 rej09b0321-0200 15.3.4 hour counter (rhrcnt) rhrcnt is used for setting/counting in the bcd-coded hour section. the count operation is performed by a carry for each 1 hour of the minute counter. the assignable range is from 00 through 23 (pract ically in bcd), otherwise operation errors occur. carry out write processing after stopping the count operation through the setting of the start bit in rcr2. rhrcnt is not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r/w r/w r/w r/w r/w r/w r 0 r bit: initial value: r/w: ?? ?????? 10 hours 1 hour bit bit name initial value r/w description 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5, 4 10 hours undefined r/w c ounting ten's position of hours counts on 0 to 2 for ten's position of hours. 3 to 0 1 hour undefined r/w c ounting one's position of hours counts on 0 to 9 once per hour. when a carry is generated, 1 is added to the ten's position.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 642 of 1164 rej09b0321-0200 15.3.5 day of week counter (rwkcnt) rwkcnt is used for setting/counting day of week section. the count operation is performed by a carry for each day of the date counter. the assignable range is from 0 through 6 (practically in bcd), otherwise operation errors occur. carry out write processing after stopping the count operation through the setting of the start bit in rcr2. rwkcnt is not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r/w r/w r/w r 0 r bit: initial value: r/w: ?? 0 r ? 0 r ? 0 r ? ??? day bit bit name initial value r/w description 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 to 0 day undefined r/w day-of-week counting day-of-week is indicated with a binary code. 000: sunday 001: monday 010: tuesday 011: wednesday 100: thursday 101: friday 110: saturday 111: reserved (setting prohibited)
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 643 of 1164 rej09b0321-0200 15.3.6 date counter (rdaycnt) rdaycnt is used for setting/counting in the bcd-coded date section. the count operation is performed by a carry for each day of the hour counter. the assignable range is from 01 through 31 (pract ically in bcd), otherwise operation errors occur. carry out write processing after stopping the count operation through the setting of the start bit in rcr2. rdaycnt is not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. the range of date changes with each month and in leap years. please confirm the correct setting. leap years are recognized by dividing the year counter values by 400, 100, and 4 and obtaining a fractional result of 0. the year counter va lue of 0000 is included in the leap year. 0 1 2 3 4 5 6 7 0 r/w r/w r/w r 0 r bit: initial value: r/w: ?? 10 days ?? r/w r/w ? r/w ?? ? 1 day bit bit name initial value r/w description 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5, 4 10 days undefined r/w count ing ten's position of dates 3 to 0 1 day undefined r/w counting one's position of dates counts on 0 to 9 once per date. when a carry is generated, 1 is added to the ten's position.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 644 of 1164 rej09b0321-0200 15.3.7 month counter (rmoncnt) rmoncnt is used for setting/counting in the bcd-coded month section. the count operation is performed by a carry for each month of the date counter. the assignable range is from 01 through 12 (prac tically in bcd), otherwise operation errors occur. carry out write processing after stopping the count operation through the setting of the start bit in rcr2. rmoncnt is not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r/w r/w r/w r 0 r bit: initial value: r/w: ?? 0 r ? 10 months ?? r/w r/w ?? ? 1 month bit bit name initial value r/w description 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 10 months undefined r/w count ing ten's position of months 3 to 0 1 month undefined r/w c ounting one's position of months counts on 0 to 9 once per month. when a carry is generated, 1 is added to the ten's position.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 645 of 1164 rej09b0321-0200 15.3.8 year counter (ryrcnt) ryrcnt is used for setting/counting in the bcd-coded year section. the count operation is performed by a carry for each year of the month counter. the assignable range is from 0000 through 9999 (practically in bcd), otherwise operation errors occur. carry out write processing after stopping the count operation through the setting of the start bit in rcr2. ryrcnt is not initialized by a power-on reset or manual reset, in deep standby mode or software standby mode. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 15 14 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: 1000 years 100 years 10 years 1 year ? ?? ? ?? ? ?? ? ?? ? ?? ? bit bit name initial value r/w description 15 to 12 1000 years undefined r/w c ounting thousand's position of years 11 to 8 100 years undefined r/w counting hundred's position of years 7 to 4 10 years undefined r/w c ounting ten's position of years 3 to 0 1 year undefined r/w c ounting one's position of years
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 646 of 1164 rej09b0321-0200 15.3.9 second alarm register (rsecar) rsecar is an alarm register corresponding to the bcd coded second counter rseccnt of the rtc. when the enb bit is set to 1, a comparis on with the rseccnt value is performed. from among rsecar/rminar/rh rar/rwkar/rdayar/rmonar /rcr3, the counter and alarm register comparison is perf ormed only on those with enb bits set to 1, and if each of those coincides, an alarm flag of rcr1 is set to 1. the assignable range is from 00 through 59 + enb bits (practically in bcd), otherwise operation errors occur. the enb bit in rsecar is initialized to 0 by a power-on reset or in deep standby mode. the other bits are not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: enb ??????? 10 seconds 1 second bit bit name initial value r/w description 7 enb 0 r/w when this bit is set to 1, a comparison with the rseccnt value is performed. 6 to 4 10 seconds undefined r/w ten' s position of seconds setting value 3 to 0 1 second undefined r/w one' s position of seconds setting value
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 647 of 1164 rej09b0321-0200 15.3.10 minute alarm register (rminar) rminar is an alarm register corresponding to the minute counter rmincnt. when the enb bit is set to 1, a comparison with the rmincnt value is performed. from among rsecar/rminar/rhrar/rwkar/rdayar/rmonar/rcr3, the counter and alarm register comparison is performed only on those with enb bits set to 1, and if each of those coincides, an alarm flag of rcr1 is set to 1. the assignable range is from 00 through 59 + enb bits (practically in bcd), otherwise operation errors occur. the enb bit in rminar is initialized by a power-on reset or in deep standby mode. the other bits are not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: enb ??????? 10 minutes 1 minute bit bit name initial value r/w description 7 enb 0 r/w when this bit is set to 1, a comparison with the rmincnt value is performed. 6 to 4 10 minutes undefined r/w ten' s position of minutes setting value 3 to 0 1 minute undefined r/w one' s position of minutes setting value
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 648 of 1164 rej09b0321-0200 15.3.11 hour alarm register (rhrar) rhrar is an alarm register co rresponding to the bcd coded hour counter rhrcnt of the rtc. when the enb bit is set to 1, a comparison wi th the rhrcnt value is performed. from among rsecar/rminar/rhrar/rwkar/rdayar/rmonar/rcr3, the counter and alarm register comparison is performed only on those with enb bits set to 1, and if each of those coincides, an alarm flag of rcr1 is set to 1. the assignable range is from 00 through 23 + enb bits (practically in bcd), otherwise operation errors occur. the enb bit in rhrar is initialized by a power-on reset or in deep standby mode. the other bits are not initialized by a power-on reset or manual re set, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r/w r/w r/w r/w r/w r/w r/w 0 r bit: initial value: r/w: enb ? ?????? 10 hours 1 hour bit bit name initial value r/w description 7 enb 0 r/w when this bit is set to 1, a comparison with the rhrcnt value is performed. 6 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 5, 4 10 hours undefined r/w ten' s position of hours setting value 3 to 0 1 hour undefined r/w one' s position of hours setting value
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 649 of 1164 rej09b0321-0200 15.3.12 day of week alarm register (rwkar) rwkar is an alarm register co rresponding to the bcd coded day of week counter rwkcnt. when the enb bit is set to 1, a comparison w ith the rwkcnt value is performed. from among rsecar/rminar/rhrar/rwkar/rdayar/rmonar/rcr3, the counter and alarm register comparison is performed only on those with enb bits set to 1, and if each of those coincides, an alarm flag of rcr1 is set to 1. the assignable range is from 0 through 6 + enb bits (practically in bcd), otherwise operation errors occur. the enb bit in rwkar is initialized by a power-on reset or in deep standby mode. the other bits are not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. r/w enb 0 1 2 3 4 5 6 7 0 r/w r/w r/w 0 r bit: initial value: r/w: ? 0 r ? 0 r ? 0 r ? ??? day bit bit name initial value r/w description 7 enb 0 r/w when this bit is set to 1, a comparison with the rwkcnt value is performed. 6 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 2 to 0 day undefined r/w day of week setting value 000: sunday 001: monday 010: tuesday 011: wednesday 100: thursday 101: friday 110: saturday 111: reserved (setting prohibited)
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 650 of 1164 rej09b0321-0200 15.3.13 date alarm register (rdayar) rdayar is an alarm register corresponding to the bcd coded date counter rdaycnt. when the enb bit is set to 1, a comparison with the rdaycnt value is performed. from among rsecar/rminar/rhrar/rwkar/rdayar/rmonar/rcr3, the counter and alarm register comparison is performed only on those with enb bits set to 1, and if each of those coincides, an alarm flag of rcr1 is set to 1. the assignable range is from 01 through 31 + en b bits (practically in bcd), otherwise operation errors occur. the enb bit in rdayar is initialized by a power-on reset or in deep standby mode. the other bits are not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. r/w enb 0 1 2 3 4 5 6 7 0 r/w r/w r/w 0 r bit: initial value: r/w: ? 10 days ?? r/w r/w ? r/w ?? ? 1 day bit bit name initial value r/w description 7 enb 0 r/w when this bit is set to 1, a comparison with the rdaycnt value is performed. 6 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 5, 4 10 days undefined r/w ten's position of dates setting value 3 to 0 1 day undefined r/w one's position of dates setting value
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 651 of 1164 rej09b0321-0200 15.3.14 month alarm register (rmonar) rmonar is an alarm register corresponding to the bcd coded month counter rmoncnt. when the enb bit is set to 1, a comparison w ith the rmoncnt value is performed. from among rsecar/rminar/rhrar/rwkar/rdayar/rmonar/rcr3, the counter and alarm register comparison is performed only on those with enb bits set to 1, and if each of those coincides, an alarm flag of rcr1 is set to 1. the assignable range is from 01 through 12 + en b bits (practically in bcd), otherwise operation errors occur. the enb bit in rmonar is initialized by a power-on reset or in deep standby mode. the other bits are not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. r/w enb 0 1 2 3 4 5 6 7 0 r/w r/w r/w 0 r bit: initial value: r/w: ? 0 r ? 10 months ?? r/w r/w ?? ? 1 month bit bit name initial value r/w description 7 enb 0 r/w when this bit is set to 1, a comparison with the rmoncnt value is performed. 6, 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 10 months undefined r/w ten's position of months setting value 3 to 0 1 month undefined r/w one' s position of months setting value
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 652 of 1164 rej09b0321-0200 15.3.15 year alarm register (ryrar) ryrar is an alarm register corr esponding to the year counter ryrcnt. the assignable range is from 0000 through 9999 (practically in bcd), otherwise operation errors occur. ryrar is not initialized by a power-on reset, a manual reset, or in deep standby mode and software standby mode. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 15 14 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: 1000 years 100 years 10 years 1 year ? ?? ? ?? ? ?? ? ?? ? ?? ? bit bit name initial value r/w description 15 to 12 1000 years undefined r/w thousa nd's position of years setting value 11 to 8 100 years undefined r/w hundred's position of years setting value 7 to 4 10 years undefined r/w ten' s position of years setting value 3 to 0 1 year undefined r/w one' s position of years setting value
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 653 of 1164 rej09b0321-0200 15.3.16 rtc control register 1 (rcr1) rcr1 is a register that affects carry flags and al arm flags. it also selects whether to generate interrupts for each flag. rcr1 is initialized to h'00 by a power-on reset, a manual reset, or in deep standby mode. the cf flag is retained undefined until the division circuit is reset (the reset and adj bits in rcr2 are set to 1). when using the cf flag, make sure to reset the divider circuit beforehand. this register is not initialized in software standby mode. 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 r r r r r/w r/w r/w r/w bit: initial value: r/w: cf ? ? ? cie aie ? ? af bit bit name initial value r/w description 7 cf undefined r/w carry flag status flag that indicates t hat a carry has occurred. cf is set to 1 when a count-up to 64-hz occurs at the second counter carry or 64-hz counter read. a count register value read at this time cannot be guaranteed; another read is required. 0: no carry of 64-hz counter by second counter or 64- hz counter [clearing condition] ? when 0 is written to cf 1: carry of 64-hz counter by second counter or 64 hz counter [setting condition] ? when the second counter or 64-hz counter is read during a carry occurrence by the 64-hz counter, or 1 is written to cf. 6, 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 654 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 cie 0 r/w carry interrupt enable flag when the carry flag (cf) is set to 1, the cie bit enables interrupts. 0: a carry interrupt is not generated when the cf flag is set to 1 1: a carry interrupt is generated when the cf flag is set to 1 3 aie 0 r/w alarm interrupt enable flag when the alarm flag (af) is set to 1, the aie bit allows interrupts. 0: an alarm interrupt is not generated when the af flag is set to 1 1: an alarm interrupt is generated when the af flag is set to 1 2, 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 af 0 r/w alarm flag the af flag is set when the alarm time, which is set by an alarm register (enb bit in rsecar, rminar, rhrar, rwkar, rdayar, rmonar, or ryrar is set to 1), and counter match. 0: alarm register and counter not match [clearing condition] ? when 0 is written to af. 1: alarm register and counter match * [setting condition] ? when alarm register (only a register with enb bit set to 1) and counter match note: * writing 1 holds previous value.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 655 of 1164 rej09b0321-0200 15.3.17 rtc control register 2 (rcr2) rcr2 is a register for periodic interrupt contro l, 30-second adjustment adj, divider circuit reset, and rtc count control. rcr2 is initialized to h'09 by a power-on reset or in deep standby mode. bits other than the rtcen and start bits are initialized by a manual rese t. it is not initialized in software standby mode, and retains its contents. 0 1 2 3 4 5 6 7 1 0 0 1 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: pef pes[2:0] rtcen adj reset start bit bit name initial value r/w description 7 pef 0 r/w periodic interrupt flag indicates interrupt generation with the period designated by the pes2 to pes0 bits. when set to 1, pef generates periodic interrupts. 0: interrupts not generated with the period designated by the bits pes2 to pes0. [clearing condition] ? when 0 is written to pef 1: interrupts generated wit h the period designated by the pes2 to pes0 bits. [setting condition] ? when an interrupt is generated with the period designated by the bits pes0 to pes2 or when 1 is written to the pef flag 6 to 4 pes[2:0] 000 r/w interrupt enable flags these bits specify the periodic interrupt. 000: no periodic interrupts generated 001: periodic interrupt generated every 1/256 second 010: periodic interrupt generated every 1/64 second 011: periodic interrupt generated every 1/16 second 100: periodic interrupt generated every 1/4 second 101: periodic interrupt generated every 1/2 second 110: periodic interrupt generated every 1 second 111: periodic interrupt generated every 2 seconds
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 656 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3 rtcen 1 r/w crystal oscillator control controls the operation of t he crystal oscillator for the rtc. 0: halts the crystal o scillator for the rtc. 1: runs the crystal oscillator for the rtc. 2 adj 0 r/w 30-second adjustment when 1 is written to the adj bit, times of 29 seconds or less will be rounded to 00 seconds and 30 seconds or more to 1 minute. the divi der circuit (rtc prescaler and r64cnt) will be simultaneously reset. this bit always reads 0. important: when using this bit, see section 15.5.5, procedure for setting the 30-second adjustment function. 0: runs normally. 1: 30-second adjustment. 1 reset 0 r/w reset writing 1 to this bit initialize s the divider circuit. in this case, the reset bit is automatically reset to 0 after 1 is written to and the divider circuit (rtc prescaler and r64cnt) is reset. thus, there is no need to write 1 to this bit. this bit is always read as 0. 0: runs normally. 1: divider circuit is reset. 0 start 1 r/w start bit halts and restarts the counter (clock). 0: second/minute/hour/day/week/month/year counter halts. 1: second/minute/hour/day/week/month/year counter runs normally. note: the 64-hz counter always runs unless stopped with the rtcen bit.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 657 of 1164 rej09b0321-0200 15.3.18 rtc control register 3 (rcr3) when the enb bit in rcr3 is set to 1, rcr3 compares the value of ryrcnt and that of ryrar. from among rsecar/rminar/ rhrar/rwkar/rdayar/ rmonar/rcr3, the counter and alarm register comparison is performed only on those with enb bits set to 1, and if each of those coincides, an alar m flag of rcr1 is set to 1. the enb bit in rcr3 is initialized by a power-on reset or in deep standby mode. remaining fields of rcr3 are not initialized by a power-on reset or manual reset, or in deep standby and software standby modes. 0 1 2 3 4 5 6 7 0 r/w 0 r 0 r 0 r 0 r 0 r 0 r 0 r bit: initial value: r/w: enb ? ? ? ? ? ?? bit bit name initial value r/w description 7 enb 0 r/w when this bit is set to 1, comparison of the year alarm register (ryrar) and the year counter (ryrcnt) is performed. 6 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 658 of 1164 rej09b0321-0200 15.4 operation rtc usage is shown below. 15.4.1 initial settings of registers after power-on all the registers should be set after the power is turned on. 15.4.2 setting time figure 15.2 shows how to set the time when the clock is stopped. write 1 to reset and 0 to start in the rcr2 register order is irrelevant write 1 to start in the rcr2 register set seconds, minutes, hour, day, day of the week, month, and year stop clock, reset divider circuit start clock figure 15.2 setting time
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 659 of 1164 rej09b0321-0200 15.4.3 reading time figure 15.3 shows how to read the time. disable the carry interrupt clear the carry flag read counter register carry flag = 1? yes no yes no read counter register interrupt disable the carry interrupt write 0 to cf in rcr1 (set af in rcr1 to 1 so that alarm flag is not cleared.) read rcr1 and check cf bit write 1 to cie in rcr1 write 0 to cie in rcr1 clear the carry flag enable the carry interrupt clear the carry flag write 0 to cf in rcr1 (set af in rcr1 to 1 so that alarm flag is not cleared.) read rcr1 and check cf bit write 0 to cie in rcr1 (a) to read the time without using interrupts (b) to read the time using interrupts figure 15.3 reading time if a carry occurs while reading the time, the correct time will not be obtained, so it must be read again. part (a) in figure 15.3 shows the method of reading the time without using interrupts; part (b) in figure 15.3 shows the method using carry interrupts. to keep programming simple, method (a) should normally be used.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 660 of 1164 rej09b0321-0200 15.4.4 alarm function figure 15.4 shows how to use the alarm function. write 0 to aie in rcr1 to prevent errorneous interrupt clock running set alarm time disable alarm interrupt always clear, since the flag may have been set while the alarm time was being set. write 1 to aie in rcr1 clear alarm flag enable alarm interrupt monitor alarm time (wait for interrupt or check alarm flag) figure 15.4 using alarm function alarms can be generated using seconds, minutes, hours, day of the week, date, month, year, or any combination of these. set the enb bit in the regist er on which the alarm is placed to 1, and then set the alarm time in the lower bits. clear the enb bit in the register on which the alarm is not placed to 0. when the clock and alarm times match, 1 is set in the af bit in rcr1. alarm detection can be checked by reading this bit, but normally it is done by interrupt. if 1 is set in the aie bit in rcr1, an interrupt is generated when an alarm occurs. the alarm flag is set when the clock and alarm times match. however, the alarm flag can be cleared by writing 0.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 661 of 1164 rej09b0321-0200 15.5 usage notes 15.5.1 register writing during rtc count do not write to the count registers (rse ccnt, rmincnt, rhrcnt, rdaycnt, rwkcnt, rmoncnt, and ryrcnt) during the rtc counting (while the start bit in rcr2 is 1). if any of the count registers is written to during the rtc counting, the count register may not be read correctly immediately after the execution of a write instruction. the rtc counting must be stopped before writing to any of the count registers. 15.5.2 use of real time clock (rtc) periodic interrupts the method of using the periodic interrupt function is shown in figure 15.5. a periodic interrupt can be generated periodically at the interval set by the flags pes0 to pes2 in rcr2. when the time set by the pes0 to pes2 has elapsed, the pef is set to 1. the pef is cleared to 0 upon periodic interrupt generation or when the flags pes0 to pes2 are set. periodic interrupt generation can be confirmed by reading this bit, but normally the interrupt function is used. set pes0 to pes2, and clear pef to 0, in rcr2 clear pef to 0 set pes, clear pef elapse of time set by pes clear pef figure 15.5 using periodic interrupt function
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 662 of 1164 rej09b0321-0200 15.5.3 transition to standby mode after setting register when a transition to standby mode is made after registers in the rtc are set, sometimes counting is not performed correctly. in case the registers ar e set, be sure to make a transition to standby mode after waiting for two rtc clocks or more. 15.5.4 crystal oscillator circuit for rtc crystal oscillator circuit constants (recommended values) for the rtc are shown in table 15.3, and the rtc crystal oscillator circuit in figure 15.6. table 15.3 crystal oscillator circu it constants (rec ommended values) f osc c in c out 32.768 khz 10 to 22 pf 10 to 22 pf this lsi rtc_x1 rtc_x2 xtal c in c out r f r d notes: 1. select either the c in or c out side for frequency adjustment variable capacitor according to requirements such as frequency range, degree of stability, etc. 2. built-in resistance value r f (typ value) = 10 m ? , r d (typ value) = 400 k ? 3. c in and c out values include floating capacitance due to the wiring. take care when using a ground plane. 4. the crystal oscillation stabilization time may differ depending on the mounted circuit component constants, stray capacitance, and so forth, so a suitable value should be determined in consultation with the resonator manufacturer. 5. place the crystal resonator and load capacitors c in and c out as close as possible to the chip. make wiring length as short as possible. do not allocate signal lines close to oscillation circuit. (correct oscillation may not be possible if there is externally induced noise in the rtc_x1 and rtc_x2 pins.) 6. ensure that the wiring of the crystal oscillator connection pins (rtc_x1 and rtc_x2) is routed as far away as possible from the power lines (except gnd) and signal lines. 7. when crystal oscillation circuit for rtc is not used, connect the rtc_x1 pin to gnd and leave the rtc_x2 pin open figure 15.6 example of connectin g crystal oscillator circuit for rtc
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 663 of 1164 rej09b0321-0200 15.5.5 procedure for setting the 30-second adjustment function figure 15.7 shows the procedure for setting the 30-second adjustment function. clear the start bit in rcr2 to 0. the order is irrelevant. for the respective counters, read out each value and then write it back. stop clock set minutes, hours, date, day of the week, month, and year set adj bit start clock set the adj bit in rcr2 to 1. set the start bit in rcr2 to 1. figure 15.7 procedure for setting the 30-second adjustment function to use the 30-second adjustment function, the minutes, hours, date, day of the week, month, and year counters need to be written to. thus, after clearing the start bit in rcr2 and reading out the minutes, hours, date, day of the week, month, and year counters and then writing the read values back, set the adj bit in rcr2 to 1. after the 30-second adjustment, set the start bit in rcr2 to 1 to start the clock operation.
section 15 realtime clock (rtc) rev. 2.00 sep. 07, 2007 page 664 of 1164 rej09b0321-0200
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 665 of 1164 rej09b0321-0200 section 16 serial communi cation interface with fifo (scif) this lsi has an eight-channel serial communicati on interface with fifo (scif) that supports both asynchronous and clocked synchronous serial communication. it also has 16-stage fifo registers for both transmission and reception independently for each channel that enable this lsi to perform efficient high-speed co ntinuous communication. 16.1 features ? asynchronous serial communication: ? serial data communication is performed by st art-stop in character units. the scif can communicate with a un iversal asynchronous receiver/tran smitter (uart), an asynchronous communication interface adapter (acia), or any other communications chip that employs a standard asynchronous seri al system. there are eight selectable serial data communication formats. ? data length: 7 or 8 bits ? stop bit length: 1 or 2 bits ? parity: even, odd, or none ? receive error detection: parity , framing, and overrun errors ? break detection: break is detected when a fram ing error is followed by at least one frame at the space 0 level (low level). it is also detect ed by reading the rxd level directly from the serial port register when a framing error occurs. ? clocked synchronous serial communication: ? serial data communication is synchronized w ith a clock signal. the scif can communicate with other chips having a clocked synchronous communication function. there is one serial data communication format. ? data length: 8 bits ? receive error detecti on: overrun errors ? full duplex communication: the transmitting and receiving sections are independent, so the scif can transmit and receive simultaneously. bo th sections use 16-stage fifo buffering, so high-speed continuous data transfer is possible in both the transmit and receive directions. ? on-chip baud rate generator with selectable bit rates ? internal or external tr ansmit/receive clock source: from either baud rate generator (internal) or sck pin (external)
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 666 of 1164 rej09b0321-0200 ? four types of interrupts: tr ansmit-fifo-data-empty, break , receive-fifo-data-full, and receive-error interrupts are requested independently. ? when the scif is not in use, it can be stopped by halting the clock supplied to it, saving power. ? the quantity of data in the transmit and receive fifo re gisters and the number of receive errors of the receive data in the recei ve fifo register can be ascertained. ? a time-out error (dr) can be detected when receiving in asynchronous mode. figure 16.1 shows a block diagram of the scif. p scfrdr (16 stage) scftdr (16 stage) scrsr sctsr scsmr sclsr scfdr scfcr scfsr scscr scsptr scbrr txi rxi eri bri p /4 p /16 p /64 sck txd rxd scif module data bus parity generation parity check transmission/reception control baud rate generator clock external clock bus interface peripheral bus scrsr: scfrdr: sctsr: scftdr: scsmr: scscr: [legend] scfsr: scbrr: scsptr: scfcr: scfdr: sclsr: receive shift register receive fifo data register transmit shift register transmit fifo data register serial mode register serial control register serial status register bit rate register serial port register fifo control register fifo data count register line status register figure 16.1 block diagram of scif
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 667 of 1164 rej09b0321-0200 16.2 input/output pins table 16.1 shows the pin configuration of the scif. table 16.1 pin configuration channel pin name symbol i/o function serial clock pins sc k0 to sck7 i/o clock i/o receive data pins rxd0 to rx d7 input receive data input 0 to 7 transmit data pins txd0 to tx d7 output transmit data output 16.3 register descriptions the scif has the following registers. table 16.2 register configuration channel register name abbreviation r/w initial value address access size serial mode register_0 scsmr_0 r/w h'0000 h'fffe8000 16 bit rate register_0 scbrr_0 r/w h'ff h'fffe8004 8 serial control register_0 scscr_0 r/w h'0000 h'fffe8008 16 transmit fifo data register_0 scftdr_0 w undefined h'fffe800c 8 serial status register_0 scfsr_0 r/(w) * 1 h'0060 h'fffe8010 16 receive fifo data register_0 scfrdr_0 r undefined h'fffe8014 8 fifo control register_0 scfcr_0 r/w h'0000 h'fffe8018 16 fifo data count register_0 scfdr_0 r h'0000 h'fffe801c 16 serial port register_0 scsptr_0 r/w h'0050 h'fffe8020 16 0 line status register_0 sclsr_0 r/(w) * 2 h'0000 h'fffe8024 16
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 668 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size serial mode register_1 scsmr_1 r/w h'0000 h'fffe8800 16 bit rate register_1 scbrr_1 r/w h'ff h'fffe8804 8 serial control register_1 scscr_1 r/w h'0000 h'fffe8808 16 transmit fifo data register_1 scftdr_1 w undefined h'fffe880c 8 serial status register_1 scfsr_1 r/(w) * 1 h'0060 h'fffe8810 16 receive fifo data register_1 scfrdr_1 r undefined h'fffe8814 8 fifo control register_1 scfcr_1 r/w h'0000 h'fffe8818 16 fifo data count register_1 scfdr_1 r h'0000 h'fffe881c 16 serial port register_1 scsptr_1 r/w h'0050 h'fffe8820 16 1 line status register_1 sclsr_1 r/(w) * 2 h'0000 h'fffe8824 16 serial mode register_2 scsmr_2 r/w h'0000 h'fffe9000 16 bit rate register_2 scbrr_2 r/w h'ff h'fffe9004 8 serial control register_2 scscr_2 r/w h'0000 h'fffe9008 16 transmit fifo data register_2 scftdr_2 w undefined h'fffe900c 8 serial status register_2 scfsr_2 r/(w) * 1 h'0060 h'fffe9010 16 receive fifo data register_2 scfrdr_2 r undefined h'fffe9014 8 fifo control register_2 scfcr_2 r/w h'0000 h'fffe9018 16 fifo data count register_2 scfdr_2 r h'0000 h'fffe901c 16 serial port register_2 scsptr_2 r/w h'0050 h'fffe9020 16 2 line status register_2 sclsr_2 r/(w) * 2 h'0000 h'fffe9024 16 serial mode register_3 scsmr_3 r/w h'0000 h'fffe9800 16 bit rate register_3 scbrr_3 r/w h'ff h'fffe9804 8 serial control register_3 scscr_3 r/w h'0000 h'fffe9808 16 transmit fifo data register_3 scftdr_3 w undefined h'fffe980c 8 serial status register_3 scfsr_3 r/(w) * 1 h'0060 h'fffe9810 16 receive fifo data register_3 scfrdr_3 r undefined h'fffe9814 8 fifo control register_3 scfcr_3 r/w h'0000 h'fffe9818 16 fifo data count register_3 scfdr_3 r h'0000 h'fffe981c 16 serial port register_3 scsptr_3 r/w h'0050 h'fffe9820 16 3 line status register_3 sclsr_3 r/(w) * 2 h'0000 h'fffe9824 16
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 669 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size serial mode register_4 scsmr_4 r/w h'0000 h'fffea000 16 bit rate register_4 scbrr_4 r/w h'ff h'fffea004 8 serial control register_4 scscr_4 r/w h'0000 h'fffea008 16 transmit fifo data register_4 scftdr_4 w undefined h'fffea00c 8 serial status register_4 scfsr_4 r/(w) * 1 h'0060 h'fffea010 16 receive fifo data register_4 scfrdr_4 r undefined h'fffea014 8 fifo control register_4 scfcr_4 r/w h'0000 h'fffea018 16 fifo data count register_4 scfdr_4 r h'0000 h'fffea01c 16 serial port register_4 scsptr_4 r/w h'0050 h'fffea020 16 4 line status register_4 sclsr_4 r/(w) * 2 h'0000 h'fffea024 16 serial mode register_5 scsmr_5 r/w h'0000 h'fffea800 16 bit rate register_5 scbrr_5 r/w h'ff h'fffea804 8 serial control register_5 scscr_5 r/w h'0000 h'fffea808 16 transmit fifo data register_5 scftdr_5 w undefined h'fffea80c 8 serial status register_5 scfsr_5 r/(w) * 1 h'0060 h'fffea810 16 receive fifo data register_5 scfrdr_5 r undefined h'fffea814 8 fifo control register_5 scfcr_5 r/w h'0000 h'fffea818 16 fifo data count register_5 scfdr_5 r h'0000 h'fffea81c 16 serial port register_5 scsptr_5 r/w h'0050 h'fffea820 16 5 line status register_5 sclsr_5 r/(w) * 2 h'0000 h'fffea824 16 serial mode register_6 scsmr_6 r/w h'0000 h'fffeb000 16 bit rate register_6 scbrr_6 r/w h'ff h'fffeb004 8 serial control register_6 scscr_6 r/w h'0000 h'fffeb008 16 transmit fifo data register_6 scftdr_6 w undefined h'fffeb00c 8 serial status register_6 scfsr_6 r/(w) * 1 h'0060 h'fffeb010 16 receive fifo data register_6 scfrdr_6 r undefined h'fffeb014 8 fifo control register_6 scfcr_6 r/w h'0000 h'fffeb018 16 fifo data count register_6 scfdr_6 r h'0000 h'fffeb01c 16 serial port register_6 scsptr_6 r/w h'0050 h'fffeb020 16 6 line status register_6 sclsr_6 r/(w) * 2 h'0000 h'fffeb024 16
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 670 of 1164 rej09b0321-0200 channel register name abbreviation r/w initial value address access size serial mode register_7 scsmr_7 r/w h'0000 h'fffeb800 16 bit rate register_7 scbrr_7 r/w h'ff h'fffeb804 8 serial control register_7 scscr_7 r/w h'0000 h'fffeb808 16 transmit fifo data register_7 scftdr_7 w undefined h'fffeb80c 8 serial status register_7 scfsr_7 r/(w) * 1 h'0060 h'fffeb810 16 receive fifo data register_7 scfrdr_7 r undefined h'fffeb814 8 fifo control register_7 scfcr_7 r/w h'0000 h'fffeb818 16 fifo data count register_7 scfdr_7 r h'0000 h'fffeb81c 16 serial port register_7 scsptr_7 r/w h'0050 h'fffeb820 16 7 line status register_7 sclsr_7 r/(w) * 2 h'0000 h'fffeb824 16 notes: 1. only 0 can be written to clear the flag. bits 15 to 8, 3, and 2 are read-only bits that cannot be modified. 2. only 0 can be written to clear the flag. bits 15 to 1 are read-only bits that cannot be modified.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 671 of 1164 rej09b0321-0200 16.3.1 receive shift register (scrsr) scrsr receives serial data. data input at the rxd pin is loaded into scrsr in the order received, lsb (bit 0) first, converting the data to parallel form. when one byte has been received, it is automatically transferred to the recei ve fifo data register (scfrdr). the cpu cannot read or wr ite to scrsr directly. 0 1 2 3 4 5 6 7 bit: initial value: r/w: ???????? ???????? 16.3.2 receive fifo da ta register (scfrdr) scfrdr is a 16-byte fifo regist er that stores serial receive data. the scif completes the reception of one byte of serial da ta by moving the received data from the receive shift register (scrsr) into scfrdr for storage. continuous reception is possible until 16 bytes are stored. the cpu can read but not write to scfrdr. if data is read when there is no receive data in the scfrdr, the value is undefined. when scfrdr is full of receive data, subsequent serial data is lost. scfrdr is initialized to an undefined value by a power-on reset or in deep standby mode. 0 1 2 3 4 5 6 7 r r r r r r r r bit: initial value: r/w: ????????
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 672 of 1164 rej09b0321-0200 16.3.3 transmit shift register (sctsr) sctsr transmits serial data. the scif loads transm it data from the transmit fifo data register (scftdr) into sctsr, then transmits the data seri ally from the txd pin, lsb (bit 0) first. after transmitting one data byte, the scif automatically loads the next transmit data from scftdr into sctsr and starts transmitting again. the cpu cannot read or write to sctsr directly. 0 1 2 3 4 5 6 7 bit: initial value: r/w: ???????? ???????? 16.3.4 transmit fifo data register (scftdr) scftdr is a 16-byte fifo register that stores data for serial tr ansmission. when the scif detects that the transmit shift register (sctsr) is empt y, it moves transmit data written in the scftdr into sctsr and starts serial transmission. contin uous serial transmission is performed until there is no transmit data left in scftdr. the cpu can write to scftdr at all times. when scftdr is full of transmit data (16 bytes), no more data can be written. if writing of new data is attempted, the data is ignored. scftdr is initialized to an undefined value by a power-on reset or in deep standby mode. 0 1 2 3 4 5 6 7 wwwwwwww bit: initial value: r/w: ????????
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 673 of 1164 rej09b0321-0200 16.3.5 serial mode register (scsmr) scsmr specifies the scif serial communication fo rmat and selects the clock source for the baud rate generator. the cpu can always read and write to scsmr. scsmr is initialized to h'0000 by a power-on reset or in deep standby mode. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrrrrrrr/wr/wr/wr/wr/wrr/wr/w bit: initial value: r/w: ????????c/ a chr pe o/ e stop ? cks[1:0] bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 c/ a 0 r/w communication mode selects whether the scif oper ates in asynchronous or clocked synchronous mode. 0: asynchronous mode 1: clocked synchronous mode 6 chr 0 r/w character length selects 7-bit or 8-bit data length in asynchronous mode. in the clocked synchronous mode, the data length is always 8 bits, regardless of the chr setting. 0: 8-bit data 1: 7-bit data * note: * when 7-bit data is selected, the msb (bit 7) of the transmit fifo data register is not transmitted.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 674 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 pe 0 r/w parity enable selects whether to add a parity bit to transmit data and to check the parity of receive data, in asynchronous mode. in clocked synchronous mode, a parity bit is neither added nor checked, regardless of the pe setting. 0: parity bit not added or checked 1: parity bit added and checked * note: * when pe is set to 1, an even or odd parity bit is added to transmit data, depending on the parity mode (o/ e ) setting. receive data parity is checked according to the even/odd (o/ e ) mode setting. 4 o/ e 0 r/w parity mode selects even or odd parity when parity bits are added and checked. the o/ e setting is used only in asynchronous mode and only when the parity enable bit (pe) is set to 1 to enable parity addition and checking. the o/ e setting is ignored in clocked synchronous mode, or in asynchronous mode when parity addition and checking is disabled. 0: even parity * 1 1: odd parity * 2 notes: 1. if even parity is selected, the parity bit is added to transmit data to make an even number of 1s in the transmitted character and parity bit combined. receive data is checked to see if it has an even number of 1s in the received character and parity bit combined. 2. if odd parity is selected, the parity bit is added to transmit data to make an odd number of 1s in the transmitted character and parity bit combined. receive data is checked to see if it has an odd number of 1s in the received character and parity bit combined.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 675 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3 stop 0 r/w stop bit length selects one or two bits as the stop bit length in asynchronous mode. this setting is used only in asynchronous mode. it is ignored in clocked synchronous mode because no stop bits are added. when receiving, only the first stop bit is checked, regardless of the stop bit setting. if the second stop bit is 1, it is treated as a stop bit, but if the second stop bit is 0, it is treated as the start bit of the next incoming character. 0: one stop bit when transmitting, a single 1-bit is added at the end of each transmitted character. 1: two stop bits when transmitting, two 1 bits are added at the end of each transmitted character. 2 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 1, 0 cks[1:0] 00 r/w clock select select the internal clock source of the on-chip baud rate generator. for further information on the clock source, bit rate register settings, and baud rate, see section 16.3.8, bit rate register (scbrr). 00: p 01: p /4 10: p /16 11: p /64 note: p : peripheral clock
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 676 of 1164 rej09b0321-0200 16.3.6 serial control register (scscr) scscr operates the scif transmitte r/receiver, enables/disables interrupt requests, and selects the transmit/receive clock source. th e cpu can always read and write to scscr. scscr is initialized to h'0000 by a power-on reset or in deep standby mode. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 00000000 00000000 rrrrrrrrr/wr/wr/wr/wr/wrr/wr/w bit: initial value: r/w: ????????tierietere reie ? cke[1:0] bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 7 tie 0 r/w transmit interrupt enable enables or disables the transmit-fifo-data-empty interrupt (txi) requested when the serial transmit data is transferred from the transmit fifo data register (scftdr) to the transmit shift register (sctsr), when the quantity of data in t he transmit fifo register becomes less than the specified number of transmission triggers, and when the tdfe flag in the serial status register (scfsr) is set to1. 0: transmit-fifo-data-empty interrupt request (txi) is disabled 1: transmit-fifo-data-empty interrupt request (txi) is enabled * note: * the txi interrupt request can be cleared by writing a greater quantit y of transmit data than the specified transmission trigger number to scftdr and by clearing tdfe to 0 after reading 1 from tdfe, or can be cleared by clearing tie to 0.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 677 of 1164 rej09b0321-0200 bit bit name initial value r/w description 6 rie 0 r/w receive interrupt enable enables or disables the receive fifo data full interrupts (rxi) requested when the rdf flag or dr flag in serial status register (scfsr) is set to1, receive-error (eri) interrupts requested when the er flag in scfsr is set to1, and break (bri) inte rrupts requested when the brk flag in scfsr or the orer flag in line status register (sclsr) is set to1. 0: receive fifo data full inte rrupt (rxi), receive-error interrupt (eri), and break interrupt (bri) requests are disabled 1: receive fifo data full inte rrupt (rxi), receive-error interrupt (eri), and break interrupt (bri) requests are enabled * note: * rxi interrupt requests can be cleared by reading the dr or rdf flag after it has been set to 1, then clearing the flag to 0, or by clearing rie to 0. eri or bri interrupt requests can be cleared by reading the er, br or orer flag after it has been set to 1, then clearing the flag to 0, or by clearing rie and reie to 0. 5 te 0 r/w transmit enable enables or disables the scif serial transmitter. 0: transmitter disabled 1: transmitter enabled * note: * serial transmission starts after writing of transmit data into scftdr. select the transmit format in scsmr and scfcr and reset the transmit fifo before setting te to 1.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 678 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 re 0 r/w receive enable enables or disables the scif serial receiver. 0: receiver disabled * 1 1: receiver enabled * 2 notes: 1. clearing re to 0 does not affect the receive flags (dr, er, brk, rdf, fer, per, and orer). these flags retain their previous values. 2. serial reception starts when a start bit is detected in asynchronous mode, or synchronous clock input is detected in clocked synchronous mode. select the receive format in scsmr and scfcr and reset the receive fifo before setting re to 1. 3 reie 0 r/w receive error interrupt enable enables or disables the receive-error (eri) interrupts and break (bri) interrupts. the setting of reie bit is valid only when rie bit is set to 0. 0: receive-error interrupt (eri) and break interrupt (bri) requests are disabled 1: receive-error interrupt (eri) and break interrupt (bri) requests are enabled * note: * eri or bri interrupt requests can be cleared by reading the er, br or orer flag after it has been set to 1, then clearing the flag to 0, or by clearing rie and reie to 0. even if rie is set to 0, when reie is set to 1, eri or bri interrupt requests are enabled. set so if scif wants to inform intc of eri or bri interrupt requests during dma transfer.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 679 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 1, 0 cke[1:0] 00 r/w clock enable select the scif clock source and enable or disable clock output from the sck pin. depending on the combination of these bits, the sck pin can be used for serial clock output or serial clock input. if serial clock output is set in clocked synchronous mode, the c/ a bit in scsmr is set to 1, and then these bits are set. ? asynchronous mode 00: internal clock, sck pin used for input pin (input signal is ignored) 01: internal clock, sck pin used for clock output ( the output clock frequency is 16 times the bit rate. ) 10: external clock, sck pin used for clock input ( the input clock frequency is 16 times the bit rate. ) 11: setting prohibited ? clocked synchronous mode 00: internal clock, sck pin used for serial clock output 01: internal clock, sck pin used for serial clock output 10: external clock, sck pin used for serial clock input 11: setting prohibited
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 680 of 1164 rej09b0321-0200 16.3.7 serial status register (scfsr) scfsr is a 16-bit register. the upper 8 bits indi cate the number of receives errors in the receive fifo data register, and the lower 8 bits indicate the status flag indicatin g scif operating state. the cpu can always read and write to scfsr, but cannot write 1 to the st atus flags (er, tend, tdfe, brk, rdf, and dr). these fl ags can be cleared to 0 only if they have first been read (after being set to 1). bits 3 (fer) and 2 (per) are read-only bits that cannot be written. scfsr is initialized by a power-on reset or in deep standby mode. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 00000000 01100000 rrrrrrrr r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * rr bit: initial value: r/w: note: * only 0 can be written to clear the flag after 1 is read. per[3:0] fer[3:0] er tend tdfe brk fer per rdf dr bit bit name initial value r/w description 15 to 12 per[3:0] 0000 r number of parity errors indicate the quantity of data including a parity error in the receive data stored in the receive fifo data register (scfrdr). after the er bit in scfsr is set, the value indicated by bits 15 to 12 represents the number of parity errors in scfrdr. when parity errors have occurred in all 16-byte receive data in scfrdr, per3 to per0 show 0. 11 to 8 fer[3:0] 0000 r number of framing errors indicate the quantity of dat a including a framing error in the receive data stored in scfrdr. after the er bit in scfsr is set, the value indicated by bits 11 to 8 represents the number of framing errors in scfrdr. when framing errors have occurred in all 16-byte receive data in scfrdr, fer3 to fer0 show 0.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 681 of 1164 rej09b0321-0200 bit bit name initial value r/w description 7 er 0 r/(w) * receive error indicates the occurrence of a framing error, or of a parity error when receiving data that includes parity. * 1 0: receiving is in progress or has ended normally [clearing conditions] ? er is cleared to 0 a power-on reset ? er is cleared to 0 when the chip is when 0 is written after 1 is read from er 1: a framing error or parity error has occurred. [setting conditions] ? er is set to 1 when the stop bit is 0 after checking whether or not the last stop bit of the received data is 1 at the end of one data receive operation * 2 ? er is set to 1 when the total number of 1s in the receive data plus parity bit does not match the even/odd parity specified by the o/ e bit in scsmr notes: 1. clearing the re bit to 0 in scscr does not affect the er bit, which retains its previous value. even if a receive error occurs, the receive data is transferred to scfrdr and the receive operation is continued. whether or not the data read from scfrdr includes a receive error can be detected by the fer and per bits in scfsr. 2. in two stop bits mode, only the first stop bit is checked; the second stop bit is not checked.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 682 of 1164 rej09b0321-0200 bit bit name initial value r/w description 6 tend 1 r/(w) * transmit end indicates that when the last bit of a serial character was transmitted, scftdr did not contain valid data, so transmission has ended. 0: transmission is in progress [clearing condition] ? tend is cleared to 0 when 0 is written after 1 is read from tend after transmit data is written in scftdr * 1 1: end of transmission [setting conditions] ? tend is set to 1 when the chip is a power-on reset ? tend is set to 1 when te is cleared to 0 in the serial control register (scscr) ? tend is set to 1 when scftdr does not contain receive data when the last bit of a one-byte serial character is transmitted note: 1. do not use this bit as a transmit end flag when the dmac writes data to scftdr due to a txi interrupt request.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 683 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 tdfe 1 r/(w) * transmit fifo data empty indicates that data has been transferred from the transmit fifo data register (scftdr) to the transmit shift register (sctsr), the quantity of data in scftdr has become less than the transmission trigger number specified by the ttrg1 and ttrg0 bits in the fifo control register (scfcr), and writing of transmit data to scftdr is enabled. 0: the quantity of transmit data written to scftdr is greater than the specified transmission trigger number [clearing conditions] ? tdfe is cleared to 0 when data exceeding the specified transmission trigger number is written to scftdr after 1 is read from tdfe and then 0 is written ? tdfe is cleared to 0 when the dmac is activated by the transmit fifo dat a empty interrupt (txi) and writes data exceeding the specified transmission trigger number to scftdr 1: the quantity of transmi t data in scftdr is less than or equal to the specified transmission trigger number * 1 [setting conditions] ? tdfe is set to 1 by a power-on reset ? tdfe is set to 1 when the quantity of transmit data in scftdr becomes less than or equal to the specified transmission trigger number as a result of transmission note: 1. since scftdr is a 16-byte fifo register, the maximum quantity of data that can be written when tdfe is 1 is "16 minus the specified transmission trigger number". if an attempt is made to write additional data, the data is ignored. the quantity of data in scftdr is indicated by the upper 8 bits of scfdr.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 684 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 brk 0 r/(w) * break detection indicates that a break signal has been detected in receive data. 0: no break signal received [clearing conditions] ? brk is cleared to 0 when the chip is a power-on reset ? brk is cleared to 0 when software reads brk after it has been set to 1, then writes 0 to brk 1: break signal received * 1 [setting condition] ? brk is set to 1 when data including a framing error is received, and a framing error occurs with space 0 in the subsequent receive data note 1. when a break is detected, transfer of the receive data (h'00) to scfrdr stops after detection. when the break ends and the receive signal becomes mark 1, the transfer of receive data resumes. 3 fer 0 r framing error indication indicates a framing error in the data read from the next receive fifo data register (scfrdr) in asynchronous mode. 0: no receive framing error occurred in the next data read from scfrdr [clearing conditions] ? fer is cleared to 0 when the chip undergoes a power-on reset ? fer is cleared to 0 when no framing error is present in the next data read from scfrdr 1: a receive framing error occurred in the next data read from scfrdr. [setting condition] ? fer is set to 1 when a framing error is present in the next data read from scfrdr
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 685 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 per 0 r parity error indication indicates a parity error in the data read from the next receive fifo data register (scfrdr) in asynchronous mode. 0: no receive parity error occurred in the next data read from scfrdr [clearing conditions] ? per is cleared to 0 when the chip undergoes a power-on reset ? per is cleared to 0 when no parity error is present in the next data read from scfrdr 1: a receive parity error occurred in the next data read from scfrdr [setting condition] ? per is set to 1 when a parity error is present in the next data read from scfrdr
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 686 of 1164 rej09b0321-0200 bit bit name initial value r/w description 1 rdf 0 r/(w) * receive fifo data full indicates that receive data has been transferred to the receive fifo data register (scfrdr), and the quantity of data in scf rdr has become more than the receive trigger number specified by the rtrg1 and rtrg0 bits in the fi fo control register (scfcr). 0: the quantity of transmit data written to scfrdr is less than the specified receive trigger number [clearing conditions] ? rdf is cleared to 0 by a power-on reset, standby mode ? rdf is cleared to 0 when the scfrdr is read until the quantity of receive data in scfrdr becomes less than the specified receive trigger number after 1 is read from rdf and then 0 is written ? rdf is cleared to 0 when dmac read scfrdr until the quantity of receive data in scfrdr becomes less than the specified receive trigger number 1: the quantity of receiv e data in scfrdr is more than the specified receive trigger number [setting condition] ? rdf is set to 1 when a quantity of receive data more than the specified receive trigger number is stored in scfrdr * 1 note 1. as scftdr is a 16-byte fifo register, the maximum quantity of data that can be read when rdf is 1 becomes the specified receive trigger number. if an attempt is made to read after all the data in scfrdr has been read, the data is undefined. the quantity of receive data in scfrdr is indicated by the lower 8 bits of scfdr.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 687 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 dr 0 r/(w) * receive data ready indicates that the quantity of data in the receive fifo data register (scfrdr) is less than the specified receive trigger number, and that the next data has not yet been received after the elapse of 15 etu from the last stop bit in asynchronous mode. in clocked synchronous mode, this bit is not set to 1. 0: receiving is in progress, or no receive data remains in scfrdr after receiving ended normally [clearing conditions] ? dr is cleared to 0 when the chip undergoes a power-on reset ? dr is cleared to 0 when all receive data are read after 1 is read from dr and then 0 is written ? dr is cleared to 0 when all receive data in scfrdr are read after the dmac is activated by the receive fifo data full interrupt (rxi) 1: next receive data has not been received [setting condition] ? dr is set to 1 when scfrdr contains less data than the specified receiv e trigger number, and the next data has not yet been received after the elapse of 15 etu from the last stop bit. * 1 note:1. this is equivalent to 1.5 frames with the 8-bit, 1-stop-bit format. (etu: elementary time unit) note: * only 0 can be written to clear the flag after 1 is read.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 688 of 1164 rej09b0321-0200 16.3.8 bit rate register (scbrr) scbrr is an 8-bit register that, together with the baud rate generator clock source selected by the cks1 and cks0 bits in the serial mode register (scsmr), determines the serial transmit/receive bit rate. the cpu can always read and write to scbrr. s cbrr is initialized to h'ff by a power-on reset or in deep standby mode. each channel has indepe ndent baud rate generator control, so different values can be set in eight channels. 0 1 2 3 4 5 6 7 1 r/w 1 r/w 1 r/w 1 r/w 1 r/w 1 r/w 1 r/w 1 r/w bit: initial value: r/w: the scbrr setting is calculated as follows: ? asynchronous mode: n = 10 6 ? 1 64 2 2n-1 b p ? clocked synchronous mode: n = 10 6 ? 1 8 2 2n-1 b p b: bit rate (bits/s) n: scbrr setting for baud rate generator (0 n 255) (the setting must satisfy the electrical characteristics.) p : operating frequency for peripheral modules (mhz) n: baud rate generator clock source (n = 0, 1, 2, 3) (for the clock sources and values of n, see table 16.3.)
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 689 of 1164 rej09b0321-0200 table 16.3 scsmr settings scsmr settings n clock source cks1 cks0 0 p 0 0 1 p /4 0 1 2 p /16 1 0 3 p /64 1 1 the bit rate error in asynchronous is given by the following formula: error (%) = ? 1 100 (n + 1) b 64 2 2n-1 p 10 6 table 16.4 lists examples of scbrr settings in asynchronous mode, and table 16.5 lists examples of scbrr settings in clocked synchronous mode. table 16.4 bit rates and scbrr se ttings (asynchronous mode) (1) p (mhz) 5 6 6.144 7.3728 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) n n error ( % ) 110 2 88 ? 0.25 2 106 ? 0.44 2 108 0.08 2 130 ?0.07 150 2 64 0.16 2 77 0.16 2 79 0.00 2 95 0.00 300 1 129 0.16 1 155 0.16 1 159 0.00 1 191 0.00 600 1 64 0.16 1 77 0.16 1 79 0.00 1 95 0.00 1200 0 129 0.16 0 155 0.16 0 159 0.00 0 191 0.00 2400 0 64 0.16 0 77 0.16 0 79 0.00 0 95 0.00 4800 0 32 ? 1.36 0 38 0.16 0 39 0.00 0 47 0.00 9600 0 15 1.73 0 19 ? 2.34 0 19 0.00 0 23 0.00 19200 0 7 1.73 0 9 ? 2.34 0 9 0.00 0 11 0.00 31250 0 4 0.00 0 5 0.00 0 5 2.40 0 6 5.33 38400 0 3 1.73 0 4 ? 2.34 0 4 0.00 0 5 0.00
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 690 of 1164 rej09b0321-0200 table 16.4 bit rates and scbrr se ttings (asynchronous mode) (2) p (mhz) 8 9.8304 10 12 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) n n error ( % ) 110 2 141 0.03 2 174 ?0.26 2 177 ?0.25 2 212 0.03 150 2 103 0.16 2 127 0.00 2 129 0.16 2 155 0.16 300 1 207 0.16 1 255 0.00 2 64 0.16 2 77 0.16 600 1 103 0.16 1 127 0.00 1 129 0.16 1 155 0.16 1200 0 207 0.16 0 255 0.00 1 64 0.16 1 77 0.16 2400 0 103 0.16 0 127 0.00 0 129 0.16 0 155 0.16 4800 0 51 0.16 0 63 0.00 0 64 0.16 0 77 0.16 9600 0 25 0.16 0 31 0.00 0 32 ?1.36 0 38 0.16 19200 0 12 0.16 0 15 0.00 0 15 1.73 0 19 0.16 31250 0 7 0.00 0 9 ?1.70 0 9 0.00 0 11 0.00 38400 0 6 ?6.99 0 7 0.00 0 7 1.73 0 9 ?2.34 table 16.4 bit rates and scbrr se ttings (asynchronous mode) (3) p (mhz) 12.288 14.7456 16 19.6608 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) n n error ( % ) 110 2 217 0.08 3 64 0.70 3 70 0.03 3 86 0.31 150 2 159 0.00 2 191 0.00 2 207 0.16 2 255 0.00 300 2 79 0.00 2 95 0.00 2 103 0.16 2 127 0.00 600 1 159 0.00 1 191 0.00 1 207 0.16 1 255 0.00 1200 1 79 0.00 1 95 0.00 1 103 0.16 1 127 0.00 2400 0 159 0.00 0 191 0.00 0 207 0.16 0 255 0.00 4800 0 79 0.00 0 95 0.00 0 103 0.16 0 127 0.00 9600 0 39 0.00 0 47 0.00 0 51 0.16 0 63 0.00 19200 0 19 0.00 0 23 0.00 0 25 0.16 0 31 0.00 31250 0 11 2.40 0 14 ?1.70 0 15 0.00 0 19 ?1.70 38400 0 9 0.00 0 11 0.00 0 12 0.16 0 15 0.00
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 691 of 1164 rej09b0321-0200 table 16.4 bit rates and scbrr se ttings (asynchronous mode) (4) p (mhz) 20 24 24.576 28.7 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) n n error ( % ) 110 3 88 ?0.25 3 106 ?0.44 3 108 0.08 3 126 0.31 150 3 64 0.16 3 77 0.16 3 79 0.00 3 92 0.46 300 2 129 0.16 2 155 0.16 2 159 0.00 2 186 ?0.08 600 2 64 0.16 2 77 0.16 2 79 0.00 2 92 0.46 1200 1 129 0.16 1 155 0.16 1 159 0.00 1 186 ?0.08 2400 1 64 0.16 1 77 0.16 1 79 0.00 1 92 0.46 4800 0 129 0.16 0 155 0.16 0 159 0.00 0 186 ?0.08 9600 0 64 0.16 0 77 0.16 0 79 0.00 0 92 0.46 19200 0 32 ?1.36 0 38 0.16 0 39 0.00 0 46 ?0.61 31250 0 19 0.00 0 23 0.00 0 24 ?1.70 0 28 ?1.03 38400 0 15 1.73 0 19 ?2.34 0 19 0.00 0 22 1.55 table 16.4 bit rates and scbrr se ttings (asynchronous mode) (5) p (mhz) 30 33 36 38 40 bit rate (bit/s) n n error ( % ) n n error ( % ) n n error ( % ) n n error ( % ) n n error ( % ) 110 3 132 0.13 3 145 0.33 3 159 ?0.12 3 168 ?0.19 3 177 ?0.25 150 3 97 ?0.35 3 106 0.39 3 116 0.16 3 123 ?0.24 3 129 0.16 300 2 194 0.16 2 214 ?0.07 2 233 0.16 2 246 0.16 3 64 0.16 600 2 97 ?0.35 2 106 0.39 2 116 0.16 2 123 ?0.24 2 129 0.16 1200 1 194 0.16 1 214 ?0.07 1 233 0.16 1 246 0.16 2 64 0.16 2400 1 97 ?0.35 1 106 0.39 1 116 0.16 1 123 ?0.24 1 129 0.16 4800 0 194 ?1.36 0 214 ?0.07 0 233 0.16 0 246 0.16 1 64 0.16 9600 0 97 ?0.35 0 106 0.39 0 116 0.16 0 123 ?0.24 0 129 0.16 19200 0 48 ?0.35 0 53 ?0.54 0 58 ?0.69 0 61 ?0.24 0 64 0.16 31250 0 29 0.00 0 32 0.00 0 35 0.00 0 37 0.00 0 39 0.00 38400 0 23 1.73 0 26 ?0.54 0 28 1.02 0 30 ?0.24 0 32 ?1.36 note: settings with an error of 1% or less are recommended.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 692 of 1164 rej09b0321-0200 table 16.5 bit rates and scbrr settin gs (clocked synchronous mode) (1) p (mhz) 5 8 16 28.7 30 bit rate (bit/s) n n n n n n n n n n 110 ? ? ? ? ? ? ? ? ? ? 250 3 77 3 124 3 249 ? ? ? ? 500 3 38 2 249 3 124 3 223 3 233 1 k 2 77 2 124 2 249 3 111 3 116 2.5 k 1 124 1 199 2 99 2 178 2 187 5 k 0 249 1 99 1 199 2 89 2 93 10 k 0 124 0 199 1 99 1 178 1 187 25 k 0 49 0 79 0 159 1 71 1 74 50 k 0 24 0 39 0 79 0 143 0 149 100 k ? ? 0 19 0 39 0 71 0 74 250 k 0 4 0 7 0 15 ? ? 0 29 500 k ? ? 0 3 0 7 ? ? 0 14 1 m ? ? 0 1 0 3 ? ? ? ? 2 m 0 0 * 0 1 ? ? ? ?
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 693 of 1164 rej09b0321-0200 table 16.5 bit rates and scbrr settin gs (clocked synchronous mode) (2) p (mhz) 33 36 38 40 bit rate (bit/s) n n n n n n n n 110 ? ? ? ? ? ? ? ? 250 ? ? ? ? ? ? ? ? 500 3 255 ? ? ? ? ? ? 1 k 3 125 3 140 3 147 3 155 2.5 k 2 200 2 224 2 237 2 249 5 k 2 100 2 112 2 118 2 124 10 k 1 200 1 224 1 237 1 249 25 k 1 80 1 89 1 94 1 99 50 k 0 160 0 179 0 189 0 199 100 k 0 80 0 89 0 94 0 99 250 k 0 31 0 35 0 37 0 39 500 k 0 15 0 17 0 18 0 19 1 m 0 7 0 8 ? ? 0 9 2 m ? ? ? ? ? ? ? ? [legend] blank: no setting possible ?: setting possible, but error occurs * : continuous transmission/reception not possible table 16.6 indicates the maximum bit rates in asynchronous mode when the baud rate generator is used. tables 16.7 and 16.8 list the maximum rates when the external clock input is used.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 694 of 1164 rej09b0321-0200 table 16.6 maximum bit rates for variou s frequencies with baud rate generator (asynchronous mode) settings p (mhz) maximum bit rate (bits/s) n n 5 156250 0 0 8 250000 0 0 9.8304 307200 0 0 12 375000 0 0 14.7456 460800 0 0 16 500000 0 0 19.6608 614400 0 0 20 625000 0 0 24 750000 0 0 24.576 768000 0 0 28.7 896875 0 0 30 937500 0 0 33 1031250 0 0 36 1125000 0 0 38 1187500 0 0 40 1250000 0 0
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 695 of 1164 rej09b0321-0200 table 16.7 maximum bit rates with external clock input (asynchronous mode) p (mhz) external input clock (mh z) maximum bit rate (bits/s) 5 1.2500 78125 8 2.0000 125000 9.8304 2.4576 153600 12 3.0000 187500 14.7456 3.6864 230400 16 4.0000 250000 19.6608 4.9152 307200 20 5.0000 312500 24 6.0000 375000 24.576 6.1440 384000 28.7 7.1750 448436 30 7.5000 468750 33 8.2500 515625 36 9.0000 562500 38 9.5000 593750 40 10.0000 625000 table 16.8 maximum bit rates with external clock input (clocked synchronous mode, t scyc = 12 t pcyc ) p (mhz) external input clock (mh z) maximum bit rate (bits/s) 5 0.4166 416666.6 8 0.6666 666666.6 16 1.3333 1333333.3 24 2.0000 2000000.0 28.7 2.3916 2391666.6 30 2.5000 2500000.0 33 2.7500 2750000.0 36 3.0000 3000000.0 38 3.1666 3166666.6 40 3.3333 3333333.3
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 696 of 1164 rej09b0321-0200 16.3.9 fifo control register (scfcr) scfcr resets the quantity of data in the transmit and receive data fifo registers, sets the trigger data quantity, and contains an enable bit for loop-back testing. scfcr can always be read and written to by the cpu. it is initialized to h'0000 by a power-on reset or in deep standby mode. 15 14 13 12 11 10 9 8 r/w r/w r/w r/w r r/w r/w r/w rtrg[1:0] ttrg[1:0] ? tfrst rfrst loop 0 0 0 0 0 0 0 0 r r r r r bit: initial value: r/w: ????? r r r ??? 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 bit bit name initial value r/w description 15 to 8 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. receive fifo data trigger set the quantity of receive data which sets the receive data full (rdf) flag in the serial status register (scfsr). the rdf flag is set to 1 when the quantity of receive data stored in the receive fi fo register (scfrdr) is increased more than the set trigger number shown below. ? asynchronous mode ? clocked synchronous mode 00: 1 01: 4 10: 8 11: 14 00: 1 01: 2 10: 8 11: 14 7, 6 rtrg[1:0] 00 r/w note: in clock synchronous mode, to transfer the receive data using dmac, set the receive trigger number to 1. if a number other than 1 is set, cpu must read the receive data left in scfrdr.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 697 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5, 4 ttrg[1:0] 00 r/w trans mit fifo data trigger set the quantity of remaining transmit data which sets the transmit fifo data register empty (tdfe) flag in the serial status register (scfsr). the tdfe flag is set to 1 when the quantity of tr ansmit data in the transmit fifo data register (scft dr) becomes less than the set trigger number shown below. 00: 8 (8) * 01: 4 (12) * 10: 2 (14) * 11: 0 (16) * note: * values in parentheses mean the number of empty bytes in scftdr when the tdfe flag is set to 1. 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 tfrst 0 r/w transmit fifo data register reset disables the transmit data in the transmit fifo data register and resets the data to the empty state. 0: reset operation disabled * 1: reset operation enabled note: * reset operation is executed by a power-on reset. 1 rfrst 0 r/w receive fifo data register reset disables the receive data in the receive fifo data register and resets the data to the empty state. 0: reset operation disabled * 1: reset operation enabled note: * reset operation is executed by a power-on reset.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 698 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 loop 0 r/w loop-back test internally connects the transmit output pin (txd) and receive input pin (rxd) and enables loop-back testing. 0: loop back test disabled 1: loop back test enabled 16.3.10 fifo data count register (scfdr) scfdr is a 16-bit register which indicates the quan tity of data stored in the transmit fifo data register (scftdr) and the receive fifo data register (scfrdr). it indicates the quantity of transmit data in scftdr with the upper 8 bits, and the quantity of receive data in scfrdr with the lower 8 bits. sc fdr can always be read by the cpu. scfdr is initialized to h'0000 by a power on reset or in deep standby mode. 151413121110987654321 0 0000000000000000 rrrrrrrrrrrrrrrr bit: initial value: r/w: ? ? ? t[4:0] ? ? ? r[4:0] bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 to 8 t[4:0] 00000 r t4 to t0 bits i ndicate the quantity of non-transmitted data stored in scftdr. h'00 means no transmit data, and h'10 means that scftdr is full of transmit data. 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 to 0 r[4:0] 00000 r r4 to r0 bits indicate the quantity of receive data stored in scfrdr. h'00 me ans no receive data, and h'10 means that scfrdr full of receive data.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 699 of 1164 rej09b0321-0200 16.3.11 serial port register (scsptr) scsptr controls input/output and data of pins multiplexed to scif function. bits 3 and 2 can control input/output data of sck pin. bits 1 and 0 can input data from rxd pin and output data to txd pin, so they control break of serial transmitting/receiving. the cpu can always read and write to scsptr. scsptr is initialized to h'0050 by a power-on reset or in deep standby mode. 151413121110987654321 0 0000000001010 0 r r r r r r r r r/w r/w r/w r/w bit: initial value: r/w: ???????? rrrr ???? ?? sckio sckdt spb2 io spb2 dt bit bit name initial value r/w description 15 to 7 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 6 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 5 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 4 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 3 sckio 0 r/w sck port input/output indicates input or output of the serial port sck pin. when the sck pin is actually used as a port outputting the sckdt bit value, the cke[1:0] bits in scscr should be cleared to 0. 0: sckdt bit value not output to sck pin 1: sckdt bit value output to sck pin
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 700 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 sckdt undefined r/w sck port data indicates the input/output data of the serial port sck pin. input/output is specified by the sckio bit. for output, the sckdt bit value is output to the sck pin. the sck pin status is read from the sckdt bit regardless of the sckio bit setting. however, sck input/output must be set in the pfc. 0: input/output data is low level 1: input/output dat a is high level 1 spb2io 0 r/w serial port break input/output indicates input or output of the serial port txd pin. when the txd pin is actually used as a port outputting the spb2dt bit value, the te bit in scscr should be cleared to 0. 0: spb2dt bit value not output to txd pin 1: spb2dt bit value output to txd pin 0 spb2dt undefined r/w serial port break data indicates the input data of the rxd pin and the output data of the txd pin used as se rial ports. input/output is specified by the spb2io bit. when the txd pin is set to output, the spb2dt bit value is output to the txd pin. the rxd pin status is read from the spb2dt bit regardless of the spb2io bit setting. however, rxd input and txd output must be set in the pfc. 0: input/output data is low level 1: input/output dat a is high level
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 701 of 1164 rej09b0321-0200 16.3.12 line status register (sclsr) the cpu can always read or write to sclsr, but cannot write 1 to the or er flag. this flag can be cleared to 0 only if it has first been read (after being set to 1). sclsr is initialized to h'0000 by a power-on reset or in deep standby mode. 151413121110987654321 0 0000000000000000 rrrrrrrrrrrrrrr r/(w) * bit: initial value: r/w: note: * only 0 can be written to clear the flag after 1 is read. orer ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bit bit name initial value r/w description 15 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 orer 0 r/(w) * overrun error indicates the occurrence of an overrun error. 0: receiving is in progress or has ended normally * 1 [clearing conditions] ? orer is cleared to 0 when the chip is a power-on reset ? orer is cleared to 0 when 0 is written after 1 is read from orer. 1: an overrun error has occurred * 2 [setting condition] ? orer is set to 1 when the next serial receiving is finished while the receive fifo is full of 16-byte receive data. notes: 1. clearing the re bit to 0 in scscr does not affect the orer bit, which retains its previous value. 2. the receive fifo data register (scfrdr) retains the data before an overrun error has occurred, and the next received data is discarded. when the orer bit is set to 1, the scif cannot continue the next serial reception.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 702 of 1164 rej09b0321-0200 16.4 operation 16.4.1 overview for serial communication, th e scif has an asynchronous mode in which characters are synchronized individually, and a clocked synchronous mode in which communication is synchronized with clock pulses. the scif has a 16-stage fifo buffer for both tr ansmission and receptions, reducing the overhead of the cpu, and enabling continuous high-speed communication. the transmission format is selected in the serial mode register (scsmr), as shown in table 16.9. the scif clock source is selected by the combination of th e cke1 and cke0 bits in the seri al control regist er (scscr), as shown in table 16.10. (1) asynchronous mode ? data length is selectable: 7 or 8 bits ? parity bit is selectable. so is the stop bit length (1 or 2 bits). the combination of the preceding selections constitutes the communication format and character length. ? in receiving, it is possible to detect framing er rors, parity errors, r eceive fifo data full, overrun errors, receive data ready, and breaks. ? the number of stored data bytes is indicated fo r both the transmit and receive fifo registers. ? an internal or external clock can be selected as the scif clock source. ? when an internal clock is selected, the sc if operates using the on-chip baud rate generator. ? when an external clock is selected, the external clock input must have a frequency 16 times the bit rate. (the on-chip baud rate generator is not used.) (2) clocked synchronous mode ? the transmission/reception format has a fixed 8-bit data length. ? in receiving, it is possible to detect overrun errors (orer). ? an internal or external clock can be selected as the scif clock source. ? when an internal clock is selected, the sc if operates using the on-chip baud rate generator, and outputs a serial clock signal to external devices. ? when an external clock is selected, the scif operates on the input serial clock. the on- chip baud rate generator is not used.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 703 of 1164 rej09b0321-0200 table 16.9 scsmr settings and scif communication formats scsmr settings scif communication format bit 7 c/ a bit 6 chr bit 5 pe bit 3 stop mode data length pari ty bit stop bit length 0 0 0 0 8 bits not set 1 bit 1 2 bits 1 0 set 1 bit 1 2 bits 1 0 0 7 bits not set 1 bit 1 2 bits 1 0 set 1 bit 1 asynchronous 2 bits 1 x x x clocked synchronous 8 bits not set none [legend] x: don't care table 16.10 scsmr and scscr setting s and scif clock source selection scsmr scscr settings scif transmit/receive clock bit 7 c/ a bit 1 cke1 bit 0 cke0 mode clock source sck pin function 0 scif does not use the sck pin 0 1 internal outputs a clock with a frequency 16 times the bit rate 0 external inputs a clock with frequency 16 times the bit rate 0 1 1 asynchronous setting prohibited 0 x internal outputs the serial clock 0 external inputs the serial clock 1 1 1 clocked synchronous setting prohibited [legend] x: don't care
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 704 of 1164 rej09b0321-0200 16.4.2 operation in asynchronous mode in asynchronous mode, each transmitted or received ch aracter begins with a start bit and ends with a stop bit. serial comm unication is synchronized one character at a time. the transmitting and receiving sections of th e scif are independent, so full duplex communication is possible. the tr ansmitter and receiver are 16-byte fifo buffered, so data can be written and read while transmitti ng and receiving are in progress, enabling continuous transmitting and receiving. figure 16.2 shows the general format of asynchronous serial communication. in asynchronous serial communication, the communication line is normally held in the mark (high) state. the scif monitors the line and starts serial communicat ion when the line goes to the space (low) state, indicating a start bit. one serial ch aracter consists of a start bit (low), data (lsb first), parity bit (high or low), an d stop bit (high), in that order. when receiving in asynchronous mode , the scif synchronizes at the falling edge of the start bit. the scif samples each data bit on the eighth pulse of a clock with a frequency 16 times the bit rate. receive data is latched at the center of each bit. 0 1 d 0 d 1 d 3 d 4 d 5 d 6 d 2 0/1 11 1 d 7 (lsb) (msb) start bit idle state (mark state) stop bit transmit/receive data serial data parity bit 1 bit 1 or 2 bits 7 or 8 bits 1 bit or none one unit of transfer data (character or frame) figure 16.2 example of data form at in asynchronous communication (8-bit data with parity and two stop bits)
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 705 of 1164 rej09b0321-0200 (1) transmit/receive formats table 16.11 lists the eight communication formats th at can be selected in asynchronous mode. the format is selected by settings in the serial mode register (scsmr). table 16.11 serial communication formats (asynchronous mode) scsmr bits serial transmit /receive format and frame length chr pe stop 1 2 3 4 5 6 7 8 9 10 11 12 0 0 0 start 8-bit data stop 0 0 1 start 8-bit data stop stop 0 1 0 start 8-bit data p stop 0 1 1 start 8-bit data p stop stop 1 0 0 start 7-bit data stop 1 0 1 start 7-bit data stop stop 1 1 0 start 7-bit data p stop 1 1 1 start 7-bit data p stop stop [legend] start: start bit stop: stop bit p: parity bit
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 706 of 1164 rej09b0321-0200 (2) clock an internal clock generated by the on-chip baud rate generator or an external clock input from the sck pin can be selected as the scif transmit/recei ve clock. the clock sour ce is selected by the c/ a bit in the serial mode register (scsmr) an d bits cke1 and cke0 in the serial control register (scscr). for clock source selection, refer to table 16.10. when an external clock is input at the sck pin, it must have a frequency equal to 16 times the desired bit rate. when the scif operates on an internal clock, it can output a clock signal on the sck pin. the frequency of this output clock is 16 times the desired bit rate. (3) transmitting and receiving data ? scif initialization (asynchronous mode) before transmitting or receiving, clear the te and re bits to 0 in the serial control register (scscr), then initialize the scif as follows. when changing the operation mode or the communication format, always clear the te and re bits to 0 before following the procedure given below. clearing te to 0 initializes the transmit shift register (sctsr). clearing te and re to 0, however, does not initialize the serial status register (scfsr), transmit fifo data register (scftdr), or receive fifo data register (scfrdr), which retain their previous contents. clear te to 0 afte r all transmit data has been transmitted and the tend flag in the scfsr is set. the te bit can be cleared to 0 during transmission, but the transmit data goes to the mark state after the bit is cleared to 0. set the tfrst bit in scfcr to 1 and reset scftdr before te is set again to start transmission. when an external clock is used, the clock should not be stopped during initialization or subsequent operation. scif operation becomes unreliable if the clock is stopped.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 707 of 1164 rej09b0321-0200 figure 16.3 shows a sample flowchart for initializing the scif. start of initialization clear te and re bits in scscr to 0 set tfrst and rfrst bits in scfcr to 1 set cke[1:0] bits in scscr (leaving tie, rie, te, and re bits cleared to 0) set data transfer format in scsmr set value in scbrr set rtrg[1:0], ttrg[1:0], and mce bits in scfcr, and clear tfrst and rfrst bits to 0 set te and re bits in scscr to 1, and set tie, rie, and reie bits end of initialization set the clock selection in scscr. be sure to clear bits tie, rie, te, and re to 0. set the data transfer format in scsmr. write a value corresponding to the bit rate into scbrr. (not necessary if an external clock is used.) sets pfc for external pins used. set as rxd input at reciving and txd at transmission. however, no setting for sck pin is required when cke[1:0] is 00. set the te bit or re bit in scscr to 1. also set the rie, reie, and tie bits. setting the te and re bits enables the txd and rxd pins to be used. when transmitting, the scif will go to the mark state; when receiving, it will go to the idle state, waiting for a start bit. when the intrnal clock output is selected, a clock starts to be output from the sck pin at this point. [1] [1] [2] [3] [4] [5] [2] [3] [5] pfc setting for external pins used sck, txd, rxd [4] after reading er, dr, and brk flags in scfsr, and each flag in sclsr, write 0 to clear them figure 16.3 sample flowchart for scif initialization
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 708 of 1164 rej09b0321-0200 ? transmitting serial da ta (asynchronous mode) figure 16.4 shows a sample flow chart for serial transmission. use the following procedure for serial data transmission after enabling the scif for transmission. start of transmission read tdfe flag in scfsr tdfe = 1? write transmit data in scftdr, and read 1 from tdfe flag and tend flag in scfsr, then clear to 0 all data transmitted? read tend flag in scfsr tend = 1? break output? clear spb2dt to 0 and set spb2io to 1 clear te bit in scscr to 0 end of transmission no yes no yes no yes no yes [1] scif status check and transmit data write: read scfsr and check that the tdfe flag is set to 1, then write transmit data to scftdr, and read 1 from the tdfe and tend flags, then clear to 0. the quantity of transmit data that can be written is 16 - (transmit trigger set number). [2] serial transmission continuation procedure: to continue serial transmission, read 1 from the tdfe flag to confirm that writing is possible, then write data to scftdr, and then clear the tdfe flag to 0. [3] break output during serial transmission: to output a break in serial transmission, clear the spb2dt bit to 0 and set the spb2io bit to 1 in scsptr, then clear the te bit in scscr to 0. in [1] and [2], it is possible to ascertain the number of data bytes that can be written from the number of transmit data bytes in scftdr indicated by the upper 8 bits of scfdr. [1] [2] [3] figure 16.4 sample flowchart for transmitting serial data
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 709 of 1164 rej09b0321-0200 in serial transmission, the scif operates as described below. 1. when data is written into the transmit fifo data register (scftdr), the scif transfers the data from scftdr to the transmit shift register (sctsr) and starts tran smitting. confirm that the tdfe flag in the serial stat us register (scfsr) is set to 1 before writing transmit data to scftdr. the number of data bytes that can be written is (16 ? transmit trigger setting). 2. when data is transferred from scftdr to sctsr and transmission is started, consecutive transmit operations are performed until there is no transmit data left in scftdr. when the number of transmit data bytes in scftdr falls below the transmit trigger number set in the fifo control register (scfcr), the tdfe flag is se t. if the tie bit in the serial control register (scsr) is set to 1 at this time, a transm it-fifo-data-empty interrupt (txi) request is generated. the serial transmit data is sent from the txd pin in the following order. a. start bit: one-bit 0 is output. b. transmit data: 8-bit or 7-bit data is output in lsb-first order. c. parity bit: one parity bit (even or odd parity) is output. (a format in which a parity bit is not output can also be selected.) d. stop bit(s): one or two 1 bits (stop bits) are output. e. mark state: 1 is output continuously until the start bit that starts the next transmission is sent. 3. the scif checks the scftdr transmit data at th e timing for sending the stop bit. if data is present, the data is transferred from scftdr to sctsr, the stop bit is sent, and then serial transmission of the next frame is started. figure 16.5 shows an example of the operation for transmission. tdfe 0 0/1 1 1 1 d 0 d 1 d 7 0 0/1 1 d 0 d 1 d 7 tend serial data start bit data parity bit stop bit start bit idle state (mark state) data parity bit stop bit txi interrupt request data written to scftdr and tdfe flag read as 1 then cleared to 0 by txi interrupt handler one frame txi interrupt request figure 16.5 example of transmit operation (8-bit data, parity, 1 stop bit)
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 710 of 1164 rej09b0321-0200 ? receiving serial data (asynchronous mode) figures 16.6 and 16.7 show sample flowcharts for serial reception. use the following procedure for serial data r eception after enab ling the scif for reception. start of reception read er, dr, brk flags in scfsr and orer flag in sclsr er, dr, brk or orer = 1? read rdf flag in scfsr rdf = 1? read receive data in scfrdr, and clear rdf flag in scfsr to 0 all data received? clear re bit in scscr to 0 end of reception yes no yes yes no no error handling [1] receive error handling and break detection: read the dr, er, and brk flags in scfsr, and the orer flag in sclsr, to identify any error, perform the appropriate error handling, then clear the dr, er, brk, and orer flags to 0. in the case of a framing error, a break can also be detected by reading the value of the rxd pin. [2] scif status check and receive data read: read scfsr and check that rdf = 1, then read the receive data in scfrdr, read 1 from the rdf flag, and then clear the rdf flag to 0. the transition of the rdf flag from 0 to 1 can also be identified by an rxi interrupt. [3] serial reception continuation procedure: to continue serial reception, read at least the receive trigger set number of receive data bytes from scfrdr, read 1 from the rdf flag, then clear the rdf flag to 0. the number of receive data bytes in scfrdr can be ascertained by reading from scrfdr. [1] [2] [3] figure 16.6 sample flowchar t for receiving serial data
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 711 of 1164 rej09b0321-0200 error handling receive error handling er = 1? brk = 1? break handling dr = 1? read receive data in scfrdr clear dr, er, brk flags in scfsr, and orer flag in sclsr, to 0 end yes yes yes no overrun error handling orer = 1? yes no no no ? whether a framing error or parity error has occurred in the receive data that is to be read from the receive fifo data register (scfrdr) can be ascertained from the fer and per bits in the serial status register (scfsr). ? when a break signal is received, receive data is not transferred to scfrdr while the brk flag is set. however, note that the last data in scfrdr is h'00, and the break data in which a framing error occurred is stored. figure 16.7 sample flowchart fo r receiving serial data (cont)
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 712 of 1164 rej09b0321-0200 in serial reception, the scif operates as described below. 1. the scif monitors the transmission line, and if a 0 start bit is detected, performs internal synchronization and starts reception. 2. the received data is stored in scrsr in lsb-to-msb order. 3. the parity bit and stop bit are received. after receiving these bits, the scif carries out the following checks. a. stop bit check: the scif checks whether the st op bit is 1. if there are two stop bits, only the first is checked. b. the scif checks whether receive data can be transferred from the receive shift register (scrsr) to scfrdr. c. overrun check: the scif checks that the orer flag is 0, indicating that the overrun error has not occurred. d. break check: the scif checks that the brk fl ag is 0, indicating that the break state is not set. if all the above checks are passed, the receive data is stored in scfrdr. note: when a parity error or a framing error occurs, reception is not suspended. 4. if the rie bit in scscr is set to 1 when th e rdf or dr flag change s to 1, a receive-fifo- data-full interrupt (rxi) request is generated. if the rie bit or the reie bit in scscr is set to 1 when the er flag changes to 1, a receive-error interrupt (eri) request is generated. if the rie bit or the reie bit in scscr is set to 1 when the brk or orer flag changes to 1, a break reception interrupt (br i) request is generated. figure 16.8 shows an example of the operation for reception. rdf 0 0/1 1 1 1 d 0 d 1 d 7 0 0/1 1 d 0 d 1 d 7 fer serial data start bit data parity bit stop bit start bit data parity bit stop bit rxi interrupt request one frame data read and rdf flag read as 1 then cleared to 0 by rxi interrupt handler eri interrupt request generated by receive error idle state (mark state) figure 16.8 example of scif receive op eration (8-bit data, parity, 1 stop bit)
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 713 of 1164 rej09b0321-0200 16.4.3 operation in cl ocked synchronous mode in clocked synchronous mode, the scif transmits and receives data in sync hronization with clock pulses. this mode is suitable for high-speed serial communication. the scif transmitter and receiver are independent, so full-duplex communication is possible while sharing the same clock. the transmitter an d receiver are also 16-byte fifo buffered, so continuous transmitting or receiving is possible by reading or writing data while transmitting or receiving is in progress. figure 16.9 shows the general format in clocked synchronous serial communication. bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 * * lsb msb don't care don't care one unit of transfer data (character or frame) serial data serial clock note: * high except in continuous transfer figure 16.9 data format in clocked synchronous communication in clocked synchronous serial communication, each data bit is output on the communication line from one falling edge of the serial clock to the next . data is guaranteed valid at the rising edge of the serial clock. in each character, the serial data bits are transm itted in order from the lsb (first) to the msb (last). after output of the msb, the communication line remains in the state of the msb. in clocked synchronous mode, the scif receives data by synchronizing with the rising edge of the serial clock.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 714 of 1164 rej09b0321-0200 (1) transmit/receive formats the data length is fixed at eight bits. no parity bit can be added. (2) clock an internal clock generated by the on-chip baud rate generator by the setting of the c/ a bit in scsmr and cke[1:0] in scscr, or an external cl ock input from the sck pin can be selected as the scif transmit/receive clock. when the scif operates on an internal clock, it outputs the clock signal at the sck pin. eight clock pulses are output per transmitted or received character. when the scif is not transmitting or receiving, the clock signal remains in the high st ate. when only receiving, the clock signal outputs while the re bit of scscr is 1 an d the number of data in receive fifo is more than the receive fifo data trigger number. (3) transmitting and receiving data ? scif initialization (clocked synchronous mode) before transmitting, receiving, or changing the mode or communication form at, the software must clear the te and re bits to 0 in the serial co ntrol register (scscr), then initialize the scif. clearing te to 0 initializes the transmit shift regist er (sctsr). clearing re to 0, however, does not initialize the rdf, per, fer, and orer flag s and receive data regi ster (scrdr), which retain their previous contents.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 715 of 1164 rej09b0321-0200 figure 16.10 shows a sample flowchart for initializing the scif. start of initialization clear te and re bits in scscr to 0 set tfrst and rfrst bits in scfcr to 1 to clear the fifo buffer after reading er, dr, and brk flags in scfsr, write 0 to clear them set cke[1:0] bits in scscr (leaving te, re, tie, and rie bits cleared to 0) set data transfer format in scsmr set value in scbrr set rtrg[1:0] and ttrg[1:0] bits in scfcr, and clear tfrst and rfrst bits to 0 set te and re bits in scscr to 1, and set tie, rie, and reie bits end of initialization leave the te and re bits cleared to 0 until the initialization almost ends. set the data transfer format in scsmr. set the cke1 and cke0 bits. write a value corresponding to the bit rate into scbrr. this is not necessary if an external clock is used. sets pfc for external pins used. set as rxd input at reciving and txd at transmission. set the te or re bit in scscr to 1. also set the tie, rie, and reie bits to enable the txd, rxd, and sck pins to be used. when transmitting, the txd pin will go to the mark state. when receiving in clocked synchronous mode with the synchronization clock output (clock master) selected, a clock starts to be output from the sck pin at this point. [1] [1] [2] [3] [4] [5] [6] [2] [3] [4] [6] pfc setting for external pins used sck, txd, rxd [5] figure 16.10 sample flowch art for scif initialization
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 716 of 1164 rej09b0321-0200 ? transmitting serial data (clocked synchronous mode) figure 16.11 shows a sample flowchart for transmitting serial data. use the following procedure for serial data transmission after enabling the scif for transmission. start of transmission read tdfe flag in scfsr tdfe = 1? write transmit data to scftdr and read 1 from tdfe and tend flags in scfsr, then clear these flags to 0 all data transmitted? read tend flag in scfsr tend = 1? clear te bit in scscr to 0 end of transmission no yes no yes no yes [1] scif status check and transmit data write: read scfsr and check that the tdfe flag is set to 1, then write transmit data to scftdr, and read 1 from the tdfe and tend flags, then clear these flags to 0. [2] serial transmission continuation procedeure: to continue serial transmission, read 1 from the tdfe flag to confirm that writing is possible, them write data to scftdr, and then clear the tdfe flag to 0. [1] [2] figure 16.11 sample flowchart for transmitting serial data
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 717 of 1164 rej09b0321-0200 in serial transmission, the scif operates as described below. 1. when data is written into the transmit fifo data register (scftdr), the scif transfers the data from scftdr to the transmit shift register (sctsr) and starts tran smitting. confirm that the tdfe flag in the serial stat us register (scfsr) is set to 1 before writing transmit data to scftdr. the number of data bytes that can be written is (16 ? transmit trigger setting). 2. when data is transferred from scftdr to sctsr and transmission is started, consecutive transmit operations are performed until there is no transmit data left in scftdr. when the number of transmit data bytes in scftdr falls below the transmit trigger number set in the fifo control register (scfcr), the tdfe flag is se t. if the tie bit in the serial control register (scsr) is set to 1 at this time, a transm it-fifo-data-empty interrupt (txi) request is generated. if clock output mode is selected, the scif outputs eight synchronous clock pulses. if an external clock source is selected, the scif ou tputs data in synchronization with the input clock. data is output from the txd pin in order from the lsb (bit 0) to the msb (bit 7). 3. the scif checks the scftdr transmit data at the timing for sending the msb (bit 7). if data is present, the data is transfer red from scftdr to sctsr, and then serial transmission of the next frame is started. if there is no data, th e txd pin holds the state after the tend flag in scfsr is set to 1 and the msb (bit 7) is sent. 4. after the end of serial transmission, the sck pin is held in the high state. figure 16.12 shows an example of scif transmit operation. serial clock serial data tdfe tend data written to scftdr and tdfe flag cleared to 0 by txi interrupt handler one frame bit 0 lsb txi interrupt request msb bit 1 bit 6 bit 7 bit 7 bit 0 bit 1 txi interrupt request figure 16.12 example of scif transmit operation
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 718 of 1164 rej09b0321-0200 ? receiving serial data (c locked synchronous mode) figures 16.13 and 16.14 show samp le flowcharts for receiving seri al data. when switching from asynchronous mode to clocked synchronous mode without scif initialization, make sure that orer, per, and fer are cleared to 0. start of reception read orer flag in sclsr orer = 1? read rdf flag in scfsr rdf = 1? read receive data in scfrdr, and clear rdf flag in scfsr to 0 all data received? clear re bit in scscr to 0 end of reception yes no yes yes no no error handling [1] receive error handling: read the orer flag in sclsr to identify any error, perform the appropriate error handling, then clear the orer flag to 0. reception cannot be resumed while the orer flag is set to 1. [2] scif status check and receive data read: read scfsr and check that rdf = 1, then read the receive data in scfrdr, and clear the rdf flag to 0. the transition of the rdf flag from 0 to 1 can also be identified by an rxi interrupt. [3] serial reception continuation procedure: to continue serial reception, read at least the receive trigger set number of receive data bytes from scfrdr, read 1 from the rdf flag, then clear the rdf flag to 0. the number of receive data bytes in scfrdr can be ascertained by reading scfrdr. however, the rdf bit is cleared to 0 automatically when an rxi interrupt activates the dmac to read the data in scfrdr. [1] [2] [3] figure 16.13 sample flowchart for receiving serial data (1)
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 719 of 1164 rej09b0321-0200 error handling clear orer flag in sclsr to 0 end overrun error handling orer = 1? yes no figure 16.14 sample flowchart for receiving serial data (2) in serial reception, the scif operates as described below. 1. the scif synchronizes with serial clock input or output and starts the reception. 2. receive data is shifted into scrsr in order from the lsb to the msb. after receiving the data, the scif checks the receive data can be load ed from scrsr into scfrdr or not. if this check is passed, the rdf flag is set to 1 and th e scif stores the received data in scfrdr. if the check is not passed (overrun error is de tected), further recep tion is prevented. 3. after setting rdf to 1, if the receive-data-full interrupt enable bit (rie) is set to 1 in scscr, the scif requests a receive-dat a-full interrupt (rxi). if the orer bit is set to 1 and the receive-data-full interrupt enable bit (rie) or the receive error in terrupt enable bit (reie) in scscr is also set to 1, the scif requests a break interrupt (bri). figure 16.15 shows an example of scif receive operation. bit 7 bit 0 lsb msb bit 7 bit 0 bit 1 bit 6 bit 7 rdf orer serial clock serial data data read from scfrdr and rdf flag cleared to 0 by rxi interrupt handler one frame rxi interrupt request bri interrupt request by overrun error rxi interrupt request figure 16.15 example of scif receive operation
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 720 of 1164 rej09b0321-0200 ? transmitting and receiving serial data si multaneously (clocked synchronous mode) figure 16.16 shows a samp le flowchart for transmit ting and receiving serial data simultaneously. use the following procedure for the simultaneous transmission/r eception of serial data, after enabling the scif for tr ansmission/reception. start of transmission and reception initialization read tdfe flag in scfsr tdfe = 1? write transmit data to scftdr, and read 1 from tdfe and tend flags in scftdr, then clear these flags to 0 read orer flag in sclsr orer = 1? read rdf flag in scfsr rdf = 1? clear te and re bits in scscr to 0 end of transmission and reception read receive data in scfrdr, and clear rdf flag in scfsr to 0 all data received? no no yes no no yes yes [1] scif status check and transmit data write: read scfsr and check that the tdfe flag is set to 1, then write transmit data to scftdr , and read 1 from the tdfe and tend flags, then clear these flags to 0. the transition of the tdfe flag from 0 to 1 can also be identified by a txi interrupt. [2] receive error handling: read the orer flag in sclsr to identify any error, perform the appropriate error handling, then clear the orer flag to 0. reception cannot be resumed while the orer flag is set to 1. [3] scif status check and receive data read: read scfsr and check that rdf = 1, then read the receive data in scfrdr, and clear the rdf flag to 0. the transition of the rdf flag from 0 to 1 can also be identified by an rxi interrupt. [4] serial transmission and reception continuation procedure: to continue serial transmission and reception, read 1 from the rdf flag and the receive data in scfrdr, and clear the rdf flag to 0 before receiving the msb in the current frame. similarly, read 1 from the tdfe flag to confirm that writing is possible before transmitting the msb in the current frame. then write data to scftdr and clear the tdfe flag to 0. [1] yes error handling [4] when switching from a transmit operation or receive operation to simultaneous transmission and reception operations, clear the te and re bits to 0, and then set them simultaneously to 1. note: [3] [2] figure 16.16 sample flowchart for transmitting/receiving serial data
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 721 of 1164 rej09b0321-0200 16.5 scif interrupts the scif has four interr upt sources: transmit fifo data empty (txi), receive error (eri), receive fifo data full (rxi), and break (bri). table 16.12 shows the interrupt sources and their order of priority. the interrupt sources are enabled or disabled by means of the tie, rie, and reie bits in scscr. a separate interrupt request is sent to the interrupt contro ller for each of these interrupt sources. when a txi request is enabled by the tie bit and the tdfe flag in the se rial status register (scfsr) is set to 1, a txi interrupt request is generated. the dmac can be activated and data transfer performed by this txi interrupt request. at this time, an interrupt request is not sent to the cpu. when an rxi request is enabled by the rie bit, and the rdf flag or the dr flag in scfsr is set to 1, an rxi interrupt request is generated. the dmac can be activated and data transfer performed by this rxi interrupt request. at this tim e, an interrupt request is not sent to the cpu. the rxi interrupt request caused by the dr flag is generated only in asynchronous mode. when the rie bit is set to 0 and the reie bit is set to 1, the scif requests only an eri interrupt without requesting an rxi interrupt. the txi interrupt indicates that transmit data can be written, and the rxi interrupt indicates that there is receive data in scfrdr. table 16.12 scif interrupt sources interrupt source description dmac activation priority on reset release bri interrupt initiated by break (brk) or overrun error (orer) not possible high eri interrupt initiated by receive error (er) not possible rxi interrupt initiated by re ceive fifo data full (rdf) or data ready (dr) possible txi interrupt initiated by transmit fifo data empty (tdfe) possible low
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 722 of 1164 rej09b0321-0200 16.6 usage notes note the following when using the scif. 16.6.1 scftdr writing and tdfe flag the tdfe flag in the serial stat us register (scfsr) is set when the number of transmit data bytes written in the transmit fifo data register (scftd r) has fallen below the transmit trigger number set by bits ttrg1 and ttrg0 in the fifo control register (scfcr). after td fe is set, transmit data up to the number of empty bytes in scftdr can be written, allowing efficient continuous transmission. however, if the number of data bytes written in scftdr is equal to or less than the transmit trigger number, the tdfe flag will be set to 1 agai n after being read as 1 and cleared to 0. tdfe clearing should therefore be carri ed out when scftdr contains mo re than the transmit trigger number of transmit data bytes. the number of tran smit data bytes in scftdr can be found from the upper 8 bits of the fifo data count register (scfdr). 16.6.2 scfrdr reading and rdf flag the rdf flag in the serial status register (scfsr) is set when the number of receive data bytes in the receive fifo data register (scfrdr) has beco me equal to or greater than the receive trigger number set by bits rtrg1 and rtrg0 in the fifo control register (scfcr). after rdf is set, receive data equivalent to th e trigger number can be read from scfrdr, allowing efficient continuous reception. however, if the number of data bytes in scfrdr exceeds the trigger numb er, the rdf flag will be set to 1 again if it is cleared to 0. rdf shoul d therefore be cleared to 0 after being read as 1 after reading the number of the r eceived data in the receive fifo da ta register (scfrdr) which is less than the trigger number. the number of receive data bytes in scfrdr can be found from the lower 8 bits of the fifo data count register (scfdr).
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 723 of 1164 rej09b0321-0200 16.6.3 restriction on dmac usage 1. when the dmac writes data to scftdr with a txi interrupt request, the state of the tend flag becomes undefined. therefore, the tend flag should not be used as the transfer end flag in such a case. 2. when one channel is used in full duplex communication with the dmac used for transmission and the cpu used for reception, if the receive data are read from the receive fifo data register (scfrdr) after the rdf or dr flag in the seri al status register (scfsr) has been set, the rdf or dr flag may be cleared. 3. when one channel is used in full duplex communication with the dmac used for reception and the cpu used for transmission, if the transmit data is written to the transmit fifo data register (scftdr) after the tdfe or tend flag in the serial status re gister (scfsr) has been set, the tdfe or tend flags may be cleared. 16.6.4 break detection and processing break signals can be detected by reading the rxd pin directly when a framing error (fer) is detected. in the break stat e the input from the rxd pin consists of all 0s, so the fer flag is set and the parity error flag (per) may also be set. note that, although transf er of receive data to scfrdr is ha lted in the break state, the scif receiver continues to operate. 16.6.5 sending a break signal the i/o condition and level of the txd pin are determined by the spb2io and spb2dt bits in the serial port register (scsptr). this feature can be used to send a break signal. until te bit is set to 1 (enabling transmission) after initializing, the txd pin does not work. during the period, mark status is performed by the spb2dt bit. therefore, the spb2io and spb2dt bits should be set to 1 (high level output). to send a break signal during serial transmissi on, clear the spb2dt bit to 0 (designating low level), then clear the te bit to 0 (halting transmission). when the te bit is cleared to 0, the transmitter is initialized regardless of the current tr ansmission state, and 0 is output from the txd pin.
section 16 serial communication interface with fifo (scif) rev. 2.00 sep. 07, 2007 page 724 of 1164 rej09b0321-0200 16.6.6 receive data sampli ng timing and receive ma rgin (asynchronous mode) the scif operates on a base clock with a frequency of 16 times the transfer rate. in reception, the scif synchronizes internally with the fall of the start bit, which it samples on the base clock. receive data is latched at the ri sing edge of the eighth base cl ock pulse. the timing is shown in figure 16.17. d0 d1 0123456789101112131415012345 012345 6 7 8 9 10 11 12 13 14 15 16 clocks 8 clocks base clock receive data (rxd) start bit ?7.5 clocks +7.5 clocks synchronization sampling timing data sampling timing figure 16.17 receive data sampling timing in asynchronous mode the receive margin in asynchron ous mode can therefore be expres sed as shown in equation 1. equation 1: m = (0.5 - ) - (l - 0.5) f - (1 + f) 100 % 1 2n d - 0.5 n where: m: receive margin (%) n: ratio of clock frequency to bit rate (n = 16) d: clock duty (d = 0 to 1.0) l: frame length (l = 9 to 12) f: absolute deviation of clock frequency from equation 1, if f = 0 and d = 0.5, the receive margin is 46.875%, as given by equation 2. equation 2: when d = 0.5 and f = 0: m = (0.5 - 1/(2 16)) 100% = 46.875% this is a theoretical value. a reasonable margin to allow in system designs is 20% to 30%.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 725 of 1164 rej09b0321-0200 section 17 i 2 c bus interface 3 (iic3) the i 2 c bus interface 3 conforms to and pr ovides a subset of the philips i 2 c (inter-ic) bus interface functions. however, the configuration of the re gisters that control the i 2 c bus differs partly from the philips re gister configuration. 17.1 features ? selection of i 2 c format or clocked synchronous serial format ? continuous transmission/reception since the shift register, transmit data register, and receive data register are independent from each other, the continuous transmi ssion/reception can be performed. i 2 c bus format: ? start and stop conditions generated automatically in master mode ? selection of acknowledge output levels when receiving ? automatic loading of acknowledge bit when transmitting ? bit synchronization/wait function in master mode, the state of scl is monitored per bit, and the timing is synchronized automatically. if transmission/ reception is not yet possible, set the scl to low until preparations are completed. ? six interrupt sources transmit data empty (including slave-address match) , transmit end, receive data full (including slave-address match), arbitration lost, nack detection, and stop condition detection ? the direct memory access controller (dmac) can be activated by a transmit-data-empty request or receive-data-full request to transfer data. ? direct bus drive two pins, scl0 to scl2 and sda0 to sda2, function as nmos open-drain outputs when the bus drive function is selected. clocked synchronous serial format: ? four interrupt sources transmit-data-empty, transmit-end, receive-data-full, and overrun error ? the direct memory access controller (dmac) can be activated by a transmit-data-empty request or receive-data-full request to transfer data.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 726 of 1164 rej09b0321-0200 figure 17.1 shows a block diagram of the i 2 c bus interface 3. scl iccr1 iccr2 icmr icsr icier icdrr icdrs icdrt sar sda nf2cyc transfer clock generation circuit address comparator interrupt generator interrupt request bus state decision circuit arbitration decision circuit noise filter noise filter output control output control transmission/ reception control circuit i 2 c bus control register 1 i 2 c bus control register 2 i 2 c bus mode register i 2 c bus status register i 2 c bus interrupt enable register i 2 c bus transmit data register i 2 c bus receive data register i 2 c bus shift register slave address register nf2cyc register [legend] iccr1: iccr2: icmr: icsr: icier: icdrt: icdrr: icdrs: sar: nf2cyc: peripheral bus figure 17.1 block diagram of i 2 c bus interface 3
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 727 of 1164 rej09b0321-0200 17.2 input/output pins table 17.1 shows the pin configuration of the i 2 c bus interface 3. specifications for the voltage applied to i/o pins for the i 2 c bus interface are different from others because of the pin configuration difference. for details, s ee section 29, electri cal characteristics. table 17.1 pin configuration channel pin name symbol i/o function serial clock scl0 to scl2 i/o i 2 c serial clock input/output 0 to 2 serial data sda0 to sda2 i/o i 2 c serial data input/output figure 17.2 shows an example of i/o pin connections to external circuits. specifications for the voltage applied to i/o pins for the i 2 c bus interface are different from others because of the pin configuration difference. for de tails, see section 29, electrical characteristics. i 2 c bus power supply * scl in scl out scl sda in sda out sda scl sda scl in scl out scl sda in sda out sda scl in scl out scl sda in sda out sda note: * turn on/off pvcc for the i 2 c bus power supply and for this lsi simultaneously. (master) (slave 1) (slave 2) figure 17.2 external circu it connections of i/o pins
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 728 of 1164 rej09b0321-0200 17.3 register descriptions the i 2 c bus interface 3 has the following registers. table 17.2 register configuration channel register name abbrevi- ation r/w initial value address access size 0 i 2 c bus control register 1 iccr1 r/w h'00 h'fffee000 8 i 2 c bus control register 2 iccr2 r/w h'7d h'fffee001 8 i 2 c bus mode register icmr r/w h'38 h'fffee002 8 i 2 c bus interrupt enable regist er icier r/w h'00 h'fffee003 8 i 2 c bus status register icsr r/w h'00 h'fffee004 8 slave address register sar r/w h'00 h'fffee005 8 i 2 c bus transmit data register icdrt r/w h'ff h'fffee006 8 i 2 c bus receive data register icdrr r/w h'ff h'fffee007 8 nf2cyc register nf2cyc r/w h'02 h'fffee008 8 1 i 2 c bus control register 1 iccr1 r/w h'00 h'fffee080 8 i 2 c bus control register 2 iccr2 r/w h'7d h'fffee081 8 i 2 c bus mode register icmr r/w h'38 h'fffee082 8 i 2 c bus interrupt enable regist er icier r/w h'00 h'fffee083 8 i 2 c bus status register icsr r/w h'00 h'fffee084 8 slave address register sar r/w h'00 h'fffee085 8 i 2 c bus transmit data register icdrt r/w h'ff h'fffee086 8 i 2 c bus receive data register icdrr r/w h'ff h'fffee087 8 nf2cyc register nf2cyc r/w h'02 h'fffee088 8 2 i 2 c bus control register 1 iccr1 r/w h'00 h'fffee100 8 i 2 c bus control register 2 iccr2 r/w h'7d h'fffee101 8 i 2 c bus mode register icmr r/w h'38 h'fffee102 8 i 2 c bus interrupt enable regist er icier r/w h'00 h'fffee103 8 i 2 c bus status register icsr r/w h'00 h'fffee104 8 slave address register sar r/w h'00 h'fffee105 8 i 2 c bus transmit data register icdrt r/w h'ff h'fffee106 8 i 2 c bus receive data register icdrr r/w h'ff h'fffee107 8 nf2cyc register nf2cyc r/w h'02 h'fffee108 8
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 729 of 1164 rej09b0321-0200 17.3.1 i 2 c bus control register 1 (iccr1) iccr1 is an 8-bit readable/writable register that enables or disables the i 2 c bus interface 3, controls transmission or reception, and selects ma ster or slave mode, transmission or reception, and transfer clock frequency in master mode. iccr1 is initialized to h'00 by a power-on reset or deep standby mode. 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: ice rcvd mst trs cks[3:0] bit bit name initial value r/w description 7 ice 0 r/w i 2 c bus interface 3 enable 0: this module is halted. 1: this bit is enabled for transfer operations. 6 rcvd 0 r/w reception disable enables or disables the next operation when trs is 0 and icdrr is read. 0: enables next reception 1: disables next reception
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 730 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 4 mst trs 0 0 r/w r/w master/slave select transmit/receive select in master mode with the i 2 c bus format, when arbitration is lost, mst and trs are both reset by hardware, causing a transition to slave receive mode. modification of the trs bit should be made between transfer frames. when seven bits after the start condition is issued in slave receive mode match the slave address set to sar and the 8th bit is set to 1, trs is automatically set to 1. if an overrun erro r occurs in master receive mode with the clocked synchronous serial format, mst is cleared and the mode changes to slave receive mode. operating modes are described below according to mst and trs combination. when clocked synchronous serial format is selected and mst = 1, clock is output. 00: slave receive mode 01: slave transmit mode 10: master receive mode 11: master transmit mode 3 to 0 cks[3:0] 0000 r/w transfer clock select these bits should be set according to the necessary transfer rate (table 17.3) in master mode.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 731 of 1164 rej09b0321-0200 table 17.3 transfer rate bit 3 bit 2 bit 1 bit 0 transfer rate cks3 cks2 cks1 cks0 clock p = 16.7 mhz p = 20.0 mhz p = 25.0 mhz p = 30.0 mhz p = 33.3 mhz p = 40 mhz 0 0 0 0 p /28 595 khz 714 khz 893 khz 1071 khz 1189 khz 1430 khz 1 p /40 417 khz 500 khz 625 khz 750 khz 833 khz 1000 khz 1 0 p /48 347 khz 417 khz 521 khz 625 khz 694 khz 833 khz 1 p /64 260 khz 313 khz 391 khz 469 khz 520 khz 625 khz 1 0 0 p /80 208 khz 250 khz 313 khz 375 khz 416 khz 500 khz 1 p /100 167 khz 200 khz 250 khz 300 khz 333 khz 400 khz 1 0 p /112 149 khz 179 khz 223 khz 268 khz 297 khz 357 khz 1 p /128 130 khz 156 khz 195 khz 234 khz 260 khz 313 khz 1 0 0 0 p /112 149 khz 179 khz 223 khz 268 khz 297 khz 357 khz 1 p /160 104 khz 125 khz 156 khz 188 khz 208 khz 250 khz 1 0 p /192 86.8 khz 104 khz 130 khz 156 khz 173 khz 208 khz 1 p /256 65.1 khz 78.1 khz 97.7 khz 117 khz 130 khz 156 khz 1 0 0 p /320 52.1 khz 62.5 khz 78.1 khz 93.8 khz 104 khz 125 khz 1 p /400 41.7 khz 50.0 khz 62.5 khz 75.0 khz 83.3 khz 100 khz 1 0 p /448 37.2 khz 44.6 khz 55.8 khz 67.0 khz 74.3 khz 89.3 khz 1 p /512 32.6 khz 39.1 khz 48.8 khz 58.6 khz 65.0 khz 78.1 khz note: the settings should satisfy external specifications.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 732 of 1164 rej09b0321-0200 17.3.2 i 2 c bus control register 2 (iccr2) iccr2 is an 8-bit readable/writable register that issues start/stop conditions, manipulates the sda pin, monitors the scl pin, and controls reset in the control part of the i 2 c bus. iccr2 is initialized to h'7d by a power-on reset or deep standby mode. 0 1 2 3 4 5 6 7 1 0 1 1 1 1 1 0 r/w r/w r/w r/w r r r/w r bit: initial value: r/w: bbsy scp sdao sdaop sclo ? iicrst ? bit bit name initial value r/w description 7 bbsy 0 r/w bus busy enables to confirm whether the i 2 c bus is occupied or released and to issue start/stop conditions in master mode. with the clocked synchronous serial format, this bit is always read as 0. with the i 2 c bus format, this bit is set to 1 when the sda level changes from high to low under the condition of scl = high, assuming that the start condition has been issued. this bit is cleared to 0 when the sda level changes from low to high under the condition of scl = high, assuming that the stop condition has been issued. write 1 to bbsy and 0 to scp to issue a start condition. follow this procedure when also re-transmitting a start condition. write 0 in bbsy and 0 in scp to issue a stop condition. 6 scp 1 r/w start/stop issue condition disable controls the issue of start/s top conditions in master mode. to issue a start condition, write 1 in bbsy and 0 in scp. a retransmit start condition is issued in the same way. to issue a stop condition, write 0 in bbsy and 0 in scp. this bit is always read as 1. even if 1 is written to this bit, the data will not be stored.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 733 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 sdao 1 r/w sda output value control this bit is used with sdaop when modifying output level of sda. this bit should not be manipulated during transfer. 0: when reading, sda pin outputs low. when writing, sda pin is changed to output low. 1: when reading, sda pin outputs high. when writing, sda pin is changed to output hi-z (outputs high by external pull-up resistance). 4 sdaop 1 r/w sdao write protect controls change of output level of the sda pin by modifying the sdao bit. to change the output level, clear sdao and sdaop to 0 or set sdao to 1 and clear sdaop to 0. this bit is always read as 1. 3 sclo 1 r scl output level monitors scl output level. when sclo is 1, scl pin outputs high. when sclo is 0, scl pin outputs low. 2 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 1 iicrst 0 r/w iic control part reset resets the control part except for i 2 c registers. if this bit is set to 1 when hang-up occurs because of communication failure during i 2 c bus operation, some iic3 registers and the control part can be reset. 0 ? 1 r reserved this bit is always read as 1. the write value should always be 1.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 734 of 1164 rej09b0321-0200 17.3.3 i 2 c bus mode register (icmr) icmr is an 8-bit readable/writable register that selects whether the msb or lsb is transferred first, performs master mode wait control, and selects the transfer bit count. icmr is initialized to h'38 by a power-on reset or deep standby mode. bits bc[2:0] are initialized to h'0 by the iicrst bit in iccr2. 0 1 2 3 4 5 6 7 0 0 0 1 1 1 0 0 r r r/w r/w r/w r/w r/w r/w bit: initial value: r/w: mls wait ? ? bcwp bc[2:0] bit bit name initial value r/w description 7 mls 0 r/w msb-first/lsb-first select 0: msb-first 1: lsb-first set this bit to 0 when the i 2 c bus format is used. 6 wait 0 r/w wait insertion in master mode with the i 2 c bus format, this bit selects whether to insert a wait after data transfer except the acknowledge bit. when wait is set to 1, after the fall of the clock for the final data bit, low period is extended for two transfer clocks. if wait is cleared to 0, data and acknowledge bits are transferred consecutively with no wait inserted. the setting of this bit is invalid in slave mode with the i 2 c bus format or with the clocked synchronous serial format. 5, 4 ? all 1 r reserved these bits are always read as 1. the write value should always be 1.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 735 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3 bcwp 1 r/w bc write protect controls the bc[2:0] modifications. when modifying the bc[2:0] bits, this bit should be cleared to 0. in clocked synchronous serial mode, the bc[2:0] bits should not be modified. 0: when writing, values of the bc[2:0] bits are set. 1: when reading, 1 is always read. when writing, settings of the bc[2:0] bits are invalid. bit counter these bits specify the number of bits to be transferred next. when read, the remaining number of transfer bits is indicated. with the i 2 c bus format, the data is transferred with one addition acknowledge bit. should be made between transfer frames. if these bits are set to a value other than b'000, the setting should be made while the scl pin is low. the value returns to b'000 at the end of a data transfer, including the acknowledge bit. these bits are cleared by a power-on reset, in deep standby mode, software standby mode, or module standby mode. these bits are also cleared by setting the iicrst bit of iccr2 to 1. with the clocked synchronous serial format, these bits should not be modified. 2 to 0 bc[2:0] 000 r/w i 2 c bus format 000: 9 bits 001: 2 bits 010: 3 bits 011: 4 bits 100: 5 bits 101: 6 bits 110: 7 bits 111: 8 bits clocked synchronous serial format 000: 8 bits 001: 1 bit 010: 2 bits 011: 3 bits 100: 4 bits 101: 5 bits 110: 6 bits 111: 7 bits
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 736 of 1164 rej09b0321-0200 17.3.4 i 2 c bus interrupt enable register (icier) icier is an 8-bit readable/writable register that enables or disables interrupt sources and acknowledge bits, sets acknowledge bits to be transferred, and confirms acknowledge bits received. icier is initialized to h'00 by a power-on reset or deep standby mode. 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 r r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: tie teie rie nakie stie acke ackbr ackbt bit bit name initial value r/w description 7 tie 0 r/w transmit interrupt enable when the tdre bit in icsr is set to 1 or 0, this bit enables or disables the transmit data empty interrupt (txi). 0: transmit data empty interrupt request (txi) is disabled. 1: transmit data empty interrupt request (txi) is enabled. 6 teie 0 r/w transmit end interrupt enable enables or disables the transmit end interrupt (tei) at the rising of the ninth clock while the tdre bit in icsr is 1. tei can be canceled by clearing the tend bit or the teie bit to 0. 0: transmit end interrupt request (tei) is disabled. 1: transmit end interrupt request (tei) is enabled. 5 rie 0 r/w receive interrupt enable enables or disables the receive data full interrupt request (rxi) and the overrun error interrupt request (eri) in the clocked synchronous format when receive data is transferred from icdrs to icdrr and the rdrf bit in icsr is set to 1. rxi can be canceled by clearing the rdrf or rie bit to 0. 0: receive data full interrupt request (rxi) are disabled. 1: receive data full interrupt request (rxi) are enabled.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 737 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 nakie 0 r/w nack receive interrupt enable enables or disables the nack detection interrupt request (naki) and the overrun error (ove set in icsr) interrupt request (eri) in the clocked synchronous format when the nackf or al/ove bit in icsr is set. naki can be canceled by clearing the nackf, al/ove, or nakie bit to 0. 0: nack receive interrupt request (naki) is disabled. 1: nack receive interrupt request (naki) is enabled. 3 stie 0 r/w stop condition detection interrupt enable enables or disables the stop condition detection interrupt request (stpi) when the stop bit in icsr is set. 0: stop condition detection interrupt request (stpi) is disabled. 1: stop condition detection interrupt request (stpi) is enabled. 2 acke 0 r/w acknowledge bit judgment select 0: the value of the receive acknowledge bit is ignored, and continuous transfer is performed. 1: if the receive acknowledge bit is 1, continuous transfer is halted. 1 ackbr 0 r receive acknowledge in transmit mode, this bit stores the acknowledge data that are returned by the receive device. this bit cannot be modified. this bit can be canceled by setting the bbsy bit in iccr2 to 1. 0: receive acknowledge = 0 1: receive acknowledge = 1 0 ackbt 0 r/w transmit acknowledge in receive mode, this bit spec ifies the bit to be sent at the acknowledge timing. 0: 0 is sent at the acknowledge timing. 1: 1 is sent at the acknowledge timing.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 738 of 1164 rej09b0321-0200 17.3.5 i 2 c bus status register (icsr) icsr is an 8-bit readable/writable register that confirms interrupt request flags and their status. icsr is initialized to h'00 by a power-on reset or deep standby mode. 0 1 2 3 4 5 6 7 bit: initial value: r/w: 00000000 r/w r/w r/w r/w r/w r/w r/w r/w tdre tend rdrf nackf stop al/ove aas adz bit bit name initial value r/w description 7 tdre 0 r/w transmit data register empty [clearing conditions] ? when 0 is written in tdre after reading tdre = 1 ? when data is written to icdrt [setting conditions] ? when data is transferred from icdrt to icdrs and icdrt becomes empty ? when trs is set ? when the start condition (including retransmission) is issued ? when slave mode is changed from receive mode to transmit mode 6 tend 0 r/w transmit end [clearing conditions] ? when 0 is written in tend after reading tend = 1 ? when data is written to icdrt [setting conditions] ? when the ninth clock of scl rises with the i 2 c bus format while the tdre flag is 1 ? when the final bit of transmit frame is sent with the clocked synchronous serial format
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 739 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 rdrf 0 r/w receive data register full [clearing conditions] ? when 0 is written in rdrf after reading rdrf = 1 ? when icdrr is read [setting condition] ? when a receive data is transferred from icdrs to icdrr 4 nackf 0 r/w no acknowledge detection flag [clearing condition] ? when 0 is written in nackf after reading nackf = 1 [setting condition] ? when no acknowledge is detected from the receive device in transmission while the acke bit in icier is 1 3 stop 0 r/w stop condition detection flag [clearing condition] ? when 0 is written in stop after reading stop = 1 [setting conditions] ? in master mode, when a stop condition is detected after frame transfer ? in slave mode, when the slave address in the first byte, after detecting start condition, matches the address set in sar, and then the stop condition is detected
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 740 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 al/ove 0 r/w arbitration lost flag/overrun error flag indicates that arbitration wa s lost in master mode with the i 2 c bus format and that the final bit has been received while rdrf = 1 with the clocked synchronous format. when two or more master devices attempt to seize the bus at nearly the same time, if the i 2 c bus interface 3 detects data differing from the data it sent, it sets al to 1 to indicate that the bus has been occupied by another master. [clearing condition] ? when 0 is written in al/ove after reading al/ove = 1 [setting conditions] ? if the internal sda and sda pin disagree at the rise of scl in master transmit mode ? when the sda pin outputs high in master mode while a start condition is detected ? when the final bit is received with the clocked synchronous format while rdrf = 1 1 aas 0 r/w slave addr ess recognition flag in slave receive mode, this flag is set to 1 if the first frame following a start condition matches bits sva[6:0] in sar. [clearing condition] ? when 0 is written in aas after reading aas = 1 [setting conditions] ? when the slave address is detected in slave receive mode ? when the general call address is detected in slave receive mode.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 741 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 adz 0 r/w general call address recognition flag this bit is valid in slave receive mode with the i 2 c bus format. [clearing condition] ? when 0 is written in adz after reading adz = 1 [setting condition] ? when the general call address is detected in slave receive mode 17.3.6 slave address register (sar) sar is an 8-bit readable/writable register that selects the communications format and sets the slave address. in slave mode with the i 2 c bus format, if the upper seven bits of sar match the upper seven bits of the first frame received after a start condition, this modul e operates as the slave device. sar is initialized to h'00 by a power-on reset or deep standby mode. 0 1 2 3 4 5 6 7 bit: initial value: r/w: 00000000 r/w r/w r/w r/w r/w r/w r/w r/w sva[6:0] fs bit bit name initial value r/w description 7 to 1 sva[6:0] 000000 0 r/w slave address these bits set a unique address in these bits, differing form the addresses of other slave devices connected to the i 2 c bus. 0 fs 0 r/w format select 0: i 2 c bus format is selected 1: clocked synchronous se rial format is selected
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 742 of 1164 rej09b0321-0200 17.3.7 i 2 c bus transmit data register (icdrt) icdrt is an 8-bit readable/writable register that stores the transmit data. when icdrt detects the empty space in the shift register (i cdrs), it transfer s the transmit data which is written in icdrt to icdrs and starts transferring data. if the ne xt transfer data is written to icdrt during transferring data of icdrs, continuous transf er is possible. icdrt is initialized to h'ff. icdrt is initialized to h'ff by a power-on reset or deep standby mode. 0 1 2 3 4 5 6 7 1 r/w 1 r/w 1 r/w 1 r/w 1 r/w 1 r/w 1 r/w 1 r/w bit: initial value: r/w: 17.3.8 i 2 c bus receive data register (icdrr) icdrr is an 8-bit register that stores the receiv e data. when data of one byte is received, icdrr transfers the receive data from icdrs to icdrr and the next data can be received. icdrr is a receive-only register, therefore the cp u cannot write to this register. icdrr is initialized to h'ff by a power-on reset or deep standby mode. 0 1 2 3 4 5 6 7 1 rrrrrrrr 1111111 bit: initial value: r/w: 17.3.9 i 2 c bus shift register (icdrs) icdrs is a register that is used to transfer/receive data. in transm ission, data is transferred from icdrt to icdrs and the data is sent from the sda pin. in reception, data is transferred from icdrs to icdrr after data of one byte is received. this register cannot be read directly from the cpu. 0 1 2 3 4 5 6 7 bit: initial value: r/w: ???????? ????????
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 743 of 1164 rej09b0321-0200 17.3.10 nf2cyc register (nf2cyc) nf2cyc is an 8-bit readable/writable register that selects the range of the noise filtering for the scl and sda pins. for details of the noise filter, see section 17.4.7, noise filter. nf2cyc is initialized to h'02 by a power-on reset or in deep standby mode. 0 1 2 3 4 5 6 7 0 1 0 0 0 0 0 0 r r r r r r r bit: initial value: r/w: ??????? r/w nf2 cyc bit bit name initial value r/w description 7 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 ? 1 r reserved this bit is always read as 0. the write value should always be 1. 0 nf2cyc 0 r/w noise f iltering range select 0: the noise less than one cycle of the peripheral clock can be filtered out 1: the noise less than two cycles of the peripheral clock can be filtered out
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 744 of 1164 rej09b0321-0200 17.4 operation the i 2 c bus interface 3 can communicate either in i 2 c bus mode or clocked synchronous serial mode by setting fs in sar. 17.4.1 i 2 c bus format figure 17.3 shows the i 2 c bus formats. figure 17.4 shows the i 2 c bus timing. the first frame following a start condition always consists of eight bits. sa sla 7n r/ w data a 1 1m 11 1 a/ a 1 p 1 s sla 7n1 7 r/ w a data 11 1m1 1 a/ a 1 s 1 sla r/ w 1 1m2 a 1 data n2 a/ a 1 p 1 (a) i 2 c bus format (fs = 0) (b) i 2 c bus format (start condition retransmission, fs = 0) n: transfer bit count (n = 1 to 8) m: transfer frame count (m 1) n1 and n2: transfer bit count (n1 and n2 = 1 to 8) m1 and m2: transfer frame count (m1 and m2 1) figure 17.3 i 2 c bus formats sda scl s sla r/ w a 9 8 1-7 9 8 1-7 9 8 1-7 data a data a p figure 17.4 i 2 c bus timing [legend] s: start condition. the master device drives sda from high to low while scl is high. sla: slave address r/ w : indicates the direction of data transfer: fr om the slave device to the master device when r/w is 1, or from the master device to the slave device when r/w is 0. a: acknowledge. the receive device drives sda to low. data: transfer data p: stop condition. the master device drives sda from low to high while scl is high.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 745 of 1164 rej09b0321-0200 17.4.2 master transmit operation in master transmit mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal. for ma ster transmit mode operation timing, refer to figures 17.5 and 17.6. the transmission procedure and operations in master transmit mode are described below. 1. set the ice bit in iccr1 to 1. set the wait bit in icmr and bits cks[3:0] in iccr1. (initial setting) 2. read the bbsy flag in iccr2 to confirm that the bus is released. set the mst and trs bits in iccr1 to select master transmit mode. then, write 1 to bbsy and 0 to scp. (start condition issued) this generates the start condition. 3. after confirming that tdre in icsr has been set, write the transmit data (the first byte data show the slave address and r/ w ) to icdrt. at this time, tdre is automatically cleared to 0, and data is transferred from icdrt to icdrs. tdre is set again. 4. when transmission of one byte data is completed while tdre is 1, tend in icsr is set to 1 at the rise of the 9th transmit clock pulse. read the ackbr bit in icier, and confirm that the slave device has been selected. then, write second byte data to icdrt. when ackbr is 1, the slave device has not been acknowledged, so issue the stop condition. to issue the stop condition, write 0 to bbsy and scp. scl is fixed low until the transmit data is prepared or the stop condition is issued. 5. the transmit data after the second byte is written to icdrt every time tdre is set. 6. write the number of bytes to be transmitted to icdrt. wait until tend is set (the end of last byte data transmission) while tdre is 1, or wait for nack (nackf in icsr = 1) from the receive device while acke in icier is 1. then , issue the stop condition to clear tend or nackf. 7. when the stop bit in icsr is set to 1, the operation returns to the slave receive mode.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 746 of 1164 rej09b0321-0200 tdre tend icdrt icdrs 12 12 3456789 a r/ w scl (master output) sda (master output) sda (slave output) [5] write data to icdrt (third byte) [2] instruction of start condition issuance [3] write data to icdrt (first byte) [4] write data to icdrt (second byte) user processing bit 7 slave address address + r/ w data 1 data 1 data 2 address + r/ w bit 6 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 figure 17.5 master transmit mode operation timing (1) tdre tend icdrt icdrs 1 9 23456789 a a/ a [6] issue stop condition. clear tend. [7] set slave receive mode scl (master output) sda (master output) sda (slave output) bit 7 bit 6 data n data n bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [5] write data to icdrt user processing figure 17.6 master transmit mode operation timing (2)
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 747 of 1164 rej09b0321-0200 17.4.3 master receive operation in master receive mode, the master device outputs th e receive clock, receives data from the slave device, and returns an acknowledge signal. for master receive mode operation timing, refer to figures 17.7 and 17.8. the reception procedure and operations in master receive mode are shown below. 1. clear the tend bit in icsr to 0, then clear the trs bit in iccr1 to 0 to switch from master transmit mode to master receive mode . then, clear the tdre bit to 0. 2. when icdrr is read (dummy data read), reception is started*, and the receive clock is output, and data received, in synchronization with the internal clock. the master device outputs the level specified by ackbt in icier to sda, at the 9th receive clock pulse. 3. after the reception of first frame data is complete d, the rdrf bit in icsr is set to 1 at the rise of 9th receive clock pulse. at this time, the r eceive data is read by reading icdrr, and rdrf is cleared to 0. 4. the continuous reception is performed by reading icdrr every time rdrf is set. if 8th receive clock pulse falls after reading icdrr by the other processing while rdrf is 1, scl is fixed low until icdrr is read. 5. if next frame is the last receive data, set th e rcvd bit in iccr1 to 1 before reading icdrr. this enables the issuance of the stop condition after the next reception. 6. when the rdrf bit is set to 1 at rise of th e 9th receive clock pulse, issue the stage condition. 7. when the stop bit in icsr is set to 1, read icdrr. then clear the rcvd bit to 0. 8. the operation returns to the slave receive mode. note: * if only one byte is received, read ic drr (dummy-read) after the rcvd bit in iccr1 is set.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 748 of 1164 rej09b0321-0200 tdre tend icdrs icdrr 1 a 21 3456789 9 a trs rdrf [1] clear tdre after clearing tend and trs [2] read icdrr (dummy read) [3] read icdrr scl (master output) sda (master output) sda (slave output) bit 7 master transmit mode master receive mode bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 user processing data 1 data 1 figure 17.7 master receive mode operation timing (1)
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 749 of 1164 rej09b0321-0200 rdrf rcvd icdrs icdrr 1 9 23456789 aa/ a data n-1 data n data n data n-1 [5] read icdrr after setting rcvd [6] issue stop condition [7] read icdrr, and clear rcvd [8] set slave receive mode scl (master output) sda (master output) sda (slave output) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 user processing figure 17.8 master receive mode operation timing (2) 17.4.4 slave transmit operation in slave transmit mode, the slave device outputs th e transmit data, while the master device outputs the receive clock and returns an acknowledge sign al. for slave transmit mode operation timing, refer to figures 17.9 and 17.10. the transmission procedure and operations in slave transmit mode are described below. 1. set the ice bit in iccr1 to 1. set bits cks[3:0] in iccr1. (initial setting) set the mst and trs bits in iccr1 to select slave receive m ode, and wait until the slave address matches. 2. when the slave address matches in the first frame following detection of the start condition, the slave device outputs the leve l specified by ackbt in icier to sda, at the rise of the 9th clock pulse. at this time, if the 8th bit data (r/w) is 1, the trs bit in iccr1 and the tdre bit in icsr are set to 1, and the mode changes to slave transmit mode automatically. the continuous transmission is performed by writi ng transmit data to icdrt every time tdre is set. 3. if tdre is set after writing la st transmit data to icdrt, wait until tend in icsr is set to 1, with tdre = 1. when te nd is set, clear tend. 4. clear trs for the end processing, and read icdrr (dummy read). scl is opened. 5. clear tdre.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 750 of 1164 rej09b0321-0200 tdre tend icdrs icdrr 1 a 21 3456789 9 a trs icdrt scl (master output) slave receive mode slave transmit mode sda (master output) sda (slave output) scl (slave output) bit 7 bit 7 data 1 data 1 data 2 data 3 data 2 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [2] write data to icdrt (data 1) [2] write data to icdrt (data 2) [2] write data to icdrt (data 3) user processing figure 17.9 slave transmit mode operation timing (1)
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 751 of 1164 rej09b0321-0200 tdre tend icdrs icdrr 1 9 23456789 trs icdrt a a data n scl (master output) sda (master output) sda (slave output) scl (slave output) bit 7 slave transmit mode slave receive mode bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [3] clear tend [5] clear tdre [4] read icdrr (dummy read) after clearing trs user processing figure 17.10 slave transmit mode operation timing (2)
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 752 of 1164 rej09b0321-0200 17.4.5 slave receive operation in slave receive mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal. for slave receive mode operation timing, refer to figures 17.11 and 17.12. the reception procedure and operations in slave receive mode are described below. 1. set the ice bit in iccr1 to 1. set bits ck s[3:0] in iccr1. (initial setting) set the mst and trs bits in iccr1 to select slave receive m ode, and wait until the slave address matches. 2. when the slave address matches in the first frame following detection of the start condition, the slave device outputs the level specified by ac kbt in icier to sda, at the rise of the 9th clock pulse. at the same time, rdrf in icsr is set to read icdrr (d ummy read). (since the read data show the slave address and r/w, it is not used.) 3. read icdrr every time rdrf is set. if 8th r eceive clock pulse falls while rdrf is 1, scl is fixed low until icdrr is read. the change of the acknowledge before reading icdrr, to be returned to the master device, is reflected to the next transmit frame. 4. the last byte data is read by reading icdrr. icdrs icdrr 12 1 345678 9 9 a a rdrf data 1 data 2 data 1 scl (master output) sda (master output) sda (slave output) scl (slave output) bit 7 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [2] read icdrr (dummy read) [2] read icdrr user processing figure 17.11 slave receive mode operation timing (1)
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 753 of 1164 rej09b0321-0200 icdrs icdrr 12345678 9 9 a a rdrf scl (master output) sda (master output) sda (slave output) scl (slave output) user processing bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 data 1 [3] set ackbt [3] read icdrr [4] read icdrr data 2 data 1 figure 17.12 slave receive mode operation timing (2) 17.4.6 clocked synchronous serial format this module can be operated with the clocked synchronous serial format, by setting the fs bit in sar to 1. when the mst bit in iccr1 is 1, the transfer clock output from scl is selected. when mst is 0, the external clock input is selected. (1) data transfer format figure 17.13 shows the clocked synchronous serial transfer format. the transfer data is output from the fall to the fall of the scl clock, and the data at the rising edge of the scl clock is guaranteed. the mls bit in icmr sets the order of data transfer, in either the msb first or lsb first. the output level of sda can be changed during the transfer wait, by the sdao bit in iccr2. sda scl bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 figure 17.13 clocked synchronous serial transfer format
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 754 of 1164 rej09b0321-0200 (2) transmit operation in transmit mode, transmit data is output from sda, in synchronization with the fall of the transfer clock. the transfer clock is output when mst in iccr1 is 1, and is input when mst is 0. for transmit mode operation timing, refer to figure 17.14. the transmission procedure and operations in transmit mode are described below. 1. set the ice bit in iccr1 to 1. set the mst and cks[3:0] bits in iccr1. (initial setting) 2. set the trs bit in iccr1 to select the transmit mode. then, tdre in icsr is set. 3. confirm that tdre has been set. then, write the transmit data to icdrt. the data is transferred from icdrt to icdrs, and td re is set automatically. the continuous transmission is performed by writing data to icdrt every time tdre is set. when changing from transmit mode to receive mode, clear trs while tdre is 1. 12 781 78 1 scl trs tdre icdrt icdrs bit 0 data 1 data 1 data 2 data 3 data 3 data 2 bit 6 bit 7 bit 0 bit 6 bit 7 bit 0 bit 1 sda (output) user processing [3] write data to icdrt [3] write data to icdrt [3] write data to icdrt [3] write data to icdrt [2] set trs figure 17.14 transmit mode operation timing
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 755 of 1164 rej09b0321-0200 (3) receive operation in receive mode, data is latched at the rise of the transfer clock. the transfer clock is output when mst in iccr1 is 1, and is input when mst is 0. for receive mode operation timing, refer to figure 17.15. the reception pro cedure and operations in receiv e mode are described below. 1. set the ice bit in iccr1 to 1. set bits cks[3:0] in iccr1. (initial setting) 2. when the transfer clock is output, set mst to 1 to start outputting the receive clock. 3. when the receive operation is completed, da ta is transferred from icdrs to icdrr and rdrf in icsr is set. when mst = 1, the ne xt byte can be received, so the clock is continually output. the continuous reception is performed by reading icdrr every time rdrf is set. when the 8th clock is risen wh ile rdrf is 1, the overrun is detected and al/ove in icsr is set. at this time, the pr evious reception data is retained in icdrr. 4. to stop receiving when mst = 1, set rcvd in iccr1 to 1, then read icdrr. then, scl is fixed high after receiving the next byte data. notes: follow the steps below to receive only one byte with mst = 1 specified. see figure 17.16 for the operation timing. 1. set the ice bit in iccr1 to 1. set bits cks[3:0] in iccr1. (initial setting) 2. set mst = 1 while the rcvd bit in iccr1 is 0. this caus es the receive clock to be output. 3. check if the bc2 bit in icmr is set to 1 and then set the rcvd bit in iccr1 to 1. this causes the scl to be fixed to the high level after outputting one byte of the receive clock.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 756 of 1164 rej09b0321-0200 12 781 7812 scl mst trs rdrf icdrs icdrr sda (input) bit 0 bit 6 bit 7 bit 0 bit 6 bit 7 bit 0 bit 1 bit 1 user processing data 1 data 1 data 2 data 2 data 3 [2] set mst (when outputting the clock) [3] read icdrr [3] read icdrr figure 17.15 receive mode operation timing 12345678 000 scl mst rcvd 111 110 101 100 011 010 001 000 sda (input) bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bc2 to bc0 [2] set mst [3] set the rcvd bit after checking if bc2 = 1 figure 17.16 operation timing fo r receiving one byte (mst = 1)
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 757 of 1164 rej09b0321-0200 17.4.7 noise filter the logic levels at the scl and sda pins are routed through noise filters before being latched internally. figure 17.17 shows a block diagram of the noise filter circuit. the noise filter consists of th ree cascaded latches and a match de tector. the scl (or sda) input signal is sampled on the peripheral clock. when nf2cyc is set to 0, this signal is not passed forward to the next circuit unless the outputs of both latches agree. when nf2cyc is set to 1, this signal is not passed forward to the next circuit unless the outputs of three latches agree. if they do not agree, the previous value is held. c q d c q d c q 1 0 d nf2cyc scl or sda input signal internal scl or sda signal sampling clock sampling clock peripheral clock cycle latch latch match detector latch match detector figure 17.17 block diagram of noise filter
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 758 of 1164 rej09b0321-0200 17.4.8 example of use flowcharts in respective modes that use the i 2 c bus interface 3 are shown in figures 17.18 to 17.21. bbsy=0 ? no tend=1 ? no yes start [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [13] [14] [15] initialize set mst and trs in iccr1 to 1 write 1 to bbsy and 0 to scp write transmit data in icdrt write 0 to bbsy and scp set mst and trs in iccr1 to 0 read bbsy in iccr2 read tend in icsr read ackbr in icier master receive mode yes ackbr=0 ? write transmit data in icdrt read tdre in icsr read tend in icsr clear tend in icsr read stop in icsr clear tdre in icsr end write transmit data in icdrt transmit mode? no yes tdre=1 ? last byte? stop=1 ? no no no no no yes yes tend=1 ? yes yes yes [1] test the status of the scl and sda lines. [2] set master transmit mode. [3] issue the start condition. [4] set the first byte (slave address + r/ w ) of transmit data. [5] wait for 1 byte to be transmitted. [6] test the acknowledge transferred from the specified slave device. [7] set the second and subsequent bytes (except for the final byte) of transmit data. [8] wait for icdrt empty. [9] set the last byte of transmit data. [10] wait for last byte to be transmitted. [11] clear the tend flag. [12] clear the stop flag. [13] issue the stop condition. [14] wait for the creation of stop condition. [15] set slave receive mode. clear tdre. [12] clear stop in icsr figure 17.18 sample flowch art for master transmit mode
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 759 of 1164 rej09b0321-0200 [10] no yes rdrf = 1 ? no yes rdrf=1 ? last receive - 1? master receive mode clear tend in icsr clear trs in iccr1 to 0 clear tdre in icsr clear ackbt in icier to 0 dummy-read icdrr read rdrf in icsr read icdrr set ackbt in icier to 1 set rcvd in iccr1 to 1 read icdrr read rdrf in icsr write 0 to bbsy and scp read stop in icsr read icdrr clear rcvd in iccr1 to 0 clear mst in iccr1 to 0 end no yes stop = 1 ? no yes [1] clear tend, select master receive mode, and then clear tdre. * [2] set acknowledge to the transmit device. * [3] dummy-read icddr. * [4] wait for 1 byte to be received [5] check whether it is the (last receive - 1). [6] read the receive data. [7] set acknowledge of the final byte. disable continuous reception (rcvd = 1). [8] read the (final byte - 1) of received data. [9] wait for the last byte to be receive. [10] clear the stop flag. [11] issue the stop condition. [12] wait for the creation of stop condition. [13] read the last byte of receive data. [14] clear rcvd. [15] set slave receive mode. [1] [2] [3] [4] [5] [6] [7] [8] [9] [11] [12] [13] [14] [15] notes: * make sure that no interrupt will be generated during steps [1] to [3]. when the size of receive data is only one byte in reception, steps [2] to [6] are skipped after step [1], before jumping to step [7]. the step [8] is dummy-read in icdrr. clear stop in icsr figure 17.19 sample flowch art for master receive mode
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 760 of 1164 rej09b0321-0200 tdre = 1 ? yes yes no slave transmit mode clear aas in icsr write transmit data in icdrt read tdre in icsr last byte? write transmit data in icdrt read tend in icsr clear tend in icsr clear trs in iccr1 to 0 dummy-read icdrr clear tdre in icsr end [1] clear the aas flag. [2] set transmit data for icdrt (except for the last byte). [3] wait for icdrt empty. [4] set the last byte of transmit data. [5] wait for the last byte to be transmitted. [6] clear the tend flag. [7] set slave receive mode. [8] dummy-read icdrr to release the scl. [9] clear the tdre flag. no no yes tend = 1 ? [1] [2] [3] [4] [5] [6] [7] [8] [9] figure 17.20 sample flowchart for slave transmit mode
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 761 of 1164 rej09b0321-0200 no yes rdrf = 1 ? no yes rdrf = 1 ? last receive - 1? slave receive mode clear aas in icsr clear ackbt in icier to 0 dummy-read icdrr read rdrf in icsr read icdrr set ackbt in icier to 1 read icdrr read rdrf in icsr read icdrr end no yes [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [1] clear the aas flag. [2] set acknowledge to the transmit device. [3] dummy-read icdrr. [4] wait for 1 byte to be received. [5] check whether it is the (last receive - 1). [6] read the receive data. [7] set acknowledge of the last byte. [8] read the (last byte - 1) of receive data. [9] wait the last byte to be received. [10] read for the last byte of receive data. note: when the size of receive data is only one byte in reception, steps [2] to [6] are skipped after step [1], before jumping to step [7]. the step [8] is dummy-read in icdrr. figure 17.21 sample flowch art for slave receive mode
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 762 of 1164 rej09b0321-0200 17.5 interrupt requests there are six interrupt requ ests in this module; transmit data em pty, transmit end, receive data full, nack detection, stop recognition, and arbitratio n lost/overrun error. table 17.4 shows the contents of each interrupt request. table 17.4 interrupt requests interrupt request abbreviation interrupt condition i 2 c bus format clocked synchronous serial format transmit data empty txi (tdre = 1) ? (tie = 1) transmit end tei (tend = 1) ? (teie = 1) receive data full rxi (rdrf = 1) ? (rie = 1) stop recognition stpi (stop = 1) ? (stie = 1) ? nack detection ? arbitration lost/ overrun error naki {(nackf = 1) + (al = 1)} ? (nakie = 1) when the interrupt condition described in table 17.4 is 1, the cpu executes an interrupt exception handling. note that a txi or rxi interrupt can activate the dmac if the setting for dmac activation has been made. in such a case, an inte rrupt request is not sent to the cpu. interrupt sources should be cleared in the exception handlin g. the tdre and tend bits are automatically cleared to 0 by writing the transmit data to icdrt. the rdrf bit is automa tically cleared to 0 by reading icdrr. the tdre bit is set to 1 again at the same time when the transmit data is written to icdrt. therefore, when the td re bit is cleared to 0, then an excessive data of one byte may be transmitted.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 763 of 1164 rej09b0321-0200 17.6 bit synchronous circuit in master mode, this module has a possibility that high level period may be short in the two states described below. ? when scl is driven to low by the slave device ? when the rising speed of scl is lowered by the load of the scl line (load capacitance or pull- up resistance) therefore, it monitors scl and communicates by bit with synchronization. figure 17.22 shows the timing of the bit synchronous circuit and table 17.5 shows the time when the scl output changes from low to hi-z then scl is monitored.
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 764 of 1164 rej09b0321-0200 v ih v ih v ih v ih (1) normal case synchronous clock * 1 scl pin slave low level output internal delay * 2 monitored value is high level monitored value is high level monitored value is high level internally monitored scl (2) when scl is driven low at first by the slave device synchronous clock * 1 scl pin monitored value is low level monitored value is low level internally monitored scl (3) when the rising speed of scl is slow synchronous clock * 1 scl pin notes: 1. clock whose transfer rate is set by bits cks[3:0] in i 2 c bus control register 1 (iccr1). 2. 3 to 4 t pcyc when the nf2cyc bit in nf2cyc is 0 and 4 to 5 t pcyc when the nf2cyc bit is 1. the rate is slower than the settings. internally monitored scl time for monitoring scl time for monitoring scl time for monitoring scl time for monitoring scl time for monitoring scl internal delay * 2 internal delay * 2 scl not driven to low level scl not driven to low level internal delay * 2 figure 17.22 bit synchronous circuit timing
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 765 of 1164 rej09b0321-0200 table 17.5 time for monitoring scl cks3 cks2 time for monitoring scl * 1 0 9 tpcyc * 2 0 1 21 tpcyc * 2 0 33 tpcyc * 2 1 1 81 tpcyc * 2 notes: 1. monitors the (on-boar d) scl level after the time (p cyc) for monitoring scl has passed since the rising edge of the scl monitor timing reference clock. 2. pcyc = p cyc
section 17 i 2 c bus interface 3 (iic3) rev. 2.00 sep. 07, 2007 page 766 of 1164 rej09b0321-0200 17.7 usage note 17.7.1 issuance of stop condition an d start condition (retransmission) issue a start (retransmission) or stop condition after the falling edge of the 9th clock has been recognized. the falling edge of the 9th clock can be recognized by checking the sclo bit in the i 2 c bus control register 2 (iccr2). when a start (retransmission) or stop condition is issued with a certain timing under the following conditions (1 or 2), the start (retransmission) or stop condition may not be output correctly. usage under conditions other than those described below will not cause any problem. 1. scl takes longer to rise than the period defined in section 17.6, bit synchronous circuit, due to the load of the scl bus (load capacitance or pu ll-up resistance). 2. the low-level period between the 8th and 9th clock is prolonged by the slave device, which activates the bit synchronous circuit. 17.7.2 settings for mu lti-master operation 1. transfer rate setting in multi-master operation, specify a transfer rate of at least 1/1.8 of the fastest transfer rate among the other masters. for example, when the fastest of the other masters is at 400 kbps, the iic transfer rate of this lsi must be specified as 223 kbps (= 400/1.8) or a higher rate. 2. mst and trs bits in iccr1 in multi-master operation, use the mov instruction to set the mst and trs bits in iccr1. 3. loss of arbitration when arbitration is lost, check whether the mst and trs bits in iccr1 are 0. if the mst and trs bits in iccr1 have been set to a value other than 0, clear the bits to 0. 17.7.3 reading icdrr in master receive mode in master receive mode, read icdrr before the ri sing edge of the 8th cl ock of scl. if icdrr cannot be read before the rising edge of the 8th clock so that the next round of reception proceeds with the rdrf bit in icsr set to 1, the 8the clock is fixed low and the 9th clock is output. if icdrr cannot be read before the rising edge of the 8th clock of scl, set the rcvd bit in icrr1 to 1 so that transfer proceed s in byte units.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 767 of 1164 rej09b0321-0200 section 18 serial sound interface (ssi) the serial sound interface (h ereinafter refe rred to as the "ssi") is a tr ansceiver module designed to send or receive audio data interface with a variet y of devices offering philips format. it also provides additional modes for other common formats as well as multi-channel mode. 18.1 features ? number of channels: two channels ? operating mode: non-compressed mode ? the non-compressed mode supports serial audio streams divided by channels. ? serves as both a transmitter and a receiver ? capable of using serial bus format ? asynchronous transfer takes place between the data buffer and the shift register. ? it is possible to select a value as the dividing ra tio for the clock used by the serial but interface. ? it is possible to control data transmission or reception with dmac and interrupt requests. ? selects the oversample clock from among the pins audio_clk, or audio_x1 and audio_x2. ? external clock frequency input through the pins audio_clk, or audio_x1 and audio_x2: 1 to 40 mhz ? crystal oscillator frequency for the pins audio_x1 and audio_x2: 10 to 25 mhz figure 18.1 shows a schematic diagram of the four channels in the ssi module. ssiws0 ssisck0 ssi0 ssidata0 ssiws1 ssisck1 ssi1 ssidata1 audio_x1 audio_x2 audio_clk figure 18.1 schemati c diagram of ssi module
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 768 of 1164 rej09b0321-0200 figure 18.2 shows a block diagram of the ssi module when it is used alone. ssisck ssiws ssidata audio_clk serial audio bus register ssicr ssisr ssitdr ssirdr ssi module dma request interrupt request peripheral bus data buffer barrel shifter control circuit bit counter serial clock control divider oscillation circuit lsb msb shift register audio_x1 audio_x2 [legend] ssicr: ssisr: ssitdr: ssirdr: control register status register transmit data register receive data register figure 18.2 block diagram of ssi
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 769 of 1164 rej09b0321-0200 18.2 input/output pins table 18.1 shows the pin assignments relating to the ssi module. table 18.1 pin assignments pin name number of pins i/o description ssisck0 1 i/o serial bit clock ssiws0 1 i/o word selection ssidata0 1 i/o serial data input/output ssisck1 1 i/o serial bit clock ssiws1 1 i/o word selection ssidata1 1 i/o serial data input/output audio_clk 1 input external clock for audio (entering oversample clock 256/384/512fs) audio_x1 1 input audio_x1 1 output crystal oscillator for audio (entering oversample clock 256/384/512fs)
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 770 of 1164 rej09b0321-0200 18.3 register description the ssi has the following registers. note that explanation in the text does not refer to the channels. table 18.2 register description channel register name abbreviation r/w initial value address access size control register 0 ssicr0 r/w h'00000000 h'fffed000 32 status register 0 ssisr0 r/w * h'02000003 h'fffed004 32 transmit data register 0 ssitdr0 r/w h'00000000 h'fffed008 32 0 receive data register 0 ssirdr0 r h'00000000 h'fffed00c 32 control register 1 ssicr1 r/w h'00000000 h'fffed080 32 status register 1 ssisr1 r/w * h'02000003 h'fffed084 32 transmit data register 1 ssitdr1 r/w h'00000000 h'fffed088 32 1 receive data register 1 ssirdr1 r h'00000000 h'fffed08c 32 note: * for this register, bits 26 and 27 are capabl e of reading and writing, although the others are read-only bits. for details , refer to section 18.3.2, status register (ssisr).
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 771 of 1164 rej09b0321-0200 18.3.1 control register (ssicr) ssicr is a readable/writable 32-bit register that co ntrols the irq, selects the polarity status, and sets operating mode. ssicr is initialized to h'00000000 by a power-on reset or in deep standby mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r r/w r/w r/w r/w r r/w r/w ??? dmen uien oien iien dien chnl[1:0] dwl[2:0] swl[2:0] sckd swsd sckp swsp spdp sdta pdta del ? ckdv[2:0] muen ? trmd en bit bit name initial value r/w description 31 to 29 ? all 0 r reserved the read value is not guar anteed. the write value should always be 0. 28 dmen 0 r/w dma enable enables/disables the dma request. 0: dma request is disabled. 1: dma request is enabled. 27 uien 0 r/w underflow interrupt enable 0: underflow interrupt is disabled. 1: underflow interrupt is enabled. 26 oien 0 r/w overflow interrupt enable 0: overflow interrupt is disabled. 1: overflow interrupt is enabled. 25 iien 0 r/w idle mode interrupt enable 0: idle mode interrupt is disabled. 1: idle mode interrupt is enabled.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 772 of 1164 rej09b0321-0200 bit bit name initial value r/w description 24 dien 0 r/w data interrupt enable 0: data interrupt is disabled. 1: data interrupt is enabled. 23, 22 chnl[1:0] 00 r/w channels these bits show the number of channels in each system word. 00: having one channel per system word 01: having two channels per system word 10 having three channels per system word 11: having four channels per system word 21 to 19 dwl[2:0] 000 r/w data word length indicates the number of bits in a data word. 000: 8 bits 001: 16 bits 010: 18 bits 011: 20 bits 100: 22 bits 101: 24 bits 110: 32 bits 111: reserved 18 to 16 swl[2:0] 000 r/w system word length indicates the number of bits in a system word. 000: 8 bits 001: 16 bits 010: 24 bits 011: 32 bits 100: 48 bits 101: 64 bits 110: 128 bits 111: 256 bits
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 773 of 1164 rej09b0321-0200 bit bit name initial value r/w description 15 sckd 0 r/w serial bit clock direction 0: serial bit clock is input, slave mode. 1: serial bit clock is output, master mode. note: ssi0 and ssi1 permit only the following setting: (sckd, swsd) = (0,0) and (1,1). other settings are prohibited. 14 swsd 0 r/w serial ws direction 0: serial word select is input, slave mode. 1: serial word select is output, master mode. note: ssi0 and ssi1 permit only the following setting: (sckd, swsd) = (0,0) and (1,1). other settings are prohibited. 13 sckp 0 r/w serial bit clock polarity 0: ssiws and ssidata change at the ssisck falling edge (sampled at the sck rising edge). 1: ssiws and ssidata change at the ssisck rising edge (sampled at the sck falling edge). sckp = 0 sckp = 1 ssidata input sampling timing at the time of reception (trmd = 0) ssisck rising edge ssisck falling edge ssidata output change timing at the time of transmission (trmd = 1) ssisck falling edge ssisck rising edge ssiws input sampling timing at the time of slave mode (swsd = 0) ssisck rising edge ssisck falling edge ssiws output change timing at the time of master mode (swsd = 1) ssisck falling edge ssisck rising edge 12 swsp 0 r/w serial ws polarity 0: ssiws is low for 1st channel, high for 2nd channel. 1: ssiws is high for 1st channel, low for 2nd channel.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 774 of 1164 rej09b0321-0200 bit bit name initial value r/w description 11 spdp 0 r/w serial padding polarity 0: padding bits are low. 1: padding bits are high. note: when muen = 1, padding bits are low. (the mute function is given priority.) 10 sdta 0 r/w serial data alignment 0: transmitting and receiving in the order of serial data and padding bits 1: transmitting and receiving in the order of padding bits and serial data 9 pdta 0 r/w parallel data alignment this bit is ignored if cpen = 1. when the data word length is 32, 16 or 8 bit, this configuration field has no meaning. this bit applies to ssirdr in receive mode and ssitdr in transmit mode. 0: parallel data (ssitdr, ssirdr) is left-aligned 1: parallel data (ssitdr, ssirdr) is right-aligned. ? dwl = 000 (with a data word length of 8 bits), the pdta setting is ignored. all data bits in ssirdr or ssitdr are used on the audio serial bus. four data words are transmitted or received at each 32-bit access. the first data word is derived from bits 7 to 0, the second from bits 15 to 8, the third from bits 23 to 16 and the last data word is derived from bits 31 to 24. ? dwl = 001 (with a data word length of 16 bits), the pdta setting is ignored. all data bits in ssirdr or ssitdr are used on the audio serial bus. two data words are transmitted or received at each 32-bit access. the first data word is derived from bits 15 to 0 and the second data word is derived from bits 31 to 16.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 775 of 1164 rej09b0321-0200 bit bit name initial value r/w description 9 pdta 0 r/w ? dwl = 010, 011, 100, 101 (with a data word length of 18, 20, 22 or 24 bits), pdta = 0 (left-aligned) the data bits used in ssi rdr or ssitdr are the following: bits 31 down to (32 minus the number of bits in the data word length specified by dwl). that is, if dwl = 011, the data word length is 20 bits; therefore, bits 31 to 12 in either ssirdr or ssitdr are used. all other bits are ignored or reserved. ? dwl = 010, 011, 100, 101 (with a data word length of 18, 20, 22 or 24 bits), pdta = 1 (right-aligned) the data bits used in ssi rdr or ssitdr are the following: bits (the number of bits in the data word length specified by dwl minus 1) to 0 i.e. if dwl = 011, then dwl = 20 and bits 19 to 0 are used in either ssirdr or ssitdr. all other bits are ignored or reserved. ? dwl = 110 (with a data word length of 32 bits), the pdta setting is ignored. all data bits in ssirdr or ssitdr are used on the audio serial bus. 8 del 0 r/w serial data delay 0: 1 clock cycle delay between ssiws and ssidata 1: no delay between ssiws and ssidata 7 ? 0 r reserved the read value is undefined. the write value should always be 0.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 776 of 1164 rej09b0321-0200 bit bit name initial value r/w description 6 to 4 ckdv[2:0] 000 r/w serial oversample clock divide ratio sets the ratio between oversample clock * (audio_clk, or audio_x1 and audio_x2) and the serial bit clock. in addition, combining these bits and the ckdv3 bit in the standby control register enables to divide the clock further by 1/4. this bit is ignored if sckd = 0. the serial bit clock is used in the shift register and is provided on the ssisck module pin. ? when ckdv3 = 1 000: serial bit clock frequency = oversample clock frequency/1 001: serial bit clock frequency = oversample clock frequency/2 010: serial bit clock frequency = oversample clock frequency/4 011: serial bit clock frequency = oversample clock frequency/8 100: serial bit clock frequency = oversample clock frequency/16 101: serial bit clock frequency = oversample clock frequency/6 110: serial bit clock frequency = oversample clock frequency/12 111: setting prohibited ? when ckdv3 = 0 000: serial bit clock frequency = oversample clock frequency/4 001: serial bit clock frequency = oversample clock frequency/8 010: serial bit clock frequency = oversample clock frequency/16 011: serial bit clock frequency = oversample clock frequency/32 100: serial bit clock frequency = oversample clock frequency/64 101: serial bit clock frequency = oversample clock frequency/24 110: serial bit clock frequency = oversample clock frequency/48 111: setting prohibited note: * audio_x1 and audio_x2 is selected as oversample clock when the pd0md0 bit in the port d control register (pdcr1) of pfc is set to 0, and audio_clk is selected when the bit is set to 1.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 777 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3 muen 0 r/w mute enable 0: module is not muted. 1: module is muted. 2 ? 0 r reserved the read value is undefined. the write value should always be 0. 1 trmd 0 r/w transmit/receive mode select 0: module is in receive mode. 1: module is in transmit mode. 0 en 0 r/w ssi module enable 0: module is disabled. 1: module is enabled. 18.3.2 status register (ssisr) ssisr consists of status flags indicating the operational status of the ssi module and bits indicating the current channel numbers and word numbers. ssisr is initialized to h'02000003 by a power-on reset or in deep standby mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: notes: 1. this bit can be read from or written to. writing 0 initializes the bit, but writing 1 is ignored. 2. the ssi clock must be kept supplied until the ssi is in the idle state. r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000001 * 2 0 rrrrr/w * 1 r/w * 1 rrrrrrrrrr 0011 * 2 rrrrrrrrrrrrrrrr ? ? ? dmrq uirq oirq iirq dirq ? ? ?????? ???????????? ???????? ???????????? chno[1:0] swno idst
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 778 of 1164 rej09b0321-0200 bit bit name initial value r/w description 31 to 29 ? all 0 r reserved the read value is not guar anteed. the write value should always be 0. 28 dmrq 0 r dma request status flag this status flag allows the cpu to recognize the value of the dma request pin on the ssi module. ? trmd = 0 (receive mode) if dmrq = 1, the ssirdr has unread data. if ssirdr is read, dmrq = 0 until there is new unread data. ? trmd = 1 (transmit mode) if dmrq = 1, ssitdr requires data to be written to continue the transmission to the audio serial bus. once data is written to ssitdr, dmrq = 0 until it requires further transmit data. 27 uirq 0 r/w * 1 underflow error interrupt status flag this status flag indicates that data was supplied at a lower rate than was required. in either case, this bit is set to 1 regardless of the value of the uien bit and can be cleared by writing 0 to this bit. if uirq = 1 and uien = 1, an interrupt occurs. ? trmd = 0 (receive mode) if uirq = 1, ssirdr was read before there was new unread data indicated by the dmrq or dirq bit. this can lead to the same received sample being stored twice by the host leading to potential corruption of multi-channel data. ? trmd = 1 (transmit mode) if uirq = 1, ssitdr did not have data written to it before it was required for transmission. this will lead to the same sample being transmitted once more and a potential corruption of multi-channel data. this is more serious error than a receive mode underflow as the output ssi data results in error. note: when underflow error occurs, the current data in the data buffer of this module is transmitted until the next data is filled.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 779 of 1164 rej09b0321-0200 bit bit name initial value r/w description 26 oirq 0 r/w * 1 overflow error interrupt status flag this status flag indicates that data was supplied at a higher rate than was required. in either case this bit is set to 1 regardless of the value of the oien bit and can be cleared by writing 0 to this bit. if oirq = 1 and oien = 1, an interrupt occurs. ? trmd = 0 (receive mode) if oirq = 1, ssirdr was not read before there was new unread data written to it. this will lead to the loss of a sample and a potential corruption of multi-channel data. note: when overflow error occurs, the current data in the data buffer of this module is overwritten by the next incoming data from the ssi interface. ? trmd = 1 (transmit mode) if oirq = 1, ssitdr had data written to it before it was transferred to the shift register. this will lead to the loss of a sample and a potential corruption of multi-channel data. 25 iirq 1 * 2 r idle mode interrupt status flag this interrupt status flag indicates whether the ssi module is in idle state. this bit is set regardless of the value of the iien bit to allow polling. the interrupt can be masked by clearing iien, but cannot be cleared by writing to this bit. if iirq = 1 and iien = 1, an interrupt occurs. 0: the ssi module is not in idle state. 1: the ssi module is in idle state.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 780 of 1164 rej09b0321-0200 bit bit name initial value r/w description 24 dirq 0 r data interrupt status flag this status flag indicates that the module has data to be read or requires data to be written. in either case this bit is set to 1 regardless of the value of the dien bit to allow polling. the interrupt can be masked by clearing dien, but cannot be cleared by writing to this bit. if dirq= 1 and dien = 1, an interrupt occurs. ? trmd = 0 (receive mode) 0: no unread data in ssirdr 1: unread data in ssirdr ? trmd = 1 (transmit mode) 0: transmit buffer is full. 1: transmit buffer is empty and requires data to be written to ssitdr. 23 to 4 ? undefined r reserved the read value is not guar anteed. the write value should always be 0. 3, 2 chno[1:0] 00 r channel number this value indicates the current channel number. ? trmd = 0 (receive mode) chno indicates which channel the data in ssirdr currently represents. this value will change as the data in ssirdr is updated from the shift register. ? trmd = 1 (transmit mode) chno indicates which channel is required to be written to ssitdr. this value will change as the data is copied to the shift register, regardless of whether the data is written to ssitdr.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 781 of 1164 rej09b0321-0200 bit bit name initial value r/w description 1 swno 1 r system word number this status bit indicates the current word number. ? trmd = 0 (receive mode) swno indicates which system word the data in ssirdr currently represents. this value will change as the data in ssi rdr is updated from the shift register, regardless of whether ssirdr has been read. ? trmd = 1 (transmit mode) swno indicates which system word is required to be written to ssitdr. this value will change as the data is copied to the shift register, regardless of whether the data is written to ssitdr. 0 idst 1 * 2 r idle mode status flag this status flag indicates that the serial bus activity has stopped. this bit is cleared if en = 1 and the serial bus are currently active. this bit is automatically set to 1 under the following conditions. ? ssi = master transmitter (swsd = 1 and trmd = 1) this bit is set to 1 if the en bit is cleared and the data written to ssitdr is completely output from the serial data input/output pin (ssidata), that is, the output of the system wo rd length is completed. ? ssi = master receiver (swsd = 1 and trmd = 0) this bit is set to 1 if the en bit is cleared and the current system word is completed. ? ssi = slave transmitter/receiver (swsd = 0) this bit is set to 1 if the en bit is cleared and the current system word is completed. note: if the external master stops the serial bus clock before the current system word is completed, this bit is not set. notes: 1. this bit can be read from or written to . writing 0 initializes the bit, but writing 1 is ignored. 2. the ssi clock must be kept supplie d until the ssi is in the idle state.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 782 of 1164 rej09b0321-0200 18.3.3 transmit data register (ssitdr) ssitdr is a 32-bit register that stores data to be transmitted. data written to this register is transferred to the sh ift register upon transmissi on request. if the data word length is less than 32 bits, the alignment is determined by the setting of the pdta control bit in ssicr. the data in the buffer ca n be accessed by reading this register. ssitdr is initialized to h'00000000 by a power-on reset or in deep standby mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit: initial value: r/w: 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 18.3.4 receive data register (ssirdr) ssirdr is a 32-bit register that stores receive messages. data in this register is transferred from the shif t register each time data word is received. if the data word length is less than 32 bits, the alignment is determined by the setting of the pdta control bit in ssicr. ssirdr is initialized to h'00000000 by a power-on reset or in deep standby mode. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 151413121110987654321 0 0000000000000000 rrrrrrrrrrrrrrrr 0000000000000000 rrrrrrrrrrrrrrrr bit: initial value: r/w: bit: initial value: r/w:
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 783 of 1164 rej09b0321-0200 18.4 operation description 18.4.1 bus format the ssi module can operate as a tr ansmitter or a receiver and can be configured into many serial bus formats in either mode. the bus format can be selected from one of the four major modes shown in table 18.3. table 18.3 bus format for ssi module non-compressed slave receiver non-compressed slave transmitter non-compressed master receiver non-compressed master transmitter trmd 0 1 0 1 cpen 0 0 0 0 sckd 0 0 1 1 swsd 0 0 1 1 en muen dien iien oien uien control bits del pdta sdta spdp swsp sckp swl [2:0] dwl [2:0] chnl [1:0] configuration bits
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 784 of 1164 rej09b0321-0200 18.4.2 non-compressed modes the non-compressed modes support all serial audio streams split into channels. it supports philips, sony and matsushita modes as well as many more variants on these modes. (1) slave receiver this mode allows the module to receive serial data from another device. the clock and word select signal used for the serial data stream is also supplied from an external device. if these signals do not conform to the format specified in the configuration fields of the ssi module, operation is not guaranteed. (2) slave transmitter this mode allows the module to transmit serial data to another device. the clock and word select signal used for the serial data stream is also supp lied from an external device. if these signals do not conform to the format specified in the configuration fields of the ssi module, operation is not guaranteed. (3) master receiver this mode allows the module to receive serial data from another device. the clock and word select signals are internally derived from the audio_clk input clock. the format of these signals is defined in the configuration fields of the ssi module. if the incoming data does not follow the configured format, operation is not guaranteed. (4) master transmitter this mode allows the module to transmit serial data to another device. the clock and word select signals are internally derived from the audio_clk input clock. the format of these signals is defined in the configuration fields of the ssi module. (5) operating setting related to word length all bits related to the ssicr's word length are valid in non-compressed modes. there are many configurations the ssi module supports, but some of the combinations are shown below for the popular formats by philips, sony, and matsushita.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 785 of 1164 rej09b0321-0200 1. philips format figures 18.3 and 18.4 demonstrate the supported philips format both with and without padding. padding occurs when the data word length is smaller than the system word length. prev. sample msb lsb + 1 lsb msb lsb + 1 lsb next sample system word 1 = data word 1 system word 2 = data word 2 ssisck ssiws ssidata sckp = 0, swsp = 0, del = 0, chnl = 00 system word length = data word length figure 18.3 philips form at (without padding) msb lsb msb lsb next system word 1 system word 2 data word 1 data word 2 padding padding ssisck ssiws ssidata sckp = 0, swsp = 0, del = 0, chnl = 00, spdp = 0, sdta = 0 system word length > data word length figure 18.4 philips format (with padding)
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 786 of 1164 rej09b0321-0200 2. sony format figure 18.5 shows sony format and figure 18.6 shows matsushita format. padding is assumed in both cases, but may not be present in a final implem entation if the system word length equals the data word length. msb lsb msb lsb next ssisck ssiws ssidata sckp = 0, swsp = 0, del = 1, chnl = 00, spdp = 0, sdta = 0 system word length > data word length system word 1 system word 2 data word 1 data word 2 padding padding figure 18.5 sony format (transmitted and received in the order of serial data and padding bits) 3. matsushita format msb lsb system word 1 system word 2 data word 1 data word 2 padding padding msb lsb prev. ssisck ssiws ssidata sckp = 0, swsp = 0, del = 1, chnl = 00, spdp = 0, sdta = 1 system word length > data word length figure 18.6 matsushita format (transmitted and received in the order of padding bits and serial data)
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 787 of 1164 rej09b0321-0200 (6) multi-channel formats some devices extend the definition of the specification by philips and allow more than 2 channels to be transferred within two system words. the ssi module supports the transfer of 2, 3 and 4 channels by using the chnl, swl and dwl bits only when the system word length (swl) is greater than or equal to the data word length (dwl) multiplied by channels (chnl). table 18.4 shows the number of padding bits for each of the valid setting. if setting is not valid, " ? " is indicated instead of a number. table 18.4 the number of padding bits for each valid setting padding bits per system word dwl[2:0] 000 001 010 011 100 101 110 chnl [1:0] decoded channels per system word swl [2:0] decoded word length 8 16 18 20 22 24 32 000 8 0 ? ? ? ? ? ? 001 16 8 0 ? ? ? ? ? 010 24 16 8 6 4 2 0 ? 011 32 24 16 14 12 10 8 0 100 48 40 32 30 28 26 24 16 101 64 56 48 46 44 42 40 32 110 128 120 112 110 108 106 104 96 00 1 111 256 248 240 238 236 234 232 224 000 8 ? ? ? ? ? ? ? 001 16 0 ? ? ? ? ? ? 010 24 8 ? ? ? ? ? ? 011 32 16 0 ? ? ? ? ? 100 48 32 16 12 8 4 0 ? 101 64 48 32 28 24 20 16 0 110 128 112 96 92 88 84 80 64 01 2 111 256 240 224 220 216 212 208 192
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 788 of 1164 rej09b0321-0200 padding bits per system word dwl[2:0] 000 001 010 011 100 101 110 chnl [1:0] decoded channels per system word swl [2:0] decoded word length 8 16 18 20 22 24 32 000 8 ? ? ? ? ? ? ? 001 16 ? ? ? ? ? ? ? 010 24 0 ? ? ? ? ? ? 011 32 8 ? ? ? ? ? ? 100 48 24 0 ? ? ? ? ? 101 64 40 16 10 4 ? ? ? 110 128 104 80 74 68 62 56 32 10 3 111 256 232 208 202 196 190 184 160 000 8 ? ? ? ? ? ? ? 001 16 ? ? ? ? ? ? ? 010 24 ? ? ? ? ? ? ? 011 32 0 ? ? ? ? ? ? 100 48 16 ? ? ? ? ? ? 101 64 32 0 ? ? ? ? ? 110 128 96 64 56 48 40 32 0 11 4 111 256 224 192 184 176 168 160 128
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 789 of 1164 rej09b0321-0200 when the ssi module acts as a transmitter, each wo rd written to ssitdr is transmitted to the serial audio bus in the order they are written. wh en the ssi module acts as a receiver, each word received by the serial audio bus is read in the order received from the ssirdr register. figures 18.7 to 18.9 show how 2, 3 and 4 channels are transferred to the serial audio bus. note that there are no padding bits in the first example, the second example is left-aligned and the third is right-aligned. this selection is arbitrary and is just for demonstration purposes only. msb lsb data word 1 msb lsb msb lsb msb lsb data word 2 data word 3 data word 4 system word 1 system word 2 msb lsb data word 1 msb lsb msb lsb msb lsb data word 2 data word 3 data word 4 system word 1 system word 2 lsb msb ssisck ssiws ssidata sckp = 0, swsp = 0, del = 1, chnl = 01, spdp = don't care, sdta = don't care system word length = data word length 2 figure 18.7 multicha nnel format (2 channe ls without padding) msb lsb system word 2 data word 1 msb lsb msb lsb msb data word 2 data word 3 padding system word 1 msb lsb msb lsb msb lsb data word 4 data word 5 data word 6 ssisck ssiws ssidata padding sckp = 0, swsp = 0, del = 1, chnl = 10, spdp = 1, sdta = 0 system word length = data word length 3 figure 18.8 multichann el format (3 channels with high padding)
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 790 of 1164 rej09b0321-0200 msb lsb system word 2 data word 1 msb lsb msb lsb msb lsb msb lsb msb lsb msb lsb msb lsb data word 2 data word 3 data word 4 data word 5 data word 6 data word 7 data word 8 padding system word 1 padding ssiws ssidata ssisck sckp = 0, swsp = 0, del = 1, chnl = 11, spdp = 0, sdta = 1 system word length = data word length 4 figure 18.9 multic hannel format (4 channels; tr ansmitting and receiving in the order of padding bits and serial data; with padding) (7) bit setting configuration format several more configuration bits in non-compressed mode are shown below. these bits are not mutually exclusive, but some combinations may not be useful for any other device. these configuration bits are described below with reference to figure 18.10, basic sample format. ssisck ssiws ssidata key for this and following diagrams: 0 0 0 0 0 0 means a low level on the serial bus (padding or mute) 0 means a high level on the serial bus (padding) 1 arrow head indicates sampling point of receiver bit n in ssitdr tdn 1st channel 2nd channel td28 td31 td31 td30 td29 td28 td31 td30 td29 td28 swl = 6 bits (not attainable in ssi module, demonstration only) dwl = 4 bits (not attainable in ssi module, demonstration only) chnl = 00, sckp = 0, swsp = 0, spdp = 0, sdta = 0, pdta = 0, del = 0, muen = 0 4-bit data samples continuously written to ssitdr are transmitted onto the serial audio bus. figure 18.10 basi c sample format (transmit mode with example system/data word length)
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 791 of 1164 rej09b0321-0200 figure 18.10 uses a system word length of 6 bits and a data word length of 4 bits. these settings are not possible with the ssi modul e but are used only for clarifi cation of the other configuration bits. 1. inverted clock ssisck ssiws ssidata 0 0 0 0 0 0 1st channel 2nd channel td28 td31 td31 td30 td29 td28 td31 td30 td29 td28 as basic sample format configuration except sckp = 1 figure 18.11 inverted clock 2. inverted word select ssisck ssiws ssidata 0 0 0 0 0 0 1st channel 2nd channel td28 td31 td31 td30 td29 td28 td31 td30 td29 td28 as basic sample format configuration except swsp = 1 figure 18.12 inverted word select 3. inverted padding polarity ssisck ssiws ssidata td28 td31 1st channel 2nd channel 11 11 11 td31 td30 td29 td28 td31 td30 td29 td28 as basic sample format configuration except spdp = 1 figure 18.13 invert ed padding polarity
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 792 of 1164 rej09b0321-0200 4. transmitting and receiving in the order of padding bits and serial data; with delay ssisck ssiws ssidata 0 0 0 td28 0 0 1st channel 2nd channel td30 td29 td31 td30 td29 td28 td31 td30 td29 td28 as basic sample format configuration except sdta = 1 figure 18.14 transmitting an d receiving in the order of padding bits and serial data; with delay 5. transmitting and receiving in the order of padding bits and serial data; without delay as basic sample format configuration except sdta = 1 and del = 1 0 0 0 td28 0 0 td29 0 td31 td30 td29 td28 td31 td30 td29 td28 ssisck ssiws ssidata 1st channel 2nd channel figure 18.15 transmitting an d receiving in the order of padding bits and serial data; without delay 6. transmitting and receiving in the order of serial data and padding bits; without delay as basic sample format configuration except del = 1 0 0 0 0 00 td31 td30 td31 td30 td29 td28 td31 td30 td29 td28 ssisck ssiws ssidata 1st channel 2nd channel figure 18.16 transmitting an d receiving in the order of s erial data and padding bits; without delay
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 793 of 1164 rej09b0321-0200 7. parallel right-aligned with delay as basic sample format configuration except pdta = 1 0 0 0 0 00 td3 td0 td3 td2 td1 td0 td3 td2 td1 td0 ssisck ssiws ssidata 1st channel 2nd channel figure 18.17 parallel right-aligned with delay 8. mute enabled as basic sample format configuration except muen = 1 (td data ignored) 0 0 0 0 00 00 00 00 0 0 0 0 0 0 ssisck ssiws ssidata 1st channel 2nd channel figure 18.18 mute enabled
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 794 of 1164 rej09b0321-0200 18.4.3 operation modes there are three modes of operation: configuration, enabled and disabled. figure 18.19 shows how the module enters each of these modes. module configration (after reset) module enabled (normal tx/rx) en = 1 (idst = 0) module disabled (waiting until bus inactive) en = 0 (idst = 0) en = 0 (idst = 1) reset figure 18.19 operation modes (1) configuration mode this mode is entered after the module is released from reset. all required configuration fields in the control register should be defined in this mode, before the ssi module is enabled by setting the en bit. setting the en bit causes the module to enter the module enabled mode. (2) module enabled mode operation of the module in this mode is dependent on the operation mode selected. for details, refer to section 18.4.4, transm it operation and section 18.4.5 , receive operation, below.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 795 of 1164 rej09b0321-0200 18.4.4 transmit operation transmission can be controlled either by dma or interrupt. dma control is preferred to reduce the processor load. in dma control mode the processor will only receive interrupts if there is an underflow or overflow of data or the dmac has finished its transfer. the alternative method is using the interrupts that the ssi module generates to supply data as required. this mode has a higher interrupt load as the module is only double buffered and will require data to be written at least every system word period. when disabling the module, the ssi clock* must remain present until the ssi module is in idle state, indicated by the iirq bit. figure 18.20 shows the transmit operation in dma control mode, and figure 18.21 shows the transmit operation in interrupt control mode. note: * input clock from the ssisck pin when sckd = 0. input clock from the audio_clk pin, or audio_x1 and audio_x2 pins when sckd = 1.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 796 of 1164 rej09b0321-0200 (1) transmission using dma controller start enable ssi module, enable dma, enable error interrupts. wait for interrupt from dmac or ssi. ssi error interrupt? more data to be send? disable ssi module, disable dma, disable error interrupts, enable idle interrupt. wait for idle interrupt from ssi module. end * ye s no no ye s ye s no en = 1, dmen = 1, uien = 1, oien = 1 en = 0, dmen = 0 uien = 0, oien = 0, iien = 1 release from reset, set ssicr configuration bits. set up dma controller to provide transmission data as required. dmac: end of tx data? note: * if the ssi encounters an error interrupt underflow/overflow, go back to the start in the flowchart again. define trmd, en, sckd, swsd, muen, del, pdta, sdta, spdp, swsp, sckp, swl, dwl, chnl figure 18.20 transmission using dma controller
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 797 of 1164 rej09b0321-0200 (2) transmission using int errupt data flow control start enable ssi module, enable data interrupts, enable error interrupts. wait for interrupt from ssi. data interrupt? more data to be send? disable ssi module, disable data interrupts disable error interrupts, enable idle interrupt. wait for idle interrupt from ssi module. end no yes yes no en = 1, dien = 1, uien = 1, oien = 1 use ssi status register bits to realign data after underflow/overflow. en = 0, dien = 0 uien = 0, oien = 0, iien = 1 load data of channel n for n = ( (chnl + 1) x 2) loop next channel release from reset, set ssicr configuration bits. define trmd, en, sckd, swsd, muen, del, pdta, sdta, spdp, swsp, sckp, swl, dwl, chnl. figure 18.21 transmission usin g interrupt data flow control
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 798 of 1164 rej09b0321-0200 18.4.5 receive operation like transmission, reception can be cont rolled either by dma or interrupt. figures 18.22 and 18.23 show the flow of operation. when disabling the ssi module, the ssi clock* must be kept supplied until the iirq bit is in idle state. note: * input clock from the ssisck pin when sckd = 0. input clock from the audio_clk pin, or audio_x1 and audio_x2 pins when sckd = 1.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 799 of 1164 rej09b0321-0200 (1) reception using dma controller start enable ssi module, enable dma, enable error interrupts. wait for interrupt from dmac or ssi ssi error interrupt? more data to be send? disable ssi module, disable dma, disable error interrupts, enable idle interrupt. wait for idle interrupt from ssi module. end * yes no no yes yes no en = 1, dmen = 1, uien = 1, oien = 1 en = 0, dmen = 0 uien = 0, oien = 0, iien = 1 setup dma controller to transfer data from ssi module to memory. release from reset, define ssicr configuration bits. dmac: end of rx data? define trmd, en, sckd, swsd, muen, del, pdta, sdta, spdp, swsp, sckp, swl, dwl, chnl. note: * if the ssi encounters an error interrupt underflow/overflow, go back to the start in the flowchart again. figure 18.22 reception using dma controller
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 800 of 1164 rej09b0321-0200 (2) reception using interr upt data flow control start enable ssi module, enable data interrupts, enable error interrupts. wait for interrupt from ssi. disable ssi module, disable data interrupts, disable error interrupts, enable idle interrupt. wait for idle interrupt from ssi module. end yes no yes no en = 1, dien = 1, uien = 1, oien = 1 use ssi status register bits to realign data after underflow/overflow. en = 0, dien = 0 uien = 0, oien = 0, iien = 1 read data from receive data register. release from reset, define ssicr configuration bits. ssi error interrupt? receive more data? define trmd, en, sckd, swsd, muen, del, pdta, sdta, spdp, swsp, sckp, swl, dwl, chnl. figure 18.23 reception using interrupt data flow control
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 801 of 1164 rej09b0321-0200 when an underflow or overflow error condition has matched, the chno [1:0] bit and the swno bit can be used to recover the ssi module to a known status. when an underflow or overflow occurs, the host can read the channel number and system word number to determine what point the serial audio stream has reached. in the transmitter case, the host can skip forward through the data it wants to transmit until it finds the sample data that matches what the ssi module is expecting to transmit next, and so resynchronize with the audio data stream. in the receiver case the host cpu can store null data to make the number of receive data items consistent until it is ready to store the sample data that the ssi module is indicating w ill be received next, and so resynchronize with the audio data stream. 18.4.6 temporary stop and restart procedures in transmit mode the following procedures can be used for implementation. (1) procedure for the repeated transfer and st op without having to reconfigure the dmac 1. set ssicr.dmen = 0 (disabling a dma request) to stop the dma transfer. 2. wait for ssisr.dirq = 1 (transmit mode: the transmit buffer is empty) using a polling, interrupt, or the like. 3. with ssicr.en = 0 (disabling an ssi module operation), stop the transfer. 4. before attempting another transfer, make sure that ssisr.idst = 1 is reached. 5. set ssicr.en = 1 (enabling an ssi module operation). 6. wait for ssisr.dirq = 1, using a polling, interrupt, or the like. 7. setting ssicr.dmen = 1 (enabling a dma request) will restar t the dma transfer. (2) procedure for reconfiguring th e dmac after an ssi stop 1. set ssicr.dmen = 0 (disabling a dma request) to stop the dma transfer. 2. wait for ssisr.dirq = 1 (transmit mode: th e transmit buffer is empty), using a polling, interrupt, or the like. 3. with ssicr.en = 0 (disabling an ssi module operation), stop the transfer. 4. stop the dmac with dmscnt of the dmac. 5. before attempting another transfer, make sure that ssisr.idst = 1 is reached. 6. set ssicr.en = 1 (enabling an ssi module operation). 7. set the dmac registers and start the transfer. 8. setting ssicr.dmen = 1 (enabling a dma request) will restar t the dma transfer.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 802 of 1164 rej09b0321-0200 18.4.7 serial bit clock control this function is used to control and select which clock is used for the serial bus interface. if the serial clock direction is set to input (sckd = 0), the ssi module is in clock slave mode and the shift register uses the bit clock that was input to the ssisck pin. if the serial clock direction is set to output (sckd = 1), the ssi module is in clock master mode, and the shift register uses th e bit clock that was input from the audio_clk pin or audio_x1 and audio_x2 pins, or the bit clock that is generated by dividing them. this input clock is then divided by the ratio in the serial oversampling clock divide ratio (ckdv) in ssicr and used as the bit clock in the shift register. in either case the module pin, ssis ck, is the same as the bit clock. 18.5 usage notes 18.5.1 limitations from overfl ow during receive dma operation if an overflow occurs while the receive dma is in operation, the module s hould be restarted. the receive buffer in the ssi consists of 32-bit regi sters that share the l an d r channels. therefore, data to be received at the l channel may sometim es be received at the r channel if an overflow occurs, for example, under the following condition: the control register (ssicr) has a 32-bit setting for both data word length (dwl2 to dw l0) and system word length (swl2 to swl). if an overflow is confirmed with the overflow error interrupt or overflow error status flag (the oirq bit in ssisr), write 0 to the en bit in ssicr and dmen bit to disable dma in the ssi module, thus stopping the operation. (in this case, the controller setting should also be stopped.) after this, write 0 to the oirq bit to clear the overflow status, set dma again and restart the transfer.
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 803 of 1164 rej09b0321-0200 18.5.2 note on using oversample clock to use the externally input clock as the oversamp le clock, refer to the section 4.6.1, note on inputting external clock, in which the terms ex tal and xtal pins should be replaced by the audio_x1 and audio_x2 pins respectively. to use the crystal resonator, refer to the section 4.6.2, note on using crystal resonator, in which the terms extal and xtal pins should be replaced by the audio_ x1 and audio_x2 pins respectively. also, see section 4.6.3, note on resonator. 18.5.3 restriction on stopping clock supply once the bits mstp53 and mstp52 in the standb y control register 5 (stbcr5) are cleared to 0 and the ssi operation is started, do not set thes e bits to 1 (stops clock supply to the ssi).
section 18 serial sound interface (ssi) rev. 2.00 sep. 07, 2007 page 804 of 1164 rej09b0321-0200
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 805 of 1164 rej09b0321-0200 section 19 controller area network (rcan-et) 19.1 summary 19.1.1 overview this document primarily describes the programming interface for the rcan-et module. it serves to facilitate the hardware/s oftware interface so that engi neers involved in the rcan-et implementation can ensure the design is successful. 19.1.2 scope the can data link controller function is not described in this document. it is the responsibility of the reader to investigate th e can specification document (see references). the interfaces from the can controller are described, in so far as they pertain to the connection with the user interface. the programming model is described in some detail. it is not the intention of this document to describe the implementation of the programming interf ace, but to simply pr esent the interface to the underlying can functionality. the document places no constraints upon the impl ementation of the rcan-et module in terms of process, packaging or power supply criteria. th ese issues are resolved where appropriate in implementation specifications. 19.1.3 audience in particular this document provides the design reference for software authors who are responsible for creating a can application using this module. in the creation of the rcan-et user interface lsi engineers must use this document to understand the hardware requirements.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 806 of 1164 rej09b0321-0200 19.1.4 references 1. can license specification, robert bosch gmbh, 1992 2. can specification version 2.0 part a, robert bosch gmbh, 1991 3. can specification version 2.0 part b, robert bosch gmbh, 1991 4. implementation guide for the can protocol, can specification 2.0 addendum, can in automation, erlangen, germany, 1997 5. road vehicles - controller area network (can): part 1: data link layer and physical signalling (iso-11898-1, 2002) 19.1.5 features ? supports can specification 2.0b ? bit timing compliant with iso-11898-1 ? 16 mailbox version ? clock 16 to 40 mhz ? 15 programmable mailboxes for transm it/receive + 1 receive-only mailbox ? sleep mode for low power consumption and automatic recovery from sleep mode by detecting can bus activity ? programmable receive filter mask (standard and extended identifier) supported by all mailboxes ? programmable can data rate up to 1mbit/s ? transmit message queuing with internal prior ity sorting mechanism ag ainst the problem of priority inversion for real-time applications ? data buffer access without sw handshake requirement in reception ? flexible micro-co ntroller interface ? flexible interrupt structure
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 807 of 1164 rej09b0321-0200 19.2 architecture 19.2.1 block diagram the rcan-et device offers a flexible and sophisticated way to organise and control can frames, providing the compliance to can2.0b active and iso-11898-1. the module is formed from 5 different functional entities. these are the micro processor inte rface (mpi), mailbox, mailbox control and can interface. the figure below shows the block diagram of the rcan-et module. the bus interface timing is designed according to the peripheral bus i/f required for each product. irr gsr mcr imr mailbox 0 to 15 (ram) mailbox8 mailbox9 mailbox10 mailbox11 mailbox12 mailbox13 mailbox14 mailbox15 mailbox0 mailbox1 mailbox2 mailbox3 mailbox4 mailbox5 mailbox6 mailbox7 mailbox control micro processor interface (mpi) control0 lafm data can interface ctx crx txpr txcr rxpr txack aback mbimr tec rec mailbox 0 to 15 (register) mailbox8 mailbox9 mailbox10 mailbox11 mailbox12 mailbox13 mailbox14 mailbox15 mailbox0 mailbox1 mailbox2 mailbox3 mailbox4 mailbox5 mailbox6 mailbox7 control1 rfpr umsr 32-bit internal bus system transmit buffer receive buffer control signals status signals can core bcr 16-bit peripheral bus figure 19.1 r can-et architecture
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 808 of 1164 rej09b0321-0200 important: although core of rcan-et is designed based on a 32-bit bus system, the whole rcan-et including mpi for the cpu has 16-bit bus interface to cp u. in that case, longword (32-bit) access must be implemen ted as 2 consecutive word (16- bit) accesses. in this manual, longword access means the two consecutive accesses. 19.2.2 functions of each block (1) micro processor interface (mpi) the mpi allows communication be tween the renesas cpu and rcan-et's registers/mailboxes to control the memory interface. it also contains the wakeup contro l logic that detects the can bus activities and notifies the mpi and the other parts of rcan-et so that the rcan-et can automatically exit the sleep mode. it contains registers such as mcr, irr, gsr and imr. (2) mailbox the mailboxes consists of ram configured as message buffers and registers. there are 16 mailboxes, and each mailbox has the following information. ? can message control (identifier, rtr, ide,etc) ? can message data (for can data frames) ? local acceptance filter mask for reception ? can message control (dlc) ? 3-bit wide mailbox configuration, disable automatic re-transmission bit, auto- transmission for remote request bit, new message control bit
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 809 of 1164 rej09b0321-0200 (3) mailbox control the mailbox control handles the following functions: ? for received messages, compare the ids and genera te appropriate ram addresses/data to store messages from the can interface into the mailbox and set/cl ear appropriate registers accordingly. ? to transmit messages, rcan-et will run the intern al arbitration to pick the correct priority message, and load the message from the mailbox into the tx-buffer of the can interface and set/clear appropriate re gisters accordingly. ? arbitrates mailbox accesses between the cpu and the mailbox control. ? contains registers such as txpr, txcr, txack, aback, rxpr, rfpr, umsr and mbimr. (4) can interface this block conforms to the requirements for a can bus data link controller which is specified in ref. [3, 5]. it fulfils all the functions of a standard data link controller as specified by the osi 7 layer reference model. this functional entity al so provides the registers and the logic which are specific to a given can bus, which includes the r eceive error counter, tr ansmit error counter, the bit configuration registers and various useful test modes. this block also contains functional entities to hold the data received and the data to be transmitted for the can data link controller. 19.2.3 input/output pins table 19.1 shows the pin configuration of the rcan-et. table 19.1 pin configuration channel name abbreviation i/o function transmit data pin ctx0 output can-bus transmit pin 0 receive data pin crx0 input can-bus receive pin transmit data pin ctx1 output can-bus transmit pin 1 receive data pin crx1 input can-bus receive pin
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 810 of 1164 rej09b0321-0200 19.2.4 memory map the diagram of the memory map is shown below. h'000 h'002 h'004 h'006 h'008 h'00a h'00c h'020 h'022 h'02a h'032 h'03a h'042 h'04a h'052 h'05a h'0a0 h'0a4 h'100 h'104 h'108 h'10a h'10c h'10e h'110 h'120 h'140 h'160 h'2e0 bit 15 bit 0 bit 15 bit 0 master control register (mcr) general status register(gsr) bit timing configuration register 1 (bcr1) bit timing configuration register 0 (bcr0) interrupt request register (irr) interrupt mask register (imr) mailbox-0 control 1 (nmc, mbc, dlc) mailbox-1 control/lafm/data etc. mailbox 0 data (8 bytes) mailbox-2 control/lafm/data etc. mailbox-3 control/lafm/data etc. mailbox-15 control/lafm/data etc. transmit pending register (txpr1) transmit pending register (txpr0) transmit cancel register (txcr0) transmit acknowledge register (txack0) abort acknowledge register (aback0) data frame receive pending register (rxpr0) remote frame pending register (rfpr0) mailbox interrupt mask register (mbimr0) unread message status register (umsr0) transmit error counter (tec) receive error counter (rec) 0 2 4 6 1 3 5 7 mailbox-0 control 0 (stdid, extid, rtr, ide) lafm note: the locations not used (between h'000 and h'2f2) are reserved and cannot be accessed. addresses shown above are offset addrsses. as for actual addresses, see section 28, list of registers. figure 19.2 rcan-et memory map
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 811 of 1164 rej09b0321-0200 19.3 mailbox 19.3.1 mailbox structure mailboxes play a role as message buffers to transmit/receive can frames. each mailbox is comprised of 3 identical storage fields that are 1): message control, 2): local acceptance filter mask, 3): message data. the following table show s the address map for the control, lafm, data and addresses for each mailbox. table 19.2 address map for each mailbox address control0 lafm data control1 mailbox 4 bytes 4 bytes 8 bytes 2 bytes 0 (receive only) h'100 to h'103 h'104 to h'107 h'108 to h'10f h'110 to h'111 1 h'120 to h'123 h'124 to h'127 h'128 to h'12f h'130 to h'131 2 h'140 to h'143 h'144 to h'147 h'148 to h'14f h'150 to h'151 3 h'160 to h'163 h'164 to h'167 h'168 to h'16f h'170 to h'171 4 h'180 to h'183 h'184 to h'187 h'188 to h'18f h'190 to h'191 5 h'1a0 to h'1a3 h'1a4 to h'1a7 h'1a8 to h'1af h'1b0 to h'1b1 6 h'1c0 to h'1c3 h'1c4 to h'1c7 h'1c8 to h'1cf h'1d0 to h'1d1 7 h'1e0 to h'1e3 h'1e4 to h'1e7 h'1e8 to h'1ef h'1f0 to h'1f1 8 h'200 to h'203 h'204 to h'207 h'208 to h'20f h'210 to h'211 9 h'220 to h'223 h'224 to h'227 h'228 to h'22f h'230 to h'231 10 h'240 to h'243 h'244 to h'247 h'248 to h'24f h'250 to h'251 11 h'260 to h'263 h'264 to h'267 h'268 to h'26f h'270 to h'271 12 h'280 to h'283 h'284 to h'287 h'288 to h'28f h'290 to h'291 13 h'2a0 to h'2a3 h'2a4 to h'2a7 h'2a8 to h'2af h'2b0 to h'2b1 14 h'2c0 to h'2c3 h'2c4 to h'2c7 h'2c8 to h'2cf h'2d0 to h'2d1 15 h'2e0 to h'2e3 h'2e4 to h'2e7 h'2e8 to h'2ef h'2f0 to h'2f1 mailbox-0 is a receive-only box, and all the ot her mailboxes can operate as both receive and transmit boxes, dependant upon the mbc (mailbox configuration) bits in the message control. the following diagram shows the st ructure of a mailbox in detail.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 812 of 1164 rej09b0321-0200 table 19.3 roles of mailboxes tx rx mb15 to mb1 ok ok mb0 ? ok 1514131211109876543210 0 rtr ide 0 0 nmc 0 0 0 0 0 0 dlc[3:0] extid[15:0] stdid[10:0] extid[17:16] mbc[2:0] msg_data_1 msg_data_3 msg_data_5 msg_data_7 msg_data_0 (first rx/tx byte) msg_data_2 msg_data_4 msg_data_6 extid_ lafm[17:16] ide_ lafm 0 0 0 rtr ide ide_ lafm 0 0 address data bus access size field name h'100 h'102 h'104 h'106 h'108 h'10a h'10c h'10e h'110 stdid_lafm[10:0] word/lw word word/lw word byte/word/lw byte/word byte/word/lw byte/word byte/word control 0 lafm data control 1 mb0 (reception mb) 1514131211109876543210 0 0 nmc atx dart 0 0 0 0 dlc[3:0] extid[15:0] stdid[10:0] extid[17:16] mbc[2:0] msg_data_1 msg_data_3 msg_data_5 msg_data_7 msg_data_0 (first rx/tx byte) msg_data_2 msg_data_4 msg_data_6 address data bus access size field name h'100 + n 32 h'102 + n 32 h'104 + n 32 h'106 + n 32 h'108 + n 32 h'10a + n 32 h'10c + n 32 h'10e + n 32 h'110 + n 32 regiter name mb[0].control0h mb[0].control0l mb[0].lafmh mb[0].lafml mb[0].msg_data[0][1] mb[0].msg_data[2][3] mb[0].msg_data[4][5] mb[0].msg_data[6][7] mb[0].control1h, l register name mb[n].control0h mb[n].control0l mb[n].lafmh mb[n].lafml mb[n].msg_data[0][1] mb[n].msg_data[2][3] mb[n].msg_data[4][5] mb[n].msg_data[6][7] mb[n].control1h, l word/lw word word/lw word byte/word/lw byte/word byte/word/lw byte/word byte/word control 0 lafm data control 1 mb1 to 15 (mb for transmission/reception) notes: 1. all bits shadowed in grey are reserved and the write value should be 0. the value returned by a read may not always be 0 and should not be relied upon. 2. mbc1 bit in mailbox is fixed to 1. 3. atx and dart are not supported by mailbox-0, and the mbc setting of mailbox-0 is limited. 4. when the mcr15 bit is 1, the order of stdid, rtr, ide and extid of both message control and lafm differs from hcan2. 5. n = 0 to 15 (mailbox number) extid_lafm[15:0] extid_ lafm[17:16] stdid_lafm[10:0] extid_lafm[15:0] byte: 8-bit access, word: 16-bit access, lw (longword): 32-bit access figure 19.3 mailbox-n structure
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 813 of 1164 rej09b0321-0200 19.3.2 message control field stdid[10:0]: these bits set the identifier (standard iden tifier) of data frames and remote frames. extid[17:0]: these bits set the identifier (extended identi fier) of data frames and remote frames. rtr (remote transmission request bit): used to distinguish between data frames and remote frames. this bit is overwritten by received can frames depending on data frames or remote frames. important: please note that, when atx bit is set with the setting mbc = b'001, the rtr bit will never be set. when a remote frame is received, the cpu can be notified by the corresponding rfpr set or irr[2] (remote frame request inte rrupt), however, as rcan- et needs to transmit the current message as a data frame, the rtr bit remains unchanged. in case of overrun condition, the message received is discarded. co nsequently, when a remote frame is causing overrun (umsr is set) into a mailbox configured with atx = 1/nmc = 0, the transmission of the corresponding data frame is not carried out. important: in order to support automatic answer to remote frame when mbc = b'001 is used and atx = 1 the rtr flag must be programmed to zer o to allow data frame to be transmitted. note: when a mailbox is configured to send a remote frame request the dlc used for transmission is the one stored into the mailbox. rtr description 0 data frame 1 remote frame ide (identifier extension bit): used to distinguish between the standard format and extended format of can data frames and remote frames. ide description 0 standard format 1 extended format
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 814 of 1164 rej09b0321-0200 ? mailbox-0 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000011100000000 r r r/w r r r/w r/w r/w r r r r r/w r/w r/w r/w 0 0 nmc 0 0 mbc[2:0] 0 0 0 0 dlc[3:0] note: mbc[1] of mb0 is always "1". ? mailbox-15 to 1 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000011100000000 r r r/w r/w r/w r/w r/w r/w r r r r r/w r/w r/w r/w 0 0 nmc atx dart mbc[2:0] 0 0 0 0 dlc[3:0] nmc (new message control): when this bit is set to '0', the mailbox of which the rxpr or rfpr bit is already set does not store the new message but maintains the old one and sets the umsr correspondent bit. when this bit is set to '1', the mailbox of which the rxpr or rfpr bit is already set overwrites with the new messa ge and sets the umsr correspondent bit. important: please note that if a remote frame is overw ritten with a data frame or vice versa could be that both rxpr and rfpr flags (together with umsr) are set for the same mailbox. in this case the rtr bit within the mailbox control field should be relied upon. nmc description 0 overrun mode (initial value) 1 overwrite mode atx (automatic transmission of data frame): when this bit is set to '1' and a remote frame is received into the mailbox dlc is stored. then , a data frame is transmitted from the same mailbox using the current contents of the message data and updated dlc by setting the corresponding txpr automatically. the scheduling of transmission is still governed by id priority or mailbox priority as configured with the message transmission priority control bit (mcr.2). in order to use this function, mbc[2:0] needs to be programmed to be b'001. when a transmission is performed by this function, the dlc (data length code) to be used is the one that has been received. application needs to guarantee that the dlc of the remo te frame correspond to the dlc of the data frame requested. important: when atx is used and mbc = b'001 the fi lter for the ide bit cannot be used since id of remote frame has to be exactly the same as that of data frame as the reply message.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 815 of 1164 rej09b0321-0200 important: please note that, when this function is used, the rtr bit will never be set despite receiving a remote frame. when a remote frame is received, th e cpu will be notified by the corresponding rfpr set, however, as rcan-et ne eds to transmit the current message as a data frame, the rtr bit remains unchanged. atx description 0 automatic transmission of data frame disabled (initial value) 1 automatic transmission of data frame enabled dart (disable automatic re-transmission): when this bit is set, it disables the automatic re- transmission of a message in the event of an erro r on the can bus or an arbitration lost on the can bus. in effect, when this function is used, the corresponding txcr bit is automatically set at the start of transmission. when this bit is set to '0', rcan-et tries to transmit the message as many times as required until it is successfully transmitted or it is cancelled by the txcr. dart description 0 re-transmission enabled (initial value) 1 re-transmission disabled mbc[2:0] (mailbox configuration): these bits configure the nature of each mailbox as follows. when mbc = b'111, the mailbox is inactive, i. e., it does not receive or transmit a message regardless of txpr or other settings. the mbc = b'110, b'101 and b'100 settings are prohibited. when the mbc is set to any other value, the lafm field becomes available. please don't set txpr when mbc is set as reception. similarly, please don't set txpr, when mbc is set as remote frame transmission and rtr in mailbox is cleared. there is no hardware protection, and txpr remains set. mbc[1] of mailbox-0 is fixed to "1" by hardware. this is to ensure that mb0 cannot be configured to transmit messages.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 816 of 1164 rej09b0321-0200 table 19.4 mailbox function setting mbc[2] mbc[1] mbc[0] data frame transmit remote frame transmit data frame receive remote frame receive remarks 0 0 0 yes yes no no ? not allowed for mailbox-0 0 0 1 yes yes no yes ? can be used with atx * ? not allowed for mailbox-0 ? lafm can be used 0 1 0 no no yes yes ? allowed for mailbox-0 ? lafm can be used 0 1 1 no no yes no ? allowed for mailbox-0 ? lafm can be used 1 0 0 setting prohibited 1 0 1 setting prohibited 1 1 0 setting prohibited 1 1 1 mailbox inactive (initial value) notes: * in order to support automatic retransmi ssion, rtr shall be "0" when mbc = b'001 and atx = 1. when atx = 1 is used the filt er for ide must not be used dlc[3:0] (data length code): these bits encode the number of data bytes from 0,1, 2, ? 8 that will be transmitted in a data frame. please note th at when a remote frame request is transmitted the dlc value to be used must be the same as the dlc of the data frame that is requested. dlc[3] dlc[2] dlc[1] dlc[0] description 0 0 0 0 data length = 0 byte (initial value) 0 0 0 1 data length = 1 byte 0 0 1 0 data length = 2 bytes 0 0 1 1 data length = 3 bytes 0 1 0 0 data length = 4 bytes 0 1 0 1 data length = 5 bytes 0 1 1 0 data length = 6 bytes 0 1 1 1 data length = 7 bytes 1 x x x data length = 8 bytes
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 817 of 1164 rej09b0321-0200 19.3.3 local acceptance filter mask (lafm) this area is used as local acceptance filter mask (lafm) for receive boxes . lafm: when mbc is set to b'001, b'010, b'011, this field is used as lafm field. the lafm is comprised of two 16-bit read/write areas as follows. it allows a mailbox to accept more than one identifier. word/lw word h'104 + n 32 h'106 + n 32 mb[n].lafmh mb[n].lafml address register name feld name acces size lafm field 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 extid_ lafm[17:16] ide_ lafm 0 0 stdid_lafm[10:0] extid_lafm[15:0] note: n = 0 to 15 (mailbox number) figure 19.4 acceptance filter if a bit is set in the lafm, then the correspondi ng bit of a received can identifier is ignored when the rcan-et searches a mailb ox with the matching can identifier. if the bit is cleared, then the corresponding bit of a received can identifier must match to the stdid/ide/extid set in the mailbox to be stored. th e structure of the lafm is same as the message control in a mailbox. if this function is not required, it must be filled with '0'. important: rcan-et starts to find a matching identifier from mailbox-15 down to mailbox-0. as soon as rcan-et finds one matching, it stops the search. the message will be stored or not depending on the nmc and rxpr/rfpr flags. th is means that, even using lafm, a received message can only be stored into 1 mailbox. important: when a message is received and a matching mailbox is found, the whole message is stored into the mailbox. this means that, if the lafm is used, the stdid, rtr, ide and extid may differ to the ones originally set as they are updated with the stdid, rtr, ide and extid of the received message. std_lafm[10:0] ? filter mask bits for the can base identifier [10:0] bits. std_lafm[10:0] description 0 corresponding std_id bit is cared 1 corresponding std_id bit is "don't cared"
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 818 of 1164 rej09b0321-0200 ext_lafm[17:0] ? filter mask bits for the can extended identifier [17:0] bits. ext_lafm[17:0] description 0 corresponding ext_id bit is cared 1 corresponding ext_id bit is "don't cared" ide_lafm ? filter mask bit for the can ide bit. ide_lafm description 0 corresponding ide_id bit is cared 1 corresponding ide_id bit is "don't cared" 19.3.4 message data fields storage for the can message data that is transmitted or received. msg_data[0] corresponds to the first data byte that is transm itted or received. the bit order on the can bus is bit 7 through to bit 0.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 819 of 1164 rej09b0321-0200 19.4 rcan-et control registers the following sections describe rcan-et control registers. the address is mapped as follow. important: these registers can only be accessed in word size (16-bit). table 19.5 rcan-et contro l registers configuration description address name access size (bits) master control register 000 mcr word general status register 002 gsr word baud rate configuration register 1 004 bcr1 word baud rate configuration register 0 006 bcr0 word interrupt request register 008 irr word interrupt mask register 00a imr word error counter register 00c tec/rec word 19.4.1 master control register (mcr) the master control register (mcr) is a 16-bit read/write register that controls rcan-et. ? mcr (address = h'000) bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1000000000000001 r/w r/w r r r r/w r/w r/w r/w r/w r/w r r r/w r/w r/w mcr15 mcr14 ? ? ? tst[2:0] mcr7 mcr6 mcr5 ? ? mcr2 mcr1 mcr0 bit 15 ? id reorder (mcr15): this bit changes the order of stdid, rtr, ide and extid of both message control and lafm. bit15: mcr15 description 0 rcan-et is the same as hcan2 1 rcan-et is not the same as hcan2 (initial value)
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 820 of 1164 rej09b0321-0200 0 stdid[10:0] extid[15:0] rtr ide extid[17:16] word/lw word h'100 + n 32 h'102 + n 32 control 0 access size address access size address feld name feld name 151413121110987654321 0 0 stdid_lafm[10:0] extid_lafm[15:0] 0 ide_ lafm extid_lafm [17:16] word/lw word h'104 + n 32 h'106 + n 32 lafm field 0 stdid[10:0] extid[15:0] rtr ide extid[17:16] word/lw word h'100 + n 32 h'102 + n 32 control 0 151413121110987654321 0 0 stdid_lafm[10:0] extid_lafm[15:0] extid_lafm [17:16] word/lw word h'104 + n 32 h'106 + n 32 lafm field 0 ide_ lafm mcr15 (id reorder) = 0 mcr15 (id reorder) = 1 note: n = 0 to 15 (mailbox number) figure 19.5 id reorder this bit can be modified only in reset mode. bit 14 ? auto halt bus off (mcr14): if both this bit and mcr6 are set, mcr1 is automatically set as soon as rcan-et enters busoff. bit14: mcr14 description 0 rcan-et remains in busoff fo r normal recovery sequence (128 11 recessive bits) (initial value) 1 rcan-et moves directly into halt mode after it enters busoff if mcr6 is set. this bit can be modified only in reset mode. bit 13 ? reserved . the written value should always be '0' and the returned value is '0'. bit 12 ? reserved . the written value should always be '0' and the returned value is '0'. bit 11 ? reserved . the written value should always be '0' and the returned value is '0'.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 821 of 1164 rej09b0321-0200 bit 10 - 8 ? test mode (tst[2:0]): this bit enables/disables th e test modes. please note that before activating the test mode it is requested to move rcan-et into halt mode or reset mode. this is to avoid that the transition to test mode could affect a transmissi on/reception in progress. for details, please refer to section 19.6.2, test mode settings. please note that the test modes are allowed only for diagnosis and tests and not when rcan-et is used in normal operation. bit10: tst2 bit9: tst1 bit8: tst0 description 0 0 0 normal mode (initial value) 0 0 1 listen-only mode (receive-only mode) 0 1 0 self test mode 1 (external) 0 1 1 self test mode 2 (internal) 1 0 0 write error counter 1 0 1 error passive mode 1 1 0 setting prohibited 1 1 1 setting prohibited bit 7 ? auto-wake mode (mcr7): mcr7 enables or disables the auto-wake mode. if this bit is set, the rcan-et automatically cancels the sleep mode (mcr5) by detecting can bus activity (dominant bit). if mcr7 is cl eared the rcan-et does not automa tically cancel the sleep mode. rcan-et cannot store the message that wakes it up. note: mcr7 cannot be modified while in sleep mode. bit7: mcr7 description 0 auto-wake by can bus activity disabled (initial value) 1 auto-wake by can bus activity enabled
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 822 of 1164 rej09b0321-0200 bit 6 ? halt during bus off (mcr6): mcr6 enables or disables entering halt mode immediately when mcr1 is set during bus off. this bit can be modified only in reset or halt mode. please note that when halt is entered in bus off the can engine is also recovering immediately to error active mode. bit6: mcr6 description 0 don't enter halt mode during bus off but wait up to end of recovery sequence (initial value) 1 enter halt mode immediately durin g bus off if mcr[1] or mcr[14] are asserted. bit 5 ? sleep mode (mcr5): enables or disables sleep mode transition. if this bit is set, while rcan-et is in halt mode, the transition to sleep m ode is enabled. setting mcr5 is allowed after entering halt mode. the two error counters (rec, tec) will remain the same during sleep mode. this mode will be exited in two ways: 1. by writing a '0' to this bit position, 2. or, if mcr[7] is enabled, after detecting a dominant bit on the can bus. if auto wake up mode is disabled, rcan-et will ignore all can bus activities until the sleep mode is terminated. when leaving this mode th e rcan-et will synchronise to the can bus (by checking for 11 recessive bits) be fore joining can bus activity. this means that, when the no.2 method is used, rcan-et will miss the first messa ge to receive. can transceivers stand-by mode will also be unable to cope with the first message when exiting stand by mode, and the s/w needs to be designed in this manner. in sleep mode only the follo wing registers can be accessed: mcr, gsr, irr and imr. important: rcan-et is required to be in halt mode before requesting to enter in sleep mode. that allows the cpu to clear all pending interrupt s before entering sleep mode. once all interrupts are cleared rcan-et must leave the halt mode an d enter sleep mode simultaneously (by writing mcr[5] = 1 and mcr[1] = 0 at the same time). bit 5: mcr5 description 0 rcan-et sleep mode released (initial value) 1 transition to rcan-et sleep mode enabled bit 4 ? reserved . the written value should always be '0' and the returned value is '0'.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 823 of 1164 rej09b0321-0200 bit 3 ? reserved . the written value should always be '0' and the returned value is '0'. bit 2 ? message transmission priority (mcr2): mcr2 selects the order of transmission for pending transmit data. if this bit is set, pending transmit data are sent in order of the bit position in the transmission pending register (txpr). the order of transmission starts from mailbox-15 as the highest priority, and then down to mailbox-1 (if those mailboxes are configured for transmission). if mcr2 is cleared, all messages for transmission are queued with respect to their priority (by running internal arbitration). the highest priority message has the arbitra tion field (stdid + ide bit + extid (if ide = 1) + rtr bit) with the lowest digital value and is transmitted first. the internal arbitration includes the rtr bit and the ide bit (internal arbitration works in the same way as the arbitration on the can bus between tw o can nodes starting transmission at the same time). this bit can be modified only in reset or halt mode. bit 2: mcr2 description 0 transmission order determined by message identifier priority (initial value) 1 transmission order determined by mailbox number priority (mailbox-15 mailbox-1) bit 1?halt request (mcr1): setting the mcr1 bit causes the can controller to complete its current operation and then ente r halt mode (where it is cut off from the can bus). the rcan-et remains in halt mode until the mcr1 is cleare d. during the halt mode, the can interface does not join the can bus activity and does not stor e messages or transmit messages. all the user registers (including mailbox contents and tec/rec) remain unchanged with the exception of irr0 and gsr4 which are used to notify the halt status itself. if the can bus is in idle or intermission state regardless of mcr6, rcan-et will enter halt mode within one bit time. if mcr6 is set, a halt request during bus off will be also processed within one bit time. otherwise the full bus off recovery sequence will be performed beforehand. entering the halt mode can be notified by irr0 and gsr4. if both mcr14 and mcr6 are set, mcr1 is au tomatically set as soon as rcan-et enters busoff. in the halt mode, the rcan-et configuration can be modified with the exception of the bit timing setting, as it does not join the bus activity. mcr[1] has to be cleared by writing a '0' in order to re-join the can bus. after this bit has been cleared, rcan-et waits until it detects 11 recessive bits, and then joins the can bus.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 824 of 1164 rej09b0321-0200 note: after issuing a halt request the cpu is not allowed to set txpr or txcr or clear mcr1 until the transition to halt mode is completed (notified by irr0 and gsr4). after mcr1 is set this can be cleared only after entering halt mode or through a reset operation (sw or hw). note: transition into or recovery from halt mode, is only possible if the bcr1 and bcr0 registers are configured to a proper baud rate. bit 1: mcr1 description 0 clear halt request (initial value) 1 halt mode transition request bit 0 ? reset request (mcr0): controls resetting of the rcan-et module. when this bit is changed from '0' to '1' the rcan-et controller enters its reset routine, re-initialising the internal logic, which then sets gsr3 and irr0 to notify the reset mode. during a re-initialisation, all user registers are initialised. rcan-et can be re-configured while this bit is set. this bit has to be cleared by writing a '0' to join the can bus. after this bit is cleared, the rcan-et module waits until it detects 11 recessive bits, and then joins the can bus. the baud rate needs to be set up to a proper value in order to sample the value on the can bus. after power on reset, this bit and gsr3 are always set. this means that a reset request has been made and rcan-et needs to be configured. the reset request is equivalent to a power on reset but controlled by software. bit 0: mcr0 description 0 clear reset request 1 can interface reset mode transition request (initial value)
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 825 of 1164 rej09b0321-0200 19.4.2 general status register (gsr) the general status register (gsr) is a 16-bit r ead-only register that i ndicates the status of rcan-et. ? gsr (address = h'002) bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000001100 rrrrrrrrrrrrrrrr ?????????? gsr5 gsr4 gsr3 gsr2 gsr1 gsr0 bits 15 to 6: reserved . the written value should always be '0' and the returned value is '0'. bit 5 ? error passive status bit (gsr5): indicates whether the ca n interface is in error passive or not. this bit will be set high as soon as the rcan-et enters the error passive state and is cleared when the module enters again the error active state (this means the gsr5 will stay high during error passive and during bus off). consequently to find out the correct state both gsr5 and gsr0 must be considered. bit 5: gsr5 description 0 rcan-et is not in error passive or in bus off status (initial value) [reset condition] rcan-et is in error active state 1 rcan-et is in error passive (if gs r0 = 0) or bus off (if gsr0 = 1) [setting condition] when tec 128 or rec 128 or if error passive test mode is selected
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 826 of 1164 rej09b0321-0200 bit 4 ? halt/sleep status bit (gsr4): indicates whether the can engine is in the halt/sleep state or not. please note that the clearing time of this flag is not the same as the setting time of irr12. please note that this flag refl ects the status of the can engine and not of the full rcan-et ip. rcan-et exits sleep mode and can be accessed on ce mcr5 is cleared. the can engine exits sleep mode only after two additional transmission clocks on the can bus. bit 4: gsr4 description 0 rcan-et is not in the halt stat e or sleep state (initial value) 1 halt mode (if mcr1 = 1) or sleep mode (if mcr5 = 1) [setting condition] if mcr1 is set and the can bus is either in intermission or idle or mcr5 is set and rcan-et is in the halt mode or rcan-et is moving to bus off when mcr14 and mcr6 are both set bit 3 ? reset status bit (gsr3): indicates whether the rcan-et is in the reset state or not. bit 3: gsr3 description 0 rcan-et is not in the reset state 1 reset state (initial value) [setting condition] after an rcan-et intern al reset (due to sw or hw reset) bit 2 ? message transmission in progress flag (gsr2): flag that indicates to the cpu if the rcan-et is in bus off or transmitting a message or an error/overload flag due to error detected during transmission. the timing to set txack is different from the time to clear gsr2. txack is set at the 7 th bit of end of frame. gsr2 is set at the 3 rd bit of intermission if there are no more messages ready to be transmitted. it is also set by arbitration lost, bus idle, reception, reset or halt transition. bit 2: gsr2 description 0 rcan-et is in bus off or a transmission is in progress 1 [setting condition] not in bus off and no transmission in progress (initial value)
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 827 of 1164 rej09b0321-0200 bit 1?transmit/receive warning flag (gsr1): flag that indicates an error warning. bit 1: gsr1 description 0 [reset condition] when (tec < 96 and re c < 96) or bus off (initial value) 1 [setting condition] when 96 tec < 256 or 96 rec < 256 note: rec is incremented during bus off to co unt the recurrences of 11 recessive bits as requested by the bus off recovery sequence. however the flag gsr1 is not set in bus off. bit 0?bus off flag (gsr0): flag that indicates that rcan- et is in the bus off state. bit 0: gsr0 description 0 [reset condition] recovery from bus off state or after a hw or sw reset (initial value) 1 [setting condition] when tec 256 (bus off state) note: only the lower 8 bits of tec ar e accessible from the user interface. the 9 th bit is equivalent to gsr0.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 828 of 1164 rej09b0321-0200 19.4.3 bit configuration register (bcr0, bcr1) the bit configuration registers (bcr0 and bcr1) are 2 16-bit read/write register that are used to set can bit timing parameters and the baud rate pre-scaler for the can interface. the time quanta is defined as: timequanta = 2 brp f clk where: brp (baud rate pre-scaler) is the value st ored in bcr0 incremented by 1 and fclk is the used peripheral bus frequency. ? bcr1 (address = h'004) bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w r/w r/w r/w r r/w r/w r/w r r r/w r/w r r r r/w tsg1[3:0] ? tsg2[2:0] ? ? sjw[1:0] ? ? ? bsp please refer to the table below for tsg1 and tsg2 setting. bits 15 to 12 ? time segment 1 (tsg1[3:0] = bcr1[15:12]): these bits are used to set the segment tseg1 ( = prseg + phseg1) to compensate for edges on the can bus with a positive phase error. a value from 4 to 16 time quanta can be set. bit 15: tsg1[3] bit 14: tsg1[2] bit 13: tsg1[1] bit 12: tsg1[0] description 0 0 0 0 setting prohibited (initial value) 0 0 0 1 setting prohibited 0 0 1 0 setting prohibited 0 0 1 1 prseg + phseg1 = 4 time quanta 0 1 0 0 prseg + phseg1 = 5 time quanta : : : : : : : : : : 1 1 1 1 prseg + phseg1 = 16 time quanta
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 829 of 1164 rej09b0321-0200 bit 11: reserved . the written value should always be '0' and the returned value is '0'. bits 10 to 8 ? time segment 2 (tsg2[2:0] = bcr1[10:8]): these bits are used to set the segment tseg2 ( = phseg2) to compensate for edges on the can bus with a negative phase error. a value from 2 to 8 time quanta can be set as shown below. bit 10: tsg2[2] bit 9: tsg2[1] bit 8: tsg2[0] description 0 0 0 setting prohibited (initial value) 0 0 1 phseg2 = 2 time quanta (conditi onally prohibited) see the table below for tsg1 and tsg2 setting. 0 1 0 phseg2 = 3 time quanta 0 1 1 phseg2 = 4 time quanta 1 0 0 phseg2 = 5 time quanta 1 0 1 phseg2 = 6 time quanta 1 1 0 phseg2 = 7 time quanta 1 1 1 phseg2 = 8 time quanta bits 7 and 6: reserved . the written value should always be '0' and the returned value is '0'. bits 5 and 4 - resynchronisation jump width (sjw[1:0] = bcr0[5:4]): these bits set the synchronisation jump width. bit 5: sjw[1] bit 4: sjw[0] description 0 0 synchronisation jump width = 1 time quantum (initial value) 0 1 synchronisation jump width = 2 time quanta 1 0 synchronisation jump width = 3 time quanta 1 1 synchronisation jump width = 4 time quanta bits 3 to 1: reserved . the written value should always be '0' and the returned value is '0'.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 830 of 1164 rej09b0321-0200 bit 0 ? bit sample point (bsp = bcr1[0]): sets the point at which data is sampled. three-time sampling is only available when the brp is programmed to be greater than 4. bit 0: bsp description 0 bit sampling at one point (end of time segment 1) (initial value) 1 bit sampling at three points (rising edge of the last three clock cycles of phseg1) ? bcr0 (address = h'006) bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w ? ? ? ? ? ? ? ? brp[7:0] bits 8 to 15 : reserved . the written value should always be '0' and the returned value is '0'. bits 7 to 0?baud rate pre-scale (brp[7:0] = bcr0 [7:0]): these bits are used to define the peripheral bus clock periods contained in a time quantum. bit 7: brp[7] bit 6: brp[6] bit 5: brp[5] bit 4: brp[4] bit 3: brp[3] bit 2: brp[2] bit 1: brp[1] bit 0: brp[0] description 0 0 0 0 0 0 0 0 2 peripheral bus clock (initial value) 0 0 0 0 0 0 0 1 4 peripheral bus clock 0 0 0 0 0 0 1 0 6 peripheral bus clock : : : : : : : : : : : : : : : : 2 (register value+1) peripheral bus clock 1 1 1 1 1 1 1 1 512 peripheral bus clock
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 831 of 1164 rej09b0321-0200 ? requirements of bit configuration register 1-bit time (8 to 25 quanta) sync_seg prseg phseg1 tseg1 1 4-16 2-8 tseg2 phseg2 quantum sync_seg: segment for establishing synchronisation of nodes on the can bus. (normal bit edge transitions occur in this segment.) prseg: segment for compensating for physical delay between networks. phseg1: buffer segment for co rrecting phase drift (positive). (this segment is extended when synchronisation (resynchronisation) is established.) phseg2: buffer segment for co rrecting phase drift (negative). (this segment is shortened when synchronisation (resynchronisation) is established) tseg1: tsg1 + 1 tseg2: tsg2 + 1 the rcan-et bit rate calculation is: bit rate = f clk 2 (brp + 1) (tseg1 + tseg2 + 1) where brp is given by the register value and tseg1 and tseg2 are derived values from tsg1 and tsg2 register values. f clk = peripheral clock bcr setting constraints tseg1min > tseg2 sjwmax (sjw = 1 to 4) 8 tseg1 + tseg2 + 1 25 time quanta (tseg1 + tseg2 + 1 = 7 is not allowed) tseg2 2
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 832 of 1164 rej09b0321-0200 these constraints allow the setting range shown in the table below for tseg1 and tseg2 in the bit configuration register. the number in the table shows possible setting of sjw. "no" shows that there is no allowed combination of tseg1 and tseg2. table 19.6 tsg and tseg setting 001 010 011 100 101 110 111 tsg2 2 3 4 5 6 7 8 tseg2 tsg1 tseg1 0011 4 no 1-3 no no no no no 0100 5 1-2 1-3 1-4 no no no no 0101 6 1-2 1-3 1-4 1-4 no no no 0110 7 1-2 1-3 1-4 1-4 1-4 no no 0111 8 1-2 1-3 1-4 1-4 1-4 1-4 no 1000 9 1-2 1-3 1-4 1-4 1-4 1-4 1-4 1001 10 1-2 1-3 1-4 1-4 1-4 1-4 1-4 1010 11 1-2 1-3 1-4 1-4 1-4 1-4 1-4 1011 12 1-2 1-3 1-4 1-4 1-4 1-4 1-4 1100 13 1-2 1-3 1-4 1-4 1-4 1-4 1-4 1101 14 1-2 1-3 1-4 1-4 1-4 1-4 1-4 1110 15 1-2 1-3 1-4 1-4 1-4 1-4 1-4 1111 16 1-2 1-3 1-4 1-4 1-4 1-4 1-4 example 1: to have a bit rate of 500 kbps with a frequency of fclk = 40 mhz it is possible to set: brp = 3, tseg1 = 6, tseg2 = 3. then the configuration to write is bcr1 = h'5200 and bcr0 = h'0003. example 2: to have a bit rate of 250 kbps with a frequency of fclk = 35 mhz it is possible to set: brp = 4, tseg1 = 8, tseg2 = 5. then the configuration to write is bcr1 = h'7400 and bcr0 = h'0004.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 833 of 1164 rej09b0321-0200 19.4.4 interrupt re quest register (irr) the interrupt register (irr) is a 16-bit read/write-c learable register containi ng status flags for the various interrupt sources. ? irr (address = h'008) bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000001 r r r/w r/w r r r r r/w r/w r/w r/w r/w r r r/w ? ? irr13 irr12 ? ? irr9 irr8 irr7 irr6 irr5 irr4 irr3 irr2 irr1 irr0 bits 15 to 14: reserved. bit 13 - message error interrupt (irr13): this interrupt indicates that: ? a message error has occurred when in test mode. ? note: if a message overload condition occurs when in test mode, then this bit will not be set. when not in test mode this interrupt is inactive. bit 13: irr13 description 0 message error has not occurred in test mode (initial value) [clearing condition] writing 1 1 [setting condition] message error has occurred in test mode
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 834 of 1164 rej09b0321-0200 bit 12 ? bus activity while in sleep mode (irr12): irr12 indicates that a can bus activity is present. while the rcan-et is in sleep mode and a dominant bit is detected on the can bus, this bit is set. this interrupt is cleared by writing a '1' to this bit position. writing a '0' has no effect. if auto wakeup is not used and this interrupt is not requested it needs to be disabled by the related interrupt mask register. if auto wake up is not used and this interrupt is requested it should be cleared only after recovering from sleep mode. this is to avoid that a new falling edge of the reception line causes the inte rrupt to get set again. please note that the setting time of this interrup t is different from the clearing time of gsr4. bit 12: irr12 description 0 bus idle state (initial value) [clearing condition] writing 1 1 can bus activity detected in rcan-et sleep mode [setting condition] dominant bit level de tection on the crx line while in sleep mode bits 11 to 10: reserved bit 9 ? message overrun/overwri te interrupt flag (irr9): flag indicating that a message has been received but the existing message in the matching mailbox has not been read as the corresponding rxpr or rfpr is already set to '1' and not yet cl eared by the cpu. the received message is either abandoned (overrun) or ov erwritten dependant upon the nmc (new message control) bit. this bit is cleared when all bit in umsr (unread message status register) are cleared (by writing '1') or by setting mbimr (mailbox interr upt mast register) fo r all umsr flag set . it is also cleared by writing a '1' to all the correspondent bit position in mbimr. writing to this bit position has no effect. bit 9: irr9 description 0 no pending notification of message overrun/overwrite [clearing condition] clearing of all bit in umsr/setting mbimr for all umsr set (initial value) 1 a receive message has been discarded due to overrun condition or a message has been overwritten [setting condition] message is received while the corresponding rxpr and/or rfpr = 1 and mbimr = 0
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 835 of 1164 rej09b0321-0200 bit 8 - mailbox empty interrupt flag (irr8): this bit is set when one of the messages set for transmission has been successfu lly sent (corresponding txack flag is set) or has been successfully aborted (corre sponding aback flag is set). the related txpr is also cleared and this mailbox is now ready to accept a new message data for the next transmission. in effect, this bit is set by an or'ed signal of the txack and aback bits not masked by the corresponding mbimr flag. therefore, this bit is automatica lly cleared when all the txack and aback bits are cleared. it is also cleared by writing a '1' to all the correspondent bit position in mbimr. writing to this bit position has no effect. bit 8: irr8 description 0 messages set for transmission or transmission cancellation request not progressed. (initial value) [clearing condition] all the txack and aback bits are cleared/setting mbimr for all txack and aback set 1 message has been transmitted or aborted, and new message can be stored [setting condition] when one of the txpr bits is cleared by completion of transmission or completion of transmission abort, i.e., when a txack or aback bit is set (if mbimr = 0). bit 7 - overload frame (irr7): flag indicating that the rcan- et has detected a condition that should initiate the transmission of an overload frame. note that on the condition of transmission being prevented, such as listen only mode, an overload frame will not be transmitted, but irr7 will still be set. irr7 remains asserted until reset by writing a '1' to this bit position - writing a '0' has no effect. bit 7: irr7 description 0 [clearing condition] writing 1 (initial value) 1 [setting conditions] overload condition detected
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 836 of 1164 rej09b0321-0200 bit 6 - bus off int errupt flag (irr6): this bit is set when rcan-et enters the bus-off state or when rcan-et leaves bus-off and returns to er ror-active. the cause th erefore is the existing condition tec 256 at the node or the end of the bus-off recovery sequence (128 11 consecutive recessive bits) or the transition from bu s off to halt (automatic or manual). this bit remains set even if the rcan-et node leaves the bus-off condition, and needs to be explicitly cleared by s/w. the s/w is exp ected to read the gsr0 to judg e whether rcan-et is in the bus- off or error active status. it is cleared by writing a '1' to this bit position even if the node is still bus-off. writing a '0' has no effect. bit 6: irr6 description 0 [clearing condition] writing 1 (initial value) 1 enter bus off state caused by transmit error or error active state returning from bus-off [setting condition] when tec becomes 256 or end of bus-off after 128 11 consecutive recessive bits or transition from bus off to halt bit 5 - error passive interrupt flag (irr5): interrupt flag indicatin g the error passive state caused by the transmit or receive error counter or by error passive forced by test mode. this bit is reset by writing a '1' to this bit position, writing a '0 ' has no effect. if this bit is cleared the node may still be error passive. please note that the sw needs to check gsr0 and gsr5 to judge whether rcan-et is in error passive or bus off status. bit 5: irr5 description 0 [clearing condition] writing 1 (initial value) 1 error passive state caused by transmit/receive error [setting condition] when tec 128 or rec 128 or error passive test mode is used bit 4 - receive error counter wa rning interrupt flag (irr4): this bit becomes set if the receive error counter (rec) reaches a value greater than 95 when rcan-et is not in the bus off status. the interrupt is reset by writing a '1' to this bit position, writing '0' has no effect. bit 4: irr4 description 0 [clearing condition] writing 1 (initial value) 1 error warning state caused by receive error [setting condition] when rec 96 and rcan-et is not in bus off
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 837 of 1164 rej09b0321-0200 bit 3 - transmit error counter warning interrupt flag (irr3): this bit becomes set if the transmit error coun ter (tec) reaches a value great er than 95. the interrupt is reset by writing a '1' to this bit position, writing '0' has no effect. bit 3: irr3 description 0 [clearing condition] writing 1 (initial value) 1 error warning state caused by transmit error [setting condition] when tec 96 bit 2 - remote frame reque st interrupt flag (irr2): flag indicating that a remote frame has been received in a mailbox. this b it is set if at least one receive mailbox, with related mbimr not set, contains a remote frame transmission request. th is bit is automatically cl eared when all bits in the remote frame receive pending register (rfpr), are cleared. it is also cleared by writing a '1' to all the correspondent bit position in mb imr. writing to this bit has no effect. bit 2: irr2 description 0 [clearing condition] clearing of all bits in rfpr (initial value) 1 at least one remote request is pending [setting condition] when remote frame is received and the corresponding mbimr = 0 bit 1 ? data frame receive d interrupt flag (irr1): irr1 indicates that there are pending data frames received. if this bit is set at least one receive mailbox contains a pending message. this bit is cleared when all bits in the data frame receive pending register (rxpr) are cleared, i.e. there is no pending message in any receiving mailbox. it is in effect a logical or of the rxpr flags from each configured receive mailb ox with related mbimr not set. it is also cleared by writing a '1' to all the correspondent bit position in mbimr. writing to this bit has no effect. bit 1: irr1 description 0 [clearing condition] clearing of all bits in rxpr (initial value) 1 data frame received and stored in mailbox [setting condition] when data is received and the corresponding mbimr = 0
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 838 of 1164 rej09b0321-0200 bit 0 ? reset/halt/sleep interrupt flag (irr0): this flag can get set for three different reasons. it can indicate that: 1. reset mode has been entered after a sw (mcr0) or hw reset 2. halt mode has been entered after a halt request (mcr1) 3. sleep mode has been entered after a sleep request (mcr5) has been made while in halt mode. the gsr may be read after this bit is set to determine which state rcan-et is in. important: when a sleep mode request needs to be made, the halt mode must be used beforehand. please refer to the mcr5 description and figure 19.8. irr0 is set by the transition from "0" to "1" of gsr3 or gsr4 or by transition from halt mode to sleep mode. so, irr0 is not set if rcan-et enters halt mode again right after exiting from halt mode, without gsr4 being cleared. similarly, irr0 is not set by direct transition from sleep mode to halt request. at the transition from ha lt/sleep mode to transition/reception, clearing gsr4 needs (one-bit time - tseg2) to (one-bit time * 2 - tseg2). in the case of reset mode, irr0 is set, however, the interrupt to the cpu is not asserted since imr0 is automatically set by initialisation. bit 0: irr0 description 0 [clearing condition] writing 1 1 transition to s/w reset mode or transition to halt mode or transition to sleep mode (initial value) [setting condition] when reset/halt/sleep transition is completed after a reset (mcr0 or hw) or halt mode (mcr1) or sleep mode (mcr5) is requested
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 839 of 1164 rej09b0321-0200 19.4.5 interrupt ma sk register (imr) the interrupt mask register is a 16 bit register that protects all corresponding interrupts in the interrupt request register (irr) from generating an output signal on the irq. an interrupt request is masked if the correspond ing bit position is set to '1'. this register can be read or written at any time. the imr directly controls the genera tion of irq, but does not prevent the setting of the corresponding bit in the irr. ? imr (address = h'00a) bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w imr15 imr14 imr13 imr12 imr11 imr10 imr9 imr8 imr7 imr6 imr5 imr4 imr3 imr2 imr1 imr0 bit 15 to 0: maskable interrupt sources corresponding to irr[15:0] respectively. when a bit is set, the interrupt signal is not generated, although setting the corresponding irr bit is still performed. bit[15:0]: imrn description 0 corresponding irr is not masked (irq is generated for interrupt conditions) 1 corresponding interrupt of irr is masked (initial value)
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 840 of 1164 rej09b0321-0200 19.4.6 transmit error counter (tec ) and receive error counter (rec) the transmit error counter (tec) and receive error counter (rec) is a 16-bit read/(write) register that functions as a count er indicating the number of transm it/receive message errors on the can interface. the count value is stipulated in th e can protocol specification refs. [2], [3], [4] and [5]. when not in (write error counter) test mode this register is read only, and can only be modified by the can interface. this register can be cleared by a reset request (mcr0) or entering to bus off. in write error counter test mode (i.e. tst[2:0] = b'100), it is possible to write to this register. the same value can only be written to tec/rec, and the value written into tec is set to tec and rec. when writing to this register, rcan-et needs to be put into halt mode. this feature is only intended for test purposes. ? tec/rec (address = h'00c) bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * tec7 tec6 tec5 tec4 tec3 tec2 tec1 tec0 rec7 rec6 rec5 rec4 rec3 rec2 rec1 rec0 note: * it is only possible to write the value in test mode when tst[2:0] in mcr is b'100. rec is incremented during bus off to coun t the recurrences of 11 recessive bits as requested by the bus off recovery sequence.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 841 of 1164 rej09b0321-0200 19.5 rcan - et mailbox registers the following sections describe rcan-et mailbox registers that control/flag individual mailboxes. the address is mapped as follows. important: longword access is carried out as two consecutive word accesses. table 19.7 rcan-et mailbox registers description address name access size (bits) transmit pending 1 h'020 txpr1 lw transmit pending 0 h'022 txpr0 ? h'024 h'026 h'028 transmit cancel 0 h'02a txcr0 h'02c h'02e h'030 transmit acknowledge 0 h'032 txack0 word h'034 h'036 h'038 abort acknowledge 0 h'03a aback0 word h'03c h'03e h'040 data frame receive pending 0 h'042 rxpr0 word h'044 h'046 h'048 remote frame receive pending 0 h'04a rfpr0 word h'04c h'04e h'050
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 842 of 1164 rej09b0321-0200 description address name access size (bits) mailbox interrupt mask register 0 h'052 mbimr0 word h'054 h'056 h'058 unread message status register 0 h'05a umsr0 word h'05c h'05e 19.5.1 transmit pending register (txpr0, txpr1) the concatenation of txpr0 and tx pr1 is a 32-bit register that contains any transmit pending flags for the can module. in the case of 16-bit bus interface, long word access is carried out as two consecutive word accesses. temp txpr1 txpr0 h'020 h'022 16-bit peripheral bus data is stored into temp instead of txpr1. consecutive access 16-bit peripheral bus lower word data is stored into txpr0. txpr1 is always h'0000. temp txpr1 txpr0 h'020 h'022
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 843 of 1164 rej09b0321-0200 temp txpr1 txpr0 h'020 h'022 16-bit peripheral bus txpr0 is stored into temp, when txpr1 (= h'0000) is read. consecutive access 16-bit peripheral bus temp is read instead of txpr0. temp txpr1 txpr0 h'020 h'022 always h'0000 the txpr1 register cannot be modified and it is always fixed to '0'. the txpr0 controls mailbox-15 to mailbox-1. the cpu may set the txpr bits to affect any message being considered for transmission by writing a '1' to th e corresponding bit location. writing a '0' has no effect, and txpr cannot be cleared by writing a '0' and must be cleared by setting the corresponding txcr bits. txpr may be read by the cpu to determine which, if any, transmissions are pending or in progress. in effect there is a transmit pending bit for all mailboxes except for the mailbox-0. writing a '1' to a bit location when the mailbox is not configured to transmit is not allowed. the rcan-et will clear a transmit pending flag after successful transmission of its corresponding message or when a transmission abort is reques ted successfully from the txcr. the txpr flag is not cleared if the message is not transmitted due to the can node losing the arbitration process or due to er rors on the can bus, and rcan-et automatically tries to transmit it again unless its dart bit (disable automatic re -transmission) is set in the message-control of the corresponding mailbox. in such case (dart set), the transmission is cleared and notified through mailbox empty interrupt flag (irr8) and the correspondent bit within the abort acknowledgement register (aback). if the status of the txpr changes, the rcan-et shal l ensure that in the iden tifier priority scheme (mcr2 = 0), the highest priority message is always presented for transmission in an intelligent way even under circumstances such as bus arbitr ation losses or errors on the can bus. please refer to section 19.6, application note, for details.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 844 of 1164 rej09b0321-0200 when the rcan-et changes the state of any txpr bi t position to a '0', an empty slot interrupt (irr8) may be generated. this indicates that either a successful or an aborted mailbox transmission has just been made. if a message tr ansmission is successful it is signalled in the txack register, and if a message transmission abortion is successful it is signalled in the aback register. by checking these registers, the contents of the message of the corresponding mailbox may be modified to prepare for the next transmission. ? txpr1 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * txpr1[15:0] note: * any write operation is ignored. read value is always h'0000. long word access is mandatory when reading or writing txpr1/txpr0. writing any value to txpr1 is allowed, however, write operation to txpr1 has no effect. writing to the bit 0 in txpr0 has no effect. ? txpr0 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * ? txpr0[15:1] 0 note: * it is possible only to write a '1' for a mailbox configured as transmitter. bit 15 to 1 ? indicates that the corres ponding mailbox is requested to transmit a can frame. the bit 15 to 1 corresponds to mailbox-15 to 1 respectively. when multiple bits are set, the order of the transmissions is governed by the mcr2 ? can-id or mailbox number. bit[15:1]:txpr0 description 0 transmit message idle state in corresponding mailbox (initial value) [clearing condition] completion of message transmission or message transmission abortion (automatically cleared) 1 transmission request made for corresponding mailbox bit 0? reserved : this bit is always '0' as this is a recei ve-only mailbox. writi ng a '1' to this bit position has no effect. the returned value is '0'.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 845 of 1164 rej09b0321-0200 19.5.2 transmit cancel register 0 (txcr0) txcr0 is a 16-bit read/conditionally-write registers. the txcr0 controls mailbox-15 to mailbox-1.this register is used by the cpu to request the pending transmission requests in the txpr to be cancelled. to clear the corresponding bit in the txpr the cpu must write a '1' to the bit position in the txcr. writing a '0' has no effect. when an abort has succeeded the can controlle r clears the correspond ing txpr + txcr bits, and sets the corresponding aback bit. however, once a mailbox has started a transmission, it cannot be cancelled by this bit. in such a case, if the transmi ssion finishes in success, the can controller clears the corresponding txpr + tx cr bit, and sets the corresponding txack bit, however, if the transmission fails due to a bus arbitration loss or an error on the bus, the can controller clears the corresponding txpr + txcr bit, and sets the corresponding aback bit. if an attempt is made by the cpu to clear a mailbox transmission that is not transmit-pending it has no effect. in this case the cpu will be not able at all to set the txcr flag. ? txcr0 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 ? 000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * 0 txcr0[15:1] note: * only writing a '1' to a mailbox that is requested for transmission and is configured as transmit. bit 15 to 1 ? requests the corresponding mailbox, that is in the queue for transmission, to cancel its transmission. the bit 15 to 1 corresponds to mailbox-15 to 1 (and txpr0[15:1]) respectively. bit[15:1]:txcr0 description 0 transmit message cancellation idle state in corresponding mailbox (initial value) [clearing condition] completion of transmit message cancellation (automatically cleared) 1 transmission cancellation request made for corresponding mailbox bit 0 ? this bit is always '0' as this is a receive- only mailbox. writing a '1' to this bit position has no effect and always read back as a '0'.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 846 of 1164 rej09b0321-0200 19.5.3 transmit acknowledge register 0 (txack0) the txack0 is a 16-bit read/conditionally-write registers. this register is used to signal to the cpu that a mailbox transmission has been succe ssfully made. when a tr ansmission has succeeded the rcan-et sets the corresponding bit in th e txack register. the cpu may clear a txack bit by writing a '1' to the corresponding bit location. writing a '0' has no effect. ? txack0 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 ? 000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * 0 txack0[15:1] note: * only when writing a '1' to clear. bit 15 to 1 ? notifies that the requested transmission of the corresponding mailbox has been finished successfully. the bit 15 to 1 corresponds to ma ilbox-15 to 1 respectively. bit[15:1]:txack0 description 0 [clearing condition] writing '1' (initial value) 1 corresponding mailbox has successfully transmitted message (data or remote frame) [setting condition] completion of message transmission for corresponding mailbox bit 0 ? this bit is always '0' as this is a receive- only mailbox. writing a '1' to this bit position has no effect and always read back as a '0'.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 847 of 1164 rej09b0321-0200 19.5.4 abort acknowledge register 0 (aback0) the aback0 is a 16-bit read/conditionally-write registers. this register is used to signal to the cpu that a mailbox transmission has been aborted as per its requ est. when an abort has succeeded the rcan-et sets the corresponding bit in th e aback register. the cpu may clear the abort acknowledge bit by writing a '1' to the corresponding bit location. writing a '0' has no effect. an aback bit position is set by the rcan-et to ackno wledge that a txpr bit has been cleared by the corresponding txcr bit. ? aback0 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 ? 000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * 0 aback0[15:1] note: * only when writing a '1' to clear. bit 15 to 1 ? notifies that the requested transmission cancellation of the corresponding mailbox has been performed successfully. the bit 15 to 1 corre sponds to mailbox-15 to 1 respectively. bit[15:1]:aback0 description 0 [clearing condition] writing '1' (initial value) 1 corresponding mailbox has cancelled transmission of message (data or remote frame) [setting condition] completion of transmission cancellation for corresponding mailbox bit 0 ? this bit is always '0' as this is a receive- only mailbox. writing a '1' to this bit position has no effect and always read back as a '0'.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 848 of 1164 rej09b0321-0200 19.5.5 data frame receive pending register 0 (rxpr0) the rxpr0 is a 16-bit read/conditionally-write registers. the rxpr is a register that contains the received data frames pending flags associated w ith the configured receive mailboxes. when a can data frame is successfully st ored in a receive mailbox the co rresponding bit is set in the rxpr. the bit may be cleared by writing a '1' to the corresponding bit position. writing a '0' has no effect. however, the bit may only be set if the mailbox is configured by its mbc (mailbox configuration) to receive data frames. when a rxpr bit is set, it also sets irr1 (data frame received interrupt flag) if its mbimr (mailbox interrupt mask register) is not set, and the interrupt signal is generated if im r1 is not set. please note that th ese bits are only set by receiving data frames and not by receiving remote frames. ? rxpr0 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * rxpr0[15:0] note: * only when writing a '1' to clear. bit 15 to 0 ? configurable receive mail box locations corresponding to each mailbox position from 15 to 0 respectively. bit[15:0]: rxpr0 description 0 [clearing condition] writing '1' (initial value) 1 corresponding mailbox received a can data frame [setting condition] completion of data frame receive on corresponding mailbox
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 849 of 1164 rej09b0321-0200 19.5.6 remote frame receive pending register 0 (rfpr0) the rfpr0 is a 16-bit read/conditionally-write regist ers. the rfpr is a register that contains the received remote frame pending flags associated wi th the configured receive mailboxes. when a can remote frame is succe ssfully stored in a receive mailbox the corresponding bit is set in the rfpr. the bit may be cleared by writing a '1' to the corresponding bit position. writing a '0' has no effect. in effect there is a bit position for all mailboxes. however, the bit may only be set if the mailbox is configured by its mbc (mailbox conf iguration) to receive remote frames. when a rfpr bit is set, it also sets irr2 (remote fram e request interrupt flag) if its mbimr (mailbox interrupt mask register) is not set, and the interrupt signal is generated if imr2 is not set. please note that these bits are only se t by receiving remote frames an d not by receiving data frames. ? rfpr0 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * rfpr0[15:0] note: * only when writing a '1' to clear. bit 15 to 0 ? remote request pending flags for mailboxes 15 to 0 respectively. bit[15:0]: rfpr0 description 0 [clearing condition] writing '1' (initial value) 1 corresponding mailbox received remote frame [setting condition] completion of remote frame receive in corresponding mailbox
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 850 of 1164 rej09b0321-0200 19.5.7 mailbox interrupt mask register 0 (mbimr0) the mbimr1 and mbimr0 are 16-bit read/write registers. the mbimr only prevents the setting of irr related to the mailbox ac tivities, that are irr[1] ? data frame received interrupt, irr[2] ? remote frame request interrupt, irr[8] ? mailbox empty interrupt, and irr[9] ? message overrun/overwrite interrupt. if a mailbox is conf igured as receive, a mask at the corresponding bit position prev ents the generation of a receive interr upt (irr[1] and irr[ 2] and irr[9]) but does not prevent the setting of the corresponding bit in the rxpr or rfpr or umsr. similarly when a mailbox has been configured for transmission, a mask prevents the generation of an interrupt signal and setting of an mailbox empt y interrupt due to succes sful transmission or abortion of transmission (irr[8]), however, it do es not prevent the rcan- et from clearing the corresponding txpr/txcr bit + setting the txack bit for successful transmission, and it does not prevent the rcan-et from clearing the corresponding txpr/txcr bit + setting the aback bit for abortion of the transmission. a mask is set by writing a '1' to the corresponding bit position for the mailbox activity to be masked. at reset all mailbox interrupts are masked. ? mbimr0 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1111111111111111 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w mbimr0[15:0] bit 15 to 0 ? enable or disable interrupt requests from individual mailbox-15 to mailbox-0 respectively. bit[15:0]: mbimr0 description 0 interrupt request from irr1/irr2/irr8/irr9 enabled 1 interrupt request from irr1/irr2/i rr8/irr9 disabled (initial value)
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 851 of 1164 rej09b0321-0200 19.5.8 unread message status register 0 (umsr0) this register is a 16-bit read/conditionally write register and it records the mailboxes whose contents have not been accessed by the cpu prior to a new message being received. if the cpu has not cleared the corresponding bit in the rxpr or rfpr when a new message for that mailbox is received, the corresponding umsr bit is set to '1'. this bit may be cleared by writing a '1' to the corresponding bit location in the umsr. writing a '0' has no effect. if a mailbox is configured as transmit box, the corresponding umsr will not be set. ? umsr0 bit: initial value: r/w: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * umsr0[15:0] bit 15 to 0 ? indicate that an unread received message has been overwritten or overrun condition has occurred for mailboxes 15 to 0. bit[15:0]: umsr0 description 0 [clearing condition] writing '1' (initial value) 1 unread received message is overwritten by a new message or overrun condition [setting condition] when a new message is received before rxpr or rfpr is cleared
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 852 of 1164 rej09b0321-0200 19.6 application note 19.6.1 configuration of rcan-et rcan-et is considered in configuration mode or after a h/w (power on reset)/ s/w (mcr[0]) reset or when in halt mode. in both conditions rcan-et cannot join the can bus activity and configuration changes have no impact on the traffic on the can bus. (1) after a reset request the following sequence must be implemented to configure th e rcan-et after (s/w or h/w) reset. after reset, all the registers are initiali zed, therefore, rcan-et ne eds to be configured before joining the can bus activity . please read the notes carefully.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 853 of 1164 rej09b0321-0200 power on/sw reset * 1 clear irr[0] bit gsr[3] = 0? detect 11 recessive bits and join the can bus activity rcan-et is in tx_rx mode set txpr to start transmission or stay idle to receive configure mcr[15] clear mcr[0] clear required imr bits set bit timing (bcr) mailbox setting (std-id, ext-id, lafm, dlc, rtr, ide, mbc, mbimr, dart, atx, nmc, message-data) * 2 irr[0] = 1, gsr[3] = 1 (automatically) no * 3 yes transmission_reception (tx_rx) mode receive * 4 transmit * 4 notes: 1. sw reset could be performed at any time by setting mcr[0] = 1. 2. mailboxes are comprised of rams, therefore, please initialize all the mailboxes enabled by mbc. 3. it takes approximately 25 peripheral bus cycles for gsr[3] to be cleared to 0. 4. if there is no txpr set, rcan-et will receive the next incoming message. if there is a txpr(s) set, rcan-et will start transmission of the message and will be arbitrated by the can bus. if it loses the arbitration, it will become a receiver. mcr[0] = 1 (automatically in hardware reset only) configuration mode figure 19.6 reset sequence
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 854 of 1164 rej09b0321-0200 (2) halt mode when rcan-et is in halt mode, it cannot take part to the can bus activity. consequently the user can modify all the requested registers without influencing existing traffic on the can bus. it is important for this that the user waits for the rcan-et to be in halt mode before to modify the requested registers - note that the transition to ha lt mode is not always immediate (transition will occurs when the can bus is idle or in intermi ssion). after rcan-et transit to halt mode, gsr4 is set. once the configuration is completed the halt request needs to be released. rcan-et will join can bus activity after the detection of 11 recessive bits on the can bus. (3) sleep mode when rcan-et is in sleep mode the clock for the main blocks of the ip is stopped in order to reduce power consumption. only the following us er registers are clocked and can be accessed: mcr, gsr, irr and imr. interr upt related to transmission (t xack and aback) and reception (rxpr and rfpr) cannot be cl eared when in sleep mode (a s txack, aback, rxpr and rfpr are not accessible) and mu st to be cleared beforehand. the following diagram shows the flow to follow to move rcan-et into sleep mode.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 855 of 1164 rej09b0321-0200 (4) can sleep mode sleep mode transmission/reception mode gsr[4] = 1? user monitor user monitor yes irr[0] = 1 write mcr[1] = 1 write irr[0] = 1 : hardware operation : manual operation irr[0] = 1 irr0 = 0 irr[12] = 1 write irr[0] = 1 irr[0] = 0 mcr[5] = 0 write irr[12] = 1 irr[12] = 0 write mcr[1] = 0 & mcr[5] = 1 halt request sleep request write irr[12] = 1 irr[12] = 0 write mcr[5] = 0 no can bus activity yes sleep mode sequence flow no gsr4 = 0? yes no mcr[7] = 1? yes no clk is stop only mcr, gsr, irr, imr can be accessed. figure 19.7 halt mode/sleep mode
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 856 of 1164 rej09b0321-0200 figure 19.8 - halt mode/sleep mode shows allowed state transition. ? please don't set mcr5 (sleep mode) without entering halt mode. ? after setting mcr1, make sure that gsr4 is set and the rcan-et has entered halt mode before clearing mcr1. power on/sw reset reset clear mcr0 and gsr3 = 0 clear mcr1 and mcr5 notes: 1. mcr5 can be cleared by automatically by detecting a dominant bit on the can bus if mcr7 is set or by writing "0". 2. mcr1 is cleared in sw. clearing mcr1 and setting mcr5 have to be carried out by the same instruction. 3. mcr1 must not be cleared in sw, before gsr4 is set. mcr1 can be set automatically in hw when rcan-et moves to bus off and mcr14 and mcr6 are both set. 4. when mcr5 is cleared and mcr1 is set at the same time, rcan-et moves to halt request. right after that, it moves to halt mode with no reception/transmission. transmission reception set mcr1 * 3 halt request except transmitter/receiver/busoff, if mcr6 = 0 busoff or except transmitter/receiver, if mcr6 = 1 halt mode clear mcr5 * 1 clear mcr5 set mcr1 * 4 sleep mode set mcr5 clear mcr1 * 2 figure 19.8 halt mode/sleep mode
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 857 of 1164 rej09b0321-0200 the following table shows conditions to access registers. table 19.8 conditions to access registers rcan-et registers status mode mcr gsr irr imr bcr mbimr flag_register mailbox (ctrl0, lafm) mailbox (data) mailbox (ctrl1) reset yes yes yes yes yes yes yes yes transmission reception yes yes no * 1 yes yes no * 1 yes * 2 yes * 2 no * 1 yes * 2 halt request yes yes no * 1 yes yes no * 1 yes * 2 yes * 2 no * 1 yes * 2 halt yes yes no * 1 yes yes yes yes yes sleep yes yes no no no no no no notes: 1. no hardware protection 2. when txpr is not set. 19.6.2 test mode settings the rcan-et has various test modes. the register tst[2:0] (mcr[10:8]) is used to select the rcan-et test mode. the default (initialized) settings allow rcan-et to operate in normal mode. the following table is examples for test modes. test mode can be selected only while in c onfiguration mode. the user must then exit the configuration mode (ensuring bcr0/bcr1 is set) in order to run the selected test mode. table 19.9 test mode settings bit10: tst2 bit9: tst1 bit8: tst0 description 0 0 0 normal mode (initial value) 0 0 1 listen-only mode (receive-only mode) 0 1 0 self test mode 1 (external) 0 1 1 self test mode 2 (internal) 1 0 0 write error counter 1 0 1 error passive mode 1 1 0 setting prohibited 1 1 1 setting prohibited
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 858 of 1164 rej09b0321-0200 ? normal mode rcan-et operates in the normal mode. ? listen-only mode: iso-11898 requires this mode for baud rate detection. the error counters are cleared and disabled so that the tec/rec does not increase the values, and the ctx output is disabled so that rcan-et does not generate error frames or acknowledgment bits. irr13 is set when a message error occurs. ? self test mode 1 rcan-et generates its own acknowledge bit, and can store its own messages into a reception mailbox (if required). the crx/ctx pins must be connected to the can bus. ? self test mode 2 rcan-et generates its own acknowledge bit, and can store its own messages into a reception mailbox (if required). the crx/ctx pins do not need to be connected to the can bus or any external devices, as the internal ctx is looped back to the internal crx. ctx pin outputs only recessive bits and crx pin is disabled. ? write error counter tec/rec can be written in this mode. rcan-et can be forced to become an error passive mode by writing a value greater than 127 into the error counters. the value written into tec is used to write into rec, so only the same value can be set to these registers. similarly, rcan-et can be forced to become an error warn ing by writing a value greater than 95 into them. ? error passive mode rcan-et needs to be in halt mode when writing into tec/rec (mcr1 must be "1" when writing to the error counter). furthermore this te st mode needs to be exited prior to leaving halt mode.error passive mode: rcan-et can be forced to enter error passive mode. note: the rec will not be modified by implementing this mode. however, once running in error passive mode, the rec will increase norm ally should errors be received. in this mode, rcan-et will enter busoff if tec reac hes 256 (dec). however when this mode is used rcan-et will not be able to become error active. consequently, at the end of the bus off recovery sequence, rcan-et will move to error passive and not to error active when message error occurs, irr13 is set in all test modes.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 859 of 1164 rej09b0321-0200 19.6.3 message transmission sequence (1) message transmission request the following sequence is an ex ample to transmit a can frame onto the bus. as described in the previous register section, please note that irr8 is set when one of the txack or aback bits is set, meaning one of the mailboxes has completed its transmission or transmission abortion and is now ready to be updated for the next transmi ssion, whereas, the gsr2 means that there is currently no transmission reques t made (no txpr flags set). no no no yes yes yes rcan-et is in normal mode (mbc[n] = 0) write '1' to the txpr[n] bit at any desired time internal arbitration 'n' highest priority? transmission start mailbox[n] is ready to be updated for next transmission clear txack[n] txack[n] set? can bus arbitration acknowledge bit can bus irr8 set? update message data of mailbox[n] monitor for the next interrupt monitor for the next interrupt note: n = 0 to 15 (mailbox number) figure 19.9 transmission request (2) internal arbitration for transmission the following diagram explains how rcan-et manages to schedule transmission-requested messages in the correct order based on the can identifier. 'internal arbitration' picks up the highest priority message amongst transmit-requested messages.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 860 of 1164 rej09b0321-0200 sof eof interm sof sof eof interm rcan-et scheduler state scheduler start point txpr/txcr/ error/arb-lost set point interm: intermission field sof: start of frame eof: end of frame message: arbitration + control + data + crc + ack field transmission frame-1 reception frame-2 transmission frame-3 message bus idle can bus state message ctx arb for frame-1 ctx/crx arb for frame-1 ctx/crx arb for frame-3/2 ctx arb for frame-3 ctx arb for frame-3 ctx/crx arb for frame-3 1-1 1-2 2-1 2-2 3-1 3-2 figure 19.10 internal arbitration for transmission the rcan-et has two state machin es. one is for transmission, and the other is for reception. 1-1: when a txpr bit(s) is set while the can bus is idle, the internal arbitration starts running immediately and the tran smission is started. 1-2: operations for both transmi ssion and reception starts at so f. since there is no reception frame, rcan-et becomes transmitter. 2-1: at crc delimiter, internal arbitration to search next message transmitted starts. 2-2: operations for both transmission and reception starts at sof. because of a reception frame with higher priority, rcan-et becomes receiver. therefore, r eception is carried out instead of transmitting frame-3. 3-1: at crc delimiter, internal arbitration to search next message transmitted starts. 3-2: operations for both transmission and reception starts at sof. since a transmission frame has higher priority than reception one, rcan-et becomes transmitter. internal arbitration for the next transmission is also performed at the beginning of each error delimiter in case of an error is detected on the can bus. it is also performed at the beginning of error delimiters following overload frame. as the arbitration for transmission is performed at crc delimiter, in case a remote frame request is received into a mailbox with atx = 1 the answer can join the arbitration for transmission only at the following bus idle, crc delimiter or error delimiter. depending on the status of the can bus, following the assertion of the txcr, the corresponding message abortion can be handled with a delay of maximum 1 can frame.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 861 of 1164 rej09b0321-0200 19.6.4 message receive sequence the diagram below shows the message receive sequence. rcan-et can bus end of arbitration field end of frame idle valid can-id received compare id with mailbox[n] + lafm[n] (if mbc is config to receive) store mailbox-number[n] and go back to idle state ? store message by overwriting ? set umsr ? set irr9 (if mbimr[n] = 0) ? generate interrupt signal (if imr9 = 0) ? set rxpr[n] (rfpr[n]) ? set irr1 (irr2) (if mbimr[n] = 0) ? generate interrupt signal (if imr1 (imr2) = 0) ? reject message ? set umsr ? set irr9 (if mbimr[n] = 0) ? generate interrupt signal (if imr9 = 0) ? set rxpr[n] (rfpr[n]) * 1 ? store message ? set rxpr[n] (rfpr[n]) ? set irr1 (irr2) (if mbimr[n] = 0) ? generate interrupt signal (if imr1 (imr2) = 0) valid can frame received clear by clear umsr[n] * 2 write 1 to rxpr[n] read mailbox[n] irr[1] set? read irr msg overwrite or overrun? (nmc) overwrite overrun n = 0? n = n - 1 no no no no yes yes yes write 1 to rfpr[n] read mailbox[n] read rfpr[n] = 1 yes yes cpu received interrupt due to can message reception rxpr[n] (rfpr[n]) already set? id matched? intrrupt signal intrrupt signal intrrupt signal loop (n = 15; n 0; n = n - 1) read rxpr[n] = 1 notes: 1. only if cpu clears rxpr[n]/rfpr[n] at the same time that umsr is set in overrun, rxpr[n]/rfpr[n] may be set again eve n thuotgh the message has not been updated. 2. in case overwrite configuration (nmc = 1) is used for the mailbox n the message must be discarded when umsr[n] = 1, umsr[n ] cleared and the full interrupt service routine started again. in case of overrun configuration (nmc = 0) is used clear again rxpr[n]/ rfpr[n]/umsr[n] when umsr[n] = 1 and consider the message obsolate. clear by clear umsr[n] * 2 exit interrpt service routine figure 19.11 message receive sequence
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 862 of 1164 rej09b0321-0200 when rcan-et recognises the end of the arbitra tion field while receiving a message, it starts comparing the received identifier to the identifiers set in the mailb oxes, starting from mailbox-15 down to mailbox-0. it first checks the mbc if it is configured as a receive box, and reads lafm, and reads the can-id of mailbox-15 (if configured as receive) to finally compare them to the received id. if it does not match, the same check takes place at mailbox-14 (if configured as receive). once rcan-et finds a matc hing identifier, it stores the number of mailbox-[n] into an internal buffer, stops the search, and goes back to idle state, waiting for the endofframe (eof) to come. when the 6 th bit of eof is notified by the can interface logic, the received message is written or abandoned, depending on the nmc bit. no modification of configuration during communication is allowed. entering halt mode is one of ways to modify configuration. if it is written into the corresponding mailbox, including the can-id, i.e., there is a possibility that the can-id is overwritten by a different can-id of the received message due to the lafm used. this also implies that, if the id entifier of a received message matches to id + lafm of 2 or more mailboxes, the higher numbered mailbox will always store the relevant messages and the lower numbered mailbox will never receive messages. th erefore, the settings of the identifiers and lafms need to be carefully selected. with regards to the reception of data and remote frames described in the above flow diagram the clearing of the umsr flag after the reading of i rr is to detect situations where a message is overwritten by a new incoming message stored in the same mailbox while the interrupt service routine is running. if during the final check of umsr a overwrite condition is detected the message needs to be discarded and read again. please note that in the case a received remote frame is overwritten by a data frame, both the remote frame request interrupt (irr2) and data frame received interrupt (irr1) and also the receive flags (rxpr and rfpr) are set. in an an alogous way, the overwriting of a data frame by a remote frame, leads to setting both irr2 and irr1. in the overrun mode (nmc = '0'), only the first ma ilbox will cause the flags to be asserted. so, if a data frame is initially received, then rxpr and irr1 are both asserted. if a remote frame is then received before the data frame has been read , then rfpr and irr2 ar e not set. in this case umsr of the corresponding mailbox will still be set.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 863 of 1164 rej09b0321-0200 19.6.5 reconfiguration of mailbox when re-configuration of mailboxes is required, the following procedures should be taken. (1) change configuration of transmit box two cases are possible. ? change of id, rtr, ide, lafm , data, dlc, nmc, atx, dart this change is possible only when mbc = b'000. confirm that the corresponding txpr is not set. the configuration (except mbc bit) can be changed at any time. ? change from transmit to r eceive configuration (mbc) confirm that the corresponding txpr is not set. the configuration can be changed only in halt or reset state. please note that it might take longer for rcan-et to tran sit to halt state if it is receiving or transmitting a message (as the tr ansition to the halt state is delayed until the end of the reception/tr ansmission), and also rcan-et will not be able to receive/transmit messages during the halt state. in case rcan-et is in the bus off state the transition to halt state depends on the configuration of the bit 6 of mcr and also bit and 14 of mcr. (2) change configuration (id, rtr, ide, lafm, data, dlc, nmc, atx, dart) of receive box or change receive box to transmit box the configuration can be changed only in halt mode. rcan-et will not lose a message if the message is currently on the can bus and rcan-et is a receiver. rcan-et will be moving into halt mode after completing the current reception. please note that it might take longer if rcan-et is recei ving or transmitting a message (as the transition to the halt state is delayed until the end of the reception/transmission), an d also rcan-et will not be able to receive/transmit me ssages during the halt mode. in case rcan-et is in the bus off state the transition to halt mode depends on the configuration of the bit 6 and 14 of mcr.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 864 of 1164 rej09b0321-0200 method by halt mode rcan-et is in tx_rx mode rcan-et is in tx_rx mode set mcr[1] (halt mode) is rcan-et transmitter, receiver or bus off? generate interrupt (irr0) read irr0 & gsr4 as '1' rcan-et is in halt mode change id or mbc of mailbox clear mcr1 yes no the shadowed boxes need to be done by s/w (host processor) finish current session figure 19.12 change id of receive box or change receive bo x to transmit box
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 865 of 1164 rej09b0321-0200 19.7 interrupt sources table 19.10 lists the rcan-et interrupt sources. with the exception of the reset processing interrupt (irr0) by a power-on reset, these sources can be masked. masking is implemented using the mailbox interrupt mask register 0 (mbimr0) and interrupt mask register (imr). for details on the interrupt vector of each in terrupt source, see section 6, interrupt controller (intc). table 19.10 rcan-et interrupt sources channel interrupt description interrupt flag dtc activation error passive mode (tec 128 or rec 128) irr5 bus off (tec 256)/bus off recovery irr6 error warning (tec 96) irr3 ers_0 error warning (rec 96) irr4 message error detection irr13 * 1 reset/halt/can sleep transition irr0 overload frame transmission irr7 unread message overwrite (overrun) irr9 ovr_0 detection of can bus operation in can sleep mode irr12 sle_0 message transmission/transmission disabled (slot empty) irr8 rm1_0 * 2 not possible 0 rm0_0 * 2 data frame reception/ remote frame reception irr1 * 3 irr2 * 3 possible
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 866 of 1164 rej09b0321-0200 channel interrupt description interrupt flag dtc activation error passive mode (tec 128 or rec 128) irr5 bus off (tec 256)/bus off recovery irr6 error warning (tec 96) irr3 ers_1 error warning (rec 96) irr4 message error detection irr13 * 1 reset/halt/can sleep transition irr0 overload frame transmission irr7 unread message overwrite (overrun) irr9 ovr_1 detection of can bus operation in can sleep mode irr12 sle_1 message transmission/transmission disabled (slot empty) irr8 rm1_1 * 2 not possible 1 rm0_1 * 2 data frame reception/ remote frame reception irr1 * 3 irr2 * 3 possible notes: 1. available only in test mode. 2. rm0 is an interrupt generated by the remote request pending flag for mailbox 0 (rfpr0[0]) or the data frame receive flag for mailbox 0 (rxpr0[0]). rm1 is an interrupt generated by the remote request pending flag for mailbox n (rfpr0[n]) or the data frame receive flag for mailbox n (rxpr0[n]) (n = 1 to 15). 3. irr1 is a data frame received interrupt flag for mailboxes 0 to 15, and irr2 is a remote frame request interrupt flag for mailboxes 0 to 15.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 867 of 1164 rej09b0321-0200 19.8 can bus interface a bus transceiver ic is necessary to connect this lsi to a can bus. a renesas ha13721 transceiver ic and its compatible products are recommended. as the crx and ctx pins use 3 v, an external level shifter is necessary. figure 19.13 shows a sample connection diagram. ctx note: nc: no connection crx can bus 120 ? 120 ? vcc ha13721 mode 3 v 5 v level shifter rxd txd nc canh vcc canl gnd this lsi figure 19.13 high-speed interface using ha13721
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 868 of 1164 rej09b0321-0200 19.9 usage notes 19.9.1 module standby mode the standby control register 2 (stbcr2) controls th e supply of clocks to rcan-et. as an initial value, the clock to rcan-et is halted. registers should be accessed after the module stop mode is released. 19.9.2 reset two types of resets are supported for rcan-et. ? hardware reset rcan-et is initialized by a power-on reset, deep standby mode, or software standby mode. ? software reset the mcr0 bit in the master control register (mcr) initializes registers other than mcr and can communication functions. as the irr0 bit in the interrupt request register (irr) is initialized and set to 1 at a reset, it should be cleared to 0 in the configuration mode shown in the reset sequence diagram. the area except for the message control field 1 (control1) of mailbox is consisted of ram, and not initialized at a reset. after a power-on reset, all the mailboxes should be initialized in the configuration mode shown in the reset sequence diagram. 19.9.3 can sleep mode the supply of main clocks in the modules is stopped in can sleep mode. therefore, registers other than mcr, gsr, irr, and imr sh ould not be accessed in can sleep mode. 19.9.4 register access when the can bus receive frame is being stor ed in the mailbox with the can communication functions of rcan-et, accessing th e mailbox area generates 0 to 5 peripheral bus cycles as a wait.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 869 of 1164 rej09b0321-0200 19.9.5 interrupts as shown in table 19.2, the mailbox 0 receive in terrupt enables the dmac activation. when an interrupt is specified as to be activated by th e mailbox 0 receive interr upt and cleared by the interrupt source at the dma transfer, up to the message control field 1 (control1) of mailbox 0 should be read using the block transfer mode.
section 19 controller area network (rcan-et) rev. 2.00 sep. 07, 2007 page 870 of 1164 rej09b0321-0200
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 871 of 1164 rej09b0321-0200 section 20 a/d converter (adc) this lsi includes a 10-bit successive-approximation a/d converter allowing selection of up to eight analog input channels. 20.1 features ? resolution: 10 bits ? input channels: 8 ? minimum conversion time: 3.9 s per channel ? operating modes: 3 ? single mode: a/d conversion on one channel ? multi mode: a/d conversion on one to four channels or on one to eight channels ? scan mode: continuous a/d conversion on one to four channels or on one to eight channels ? data registers: 8 conversion results are held in a 16- bit data register for each channel ? sample-and-hold function ? a/d conversion start methods: 4 ? software ? conversion start trigger from multi- function timer pulse unit 2 (mtu2) ? conversion start trigger from the 8-bit timer (tmr) ? external trigger signal ? interrupt source an a/d conversion end interrupt (adi) request can be generated on completion of a/d conversion. ? module standby mode can be set
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 872 of 1164 rej09b0321-0200 figure 20.1 shows a block diagram of the a/d converter. an4 an5 an6 an7 an0 an1 an2 an3 av ref addre addrf addrg addrh bus interface module data bus + ? adi interrupt signal adtrg , conversion start trigger from mtu2 or tmr av ss adcsr av cc addra addrb addrc addrd multiplexer control circuit comparator sample-and-hold circuit 10-bit d/a successive- approximation register peripheral bus adcsr: addra: addrb: addrc: addrd: [legend] a/d control/status register a/d data register a a/d data register b a/d data register c a/d data register d addre: addrf: addrg: addrh: a/d data register e a/d data register f a/d data register g a/d data register h figure 20.1 block di agram of a/d converter
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 873 of 1164 rej09b0321-0200 20.2 input/output pins table 20.1 summarizes the a/d converter's input pins. table 20.1 pin configuration pin name symbol i/o function analog power supply pin avcc input analog power supply pin analog ground pin avss input analog ground pin and a/d conversion reference ground reference power supply pin avref input a/d converter reference voltage pin analog input pin 0 an0 input analog input pin 1 an1 input analog input pin 2 an2 input analog input pin 3 an3 input analog input pin 4 an4 input analog input pin 5 an5 input analog input pin 6 an6 input analog input pin 7 an7 input analog input a/d external trigger input pin adtrg input external trigger input to start a/d conversion
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 874 of 1164 rej09b0321-0200 20.3 register configuration the a/d converter has the following registers. table 20.2 register configuration register name abbreviation r/w initial value address access size a/d data register a addra r h'0000 h'fffe5800 16 a/d data register b addrb r h'0000 h'fffe5802 16 a/d data register c addrc r h'0000 h'fffe5804 16 a/d data register d addrd r h'0000 h'fffe5806 16 a/d data register e addre r h'0000 h'fffe5808 16 a/d data register f a ddrf r h'0000 h'fffe580a 16 a/d data register g a ddrg r h'0000 h'fffe580c 16 a/d data register h addrh r h'0000 h'fffe580e 16 a/d control/status register adcsr r/w h'0040 h'fffe5820 16 20.3.1 a/d data registers a to h (addra to addrh) the sixteen a/d data registers, addra to addrh, are 16-bit read-only registers that store the results of a/d conversion. an a/d conversion produces 10-bit data, which is transferred for storage into the addr corresponding to the se lected channel. the 10 bits of the result are stored in the upper bits (bits 15 to 6) of addr. bits 5 to 0 of addr are reserved bits that are always read as 0. access to addr in 8-bit units is prohibited. addr must always be accessed in 16-bit units. addr is initialized to h'0000 by a power-on reset as well as in deep standby mode, software standby mode or module standby mode.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 875 of 1164 rej09b0321-0200 table 20.3 indicates the pairings of analog input channels and addr. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0000000000000000 rrrr bit: initial value: r/w: ?????? rrrrrrrrrrrr bit bit name initial value r/w description 15 to 6 all 0 r bit data (10 bits) 5 to 0 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. table 20.3 analog input channels and addr analog input channel a/d data register where conversion result is stored an0 addra an1 addrb an2 addrc an3 addrd an4 addre an5 addrf an6 addrg an7 addrh
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 876 of 1164 rej09b0321-0200 20.3.2 a/d control/status register (adcsr) adcsr is a 16-bit readable/writable register that selects the mode, controls the a/d converter, and enables or disables starting of a/d conversion by external trigger input. adcsr is initialized to h'0040 by a power-on reset as well as in deep standby mode, software standby mode or module standby mode. 151413121110987654321 0 0000000001000000 r/(w) * r/w r/w r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: note: only 0 can be written to clear the flag after 1 is read. * adf adie adst ? trgs[3:0] cks[1:0] mds[2:0] ch[2:0] bit bit name initial value r/w description 15 adf 0 r/(w) * 1 a/d end flag status flag indicating the end of a/d conversion. [clearing conditions] ? cleared by reading adf while adf = 1, then writing 0 to adf ? cleared when dmac is activated by adi interrupt and addr is read [setting conditions] ? a/d conversion ends in single mode ? a/d conversion ends for the selected channels in multi mode ? a/d conversion ends for the selected channels in scan mode 14 adie 0 r/w a/d interrupt enable enables or disables the interrupt (adi) requested at the end of a/d conversion. set the adie bit while a/d conversion is not being made. 0: a/d end interrupt request (adi) is disabled 1: a/d end interrupt request (adi) is enabled
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 877 of 1164 rej09b0321-0200 bit bit name initial value r/w description 13 adst 0 r/w a/d start starts or stops a/d conversion. this bit remains set to 1 during a/d conversion. 0: a/d conversion is stopped 1: single mode: a/d conversion starts. this bit is automatically cleared to 0 when a/d conversion ends on the selected channel. multi mode: a/d conversion starts. this bit is automatically cleared to 0 when a/d conversion is completed cycling through the selected channels. scan mode: a/d conversion starts. a/d conversion is continuously performed until this bit is cleared to 0 by software, by a power-on reset as well as by a transition to deep standby mode, software standby mode or module standby mode. 12 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 878 of 1164 rej09b0321-0200 bit bit name initial value r/w description 11 to 8 trgs[3:0] 0000 r/w timer trigger select these bits enable or disable starting of a/d conversion by a trigger signal. 0000: start of a/d conversion by external trigger input is disabled 0001: a/d conversion is star ted by conversion trigger trgan from mtu2 0010: a/d conversion is star ted by conversion trigger trg0n from mtu2 0011: a/d conversion is star ted by conversion trigger trg4an from mtu2 0100: a/d conversion is star ted by conversion trigger trg4bn from mtu2 0101: setting prohibited 0110: setting prohibited 0111: setting prohibited 1000: setting prohibited 1001: a/d conversion is started by adtrg 1010: a/d conversion is star ted by conversion trigger from the tmr 1011 to 1111: setting prohibited 7, 6 cks[1:0] 01 r/w clock select these bits select the a/d conversion time. * 2 set the a/d conversion time while a/d conversion is halted (adst = 0). 00: conversion time = 138 states (maximum) 01: conversion time = 274 states (maximum) 10: conversion time = 546 states (maximum) 11: setting prohibited
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 879 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 to 3 mds[2:0] 000 r/w multi-scan mode these bits select the operating mode for a/d conversion. 0xx: single mode 100: multi mode: a/d conversion on 1 to 4 channels 101: multi mode: a/d conversion on 1 to 8 channels 110: scan mode: a/d conversion on 1 to 4 channels 111: scan mode: a/d conversion on 1 to 8 channels channel select these bits and the mds bits in adcsr select the analog input channels. mds2 = 0 mds2 = 1, mds0 = 0 mds2 = 1, mds0 = 1 000: an0 000: an0 000: an0 001: an1 001: an0, an1 001: an0, an1 010: an2 010: an0 to an2 010: an0 to an2 011: an3 011: an0 to an3 011: an0 to an3 100: an4 100: an4 100: an0 to an4 101: an5 101: an4, an5 101: an0 to an5 110: an6 110: an4 to an6 110: an0 to an6 111: an7 111: an4 to an7 111: an0 to an7 2 to 0 ch[2:0] 000 r/w note: these bits must be set so that adcsr_0 and adcsr_1 do not have the same analog inputs. [legend] x: don't care notes: 1. only 0 can be written to clear the flag after 1 is read. 2. to satisfy the absolute accuracy of the a/d converter characteristics, set a value greater than the minimum conversion time.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 880 of 1164 rej09b0321-0200 20.4 operation the a/d converter uses the successi ve-approximatio n method, and the resoluti on is 10 bits. it has three operating modes: single mode, multi mode, and scan mode. switching the operating mode or analog input channels must be done while the adst bit in adcsr is 0 to prevent incorrect operation. the adst bit can be set at the same time as the operating mode or analog input channels are changed. 20.4.1 single mode single mode should be selected when only a/d conversion on one channel is required. in single mode, a/d conversion is performed once for the specified one anal og input channel, as follows: 1. a/d conversion for the selected channel starts when the adst bit in adcsr is set to 1 by software, mtu2, tmr, or external trigger input. 2. when a/d conversion is completed, the a/d co nversion result is transferred to the a/d data register corresponding to the channel. 3. after a/d conversion has completed, the adf bit in adcsr is set to 1. if the adie bit is set to 1 at this time, an adi in terrupt request is generated. 4. the adst bit that remains 1 during a/d conve rsion is automatically cleared to 0 when a/d conversion is completed, and the a/d converter becomes idle. when the operating mode or analog input channel selection must be changed during a/d conversion, to prevent incorrect operation, first cl ear the adst bit to 0 to halt a/d conversion. after making the necessary changes, set the adst bit to 1 to start a/d conversion again. the adst bit can be set at the same time as the mode or channel selection is switched.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 881 of 1164 rej09b0321-0200 typical operations when a single channel (an1) is selected in single mode are described next. figure 20.2 shows a timing diagram for this example (the bits which are set in this example belong to adcsr). 1. single mode is selected, input channel an1 is selected (ch2 = 0, ch1 = 0, ch0 = 1), the a/d interrupt is enabled (adie = 1), and a/d conversion is started (adst = 1). 2. when a/d conversion is completed, the a/d conversion result is transferred into addrb. at the same time the adf flag is set to 1, the ad st bit is cleared to 0, and the a/d converter becomes idle. 3. since adf = 1 and adie = 1, an adi interrupt is requested. 4. the a/d interrupt handling routine starts. 5. the routine reads adf = 1, and then writes 0 to the adf flag. 6. the routine reads and processes the a/d conversion result (addrb). 7. execution of the a/d interrupts handling routine ends. then, when the adst bit is set to 1, a/d conversion starts and steps 2. to 7. are executed.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 882 of 1164 rej09b0321-0200 adie adst adf addra addrb addrc addrd channel 0 (an0) operating channel 1 (an1) operating channel 2 (an2) operating channel 3 (an3) operating waiting waiting clear * a/d conversion result 1 a/d conversion result 2 note: * vertical arrows ( ) indicate instruction execution by software. read conversion result read conversion result waiting waiting set * set * set * clear * conversion time 1 conversion time 2 waiting waiting a/d conversion starts figure 20.2 example of a/d converter operation (single mode, one channel (an1) selected)
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 883 of 1164 rej09b0321-0200 20.4.2 multi mode multi mode should be selected when performing a/d conversion once on one or more channels. in multi mode, a/d conversion is performed once for a maximum of eight specified analog input channels, as follows: 1. a/d conversion starts from th e analog input channel with the lowest number (e.g. an0, an1, ?, an3) when the adst bit in adcsr is set to 1 by software, mtu2, tmr, or external trigger input. 2. when a/d conversion is completed on each ch annel, the a/d conversion result is sequentially transferred to the a/d data register corresponding to that channel. 3. after a/d conversion on all selected channels has completed, the adf bit in adcsr is set to 1. if the adie bit is set to 1 at this time, an adi interrupt request is generated. 4. the adst bit that remains 1 during a/d conve rsion is automatically cleared to 0 when a/d conversion is completed, and the a/d converter becomes idle. if the adst bit is cleared to 0 during a/d conversion, a/d conversion is ha lted and the a/d converter becomes idle. the adf bit is cleared by read ing adf while adf = 1, then writing 0 to the adf bit. a/d conversion is to be performed once on all the specified channels. the conversion results are transferred for storage into the a/d data registers corresponding to the channels. when the operating mode or analog input channel selection must be changed during a/d conversion, to prevent incorrect operation, first cl ear the adst bit to 0 to halt a/d conversion. after making the necessary changes, set the adst bit to 1. a/d conversion will start again from the first channel in the group. the adst bit can be set at the same time as the mode or channel selection is changed. typical operations when three ch annels (an0 to an2) are selected in multi mode are described next. figure 20.3 shows a timing diagram for this example. 1. multi mode is selected (mds2 = 1, mds1 = 0), analog input channels an0 to an2 are selected (ch2 = 0, ch1 = 1, ch0 = 0), and a/d conversion is started (adst = 1). 2. a/d conversion of the first channel (an0) starts. when a/d conversion is completed, the a/d conversion result is transferred into addra. 3. next, the second channel (an1) is select ed automatically and a/d conversion starts. 4. conversion proceeds in the same way through the third channel (an2). 5. when conversion of all selected channels (an0 to an2) is completed, the adf flag is set to 1 and the adst bit cleared to 0. if the adie bit is set to 1 at this time, an adi interrupt is requested.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 884 of 1164 rej09b0321-0200 if the adie bit is set to 1 at this time, an adi interrupt is requested. adst adf waiting waiting waiting waiting waiting addra addrb addrc addrd waiting waiting channel 0 (an0) operating channel 1 (an1) operating channel 2 (an2) operating channel 3 (an3) operating set * clear * a/d conversion result 2 a/d conversion result 3 conversion time 1 a/d conversion result 1 a/d conversion note: * vertical arrows ( ) indicate instruction execution by software. conversion time 2 conversion time 3 clear * figure 20.3 example of a/d converter operation (multi mode, three channels (an0 to an2) selected)
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 885 of 1164 rej09b0321-0200 20.4.3 scan mode scan mode is useful for monitoring analog inputs in a group of one or more channels at all times. in scan mode, a/d conversion is performed sequen tially for a maximum of eight specified analog input channels, as follows: 1. a/d conversion for the selected channels starts from the analog input channel with the lowest number (e.g. an0, an1, ?, an3) when the adst bit in adcsr is set to 1 by software, mtu2, tmr, or external trigger input. 2. when a/d conversion is completed on each chan nel, the a/d conversion result is sequentially transferred to the a/d data register corresponding to that channel. 3. after a/d conversion on all selected channels has completed, the adf bit in adcsr is set to 1. if the adie bit is set to 1 at this time, an adi interrupt request is generated. the a/d converter starts a/d conversion again fr om the channel with the lowest number. 4. the adst bit is not cleared au tomatically, so steps 2. and 3. ar e repeated as long as the adst bit remains set to 1. when the adst bit is cleared to 0, a/d conversion halts and the a/d converter becomes idle. the adf bit is cleared by reading adf while adf = 1, then writing 0 to the adf bit. when the operating mode or analog input channel selection must be changed during a/d conversion, to prevent incorrect operation, first cl ear the adst bit to 0 to halt a/d conversion. after making the necessary changes, set the adst bit to 1. a/d conversion will start again from the first channel in the group. the adst bit can be set at the same time as the mode or channel selection is changed. typical operations when three cha nnels (an0 to an2) are selected in scan mode are described as follows. figure 20.4 shows a timing diagram for this example. 1. scan mode is selected (mds2 = 1, mds1 = 1), analog input channels an0 to an2 are selected (ch2 = 0, ch1 = 1, ch0 = 0), and a/d conversion is started (adst = 1). 2. a/d conversion of the first channel (an0) star ts. when a/d conversion is completed, the a/d conversion result is transferred into addra. 3. next, the second channel (an1) is select ed automatically and a/d conversion starts. 4. conversion proceeds in the same way through the third channel (an2). 5. when conversion of all the selected channels (a n0 to an2) is completed, the adf flag is set to 1 and conversion of the first channel (an0) starts again. if the adie bit is set to 1 at this time, an adi interrupt is requested.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 886 of 1164 rej09b0321-0200 6. the adst bit is not cleared automatically, so st eps 2. to 4. are repeated as long as the adst bit remains set to 1. when steps 2. to 4. are repeated, the adf flag is kept to 1. when the adst bit is cleared to 0, a/d conversion stops . the adf bit is cleared by readin g adf while adf = 1, then writing 0 to the adf bit. if both the adf flag and adie bit are set to 1 while steps 2. to 4. are repeated, an adi interrupt is requested at all times. to generate an interrupt on completing conversion of the third channel, clear the adf bit to 0 after an interrupt is requested.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 887 of 1164 rej09b0321-0200 adst adf waiting waiting waiting waiting waiting addra addrb addrc addrd waiting waiting waiting * 2 channel 0 (an0) operating channel 1 (an1) operating channel 2 (an2) operating channel 3 (an3) operating waiting a/d conversion result 1 a/d conversion result 4 a/d conversion result 2 a/d conversion result 3 clear * 1 clear * 1 set * 1 continuous a/d conversion notes: 1. vertical arrows ( ) indicate instruction execution by software. 2. a/d conversion data is invalid/ conversion time 1 conversion time 2 conversion time 3 conversion time 4 conversion time 5 figure 20.4 example of a/d converter operation (scan mode, three channels (an0 to an2) selected)
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 888 of 1164 rej09b0321-0200 20.4.4 a/d converter activation by external trigger, mtu2, or tmr the a/d converter can be independently activated by an a/d conversion request from the external trigger, mtu2, or tmr. to activate the a/d conve rter by the external trigger, mtu2, or tmr, set the a/d trigger enable bits (trgs[3:0]). after this bit setting has been made, the adst bit is automatically set to 1 and a/d conversion is started when an a/d conversion request from the external trigger, mtu2, or tmr occurs. the channel combination is determined by the ch[2:0] bits in adcsr. the timing from setting of the adst bit until the start of a/d conversion is the same as when 1 is written to the adst bit by software. 20.4.5 input sampling and a/d conversion time the a/d converter has a built-in sample-and-hold circuit. the a/d converter samples the analog input at the a/d conversion start delay time (t d ) after the adst bit in adcsr is set to 1, then starts conversion. figure 20.5 shows the a/d conversion timing. table 20.4 indicates the a/d conversion time. as indicated in figure 20.5, the a/d conversion time (t conv ) includes t d and the input sampling time(t spl ). the length of t d varies depending on the timing of the write access to adcsr. the total conversion time therefore varies within the ranges indicated in table 20.4. in multi mode and scan mode, the values given in table 20.4 apply to the first conversion. in the second and subsequent conversions, time is the values given in table 20.5.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 889 of 1164 rej09b0321-0200 (1) (2) p adif t d t spl t conv write signal input sampling timing (1): (2): t d : t spl : t conv : [legend] address adcsr write cycle adcsr address a/d conversion start delay time input sampling time a/d conversion time figure 20.5 a/d conversion timing table 20.4 a/d conversio n time (single mode) cks1 = 0 cks1 = 1 cks0 = 0 cks0 = 1 cks0 = 0 item symbol min. typ. max. min. typ. max. min. typ. max. a/d conversion start delay time t d 11 ? 14 19 ? 26 35 ? 50 input sampling time t spl ? 33 ? ? 65 ? ? 129 ? a/d conversion time t conv 135 ? 138 267 ? 274 531 ? 546 note: values in the table are the numbers of states.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 890 of 1164 rej09b0321-0200 table 20.5 a/d conversion time (multi mode and scan mode) cks1 cks0 conversion time (states) 0 128 (constant) 0 1 256 (constant) 1 0 512 (constant) note: values in the table are the numbers of states. 20.4.6 external tr igger input timing a/d conversion can also be externally triggered. when the trgs[3:0] bits in adcsr are set to b'1001, an external trigger is input to the adtrg pin. the adst bit in adcsr is set to 1 at the falling edge of the adtrg pin, thus starting a/d conversion. other operations, regardless of the operating mode, are the same as when the adst bit has been set to 1 by software. figure 20.6 shows the timing. p adst a/d conversion adtrg internal trigger signal figure 20.6 external trigger input timing
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 891 of 1164 rej09b0321-0200 20.5 interrupt sources and dmac transfer request the a/d converter generates an a/d conversion end interrupt (adi) at the end of a/d conversion. an adi interrupt request is generated if the adie bit is set to 1 when the adf bit in adcsr is set to 1 on completion of a/d conversion. note that the direct memory access controller (dmac) can be activated by an adi interrupt depending on the dmac setting. in this case, an interrupt is not issued to the cpu. if the setting to activate the dmac has not been made, an interrupt request is sent to the cpu. having the converted data read by the dmac in response to an adi interrupt enables continuous conversion to be achieved without imposing a load on software. in single mode, set the dmac so that dma transfer initiated by an adi interrupt is performed only once. in the case of a/d conversion on multiple channels in scan mode or multi mode, setting the dma transfer count to one causes dma transfer to finish after transferring only one channel of data. to make the dmac transfer all conv ersion data, set the add r where a/d conversion data is stored as the transfer so urce address, and the nu mber of converted chan nels as the transfer count. when the dmac is activated by adi, the adf bit in adcsr is automatica lly cleared to 0 when data is transferred by the dmac. table 20.6 relationship between interr upt sources and dmac transfer request name interrupt source inte rrupt flag dmac activation adi a/d conversion end adf in adcsr possible 20.6 definitions of a/d conversion accuracy the a/d converter compares an analog value input from an analog input channel with its analog reference value and converts it to 10-bit digital data. the absolute accuracy of this a/d conversion is the deviation between the input analog value and the output digital value. it includes the following errors: ? offset error ? full-scale error ? quantization error ? nonlinearity error
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 892 of 1164 rej09b0321-0200 these four error quantities are explained below with reference to figure 20.7. in the figure, the 10 bits of the a/d converter have been simplified to 3 bits. offset error is the deviation between actual and ideal a/d conversion characteristics when the digital output value changes from the minimum (zero voltage) b'0000000000 (000 in the figure) to b'000000001 (001 in the figure) (figure 20.7, item (1)). full-scale error is the deviation between actual and ideal a/d conversion characteristics when the digital output value change s from b'1111111110 (110 in the figure) to the maximum b'1111111111 (111 in the figure) (figure 20.7, item (2)). quantization error is the intrinsic error of the a/d converter and is ex pressed as 1/2 lsb (figure 20.7, item (3)). nonlinearity error is the deviation between ac tual and ideal a/d conversion characteristics between zero voltage and full-scale voltage (figure 20.7, item (4)). note that it does not include offset, full-scale, or quantization error. 0fs 111 110 101 100 011 010 001 000 analog input voltage (3) quantization error (4) nonlinearity error (2) full-scale error ideal a/d conversion characteristic digital output [legend] fs: full-scale voltage fs analog input voltage actual a/d convertion characteristic (1) offset error ideal a/d conversion characteristic digital output 1024 1 1024 2 1024 1022 1024 1023 figure 20.7 definitions of a/d conversion accuracy
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 893 of 1164 rej09b0321-0200 20.7 usage notes when using the a/d converter, note the following points. 20.7.1 module standby mode setting operation of the a/d converter can be disabled or enabled using the standby control register. the initial setting is for operation of the a/d converter to be halted. register access is enabled by clearing module standby mode. for details , see section 25, power-down modes. 20.7.2 setting analog input voltage permanent damage to the lsi may result if the following voltage ranges are exceeded. 1. analog input range during a/d conversion, voltages on the analog input pins ann should not go beyond the following range: avss ann avcc (n = 0 to 7). 2. avcc and avss input voltages input voltages avcc and avss should be pvcc ? 0.3 v avcc pvcc and avss = pvss. do not leave the avcc and avss pins open when the a/d converter or d/a converter is not in use and in software standby mode. when not in use, connect avcc to the po wer supply (pvcc) and avss to the ground (pvss). 3. setting range of avref input voltage set the reference voltage range of the avref pin as 3.0 v avref avcc. 20.7.3 notes on board design in board design, digital circuitry and analog circuitry should be as mutually isolated as possible, and layout in which digital circuit signal lines and analog circuit signal lines cross or are in close proximity should be avoided as far as possible. failure to do so may result in incorrect operation of the analog circuitry due to inductance, adversely affecting a/d conversion values. digital circuitry must be isolated from the analog input signals (an0 to an7), analog reference voltage (avref), and analog power supply (avcc) by the analog ground (avss). also, the analog ground (avss) should be connected at one point to a stable digital ground (pvss) on the board.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 894 of 1164 rej09b0321-0200 20.7.4 processing of analog input pins to prevent damage from voltage surges at the analog input pins (an0 to an7), connect an input protection circuit like the one shown in figure 20.8. the circuit shown also includes a cr filter to suppress noise. this circuit is shown as an example; the circuit constants should be selected according to actual ap plication conditions. figure 20.9 shows an equivalent circuit diagram of the analog input ports and table 20.7 lists the analog input pin specifications. this lsi avref avcc an0 to an7 avss * 1 * 1 * 2 r in 100 ? 0.1 f notes: values are reference values. 2. r in : input impedance 0.01 f 10 f 1. figure 20.8 example of analog input protection circuit
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 895 of 1164 rej09b0321-0200 an0 to an7 3 k ? 20 pf to a/d converter note: values are reference values. figure 20.9 analog input pin equivalent circuit table 20.7 analog input pin ratings item min. max. unit analog input capacitance ? 20 pf allowable signal-source impedance ? 5 k ? 20.7.5 permissible si gnal source impedance this lsi's analog input is designed such that conversion precision is guaranteed for an input signal for which the signal source impedance is 5 k ? or less. this specification is provided to enable the a/d converter's sample-and-hold circuit input capacitance to be charged within the sampling time; if the sensor output impedance exceeds 5 k ? , charging may be insufficient and it may not be possible to guarantee a/d conversi on precision. however, for a/d conversion in single mode with a large capacitance provided externally for a/d conversion in single mode, the input load will essentially comprise only the internal input resistance of 3 k ? , and the signal source impedance is ignored. however, as a low-pass filter effect is obtained in this case, it may not be possible to follow an analog signal with a large differential coeffici ent (e.g., 5 mv/ s or greater) (see figure 20.10). when converting a high-speed analog signal, a low-impedance buffer should be inserted.
section 20 a/d converter (adc) rev. 2.00 sep. 07, 2007 page 896 of 1164 rej09b0321-0200 sensor input this lsi sensor output impedance low-pass filter c to 0.1 f up to 5 k ? cin = 15 pf 20 pf 3 k ? note: values are reference values. a/d converter equivalent circuit figure 20.10 example of analog input circuit 20.7.6 influences on absolute precision adding capacitance results in coupling with gnd, and therefor e noise in gnd may adversely affect absolute precision. be sure to connect avss, etc. to an electrically stable gnd. care is also required to insure that filter circu its do not communicate with digital signals on the mounting board (i.e., acting as antennas). 20.7.7 usage note when shifting to single mode during a/d conversion during the a/d conversion in scan mode or multi mode, if the a/d conversion is stopped by clearing the a/d start bit (adst) in adcsr to 0 and restarted after a transition to single mode, make sure to set asdt to 1 after the time requi red for one-channel a/d co nversion has elapsed.
section 21 d/a converter (dac) rev. 2.00 sep. 07, 2007 page 897 of 1164 rej09b0321-0200 section 21 d/a converter (dac) 21.1 features ? resolution: 8 bits ? input channels: 2 ? minimum conversion time: max.10 s (with 20 pf load) ? output voltage: 0 v to avref ? d/a output hold function in software standby modes ? module standby mode can be set dadr0 av cc avref da0 da1 dadr1 dacr avss module data bus peripheral bus 8-bit d/a control circuit bus interface [legend] dadr0: d/a data register 0 dadr1: d/a data register 1 dacr: d/a control register figure 21.1 block di agram of d/a converter
section 21 d/a converter (dac) rev. 2.00 sep. 07, 2007 page 898 of 1164 rej09b0321-0200 21.2 input/output pins table 21.1 shows the pin configuration of the d/a converter. table 21.1 pin configuration pin name symbol i/o function analog power supply pin avcc input analog block power supply analog ground pin avss input analog block ground reference voltage pin avref input d/a conversion reference voltage analog output pin 0 da0 output channel 0 analog output analog output pin 1 da1 output channel 1 analog output 21.3 register descriptions the d/a converter has the following registers. table 21.2 register configuration register name abbreviation r/w initial value address access size d/a data register 0 dadr0 r/w h'00 h'fffe6800 8, 16 d/a data register 1 dadr1 r/w h'00 h'fffe6801 8, 16 d/a control register da cr r/w h'1f h'fffe6802 8, 16
section 21 d/a converter (dac) rev. 2.00 sep. 07, 2007 page 899 of 1164 rej09b0321-0200 21.3.1 d/a data registers 0 and 1 (dadr0 and dadr1) dadr is an 8-bit readable/writable register that stores data to which d/a conversion is to be performed. whenever analog output is enabled, the values in dadr are converted and output to the analog output pins. dadr is initialized to h'00 by a power-on rese t in deep standby mode or module standby mode. 7654321 0 00000000 r/w r/w r/w r/w r/w r/w r/w r/w bit: initial value: r/w: 21.3.2 d/a control register (dacr) dacr is an 8-bit readable/writable register that controls the operatio n of the d/a converter. dacr is initialized to h'1f by a power-on rese t in deep standby mode or module standby mode. 7654321 0 00011111 r/wr/wr/w????? bit: initial value: r/w: daoe1 daoe0 dae ????? bit bit name initial value r/w description 7 daoe1 0 r/w d/a output enable 1 controls d/a conversion and analog output for channel 1. 0: analog output of channel 1 (da1) is disabled 1: d/a conversion of channel 1 is enabled. analog output of channel 1 (da1) is enabled. 6 daoe0 0 r/w d/a output enable 0 controls d/a conversion and analog output for channel 0. 0: analog output of channel 0 (da0) is disabled 1: d/a conversion of channel 0 is enabled. analog output of channel 0 (da0) is enabled.
section 21 d/a converter (dac) rev. 2.00 sep. 07, 2007 page 900 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 dae 0 r/w d/a enable used together with the daoe0 and daoe1 bits to control d/a conversion. output of conversion results is always controlled by the daoe0 and daoe1 bits. for details, see table 21.3. 0: d/a conversion for channels 0 and 1 is controlled independently 1: d/a conversion for channels 0 and 1 is controlled together 4 to 0 ? all 1 ? reserved these bits are always read as 1 and cannot be modified. table 21.3 control of d/a conversion bit 5 bit 7 bit 6 dae daoe1 daoe0 description 0 d/a conversion is disabled. 0 1 d/a conversion of channel 0 is enabled and d/a conversion of channel 1 is disabled. 0 d/a conversion of channel 1 is enabled and d/a conversion of channel 0 is disabled. 0 1 1 d/a conversion of channels 0 and 1 is enabled. 0 d/a conversion is disabled. 0 1 0 1 1 1 d/a conversion of channels 0 and 1 is enabled.
section 21 d/a converter (dac) rev. 2.00 sep. 07, 2007 page 901 of 1164 rej09b0321-0200 21.4 operation the d/a converter includes d/a conversion circuits for two channels, each of which can operate independently. when the daoe bit in dacr is set to 1, d/a conversion is enabled and the conversion result is output. an operation example of d/a conversion on channel 0 is shown below. figure 21.2 shows the timing of this operation. 1. write the conversion data to dadr0. 2. set the daoe0 bit in dacr to 1 to start d/a co nversion. the conversion result is output from the analog output pin da0 after the conversion time t dconv has elapsed. the conversion result continues to be output until dadr0 is written to again or the daoe0 bit is cleared to 0. the output value is expressed by the following formula: contents of dadr 256 avref 3. if dadr0 is written to again, the conversion is immediately started. the conversion result is output after the conversion time t dconv has elapsed. 4. if the daoe0 bit is cleared to 0, analog output is disabled. dadr0 daoe0 da0 t dconv t dconv conversion data 1 conversion result 1 high-impedance state dadr0 write cycle address dacr write cycle conversion data 2 conversion result 2 [legend] t dconv : d/a conversion time dadr0 write cycle dacr write cycle figure 21.2 example of d/a converter operation
section 21 d/a converter (dac) rev. 2.00 sep. 07, 2007 page 902 of 1164 rej09b0321-0200 21.5 usage notes 21.5.1 module standby mode setting operation of the d/a converter can be disabled or enabled using the standby control register. the initial setting is for operation of the d/a converter to be halted. register access is enabled by canceling module standby mode. for detail s, see section 25, power-down modes. 21.5.2 d/a output hold function in software standby mode when this lsi enters software standby mode wi th d/a conversion enable d, the d/a outputs are retained, and the analog power supply current is equal to as during d/a conversion. if the analog power supply current needs to be reduced in software standby mode, clear the daoe0, daoe1, and dae bits to 0 to disable the d/a outputs. 21.5.3 d/a conversion and d/a output in deep standby mode when this lsi enters deep standby mode with d/a conversion enabled, the d/a conversion is stopped and thus the d/a outputs are also stopped. before entering deep standby mode, clear the daoe0, daoe1, and dae bits to 0 to disable the d/a outputs. 21.5.4 setting analog input voltage the reliability of this lsi may be adversely affect ed if the following volt age ranges are exceeded. 1. avcc and avss input voltages input voltages avcc and avss should be pvcc ? 0.3 v avcc pvcc and avss = pvss. do not leave the avcc and avss pins open when the a/d converter or d/a converter is not in use and in software standby mode. when not in use, connect avcc to the po wer supply (pvcc) and avss to the ground (pvss). 2. setting range of avref input voltage set the reference voltage range of the avref pin as 3.0 v avref avcc.
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 903 of 1164 rej09b0321-0200 section 22 i/o ports this lsi has six ports: a to f. all port pins are multiplexed with other pin functions. the functions of the multiplexed pins are selected using the pin function controller (pfc). each port is provided with a data register for storing the pin data and a port read register for reading out the pin values. 22.1 port a port a is an i/o port with 32 pins shown in figure 22.1. port a pa31 ( i/o ) / crx1 (input) / dtend0 (output) pa30 ( i/o ) / ctx1 (output) / dact0 (output) pa29 ( i/o ) / crx0 (input) / dack0 (output) pa28 ( i/o ) / ctx0 (output) / dreq0 (input) pa27 ( i/o ) / a27 (output) / pint3 (input) / dtend3 (output) pa26 ( i/o ) / a26 (output) / pint2 (input) / dact3 (output) pa25 ( i/o ) / a25 (output) / pint1 (input) / dack3 (output) pa24 ( i/o ) / a24 (output) / pint0 (input) / dreq3 (input) pa23 ( i/o ) / a23 (output) pa22 ( i/o ) / a22 (output) pa21 ( i/o ) / a21 (output) pa20 ( i/o ) / a20 (output) pa19 ( i/o ) / a19 (output) pa18 ( i/o ) / a18 (output) pa17 ( i/o ) / a17 (output) pa16 ( i/o ) / a16 (output) pa15 ( i/o ) / a15 (output) pa14 ( i/o ) / a14 (output) pa13 ( i/o ) / a13 (output) pa12 ( i/o ) / a12 (output) pa11 ( i/o ) / a11 (output) pa10 ( i/o ) / a10 (output) pa9 ( i/o ) / a9 (output) pa8 ( i/o ) / a8 (output) pa7 ( i/o ) / a7 (output) pa6 ( i/o ) / a6 (output) pa5 ( i/o ) / a5 (output) pa4 ( i/o ) / a4 (output) pa3 ( i/o ) / a3 (output) pa2 ( i/o ) / a2 (output) pa1 ( i/o ) / a1 (output) pa0 ( i/o ) / a0 (output) figure 22.1 port a
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 904 of 1164 rej09b0321-0200 22.1.1 register configuration table 22.1 lists the port a registers. table 22.1 register configuration register name abbreviation r/w address access size port a data register h padrh r/w h'fffe3800 8, 16, 32 port a data register l padrl r/w h'fffe3802 8, 16 port a port register h paprh r h'fffe3804 8, 16, 32 port a port register l paprl r h'fffe3806 8, 16 22.1.2 port a data registers h and l (padrh and padrl) padrh and padrl are 16-bit readab le/writable registers that store port a data. bits pa31dr to pa0dr correspond to pins pa31 to pa0, respectively. if a pin is set to the general output function, the pin will output the value written to the corresponding bit in padrh or padrl, and the register value is read from padrh or padrl regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if padrh or padrl is read. also, if a value is written to padrh or padrl, although the value will actually be written, it will have no influence on the state of the pin. table 22.2 summarizes the padrh and padrl read/write operations. padrh and padrl are initialized to h'0000 by a power-on reset or in deep standby mode. these registers are not initialized either by a ma nual reset or by switching to sleep mode or software standby mode.
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 905 of 1164 rej09b0321-0200 ? port a data register h (padrh) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pa31 dr pa30 dr pa29 dr pa28 dr pa27 dr pa26 dr pa25 dr pa24 dr pa23 dr pa22 dr pa21 dr pa20 dr pa19 dr pa18 dr pa17 dr pa16 dr ? port a data register l (padrl) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pa15 dr pa14 dr pa13 dr pa12 dr pa11 dr pa10 dr pa 9 dr pa8 dr pa7 dr pa6 dr pa5 dr pa4 dr pa3 dr pa 2 dr pa1 dr pa0 dr table 22.2 port a data registers h and l (padrh and padrl) read/write operations paiorh, paiorl pin function read write 0 general input pin state the value is written to padrh and padrl but there is no effect on the pin state. other than general input pin state the value is written to padrh and padrl but there is no effect on the pin state. 1 general output value of padrh and padrl the value written is output from the pin. other than general output value of padrh and padrl the value is written to padrh and padrl but there is no effect on the pin state.
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 906 of 1164 rej09b0321-0200 22.1.3 port a port registers h and l (paprh and paprl) paprh and paprl are 16-bit read-only registers in which bits pa31pr to pa0pr correspond to pins pa31 to pa0. paprh and paprl are always read as the states of the pins regardless of the pfc setting. ? port a port register h (paprh) bit: initial value: r/w: 151413121110987654321 0 pa31 pa30 pa29 pa28 pa27 pa26 pa25 pa24 pa23 pa22 pa21 pa20 pa19 pa18 pa17 pa16 rrrrrrrrrrrrrrrr pa31 pr pa30 pr pa29 pr pa28 pr pa27 pr pa26 pr pa25 pr pa24 pr pa23 pr pa22 pr pa21 pr pa20 pr pa19 pr pa18 pr pa17 pr pa16 pr ? port a port register l (paprl) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: pa15 pa14 pa13 pa12 pa11 pa10 pa9 pa8 pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 rrrrrrrrrrrrrrrr pa15 pr pa14 pr pa13 pr pa12 pr pa11 pr pa10 pr pa 9 pr pa8 pr pa7 pr pa6 pr pa5 pr pa4 pr pa3 pr pa2 pr pa1 pr pa0 pr
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 907 of 1164 rej09b0321-0200 22.2 port b port b is an i/o port with 32 pins shown in figure 22.2. port b pb31 ( i/o ) / d31 (i/o) / pint7 (input) pb30 ( i/o ) / d30 (i/o) / pint6 (input) / tmci0 (input) / sck3 (i/o) pb29 ( i/o ) / d29 (i/o) / pint5 (input) / tmri0 (input) / rxd3 (input) pb28 ( i/o ) / d28 (i/o) / pint4 (input) / tmo0 (output) / txd3 (output) pb27 ( i/o ) / d27 (i/o) / pint3 (input) pb26 ( i/o ) / d26 (i/o) / pint2 (input) / tic5w (i/o) / sck6 (i/o) pb25 ( i/o ) / d25 (i/o) / pint1 (input) / tic5v (i/o) / rxd6 (input) pb24 ( i/o ) / d24 (i/o) / pint0 (input) / tic5u (i/o) / txd6 (output) pb23 ( i/o ) / d23 (i/o) / irq7 (input) / tioc4d (i/o) pb22 ( i/o ) / d22 (i/o) / irq6 (input) / tioc4c (i/o) / sck2 (i/o) pb21 ( i/o ) / d21 (i/o) / irq5 (input) / tioc4b (i/o) / rxd2 (input) pb20 ( i/o ) / d20 (i/o) / irq4 (input) / tioc4a (i/o) / txd2 (output) pb19 ( i/o ) / d19 (i/o) / irq3 (input) / tioc3d (i/o) pb18 ( i/o ) / d18 (i/o) / irq2 (input) / tioc3c (i/o) pb17 ( i/o ) / d17 (i/o) / irq1 (input) / tioc3b (i/o) pb16 ( i/o ) / d16 (i/o) / irq0 (input) / tioc3a (i/o) pb15 ( i/o ) / d15 (i/o) pb14 ( i/o ) / d14 (i/o) pb13 ( i/o ) / d13 (i/o) pb12 ( i/o ) / d12 (i/o) pb11 ( i/o ) / d11 (i/o) pb10 ( i/o ) / d10 (i/o) pb9 ( i/o ) / d9 (i/o) pb8 ( i/o ) / d8 (i/o) pb7 ( i/o ) / d7 (i/o) pb6 ( i/o ) / d6 (i/o) pb5 ( i/o ) / d5 (i/o) pb4 ( i/o ) / d4 (i/o) pb3 ( i/o ) / d3 (i/o) pb2 ( i/o ) / d2 (i/o) pb1 ( i/o ) / d1 (i/o) pb0 ( i/o ) / d0 (i/o) figure 22.2 port b
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 908 of 1164 rej09b0321-0200 22.2.1 register configuration table 22.3 lists the port b registers. table 22.3 register configuration register name abbreviation r/w address access size port b data register h pbdrh r/w h'fffe3808 8, 16, 32 port b data register l pbdrl r/w h'fffe380a 8, 16 port b port register h pbprh r h'fffe380c 8, 16, 32 port b port register l pbprl r h'fffe380e 8, 16 22.2.2 port b data registers h and l (pbdrh and pbdrl) pbdrh and pbdrl are 16-bit readable/writable regi sters that store port b data. bits pb31dr to pb0dr correspond to pins pb31 to pb0, respectively. if a pin is set to the general output function, the pin will output the value written to the corresponding bit in pbdrh or pbdrl, and the register value is read from pbdrh or pbdrl regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pbdrh or pbdrl is read. also, if a value is written to pbdrh or pbdrl, although the value will actually be written, it will have no influence on the state of the pin. table 22.4 summarizes the pbdrh and pbdrl read/write operations. pbdrh and pbdrl are initialized to h'0000 by a power-on reset or in deep standby mode. these registers are not initialized either by a manual rese t or by switching to sleep mode or software standby mode.
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 909 of 1164 rej09b0321-0200 ? port b data register h (pbdrh) 151413121110987654321 0 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pb31 dr pb30 dr pb29 dr pb28 dr pb27 dr pb26 dr pb25 dr pb24 dr pb23 dr pb22 dr pb21 dr pb20 dr pb19 dr pb18 dr pb17 dr pb16 dr ? port b data register l (pbdrl) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pb15 dr pb14 dr pb13 dr pb12 dr pb11 dr pb10 dr pb9 dr pb8 dr pb7 dr pb6 dr pb5 dr pb4 dr pb3 dr pb2 dr pb1 dr pb0 dr table 22.4 port b data re gisters h and l (pbdrh and pbdrl) read/write operations pbiorh, l pin function read write 0 general input pin state the value is written to pbdrh and pbdrl but there is no effect on the pin state. other than general input pin state the value is written to pbdrh and pbdrl but there is no effect on the pin state. 1 general output value of pbdrh and pbdrl the value written is output from the pin. other than general output value of pbdrh and pbdrl the value is written to pbdrh and pbdrl but there is no effect on the pin state.
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 910 of 1164 rej09b0321-0200 22.2.3 port b port registers h and l (pbprh and pbprl) pbprh and pbprl are 16-bit read-only registers in which bits pb31pr to pb0pr correspond to pins pb31 to pb0. pbprh and pbprl are always read the states of the pins regardless of the pfc setting. ? port b port register h (pbprh) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: pb31 pb30 pb29 pb28 pb27 pb26 pb25 pb24 pb23 pb22 pb21 pb20 pb19 pb18 pb17 pb16 rrrrrrrrrrrrrrrr pb31 pr pb30 pr pb29 pr pb28 pr pb27 pr pb26 pr pb25 pr pb24 pr pb23 pr pb22 pr pb21 pr pb20 pr pb19 pr pb18 pr pb17 pr pb16 pr ? port b port register l (pbprl) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: pb15 pb14 pb13 pb12 pb11 pb10 pb9 pb8 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 rrrrrrrrrrrrrrrr pb15 pr pb14 pr pb13 pr pb12 pr pb11 pr pb10 pr pb9 pr pb8 pr pb7 pr pb6 pr pb5 pr pb4 pr pb3 pr pb2 pr pb1 pr pb0 pr
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 911 of 1164 rej09b0321-0200 22.3 port c port c is an i/o port with 26 pins and is shown in figure 22.3. port c pc25 (input) / irq3 (input) / sda1 (i/o) pc24 (input) / irq2 (input) / scl1 (i/o) pc23 (input) / irq1 (input) / sda0 (i/o) pc22 (input) / irq0 (input) / scl0 (i/o) / dreq2 (input) pc21 (i/o) / bc3(output) /dqm3 (output) / tclkc (input) / dack2 (output) pc20 (i/o) / bc2(output) /dqm2 (output) / tclkb (input) pc19 (i/o) / bc1(output) /dqm1 (output) pc18 (i/o) / bc0(output) /dqm0 (output) pc17 (i/o) / sdwe (output) pc16 (i/o) / sdcas (output) pc15 (i/o) / sdras (output) pc14 (i/o) / sdcke (output) pc13 (i/o) / wait (input) pc12 (i/o) / wr3 (output) / wr (output) / tioc2b (i/o)/ dtend2 (output) pc11 (i/o) / wr2 (output) / tioc2a (i/o) / dact2 (output) pc10 (i/o) / wr1 (output) / wr (output) pc9 (i/o) / wr0 (output) / wr (output) pc8 (i/o) / rd (output) pc7 (i/o) / sdcs0 (output) pc6 (i/o) / cs6 (output) / tclka (input) / sck5 (i/o) pc5 (i/o) / cs5 (output) / tioc1b (i/o) / rxd5 (input) pc4 (i/o) / cs4 (output) / tioc1a (i/o) / txd5 (output) pc3 (i/o) / cs3 (output) / ubctrg (output) pc2 (i/o) / cs2 (output) / sdcs1 (output) / adtrg (input) pc1 (i/o) / cs1 (output) pc0 (i/o) / cs0 (output) figure 22.3 port c 22.3.1 register configuration table 22.5 lists the port c registers. table 22.5 register configuration register name abbreviation r/w address access size port c data register h pcdrh r/w h'fffe3810 8, 16, 32 port c data register l pcdrl r/w h'fffe3812 8, 16 port c port register h pcprh r h'fffe3814 8, 16, 32 port c port register l pcprl r h'fffe3816 8, 16
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 912 of 1164 rej09b0321-0200 22.3.2 port c data registers h and l (pcdrh and pcdrl) pcdrh and pcdrl are 16-bit readable/writable regi sters that store port c data. bits pc21dr to pc0dr correspond to pins pc21 to pc0, respectively. if a pin is set to the general output function, the pin will output the value written to the corresponding bit in pcdrh or pcdrl, and the register value is read from pcdrh and pcdrl regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pcdrh or pcdrl is read. also, if a value is written to pcdrh or pcdrl, although the value will actually be written, it will have no influence on the state of the pin. table 22.6 summarizes the pcdrh and pcdrl read/write operations. bits 15 to 6 in pcdrh are reserved. these bits are read as 0. the write value should always be 0. pcdrh and pcdrl are initialized to h'0000 by a power-on reset or in deep standby mode. these registers are not initialized either by a manual rese t or by switching to sleep mode or software standby mode. ? port c data register h (pcdrh) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r r/w r/w r/w r/w r/w r/w ?????? pc21 dr pc20 dr pc19 dr pc18 dr pc17 dr pc16 dr rrrr ???? ? port c data register l (pcdrl) 151413121110987654321 0 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pc15 dr pc14 dr pc13 dr pc12 dr pc11 dr pc10 dr pc9 dr pc8 dr pc7 dr pc6 dr pc5 dr pc4 dr pc3 dr pc2 dr pc1 dr pc0 dr
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 913 of 1164 rej09b0321-0200 table 22.6 port c data registers h and l (pcdrh and pcdrl) read/write operations pciorh, pciorl pin function read write 0 general input pin state the valu e is written to pcdrh and pcdrl but there is no effect on the pin state. other than general input pin state the value is written to pcdrh and pcdrl but there is no effect on the pin state. 1 general output value of pcdrh and pcdrl the value written is output from the pin. other than general output value of pcdrh and pcdrhl the value is written to pcdrh and pcdrl but there is no effect on the pin state. 22.3.3 port c port registers h and l (pcprh and pcprl) pcprh and pcprl are 16-bit read-only registers in which bits pc25pr to pc0pr correspond to pins pc25 to pc0. pcprh and pcprl are always read as the states of the pins regardless of the pfc setting. bits 15 to 10 in pcprh are reserved. these bits are read as 0. the write value should always be 0. ? port c port register h (pcprh) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0 0 0 0 0 0 pc25 pc24 pc23 pc22 pc21 pc20 pc19 pc18 pc17 pc16 rrrrrrrrrrrrrrrr ?????? pc25 pr pc24 pr pc23 pr pc22 pr pc21 pr pc20 pr pc19 pr pc18 pr pc17 pr pc16 pr ? port c port register l (pcprl) 151413121110987654321 0 bit: initial value: r/w: pc15 pc14 pc13 pc12 pc11 pc10 pc9 pc8 pc7 pc6 pc5 pc5 pc3 pc2 pc1 pc0 rrrrrrrrrrrrrrrr pc15 pr pc14 pr pc13 pr pc12 pr pc11 pr pc10 pr pc9 pr pc8 pr pc7 pr pc6 pr pc5 pr pc5 pr pc3 pr pc2 pr pc1 pr pc0 pr
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 914 of 1164 rej09b0321-0200 22.4 port d port d is an i/o port with 17 pins shown in figure 22.4. port d pd16 (input) / scl2 (i/o) pd15 (input) / sda2 (i/o) pd14 (i/o) / dack1 (output) pd13 (i/o) / dreq1 (input) pd12 (i/o) / tmci1 (input) / sck1 (i/o) pd11 (i/o) / tmri1 (input) / rxd1 (input) pd10 (i/o) / tmo1 (output) / tioc0d (i/o) / txd1 (output) pd9 (i/o) / tioc0c (i/o) / sck0 (i/o) pd8 (i/o) / tioc0b (i/o) / rxd0 (input) / dtend1 (output) pd7 (i/o) / tioc0a (i/o) / txd0 (output) / dact1 (output) pd6 (i/o) / sck4 (i/o) / ssiws1 (i/o) pd5 (i/o) / rxd4 (input) / ssisck1 (i/o) pd4 (i/o) / txd4 (output) / ssidata1 (i/o) pd3 (i/o) / ssiws0 (i/o) pd2 (i/o) / ssisck0 (i/o) pd1 (i/o) / ssidata0 (i/o) pd0 (i/o) / audio_clk (input) figure 22.4 port d 22.4.1 register configuration table 22.7 lists the port d registers. table 22.7 register configuration register name abbreviation r/w address access size port d data register pddr r/w h'fffe381a 8, 16 port d port register h pdprh r h'fffe381c 8, 16, 32 port d port register l pdprl r h'fffe381e 8, 16
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 915 of 1164 rej09b0321-0200 22.4.2 port d data register (pddr) pddr is a 16-bit readable/writable register that stores port d data. bits pd14dr to pd0dr correspond to pins pd14 to pd0, respectively. if a pin is set to the general output function, that pin will output the value written to the corresponding bit in pddr, and the register value is read from pddr regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pddr is read. also, if a value is written to pddr, although the value will actually be written, it will have no influence on the state of the pin. table 22.8 summarizes the pddr read/write operations. bit 15 in pddr is reserved. this bit is read as 0. the write value should always be 0. pddr is initialized to h'0000 by a power-on reset or in deep standby mode. this register is not initialized either by a manual reset or by switching to sleep mode or software standby mode. 151413121110987654321 0 bit: initial value: r/w: 0000000000000000 r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ? pd14 dr pd13 dr pd12 dr pd11 dr pd10 dr pd9 dr pd8 dr pd7 dr pd6 dr pd5 dr pd4 dr pd3 dr pd2 dr pd1 dr pd0 dr table 22.8 port d data register (pddr) read/write operations pdior pin function read write 0 general input pin state the value is written to pddr but there is no effect on the pin state. other than general input pin state the value is wri tten to pddr but there is no effect on the pin state. 1 general output value of pddr the value written is output from the pin. other than general output value of pddr the value is written to pddr but there is no effect on the pin state.
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 916 of 1164 rej09b0321-0200 22.4.3 port d port registers h and l (pdprh and pdprl) pdprh and pdprl are 16-bit read-only registers in which bits pd16pr to pd0pr correspond to pins pd16 to pd0. pdprh and pdprl are always read as the states of the pins regardless of the pfc setting. bits 15 to 1 in pdprh are reserved. these bits are read as 0. the write value should always be 0. ? port d port register h (pdprh) 151413121110987654321 0 bit: initial value: r/w: 000000000000000 pd16 rrrrrrrrrrrrrrrr ??????????????? pd16 pr ? port d port register l (pdprl) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: pd15 pd14 pd13 pd12 pd11 pd10 pd9 pd8 pd7 pd6 pd5 pd4 pd3 pd2 pd1 pd0 rrrrrrrrrrrrrrrr pd15 dr pd14 dr pd13 dr pd12 dr pd11 dr pd10 dr pd9 dr pd8 dr pd7 dr pd6 dr pd5 dr pd4 dr pd3 dr pd2 dr pd1 dr pd0 dr
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 917 of 1164 rej09b0321-0200 22.5 port e port e is an i/o port with 8 pins shown in figure 22.5. port e pe7 (input) / irq7 (input) / an7 (input) / da1 (output) pe6 (input) / irq6 (input) / an6 (input) / da0 (output) pe5 (input) / irq5 (input) / an5 (input) pe4 (input) / irq4 (input) / an4 (input) pe3 (input) / pint7 (input) / an3 (input) pe2 (input) / pint6 (input) / an2 (input) pe1 (input) / pint5 (input) / an1 (input) pe0 (input) / pint4 (input) / an0 (input) figure 22.5 port e 22.5.1 register configuration table 22.9 lists the port e registers. table 22.9 register configuration register name abbreviation r/w address access size port e port register pepr r h'fffe3826 8, 16 22.5.2 port e port register (pepr) pepr is a 16-bit read-only register. bits pe7pr to pe0pr correspond to pins pe7 to pe0, respectively. the pin values can always be read from pepr, regardless of the pfc settings. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0 0 0 0 0 0 0 0 pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 rrrrrrrrrrrrrrrr ???????? pe7 pr pe6 pr pe5 pr pe4 pr pe3 pr pe2 pr pe1 pr pe0 pr
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 918 of 1164 rej09b0321-0200 22.6 port f port f is an i/o port with 8 pins shown in figure 22.6. port f pf7 (i/o) / audata3 (i/o) pf6 (i/o) / audata2 (i/o) pf5 (i/o) / audata1 (i/o) pf4 (i/o) / audata0 (i/o) pf3 (i/o) / audsync (i/o) pf2 (i/o) / tclkd (input) / sck7 (i/o) / audck (input) pf1 (i/o) / rxd7 (input) / audmd (input) pf0 (i/o) / txd7 (output) / audrst (input) figure 22.6 port f 22.6.1 register configuration table 22.10 lists the port f registers. table 22.10 register configuration register name abbreviation r/w address access size port f data register pfdr r/w h'fffe382a 8, 16 port f port register pfpr r h'fffe382e 8, 16
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 919 of 1164 rej09b0321-0200 22.6.2 port f data register (pfdr) pfdr is a 16-bit read-only register that stores the port f data. bits pf7dr to pf0dr correspond to pins pf7 to pf0, respectively. if a pin is set to the general output function, the pin will output the value written to the corresponding bit in pfdr, and the register value is read from pfdr regardless of the state of the pin. if a pin is set to the general input function, the pin state, not the register value, will be returned if pfdr is read. also, if a value is written to pfdr , although the value will actually be written, it will have no influence on the state of the pin. table 22.11 summarizes the pfdr read/write operations. pfdr is initialized to h'0000 by a power-on reset or in deep standby mode. this register is not initialized either by a manual reset or by switching to sleep mode or software standby mode. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w ???????? pf7 dr pf6 dr pf5 dr pf4 dr pf3 dr pf2 dr pf1 dr pf0 dr table 22.11 port f data regist er (pfdr) read/write operations pfior pin function read write 0 general input pin state the value is written to pfdr but there is no effect on the pin state. other than general input pin state the value is wri tten to pfdr but there is no effect on the pin state. 1 general output value of pfdr the valu e written is output from the pin. other than general output value of pfdr the value is wr itten to pfdr but there is no effect on the pin state.
section 22 i/o ports rev. 2.00 sep. 07, 2007 page 920 of 1164 rej09b0321-0200 22.6.3 port f port register (pfpr) pfpr is a 16-bit read-only register in which bits pf7pr to pf0pr correspond to pins pf7 to pf0. pfpr are always read as the states of the pins regardless of the pfc setting. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0 0 0 0 0 0 0 0 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 rrrrrrrrrrrrrrrr ???????? pf7 pr pf6 pr pf5 pr pf4 pr pf3 pr pf2 pr pf1 pr pf0 pr
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 921 of 1164 rej09b0321-0200 section 23 pin function controller (pfc) the pin function controller (pfc) consists of registers that select the functions of the multiplexed pins and their i/o directions. tables 25.1 to 25.6 list the multiplexed pins of this lsi. table 23.1 multiplexed pin table (port a) port function 1 panmd[2:0] = 000 (related modules) function 2 panmd[2:0] = 001 (related modules) function 3 panmd[2:0] = 010 (related modules) function 4 panmd[2:0] = 011 (related modules) function 5 panmd[2:0] = 100 (related modules) pa31 i/o (port) crx1 input (rcan-et) dtend0 output (dmac) pa30 i/o (port) ctx1 output (rcan-et) dact0 output (dmac) pa29 i/o (port) crx0 input (rcan-et) dack0 output (dmac) pa28 i/o (port) ctx0 output (rcan-et) dreq0 input (dmac) pa27 i/o (port) a27 output (bsc) dtend3 output (dmac) pint3b input (intc) pa26 i/o (port) a26 output (bsc) dact3 output (dmac) pint2b input (intc) pa25 i/o (port) a25 output (bsc) dack3 output (dmac) pint1b input (intc) pa24 i/o (port) a24 output (bsc) dreq3 input (dmac) pint0b input (intc) pa23 i/o (port) a23 output (bsc) pa22 i/o (port) a22 output (bsc) pa21 i/o (port) a21 output (bsc) pa20 i/o (port) a20 output (bsc) pa19 i/o (port) a19 output (bsc) a pa18 i/o (port) a18 output (bsc) pa17 i/o (port) a17 output (bsc) pa16 i/o (port) a16 output (bsc) pa15 i/o (port) a15 output (bsc) pa14 i/o (port) a14 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 922 of 1164 rej09b0321-0200 port function 1 panmd[2:0] = 000 (related modules) function 2 panmd[2:0] = 001 (related modules) function 3 panmd[2:0] = 010 (related modules) function 4 panmd[2:0] = 011 (related modules) function 5 panmd[2:0] = 100 (related modules) a pa13 i/o (port) a13 output (bsc) pa12 i/o (port) a12 output (bsc) pa11 i/o (port) a11 output (bsc) pa10 i/o (port) a10 output (bsc) pa9 i/o (port) a9 output (bsc) pa8 i/o (port) a8 output (bsc) pa7 i/o (port) a7 output (bsc) pa6 i/o (port) a6 output (bsc) pa5 i/o (port) a5 output (bsc) pa4 i/o (port) a4 output (bsc) pa3 i/o (port) a3 output (bsc) pa2 i/o (port) a2 output (bsc) pa1 i/o (port) a1 output (bsc) pa0 i/o (port) a0 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 923 of 1164 rej09b0321-0200 table 23.2 multiplexed pin table (port b) port function 1 pbnmd[2:0] = 000 (related modules) function 2 pbnmd[2:0] = 001 (related modules) function 3 pbnmd[2:0] = 010 (related modules) function 4 pbnmd[2:0] = 011 (related modules) function 5 pbnmd[2:0] = 100 (related modules) b pb31 i/o (port) d31 i/o (bsc) pint7a input (intc) pb30 i/o (port) d30 i/o (bsc) pint6a input (intc) sck3 i/o (scif) tmci0 input (tmr) pb29 i/o (port) d29 i/o (bsc) pint5a input (intc) rxd3 input (scif) tmri0 input (tmr) pb28 i/o (port) d28 i/o (bsc) pint4a input (intc) txd3 output (scif) tmo0 output (tmr) pb27 i/o (port) d27 i/o (bsc) pint3a input (intc) pb26 i/o (port) d26 i/o (bsc) pint2a input (intc) tic5w input (mtu2) sck6 i/o (scif) pb25 i/o (port) d25 i/o (bsc) pint1a input (intc) tic5v input (mtu2) rxd6 input (scif) pb24 i/o (port) d24 i/o (bsc) pint0a input (intc) tic5u input (mtu2) txd6 output (scif) pb23 i/o (port) d23 i/o (bsc) irq7a input (intc) tioc4d i/o (mtu2) pb22 i/o (port) d22 i/o (bsc) irq6a input (intc) tioc4c i/o (mtu2) sck2 i/o (scif) pb21 i/o (port) d21 i/o (bsc) irq5a input (intc) tioc4b i/o (mtu2) rxd2 input (scif) pb20 i/o (port) d20 i/o (bsc) irq4a input (intc) tioc4a i/o (mtu2) txd2 output (scif) pb19 i/o (port) d19 i/o (bsc) irq3a input (intc) tioc3d i/o (mtu2) pb18 i/o (port) d18 i/o (bsc) irq2a input (intc) tioc3c i/o (mtu2) pb17 i/o (port) d17 i/o (bsc) irq1a input (intc) tioc3b i/o (mtu2) pb16 i/o (port) d16 i/o (bsc) irq0a input (intc) tioc3a i/o (mtu2)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 924 of 1164 rej09b0321-0200 port function 1 pbnmd[2:0] = 000 (related modules) function 2 pbnmd[2:0] = 001 (related modules) function 3 pbnmd[2:0] = 010 (related modules) function 4 pbnmd[2:0] = 011 (related modules) function 5 pbnmd[2:0] = 100 (related modules) b pb15 i/o (port) d15 i/o (bsc) pb14 i/o (port) d14 i/o (bsc) pb13 i/o (port) d13 i/o (bsc) pb12 i/o (port) d12 i/o (bsc) pb11 i/o (port) d11 i/o (bsc) pb10 i/o (port) d10 i/o (bsc) pb9 i/o (port) d9 i/o (bsc) pb8 i/o (port) d8 i/o (bsc) pb7 i/o (port) d7 i/o (bsc) pb6 i/o (port) d6 i/o (bsc) pb5 i/o (port) d5 i/o (bsc) pb4 i/o (port) d4 i/o (bsc) pb3 i/o (port) d3 i/o (bsc) pb2 i/o (port) d2 i/o (bsc) pb1 i/o (port) d1 i/o (bsc) pb0 i/o (port) d0 i/o (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 925 of 1164 rej09b0321-0200 table 23.3 multiplexed pin table (port c) port function 1 pcnmd[2:0] = 000 (related modules) function 2 pcnmd[2:0] = 001 (related modules) function 3 pcnmd[2:0] = 010 (related modules) function 4 pcnmd[2:0] = 011 (related modules) function 5 pcnmd[2:0] = 100 (related modules) c pc25 input (port) irq3b input (intc) sda1 i/o (iic3) pc24 input (port) irq2b input (intc) scl1 i/o (iic3) pc23 input (port) irq1b input (intc) sda0 i/o (iic3) pc22 input (port) irq0b input (intc) dreq2 input (dmac) scl0 i/o (iic3) pc21 i/o (port) bc3/dqm3 output (bsc) tclkc input (mtu2) dack2 output (dmac) pc20 i/o (port) bc2/dqm2 output (bsc) tclkb input (mtu2) pc19 i/o (port) bc1/dqm1 output (bsc) pc18 i/o (port) bc0/dqm0 output (bsc) pc17 i/o (port) sdwe output (bsc) pc16 i/o (port) sdcas output (bsc) pc15 i/o (port) sdras output (bsc) pc14 i/o (port) sdcke output (bsc) pc13 i/o (port) wait input (bsc) pc12 i/o (port) wr3 output (bsc) tioc2b i/o (mtu2) dtend2 output (dmac) pc11 i/o (port) wr2 output (bsc) tioc2a i/o (mtu2) dact2 output (dmac) pc10 i/o (port) wr1 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 926 of 1164 rej09b0321-0200 port function 1 pcnmd[2:0] = 000 (related modules) function 2 pcnmd[2:0] = 001 (related modules) function 3 pcnmd[2:0] = 010 (related modules) function 4 pcnmd[2:0] = 011 (related modules) function 5 pcnmd[2:0] = 100 (related modules) c pc9 i/o (port) wr0 output (bsc) pc8 i/o (port) rd output (bsc) pc7 i/o (port) sdcs0 output (bsc) pc6 i/o (port) cs6 output (bsc) sck5 i/o (scif) tclka input (mtu2) pc5 i/o (port) cs5 output (bsc) rxd5 input (scif) tioc1b i/o (mtu2) pc4 i/o (port) cs4 output (bsc) txd5 output (scif) tioc1a i/o (mtu2) pc3 i/o (port) cs3 output (bsc) ubctrg output (ubc) pc2 i/o (port) cs2 output (bsc) sdcs1 output (bsc) adtrg input (a/d) pc1 i/o (port) cs1 output (bsc) pc0 i/o (port) cs0 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 927 of 1164 rej09b0321-0200 table 23.4 multiplexed pin table (port d) port function 1 pdnmd[2:0] = 000 (related modules) function 2 pdnmd[2:0] = 001 (related modules) function 3 pdnmd[2:0] = 010 (related modules) function 4 pdnmd[2:0] = 011 (related modules) function 5 pdnmd[2:0] = 100 (related modules) d pd16 input (port) scl2 i/o (iic3) pd15 input (port) sda2 i/o (iic3) pd14 i/o (port) dack1 output (dmac) pd13 i/o (port) dreq1 input (dmac) pd12 i/o (port) sck1 i/o (scif) tmci1 input (tmr) pd11 i/o (port) rxd1 input (scif) tmri1 input (tmr) pd10 i/o (port) txd1 output (scif) tmo1 output (tmr) tioc0d i/o (mtu2) pd9 i/o (port) sck0 i/o (scif) tioc0c i/o (mtu2) pd8 i/o (port) rxd0 input (scif) dtend1 output (dmac) tioc0b i/o (mtu2) pd7 i/o (port) txd0 output (scif) dact1 output (dmac) tioc0a i/o (mtu2) pd6 i/o (port) ssiws1 i/o (ssi) sck4 i/o (scif) pd5 i/o (port) ssisck1 i/o (ssi) rxd4 input (scif) pd4 i/o (port) ssidata1 i/o (ssi) txd4 output (scif) pd3 i/o (port) ssiws0 i/o (ssi) pd2 i/o (port) ssisck0 i/o (ssi) pd1 i/o (port) ssidata0 i/o (ssi) pd0 i/o (port) audio_clk input (ssi)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 928 of 1164 rej09b0321-0200 table 23.5 multiplexed pin table (port e) port function 1 penmd[2:0] = 000 (related modules) function 2 penmd[2:0] = 001 (related modules) function 3 penmd[2:0] = 010 (related modules) function 4 penmd[2:0] = 011 (related modules) function 5 penmd[2:0] = 100 (related modules) e pe7 input (port) irq7b input (intc) pe6 input (port) irq6b input (intc) pe5 input (port) irq5b input (intc) pe4 input (port) irq4b input (intc) pe3 input (port) pint7b input (intc) pe2 input (port) pint6b input (intc) pe1 input (port) pint5b input (intc) pe0 input (port) pint4b input (intc) table 23.6 multiplexed pin table (port f) port function 1 pfnmd[2:0] = 000 (related modules) function 2 pfnmd[2:0] = 001 (related modules) function 3 pfnmd[2:0] = 010 (related modules) function 4 pfnmd[2:0] = 011 (related modules) function 5 pfnmd[2:0] = 100 (related modules) pf7 i/o (port) audata3 i/o (aud-ii) pf6 i/o (port) audata2 i/o (aud-ii) pf5 i/o (port) audata1 i/o (aud-ii) pf4 i/o (port) audata0 i/o (aud-ii) pf3 i/o (port) audsync input (aud-ii) pf2 i/o (port) audck input (aud-ii) sck7 i/o (scif) tclkd input (mtu2) pf1 i/o (port) audmd input (aud-ii) rxd7 input (scif) f pf0 i/o (port) audrst input (aud-ii) txd7 output (scif)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 929 of 1164 rej09b0321-0200 23.1 register descriptions the pfc includes the following registers. table 23.7 register configuration register abbr. r/w initial value address access size port a i/o register h paio rh r/w h'0000 h'fffe3880 8, 16, 32 port a i/o register l paiorl r/w h'0000 h'fffe3882 8, 16 port a control register 8 pa cr8 r/w h'0000 h'fffe3884 8, 16, 32 port a control register 7 pacr7 r/w h'0000 h'fffe3886 8, 16 port a control register 6 pa cr6 r/w h'1111 h'fffe3888 8, 16, 32 port a control register 5 pa cr5 r/w h'1111 h'fffe388a 8, 16 port a control register 4 pacr4 r/w h'1111 h'fffe388c 8, 16, 32 port a control register 3 pa cr3 r/w h'1111 h'fffe388e 8, 16 port a control register 2 pa cr2 r/w h'1111 h'fffe3890 8, 16, 32 port a control register 1 pacr1 r/w h'1111 h'fffe3892 8, 16 port b i/o register h pbio rh r/w h'0000 h'fffe3898 8, 16, 32 port b i/o register l pbiorl r/w h'0000 h'fffe389a 8, 16 port b control register 8 pbcr8 r/w h'0000/h'1111 h'fffe389c 8, 16, 32 port b control register 7 pbcr7 r/w h'0000/h'1111 h'fffe389e 8, 16 port b control register 6 pbcr6 r/w h'0000/h'1111 h'fffe38a0 8, 16, 32 port b control register 5 pbcr5 r/w h'0000/h'1111 h'fffe38a2 8, 16 port b control register 4 pbcr4 r/w h'0000/h'1111 h'fffe38a4 8, 16, 32 port b control register 3 pbcr3 r/w h'0000/h'1111 h'fffe38a6 8, 16 port b control register 2 pbcr2 r/w h'1111 h'fffe38a8 8, 16, 32 port b control register 1 pb cr1 r/w h'1111 h'fffe38aa 8, 16 port c i/o register h pciorh r/w h'0000 h'fffe38b0 8, 16, 32 port c i/o register l pciorl r/w h'0000 h'fffe38b2 8, 16 port c control register 7 p ccr7 r/w h'0000 h'fffe38b6 8, 16 port c control register 6 pccr6 r/w h'0000 h'fffe38b8 8, 16, 32 port c control register 5 p ccr5 r/w h'0000 h'fffe38ba 8, 16
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 930 of 1164 rej09b0321-0200 register abbr. r/w initial value address access size port c control register 4 pccr4 r/w h'0000/h'0001 h'fffe38bc 8, 16, 32 port c control register 3 pccr3 r/w h'0011/h'0111/ h'1111 h'fffe38be 8, 16 port c control register 2 pccr2 r/w h'0000 h'fffe38c0 8, 16, 32 port c control register 1 p ccr1 r/w h'0001 h'fffe38c2 8, 16 port d i/o register pdior r/w h'0000 h'fffe38ca 8, 16 port d control register 5 p dcr5 r/w h'0000 h'fffe38d2 8, 16 port d control register 4 pdcr4 r/w h'0000 h'fffe38d4 8, 16, 32 port d control register 3 p dcr3 r/w h'0000 h'fffe38d6 8, 16 port d control register 2 pdcr2 r/w h'0000 h'fffe38d8 8, 16, 32 port d control register 1 p dcr1 r/w h'0000 h'fffe38da 8, 16 port e control register 2 pecr2 r/w h'0000 h'fffe38f0 8, 16, 32 port e control register 1 pe cr1 r/w h'0000 h'fffe38f2 8, 16 port f i/o register pfior r/w h'0000 h'fffe38fa 8, 16 port f control register 2 pf cr2 r/w h'0000 h'fffe3908 8, 16, 32 port f control register 1 pf cr1 r/w h'0000 h'fffe390a 8, 16
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 931 of 1164 rej09b0321-0200 23.1.1 port a i/o registers h and l (paiorh and paiorl) paiorh and paiorl are 16-bit re adable/writable registers that se lect the i/o direction for the port a pins. bits pa31ior to pa0ior correspond to pins pa31 to pa0, respectively. paiorh and paiorl are enabled when the function of the port a pins is set to general-purpose i/o (pa31 to pa0) by pacr, and are disabled in other cases. when a bit in paiorh and paiorl is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. paiorh and paiorl are initialized to h'0000 by a power-on reset or by switching to deep standby mode. these registers are no t initialized either by a manual reset or by switching to sleep mode or software standby mode. (1) port a i/o register h (paiorh) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pa31 ior pa30 ior pa29 ior pa28 ior pa27 ior pa26 ior pa25 ior pa24 ior pa23 ior pa22 ior pa21 ior pa20 ior pa19 ior pa18 ior pa17 ior pa16 ior (2) port a i/o register l (paiorl) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pa15 ior pa14 ior pa13 ior pa12 ior pa11 ior pa10 ior pa9 ior pa8 ior pa7 ior pa6 ior pa5 ior pa4 ior pa3 ior pa2 ior pa1 ior pa0 ior
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 932 of 1164 rej09b0321-0200 23.1.2 port a control registers 1 to 8 (pacr1 to pacr8) pacr1 to pacr8 are 16-bit readable/writable re gisters that select the functions of the multiplexed port a pins. when pint3b to pint0b are selected, do not set a input for the same interrupt. pacr8 and pacr7 are initialized to h'0000 by a power-on reset or by switching to deep standby mode. pacr1 to pacr6 are initialized to h'1111 by a power-on reset or by switching to deep standby mode. these registers are not initialized either by a manual reset or by switching to sleep mode or software standby mode. (1) port a control register 8 (pacr8) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r/w r/w r r r/w r/w r r r/w r/w r r r/w r/w ? ? pa31md[1:0] pa30md[1:0] pa29md[1:0] pa28md[1:0] ?? ?? ?? bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 pa31md [1:0] 00 r/w pa31 mode these bits control the f unction of the pa31/crx1/ dtend0 pin. 00: pa31 i/o (port) 01: crx1 input (rcan-et) 10: dtend0 output (dmac) 11: setting prohibited 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 933 of 1164 rej09b0321-0200 bit bit name initial value r/w description 9, 8 pa30md [1:0] 00 r/w pa30 mode these bits control the f unction of the pa30/ctx1/ dact0 pin. 00: pa30 i/o (port) 01: ctx1 output (rcan-et) 10: dact0 output (dmac) 11: setting prohibited 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5, 4 pa29md [1:0] 00 r/w pa29 mode these bits control the f unction of the pa29/crx0/ dack0 pin. 00: pa29 i/o (port) 01: crx0 input (rcan-et) 10: dack0 output (dmac) 11: setting prohibited 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pa28md [1:0] 00 r/w pa28 mode these bits control the f unction of the pa28/ctx0/ dreq0 pin. 00: pa28 i/o (port) 01: ctx0 output (rcan-et) 10: dreq0 input (dmac) 11: setting prohibited
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 934 of 1164 rej09b0321-0200 (2) port a control register 7 (pacr7) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r/w r/w r/w r r/w r/w r/w r r/w r/w r/w r r r/w r/w ? pa27md[2:0] pa26md[2:0] pa25md[2:0] pa24md[2:0] ???? bit bit name initial value r/w description 15 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 14 to 12 pa27md [2:0] 000 r/w pa27 mode these bits control the f unction of the pa27/a27/ dtend3/pint3b pin. 000: pa27 i/o (port) 001: a27 output (bsc) 010: dtend3 output (dmac) 011: pint3b input (intc) 100: setting prohibited 101: setting prohibited 110: setting prohibited 111: setting prohibited 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 935 of 1164 rej09b0321-0200 bit bit name initial value r/w description 10 to 8 pa26md [2:0] 000 r/w pa26 mode these bits control the f unction of the pa26/a26/ dact3/pint2b pin. 000: pa26 i/o (port) 001: a26 output (bsc) 010: dact3 output (dmac) 011: pint2b input (intc) 100: setting prohibited 101: setting prohibited 110: setting prohibited 111: setting prohibited 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 to 4 pa25md [2:0] 000 r/w pa25 mode these bits control the f unction of the pa25/a25/ dack3/pint1b pin. 000: pa25 i/o (port) 001: a25 output (bsc) 010: dack3 output (dmac) 011: pint1b input (intc) 100: setting prohibited 101: setting prohibited 110: setting prohibited 111: setting prohibited 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pa24md [1:0] 00 r/w pa24 mode these bits control the f unction of the pa24/a24/ dreq3/pint0b pin. 00: pa24 i/o (port) 01: a24 output (bsc) 10: dreq3 input (dmac) 11: pint0b input (intc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 936 of 1164 rej09b0321-0200 (3) port a control register 6 (pacr6) 1514131211109876543210 bit: initial value: r/w: 0001000100010001 r r r r/w r r r r/w r r r r/w r r r r/w ??? pa23 md0 ??? pa22 md0 ??? pa21 md0 ??? pa20 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pa23md0 1 r/w pa23 mode this bit controls the func tion of the pa23/a23 pin. 0: pa23 i/o (port) 1: a23 output (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pa22md0 1 r/w pa22 mode this bit controls the func tion of the pa22/a22 pin. 0: pa22 i/o (port) 1: a22 output (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pa21md0 1 r/w pa21 mode this bit controls the func tion of the pa21/a21 pin. 0: pa21 i/o (port) 1: a21 output (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pa20md0 1 r/w pa20 mode this bit controls the func tion of the pa20/a20 pin. 0: pa20 i/o (port) 1: a20 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 937 of 1164 rej09b0321-0200 (4) port a control register 5 (pacr5) 1514131211109876543210 bit: initial value: r/w: 0001000100010001 r r r r/w r r r r/w r r r r/w r r r r/w ??? pa19 md0 ??? pa18 md0 ??? pa17 md0 ??? pa16 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pa19md0 1 r/w pa19 mode this bit controls the func tion of the pa19/a19 pin. 0: pa19 i/o (port) 1: a19 output (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pa18md0 1 r/w pa18 mode this bit controls the func tion of the pa18/a18 pin. 0: pa18 i/o (port) 1: a18 output (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pa17md0 1 r/w pa17 mode this bit controls the func tion of the pa17/a17 pin. 0: pa17 i/o (port) 1: a17 output (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pa16md0 1 r/w pa16 mode this bit controls the func tion of the pa16/a16 pin. 0: pa16 i/o (port) 1: a16 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 938 of 1164 rej09b0321-0200 (5) port a control register 4 (pacr4) 1514131211109876543210 bit: initial value: r/w: 0001000100010001 r r r r/w r r r r/w r r r r/w r r r r/w ??? pa15 md0 ??? pa14 md0 ??? pa13 md0 ??? pa12 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pa15md0 1 r/w pa15 mode this bit controls the func tion of the pa15/a15 pin. 0: pa15 i/o (port) 1: a15 output (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pa14md0 1 r/w pa14 mode this bit controls the func tion of the pa14/a14 pin. 0: pa14 i/o (port) 1: a14 output (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pa13md0 1 r/w pa13 mode this bit controls the func tion of the pa13/a13 pin. 0: pa13 i/o (port) 1: a13 output (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pa12md0 1 r/w pa12 mode this bit controls the func tion of the pa12/a12 pin. 0: pa12 i/o (port) 1: a12 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 939 of 1164 rej09b0321-0200 (6) port a control register 3 (pacr3) 1514131211109876543210 bit: initial value: r/w: 0001000100010001 r r r r/w r r r r/w r r r r/w r r r r/w ??? pa11 md0 ??? pa10 md0 ??? pa9 md0 ??? pa8 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pa11md0 1 r/w pa11 mode this bit controls the func tion of the pa11/a11 pin. 0: pa11 i/o (port) 1: a11 output (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pa10md0 1 r/w pa10 mode this bit controls the func tion of the pa10/a10 pin. 0: pa10 i/o (port) 1: a10 output (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pa9md0 1 r/w pa9 mode this bit controls the function of the pa9/a9 pin. 0: pa9 i/o (port) 1: a9 output (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pa8md0 1 r/w pa8 mode this bit controls the function of the pa8/a8 pin. 0: pa8 i/o (port) 1: a8 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 940 of 1164 rej09b0321-0200 (7) port a control register 2 (pacr2) 1514131211109876543210 bit: initial value: r/w: 0001000100010001 r r r r/w r r r r/w r r r r/w r r r r/w ??? pa7 md0 ??? pa6 md0 ??? pa5 md0 ??? pa4 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pa7md0 1 r/w pa7 mode this bit controls the function of the pa7/a7 pin. 0: pa7 i/o (port) 1: a7 output (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pa6md0 1 r/w pa6 mode this bit controls the function of the pa6/a6 pin. 0: pa6 i/o (port) 1: a6 output (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pa5md0 1 r/w pa5 mode this bit controls the function of the pa5/a5 pin. 0: pa5 i/o (port) 1: a5 output (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pa4md0 1 r/w pa4 mode this bit controls the function of the pa4/a4 pin. 0: pa4 i/o (port) 1: a4 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 941 of 1164 rej09b0321-0200 (8) port a control register 1 (pacr1) 1514131211109876543210 bit: initial value: r/w: 0001000100010001 r r r r/w r r r r/w r r r r/w r r r r/w ??? pa3 md0 ??? pa2 md0 ??? pa1 md0 ??? pa0 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pa3md0 1 r/w pa3 mode this bit controls the function of the pa3/a3 pin. 0: pa3 i/o (port) 1: a3 output (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pa2md0 1 r/w pa2 mode this bit controls the function of the pa2/a2 pin. 0: pa2 i/o (port) 1: a2 output (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pa1md0 1 r/w pa1 mode this bit controls the function of the pa1/a1 pin. 0: pa1 i/o (port) 1: a1 output (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pa0md0 1 r/w pa0 mode this bit controls the function of the pa0/a0 pin. 0: pa0 i/o (port) 1: a0 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 942 of 1164 rej09b0321-0200 23.1.3 port b i/o registers h and l (pbiorh and pbiorl) pbiorh and pbiorl are 16-bit readable/writable re gisters that select th e i/o direction for the port b pins. bits pb31ior to pb0ior correspond to pins pb31 to pb0, respectively. pbiorh and pbiorl are enabled when the function of the po rt b pins is set to general-purpose i/o (pb31 to pb0) and to tioc i/o (mtu2) by pbcr, an d are disabled in other cases. when a bit in pbiorh and pbiorl is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. pbiorh and pbiorl are initialized to h'0000 by a power-on reset or by switching to deep standby mode. these registers are not initialized either by a manual reset or by switching to sleep mode or software standby mode. (1) port b i/o register h (pbiorh) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pb31 ior pb30 ior pb29 ior pb28 ior pb27 ior pb26 ior pb25 ior pb24 ior pb23 ior pb22 ior pb21 ior pb20 ior pb19 ior pb18 ior pb17 ior pb16 ior (2) port b i/o register l (pbiorl) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pb15 ior pb14 ior pb13 ior pb12 ior pb11 ior pb10 ior pb9 ior pb8 ior pb7 ior pb6 ior pb5 ior pb4 ior pb3 ior pb2 ior pb1 ior pb0 ior
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 943 of 1164 rej09b0321-0200 23.1.4 port b control registers 1 to 8 (pbcr1 to pbcr8) pbcr1 to pbcr8 are 16-bit readable/writable registers that select the functions of the multiplexed port b pins. when irq7a to irq0a or pint7a to pint0a are selected, do not set b input for the same interrupt. pbcr1 and pbcr2 are initialized to h'1111 by a power-on reset or by switching to deep standby mode. pbcr3 to pbcr8 are initialized to the values shown in table 23.8 by a power-on reset or by switching to deep standby mode. these registers are not initialized either by a manual reset or by switching to sleep mode or software standby mode. table 23.8 port b control register initial values initial value register area 0: 32-bit mode area 0: 16-bit mode area 0: 8-bit mode pbcr5 to pbcr8 h'1111 h'0000 h'0000 pbcr3, pbcr4 h'1111 h'1111 h'0000 (1) port b control register 8 (pbcr8) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0000/1 * 0000/1 * 0 0 0 0/1 * 0 0 0 0/1 * r r r/w r/w r r/w r/w r/w r r/w r/w r/w r r/w r/w r/w ?? pb31md[1:0] pb30md[2:0] pb29md[2:0] pb28md[2:0] ??? note: * the initial value depends on the lsi?s operating mode. bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 pb31md [1:0] 00/01 * r/w pb31 mode these bits control the f unction of the pb31/d31/ pint7a pin. 00: pb31 i/o (port) 01: d31 i/o (bsc) 10: pint7a input (intc) 11: setting prohibited
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 944 of 1164 rej09b0321-0200 bit bit name initial value r/w description 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 to 8 pb30md [2:0] 000/001 * r/w pb30 mode these bits control the f unction of the pb30/d30/ pint6a/sck3/tmci0 pin. 000: pb30 i/o (port) 001: d30 i/o (bsc) 010: pint6a input (intc) 011: sck3 i/o (scif) 100: tmci0 input (tmr) 101: setting prohibited 110: setting prohibited 111: setting prohibited 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 to 4 pb29md [2:0] 000/001 * r/w pb29 mode these bits control the f unction of the pb29/d29/ pint5a/rxd3/tmri0 pin. 000: pb29 i/o (port) 001: d29 i/o (bsc) 010: pint5a input (intc) 011: rxd3 input (scif) 100: tmri0 input (tmr) 101: setting prohibited 110: setting prohibited 111: setting prohibited 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 945 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 to 0 pb28md [2:0] 000/001 * r/w pb28 mode these bits control the f unction of the pb28/d28/ pint4a/txd3/tmo0 pin. 000: pb28 i/o (port) 001: d28 i/o (bsc) 010: pint4a input (intc) 011: txd3 output (scif) 100: tmo0 output (tmr) 101: setting prohibited 110: setting prohibited 111: setting prohibited note: * the initial value depends on the lsi's operating mode.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 946 of 1164 rej09b0321-0200 (2) port b control register 7 (pbcr7) 1514131211109876543210 bit: initial value: r/w: 0000/1 * 0 0 0 0/1 * 0 0 0 0/1 * 0 0 0 0/1 * r r r/w r/w r r/w r/w r/w r r/w r/w r/w r r/w r/w r/w ?? pb27md[1:0] pb26md[2:0] pb25md[2:0] pb24md[2:0] ??? note: the initial value depends on the lsi?s operating mode. * bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 pb27md [1:0] 00/01 * r/w pb27 mode these bits control the f unction of the pb27/d27/ pint3a pin. 00: pb27 i/o (port) 01: d27 i/o (bsc) 10: pint3a input (intc) 11: setting prohibited 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 to 8 pb26md [2:0] 000/001 * r/w pb26 mode these bits control the f unction of the pb26/d26/ pint2a/tic5w/sck6 pin. 000: pb26 i/o (port) 001: d26 i/o (bsc) 010: pint2a input (intc) 011: tic5w input (mtu2) 100: sck6 i/o (scif) 101: setting prohibited 110: setting prohibited 111: setting prohibited
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 947 of 1164 rej09b0321-0200 bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 to 4 pb25md [2:0] 000/001 * r/w pb25 mode these bits control the f unction of the pb25/d25/ pint1a/tic5v/rxd6 pin. 000: pb25 i/o (port) 001: d25 i/o (bsc) 010: pint1a input (intc) 011: tic5v input (mtu2) 100: rxd6 input (scif) 101: setting prohibited 110: setting prohibited 111: setting prohibited 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 to 0 pb24md [2:0] 000/001 * r/w pb24 mode these bits control the f unction of the pb24/d24/ pint0a/tic5u/txd6 pin. 000: pb24 i/o (port) 001: d24 i/o (bsc) 010: pint0a input (intc) 011: tic5u input (mtu2) 100: txd6 output (scif) 101: setting prohibited 110: setting prohibited 111: setting prohibited note: * the initial value depends on the lsi's operating mode.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 948 of 1164 rej09b0321-0200 (3) port b control register 6 (pbcr6) 1514131211109876543210 bit: initial value: r/w: 0000/1 * 0 0 0 0/1 * 0 0 0 0/1 * 0 0 0 0/1 * r r r/w r/w r r/w r/w r/w r r/w r/w r/w r r/w r/w r/w ?? pb23md[1:0] pb22md[2:0] pb21md[2:0] pb20md[2:0] ??? note: the initial value depends on the lsi?s operating mode. * bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 pb23md [1:0] 00/01 * r/w pb23 mode these bits control the f unction of the pb23/d23/ irq7a/tioc4d pin. 00: pb23 i/o (port) 01: d23 i/o (bsc) 10: irq7a input (intc) 11: tioc4d i/o (mtu2) 11 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 10 to 8 pb22md [2:0] 000/001 * r/w pb22 mode these bits control the f unction of the pb22/d22/ irq6a/tioc4c/sck2 pin. 000: pb22 i/o (port) 001: d22 i/o (bsc) 010: irq6a input (intc) 011: tioc4c i/o (mtu2) 100: sck2 i/o (scif) 101: setting prohibited 110: setting prohibited 111: setting prohibited
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 949 of 1164 rej09b0321-0200 bit bit name initial value r/w description 7 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 6 to 4 pb21md [2:0] 000/001 * r/w pb21 mode these bits control the f unction of the pb21/d21/ irq5a/tioc4b/rxd2 pin. 000: pb21 i/o (port) 001: d21 i/o (bsc) 010: irq5a input (intc) 011: tioc4b i/o (mtu2) 100: rxd2 input (scif) 101: setting prohibited 110: setting prohibited 111: setting prohibited 3 ? 0 r reserved this bit is always read as 0. the write value should always be 0. 2 to 0 pb20md [2:0] 000/001 * r/w pb20 mode these bits control the f unction of the pb20/d20/ irq4a/tioc4a/txd2 pin. 000: pb20 i/o (port) 001: d20 i/o (bsc) 010: irq4a input (intc) 011: tioc4a i/o (mtu2) 100: txd2 output (scif) 101: setting prohibited 110: setting prohibited 111: setting prohibited note: * the initial value depends on the lsi's operating mode.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 950 of 1164 rej09b0321-0200 (4) port b control register 5 (pbcr5) 1514131211109876543210 bit: initial value: r/w: 0000/1 * 0000/1 * 0000/1 * 0 0 0 0/1 * r r r/w r/w r r r/w r/w r r r/w r/w r r r/w r/w ?? pb19md[1:0] pb18md[2:0] pb17md[2:0] pb16md[2:0] ?? ? ? ?? note: * the initial value dependes on the lsi's clock operating mode. bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 pb19md [1:0] 00/01 * r/w pb19 mode these bits control the f unction of the pb19/d19/ irq3a/tioc3d pin. 00: pb19 i/o (port) 01: d19 i/o (bsc) 10: irq3a input (intc) 11: tioc3d i/o (mtu2) 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 pb18md [1:0] 00/01 * r/w pb18 mode these bits control the f unction of the pb18/d18/ irq2a/tioc3c pin. 00: pb18 i/o (port) 01: d18 i/o (bsc) 10: irq2a input (intc) 11: tioc3c i/o (mtu2) 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 951 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5, 4 pb17md [1:0] 00/01 * r/w pb17 mode these bits control the f unction of the pb17/d17/ irq1a/tioc3b pin. 00: pb17 i/o (port) 01: d17 i/o (bsc) 10: irq1a input (intc) 11: tioc3b i/o (mtu2) 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pb16md [1:0] 00/01 * r/w pb16 mode these bits control the f unction of the pb16/d16/ irq0a/tioc3a pin. 00: pb16 i/o (port) 01: d16 i/o (bsc) 10: irq0a input (intc) 11: tioc3a i/o (mtu2) note: * the initial value depends on the lsi's operating mode.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 952 of 1164 rej09b0321-0200 (5) port b control register 4 (pbcr4) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit: initial value: r/w: 0 0 0 0/1 * 0 0 0 0/1 * 0 0 0 0/1 * 0 0 0 0/1 * r r r r/w r r r r/w r r r r/w r r r r/w ??? pb15 md0 ??? pb14 md0 ??? pb13 md0 ??? pb12 md0 note: * the initial value dependes on the lsi's clock operating mode. bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pb15md0 0/1 * r/w pb15 mode this bit controls the func tion of the pb15/d15 pin. 0: pb15 i/o (port) 1: d15 i/o (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pb14md0 0/1 * r/w pb14 mode this bit controls the func tion of the pb14/d14 pin. 0: pb14 i/o (port) 1: d14 i/o (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pb13md0 0/1 * r/w pb13 mode this bit controls the func tion of the pb13/d13 pin. 0: pb13 i/o (port) 1: d13 i/o (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pb12md0 0/1 * r/w pb12 mode this bit controls the func tion of the pb12/d12 pin. 0: pb12 i/o (port) 1: d12 i/o (bsc) note: * the initial value depends on the lsi's operating mode.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 953 of 1164 rej09b0321-0200 (6) port b control register 3 (pbcr3) 1514131211109876543210 bit: initial value: r/w: 0000/1 * 0000/1 * 0000/1 * 0 0 0 0/1 * r r r r/w r r r r/w r r r r/w r r r r/w ??? pb11 md0 ??? pb10 md0 ??? pb9 md0 ??? pb8 md0 note: * the initial value dependes on the lsi's clock operating mode. bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pb11md0 0/1 * r/w pb11 mode this bit controls the func tion of the pb11/d11 pin. 0: pb11 i/o (port) 1: d11 i/o (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pb10md0 0/1 * r/w pb10 mode this bit controls the func tion of the pb10/d10 pin. 0: pb10 i/o (port) 1: d10 i/o (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pb9md0 0/1 * r/w pb9 mode this bit controls the function of the pb9/d9 pin. 0: pb9 i/o (port) 1: d9 i/o (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pb8md0 0/1 * r/w pb8 mode this bit controls the function of the pb8/d8 pin. 0: pb8 i/o (port) 1: d8 i/o (bsc) note: * the initial value depends on the lsi's operating mode.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 954 of 1164 rej09b0321-0200 (7) port b control register 2 (pbcr2) 1514131211109876543210 bit: initial value: r/w: 0001000100010001 r r r r/w r r r r/w r r r r/w r r r r/w ??? pb7 md0 ??? pb6 md0 ??? pb5 md0 ??? pb4 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pb7md0 1 r/w pb7 mode this bit controls the function of the pb7/d7 pin. 0: pb7 i/o (port) 1: d7 i/o (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pb6md0 1 r/w pb6 mode this bit controls the function of the pb6/d6 pin. 0: pb6 i/o (port) 1: d6 i/o (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pb5md0 1 r/w pb5 mode this bit controls the function of the pb5/d5 pin. 0: pb5 i/o (port) 1: d5 i/o (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pb4md0 1 r/w pb4 mode this bit controls the function of the pb4/d4 pin. 0: pb4 i/o (port) 1: d4 i/o (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 955 of 1164 rej09b0321-0200 (8) port b control register 1 (pbcr1) 1514131211109876543210 bit: initial value: r/w: 0001000100010001 r r r r/w r r r r/w r r r r/w r r r r/w ??? pb3 md0 ??? pb2 md0 ??? pb1 md0 ??? pb0 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pb3md0 1 r/w pb3 mode this bit controls the function of the pb3/d3 pin. 0: pb3 i/o (port) 1: d3 i/o (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pb2md0 1 r/w pb2 mode this bit controls the function of the pb2/d2 pin. 0: pb2 i/o (port) 1: d2 i/o (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pb1md0 1 r/w pb1 mode this bit controls the function of the pb1/d1 pin. 0: pb1 i/o (port) 1: d1 i/o (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pb0md0 1 r/w pb0 mode this bit controls the function of the pb0/d0 pin. 0: pb0 i/o (port) 1: d0 i/o (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 956 of 1164 rej09b0321-0200 23.1.5 port c i/o registers h and l (pciorh and pciorl) pciorh and pciorl are 16-bit readable/writable re gisters that select th e i/o direction for the port c pins. bits pc21ior to pc0ior correspond to pins pc21 to pc0, respectively. pciorh and pciorl are enabled when the function of the po rt c pins is set to general-purpose i/o (pc21 to pc0) and to tioc i/o (mtu2) by pccr, an d are disabled in other cases. when a bit in pciorh and pciorl is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 to 6 in pciorh are reserved. these bits are always read as 0. the write value should always be 0. pciorh and pciorl are initialized to h'0000 by a power-on reset or by switching to deep standby mode. these registers are not initialized either by a manual reset or by switching to sleep mode or software standby mode. (1) port c i/o register h (pciorh) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r r r r/w r/w r/w r/w r/w r/w ?????? r ? r ? r ? r ? pc21 ior pc20 ior pc19 ior pc18 ior pc17 ior pc16 ior (2) port c i/o register l (pciorl) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pc15 ior pc14 ior pc13 ior pc12 ior pc11 ior pc10 ior pc9 ior pc8 ior pc7 ior pc6 ior pc5 ior pc4 ior pc3 ior pc2 ior pc1 ior pc0 ior
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 957 of 1164 rej09b0321-0200 23.1.6 port c control registers 1 to 7 (pccr1 to pccr7) pccr1 to pccr7 are 16-bit readable/writable registers that select the functions of the multiplexed port c pins. when irq3b to irq0b are selected, do not set a input for the same interrupt. pccr2, pccr5, pccr6, and pccr7 are initialized to h'0000 by a power-on reset or by switching to deep standby mode. pccr1 is initialized to h'0001 and pccr3 and pccr4 are initialized to the values shown in table 23.9 by a power-on reset or by switching to deep standby mode. these registers are not initialized either by a manual reset or by switching to sleep mode or software standby mode. table 23.9 port c control register initial values initial value register area 0: 32-bit mode area 0: 16-bit mode area 0: 8-bit mode pccr4 h'0001 h'0000 h'0000 pccr3 h'1111 h'0111 h'0011 (1) port c control register 7 (pccr7) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r r r r r r r r/w r/w r r r/w r/w ?????????? pc25md1[1:0] ?? pc24md1[1:0] bit bit name initial value r/w description 15 to 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5, 4 pc25md [1:0] 00 r/w pc25 mode these bits control the f unction of the pc25/irq3b/ sda1 pin. 00: pc25 input (port) 01: irq3b input (intc) 10: setting prohibited 11: sda1 i/o (iic3)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 958 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pc24md [1:0] 00 r/w pc24 mode these bits control the f unction of the pc24/irq2b/ scl1 pin. 00: pc24 input (port) 01: irq2b input (intc) 10: setting prohibited 11: scl1 i/o (iic3) (2) port c control register 6 (pccr6) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r/w r/w r r r/w r/w r r r/w r/w r r r/w r/w ?? pc23md[1:0] pc22md[1:0] pc21md[1:0] ?? ??? pc20md[1:0] ? bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 pc23md [1:0] 00 r/w pc23 mode these bits control the f unction of the pc23/irq1b/ sda0 pin. 00: pc23 input (port) 01: irq1b input (intc) 10: setting prohibited 11: sda0 i/o (iic3) 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 959 of 1164 rej09b0321-0200 bit bit name initial value r/w description 9, 8 pc22md [1:0] 00 r/w pc22 mode these bits control the function of the pc22/ irq0b/dreq2/scl0 pin. 00: pc22 input (port) 01: irq0b input (intc) 10: dreq2 input (dmac) 11: scl0 i/o (iic3) 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5, 4 pc21md [1:0] 00 r/w pc21 mode these bits control the f unction of the pc21/bc3/ dqm3/tclkc/dack2 pin. 00: pc21 input (port) 01: bc3/dqm3 output (bsc) 10: tclkc input (mtu2) 11: dack2 output (dmac) 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pc20md [1:0] 00 r/w pc20 mode these bits control the f unction of the pc20/bc2/ dqm2/tclkb pin. 00: pc20 i/o (port) 01: bc2/dqm2 output (bsc) 10: tclkb input (mtu2) 11: setting prohibited
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 960 of 1164 rej09b0321-0200 (3) port c control register 5 (pccr5) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r/w r r r r/w r r r r/w r r r r/w ??? pc19 md0 ??? pc18 md0 ??? pc17 md0 ??? pc16 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pc19md0 0 r/w pc19 mode this bit controls the function of the pc19/ bc1/ dqm1 pin. 0: pc19 i/o (port) 1: bc1/dqm1 output (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pc18md0 0 r/w pc18 mode this bit controls the function of the pc18/ bc0/ dqm0 pin. 0: pc18 i/o (port) 1: bc0/dqm0 output (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pc17md0 0 r/w pc17 mode this bit controls the function of the pc17/ sdwe pin. 0: pc17 i/o (port) 1: sdwe output (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 961 of 1164 rej09b0321-0200 bit bit name initial value r/w description 0 pc16md0 0 r/w pc16 mode this bit controls the function of the pc16/ sdcas pin. 0: pc16 i/o (port) 1: sdcas output (bsc) (4) port c control register 4 (pccr4) 1514131211109876543210 bit: initial value: r/w: 0000000000000000/1 * r r r r/w r r r r/w r r r r/w r r r/w r/w ??? pc15 md0 ??? pc14 md0 ??? pc13 md0 ?? pc12md[1:0] note: * the initial value dependes on the lsi's clock operating mode. bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pc15md0 0 r/w pc15 mode this bit controls the function of the pc15/ sdras pin. 0: pc15 i/o (port) 1: sdras output (bsc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pc14md0 0 r/w pc14 mode this bit controls the function of the pc14/sdcke pin. 0: pc14 i/o (port) 1: sdcke output (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 962 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 pc13md0 0 r/w pc13 mode this bit controls the function of the pc13/ wait pin. 0: pc13 i/o (port) 1: wait input (bsc) 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pc12md [1:0] 00/01 * r/w pc12 mode these bits control t he function of the pc12/ wr3 / tioc2b/dtend2 pin. 00: pc12 i/o (port) 01: wr3 output (bsc) 10: tioc2b i/o (mtu2) 11: dtend2 output (dmac) note: * the initial value depends on the lsi's operating mode. (5) port c control register 3 (pccr3) 1514131211109876543210 bit: initial value: r/w: 0000/1 * 0000/1 * 00010001 r r r/w r/w r r r r/w r r r r/w r r r r/w ?? pc11md[1:0] ??? pc10 md0 ??? pc9 md0 ??? pc8 md0 note: * the initial value dependes on the lsi's clock operating mode. bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 963 of 1164 rej09b0321-0200 bit bit name initial value r/w description 13, 12 pc11md [1:0] 00/01 * r/w pc11 mode these bits control t he function of the pc11/ wr2 / tioc2a/dact2 pin. 00: pc11 i/o (port) 01: wr2 output (bsc) 10: tioc2a i/o (mtu2) 11: dact2 output (dmac) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pc10md0 0/1 * r/w pc10 mode this bit controls the function of the pc10/ wr1 pin. 0: pc10 i/o (port) 1: wr1 output (bsc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pc9md0 1 r/w pc9 mode this bit controls the function of the pc9/ wr0 pin. 0: pc9 i/o (port) 1: wr0 output (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pc8md0 1 r/w pc8 mode this bit controls the function of the pc8/ rd pin. 0: pc8 i/o (port) 1: rd output (bsc) note: * the initial value depends on the lsi's operating mode.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 964 of 1164 rej09b0321-0200 (6) port c control register 2 (pccr2) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r/w r r r/w r/w r r r/w r/w r r r/w r/w ??? pc7 md0 pc6md[1:0] pc5md[1:0] ?? ? ? ? pc4md[1:0] ? bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pc7md0 0 r/w pc7 mode this bit controls the function of the pc7/ sdcs0 pin. 0: pc7 i/o (port) 1: sdcs0 output (bsc) 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 pc6md[1:0] 00 r/w pc6 mode these bits control t he function of the pc6/ cs6 / sck5/tclka pin. 00: pc6 i/o (port) 01: cs6 output (bsc) 10: sck5 i/o (scif) 11: tclka input (mtu2) 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5, 4 pc5md[1:0] 00 r/w pc5 mode these bits control t he function of the pc5/ cs5 / rxd5/tioc1b pin. 00: pc5 i/o (port) 01: cs5 output (bsc) 10: rxd5 input (scif) 11: tico1b i/o (mtu2)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 965 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pc4md[1:0] 00 r/w pc4 mode these bits control t he function of the pc4/ cs4 / txd5/tioc1a pin. 00: pc4 i/o (port) 01: cs4 output (bsc) 10: txd5 output (scif) 11: tioc1a i/o (mtu2) (7) port c control register 1 (pccr1) 1514131211109876543210 bit: initial value: r/w: 0000000000000001 r r r/w r/w r r r/w r/w r r r r/w r r r r/w ? ? pc3md[1:0] pc2md[1:0] pc1 md0 ?? ??? pc0 md0 ? ?? bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 pc3md[1:0] 00 r/w pc3 mode these bits control t he function of the pc3/ cs3 / ubctrg pin. 00: pc3 i/o (port) 01: cs3 output (bsc) 10: ubctrg output (ubc) 11: setting prohibited 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 966 of 1164 rej09b0321-0200 bit bit name initial value r/w description 9, 8 pc2md[1:0] 00 r/w pc2 mode these bits control t he function of the pc2/ cs2 / sdcs1 / adtrg pin. 00: pc2 i/o (port) 01: cs2 output (bsc) 10: sdcs1 output (bsc) 11: adtrg input (a/d) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pc1md0 0 r/w pc1 mode this bit controls the function of the pc1/ cs1 pin. 0: pc1 i/o (port) 1: cs1 output (bsc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pc0md0 1 r/w pc0 mode this bit controls the function of the pc0/ cs0 pin. 0: pc0 i/o (port) 1: cs0 output (bsc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 967 of 1164 rej09b0321-0200 23.1.7 port d i/o register (pdior) pdior are 16-bit readable/writable registers that se lect the i/o direction for the port d pins. bits pd14ior to pd0ior correspond to pins pd14 to pd0, respectively. pdior are enabled when the function of the port d pins is set to general-purpose i/o (pd14 to pd0) and to tioc i/o (mtu2) by pdcr, and are disabled in other cases. when a bit in pdior is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 in pdior is reserved. these bits are always read as 0. the write value should always be 0. pdior are initialized to h'0000 by a power-on reset or by switching to deep standby mode. these registers are not initialized either by a manual rese t or by switching to sleep mode or software standby mode. 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ? pd14 ior pd13 ior pd12 ior pd11 ior pd10 ior pd9 ior pd8 ior pd7 ior pd6 ior pd5 ior pd4 ior pd3 ior pd2 ior pd1 ior pd0 ior
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 968 of 1164 rej09b0321-0200 23.1.8 port d control registers 1 to 5 (pdcr1 to pdcr5) pdcr1 to pdcr5 are 16-bit readable/writable re gisters that select the functions of the multiplexed port d pins. pdcr1 to pdcr5 are initialized to h'0000 by a power-on reset or by switching to deep standby mode. these registers are not initia lized either by a manual reset or by switching to sleep mode or software standby mode. (1) port d control register 5 (pdcr5) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 rrrrrrrrrrrrrrr/wr/w ??? ??? ??? ? ? ? ? ? pd16md[1:0] bit bit name initial value r/w description 15 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pd16md [1:0] 00 r/w pd16 mode these bits control the func tion of the pd16/scl2 pin. 00: pd16 input (port) 01: scl2 i/o (iic3) 10: setting prohibited 11: setting prohibited
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 969 of 1164 rej09b0321-0200 (2) port d control register 4 (pdcr4) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r/w r/w r r r/w r/w r r r/w r/w r r r/w r/w ? ? pd15md[1:0] ? ? pd14md[1:0] ? ? pd13md[1:0] ? ? pd12md[1:0] bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 pd15md [1:0] 00 r/w pd15 mode these bits control the function of the pd15/ sda2 pin. 00: pd15 input (port) 01: sda2 i/o (iic3) 10: setting prohibited 11: setting prohibited 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 pd14md [1:0] 00 r/w pd14 mode these bits control the func tion of the pd14/dack1 pin. 00: pd14 i/o (port) 01: setting prohibited 10: dack1 output (dmac) 11: setting prohibited 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 970 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5, 4 pd13md [1:0] 000 r/w pd13 mode these bits control the func tion of the pd13/dreq1 pin. 00: pd13 i/o (port) 01: setting prohibited 10: dreq1 input (dmac) 11: setting prohibited 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pd12md [1:0] 00 r/w pd12 mode these bits control the function of the pd12/ sck1/tmci1 pin. 00: pd12 i/o (port) 01: sck1 i/o (scif) 10: tmci1 input (tmr) 11: setting prohibited
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 971 of 1164 rej09b0321-0200 (3) port d control register 3 (pdcr3) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r/w r/w r r r/w r/w r r r/w r/w r r r/w r/w ? ? pd11md[1:0] ? ? pd10md[1:0] ? ? pd9md[1:0] ? ? pd8md[1:0] bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 13, 12 pd11md [1:0] 00 r/w pd11 mode these bits control the function of the pd11/ rxd1/tmri1 pin. 00: pd11 i/o (port) 01: rxd1 input (scif) 10: tmri1 output (tmr) 11: setting prohibited 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 pd10md [1:0] 00 r/w pd10 mode these bits control the function of the pd10/ txd1/tmo1/tioc0d pin. 00: pd10 i/o (port) 01: txd1 output (scif) 10: tmo1 output (tmr) 11: tioc0d i/o (mtu2) 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 972 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5, 4 pd9md[1:0] 00 r/w pd9 mode these bits control the function of the pd9/ sck0/tioc0c pin. 00: pd9 i/o (port) 01: sck0 i/o (scif) 10: setting prohibited 11: tioc0c i/o (mtu2) 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pd8md[1:0] 00 r/w pd8 mode these bits control t he function of the pd8/rxd0/dtend1/tioc0b pin. 00: pd8 i/o (port) 01: rxd0 input (scif) 10: dtend1 output (dmac) 11: tioc0b i/o (mtu2) (4) port d control register 2 (pdcr2) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r/w r/w r r r/w r/w r r r/w r/w r r r/w r/w ? ? pd7md[1:0] ? ? pd6md[1:0] ? ? pd5md[1:0] ? ? pd4md[1:0] bit bit name initial value r/w description 15, 14 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 973 of 1164 rej09b0321-0200 bit bit name initial value r/w description 13, 12 pd7md[1:0] 00 r/w pd7 mode these bits control t he function of the pd7/txd0/dact1/tioc0a pin. 00: pd7 i/o (port) 01: txd0 output (scif) 10: dact1 output (dmac) 11: tioc0a i/o (mtu2) 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 pd6md[1:0] 00 r/w pd6 mode these bits control the function of the pd6/ ssiws1/sck4 pin. 00: pd6 i/o (port) 01: ssiws1 i/o (ssi) 10: sck4 i/o (scif) 11: setting prohibited 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5, 4 pd5md[1:0] 00 r/w pd5 mode these bits control the function of the pd5/ ssick1/rxd4 pin. 00: pd5 i/o (port) 01: ssisck1 i/o (ssi) 10: rxd4 input (scif) 11: setting prohibited 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 974 of 1164 rej09b0321-0200 bit bit name initial value r/w description 1, 0 pd4md[1:0] 00 r/w pd4 mode these bits control the function of the pd4/ ssidata1/txd4 pin. 00: pd4 i/o (port) 01: ssidata1 i/o (ssi) 10: txd4 output (scif) 11: setting prohibited (5) port d control register 1 (pdcr1) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r/w r r r r/w r r r r/w r r r r/w ??? pd3 md0 ??? pd2 md0 ??? pd1 md0 ??? pd0 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pd3md0 0 r/w pd3 mode this bit controls the func tion of the pd3/ssiws0 pin. 0: pd3 i/o (port) 1: ssiws0 i/o (ssi) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pd2md0 0 r/w pd2 mode this bit controls the func tion of the pd2/sick0 pin. 0: pd2 i/o (port) 1: ssisck0 i/o (ssi) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 975 of 1164 rej09b0321-0200 bit bit name initial value r/w description 4 pd1md0 0 r/w pd1 mode this bit controls the func tion of the pd1/ssidata0 pin. 0: pd1 i/o (port) 1: ssidata0 i/o (ssi) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pd0md0 0 r/w pd0 mode this bit controls the function of the pd0/ audio_clk pin. 0: pd0 i/o (port) 1: audio_clk input (ssi) 23.1.9 port e control registers 1 and 2 (pecr1 and pecr2) pecr1 and pecr2 are 16-bit readable/writable re gisters that select the functions of the multiplexed port e pins. the pins states are set by the corresponding module for a/d converter input and for d/a converter output. when irq7b to irq4b or pint7b to pint4b are selected, do not set a input for the same interrupt. pecr1 and pecr2 are initialized to h'0000 by a power-on reset or by switching to deep standby mode. these registers are not initialized either by a manual reset or by switching to sleep mode or software standby mode.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 976 of 1164 rej09b0321-0200 (1) port e control register 2 (pecr2) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r/w r r r r/w r r r r/w r r r r/w ??? pe7 md0 ??? pe6 md0 ??? pe5 md0 ??? pe4 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pe7md0 0 r/w pe7 mode this bit controls the function of the pe7/irq7b pin. 0: pe7 input (port) 1: irq7b input (intc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pe6md0 0 r/w pe6 mode this bit controls the function of the pe6/irq6b pin. 0: pe6 input (port) 1: irq6b input (intc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pe5md0 0 r/w pe5 mode this bit controls the function of the pe5/irq5b pin. 0: pe5 input (port) 1: irq5b input (intc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pe4md0 0 r/w pe4 mode this bit controls the function of the pe4/irq4b pin. 0: pe4 input (port) 1: irq4b input (intc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 977 of 1164 rej09b0321-0200 (2) port e control register 1 (pecr1) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r/w r r r r/w r r r r/w r r r r/w ??? pe3 md0 ??? pe2 md0 ??? pe1 md0 ??? pe0 md0 bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pe3md0 0 r/w pe3 mode this bit controls the function of the pe3/pint7b pin. 0: pe3 input (port) 1: pint7b input (intc) 11 to 9 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 8 pe2md0 0 r/w pe2 mode this bit controls the function of the pe2/pint6b pin. 0: pe2 input (port) 1: pint6b input (intc) 7 to 5 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 4 pe1md0 0 r/w pe1 mode this bit controls the function of the pe1/pint5b pin. 0: pe1 input (port) 1: pint5b input (intc) 3 to 1 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 0 pe0md0 0 r/w pe0 mode this bit controls the function of the pe0/pint4b pin. 0: pe0 input (port) 1: pint4b input (intc)
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 978 of 1164 rej09b0321-0200 23.1.10 port f i/o register (pfior) pfior is a 16-bit readable/writable register that selects the i/o direction for the port f pins. bits pf7ior to pf0ior correspond to pins pf7 to pf0, respectively. pfior is enabled when the function of the port f pins is set to general-purpose i/o (pf7 to pf0) by pfcr, and are disabled in other cases. when a bit in pfior is set to 1, the corresponding pin is set to output, and when set to 0, the pin is set to input. bits 15 to 8 in pfior are reserved. these bits are always read as 0. the wr ite value should always be 0. pfior is initialized to h'0000 by a power-on reset or by switching to deep standby mode. this register is not initialized either by a manual re set or by switching to sleep mode or software standby mode. 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r r r r r r/w r/w r/w r/w r/w r/w r/w r/w ???????? pf7 ior pf6 ior pf5 ior pf4 ior pf3 ior pf2 ior pf1 ior pf0 ior
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 979 of 1164 rej09b0321-0200 23.1.11 port f control registers 1 and 2 (pfcr1 and pfcr2) pfcr1 and pfcr2 are 16-bit readable/writable re gisters that select the functions of the multiplexed port f pins. pfcr1 and pfcr2 are initialized to h'0000 by a power-on reset or by switching to deep standby mode. these registers are not initialized either by a manual reset or by switching to sleep mode or software standby mode. (1) port f control register 2 (pfcr2) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r/w r r r/w r/w r r r/w r/w r r r/w r/w ??? pf7 md0 pf6md[1:0] pf5md[1:0] ?? ? ? ? pf4md[1:0] ? bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pf7md0 0 r/w pf7 mode this bit controls the functi on of the pf7/audata3 pin. 0: pf7 i/o (port) 1: audata3 i/o (aud-ii) 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 pf6md[1:0] 00 r/w pf6 mode these bits control the function of the pf6/ audata2 pin. 00: pf6 i/o (port) 01: audata2 i/o (aud-ii) 10: setting prohibited 11: setting prohibited
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 980 of 1164 rej09b0321-0200 bit bit name initial value r/w description 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5, 4 pf5md[1:0] 00 r/w pf5 mode these bits control the function of the pf5/ audata1 pin. 00: pf5 i/o (port) 01: audata1 i/o (aud-ii) 10: setting prohibited 11: setting prohibited 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pf4md[1:0] 00 r/w pf4 mode these bits control the function of the pf4/ audata0 pin. 00: pf4 i/o (port) 01: audata0 i/o (aud-ii) 10: setting prohibited 11: setting prohibited
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 981 of 1164 rej09b0321-0200 (2) port f control register 1 (pfcr1) 1514131211109876543210 bit: initial value: r/w: 0000000000000000 r r r r/w r r r/w r/w r r r/w r/w r r r/w r/w ??? pf3 md0 pf2md[1:0] pf1md[1:0] ?? ? ? ? pf0md[1:0] ? bit bit name initial value r/w description 15 to 13 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 12 pf3md0 0 r/w pf3 mode this bit controls the function of the pf3/ audsync pin. 0: pf3 i/o (port) 1: audsync input (aud-ii) 11, 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 9, 8 pf2md[1:0] 00 r/w pf2 mode these bits control the function of the pf2/ audck/sck7/tclkd pin. 00: pf2 i/o (port) 01: audck input (aud-ii) 10: sck7 i/o (scif) 11: tclkd input (mtu2) 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 23 pin function controller (pfc) rev. 2.00 sep. 07, 2007 page 982 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5, 4 pf1md[1:0] 00 r/w pf1 mode these bits control the function of the pf1/ audmd/rxd7 pin. 00: pf1 i/o (port) 01: audmd input (aud-ii) 10: rxd7 input (scif) 11: setting prohibited 3, 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1, 0 pf0md[1:0] 00 r/w pf0 mode these bits control the function of the pf0/ audrst /txd7 pin. 00: pf0 i/o (port) 01: audrst input (aud-ii) 10: txd7 output (scif) 11: setting prohibited 23.2 usage note the settings of the port control registers are used as the output pin select signals, and are not basically used as the input pin select signals. this causes the signals input from the pins to propagate to all the modules ha ving the relevant multiplexed pi ns. so, unnecessary input signals must be disabled by the settings of the respective modules. settings of port control registers are decoded to enable/disable pins irq7a to irq0a and irq7b to irq0b or pins pint7a to pint0a and pint7b to pint0b. be sure to select either one of them.
section 24 on-chip ram rev. 2.00 sep. 07, 2007 page 983 of 1164 rej09b0321-0200 section 24 on-chip ram this lsi has an on-chip ram module that achie ves high-speed access and can store instructions or data. on-chip ram operation and write access to the ra m can be enabled or disabled through the ram enable bits and ram write enable bits. 24.1 features ? pages two pages (pages 0 and 1) are provided. ? memory map the on-chip ram is located in the address spaces shown in table 24.1. table 24.1 on-chip ram address spaces page address page 0 h'fff80000 to h'fff83fff page 1 h'fff84000 to h'fff87fff ? ports each page has two independent read and write ports and is connected to the internal bus (i bus), cpu instruction fetch bus (f bus), and cp u memory access bus (m bu s). (note that the f bus is connected only to the read ports.) the f bus and m bus are used for access by the cpu, and the i bus is used for access by the dmac via the internal dma write bus/internal dma read bus and bus bridge. ? priority when requests for access to the same page fr om different buses coincide, the access is processed in priority order. the priority is i bus > m bus > f bus.
section 24 on-chip ram rev. 2.00 sep. 07, 2007 page 984 of 1164 rej09b0321-0200 24.2 usage notes 24.2.1 page conflict when the same page is accessed from different buses simultaneo usly, a conflict on the page occurs. although each access is comp leted correctly, this kind of conflict degrades the memory access speed. therefore, it is advisable to provide so ftware measures to prev ent such conflicts as far as possible. for example, no conflict will aris e if different memory modules or different pages are accessed by each bus. 24.2.2 rame and ramwe bits before disabling memory operation or write access through the rame or ramwe bit, be sure to read from any address and then wr ite to the same address in each page; otherwise, the last written data in each page may not be actually written to the ram. // for ram page 0 mov.l #h'fff80000,r0 mov.l @r0,r1 mov.l r1,@r0 // for ram page 1 mov.l #h'fff84000,r0 mov.l @r0,r1 mov.l r1,@r0 figure 24.1 examples of re ad/write before disabling ram
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 985 of 1164 rej09b0321-0200 section 25 power-down modes this lsi supports sleep mode, software standby mode, deep standby mode, and module standby mode. in power-down modes, functions of cpu, clocks, on-chip memory, or part of on-chip peripheral modules are halted or the power-supply is turned off, through which low power consumption is achieved. these modes ar e canceled by a re set or interrupt. 25.1 features 25.1.1 power-down modes this lsi has the following power-down modes and function: 1. sleep mode 2. software standby mode 3. deep standby mode 4. module standby function table 25.1 shows the transition conditions for entering the modes from the program execution state, as well as the cpu and peripheral module states in each mode and the procedures for canceling each mode.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 986 of 1164 rej09b0321-0200 table 25.1 states of power-down modes state * 1 power- down mode transition conditions cpg cpu cpu register on-chip ram on-chip peripheral modules rtc power supply external memory canceling procedure sleep mode execute sleep instruction with stby bit in stbcr cleared to 0 runs halts held runs runs runs * 2 runs auto- refreshing ? interrupt ? manual reset ? power-on reset ? bus error software standby mode execute sleep instruction with stby bit in stbcr set to 1 and deep bit to 0 halts halts held halts (contents are held) halts runs * 2 runs self- refreshing ? nmi interrupt ? irq interrupt ? manual reset ? power-on reset deep standby mode execute sleep instruction with stby and deep bits in stbcr set to 1 halts halts halts halts (contents are held * 3 ) halts runs * 2 halts self- refreshing ? nmi interrupt * 4 ? irq interrupt * 4 (only for pe7 to pe4 and pc25 to pc22) ? manual reset * 4 ? power-on reset * 4 module standby function set the mstp bits in stbcr2 to stbcr5 to 1 runs runs held runs specified module halts halts runs auto- refreshing ? clear mstp bit to 0 ? power-on reset (only for rtc, h-udi, ubc, dmac, and aud-ii) notes: 1. the pin state is retained or set to high impedance. for details, see appendix a, pin states. 2. rtc operates when the start bit in the rcr2 register is set to 1. for details, see section 15, realtime clock (rtc). 3. setting bits ramkp3 to ramkp0 in the ra mkp register to 1 enables the retention of data in the corresponding area in the on-ch ip ram during the transition to deep standby mode. however, when deep standby mode is canceled by a power-on reset, the contents in the corresponding on-chip ram area are not retained. 4. deep standby mode can be canceled by an interrupt (nmi or irq) or a reset (manual reset or power-on reset). however, irq is reset only by pe7 to pe0 and pc25 to pc22. when deep standby mode is canceled by nmi interrupt or irq interrupt, reset exception handling is executed instead of interrupt e xception handling. these are power-on reset exception handlings including a manual reset.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 987 of 1164 rej09b0321-0200 25.2 register descriptions the following registers are us ed in power-down modes. table 25.2 register configuration register name abbreviation r/w initial value address access size standby control register stbcr r/w h'00 h'fffe0014 8 standby control register 2 stbcr2 r/w h'1e h'fffe0018 8 standby control register 3 stbcr3 r/w h'3f h'fffe0408 8 standby control register 4 stbcr4 r/w h'ff h'fffe040c 8 standby control register 5 stbcr5 r/w h'ff h'fffe0410 8 system control register 1 syscr1 r/w h'ff h'fffe0402 8 system control register 2 syscr2 r/w h'ff h'fffe0404 8 ram retaining area specifying register ramkp r/w h'00 h'ffff1907 8 deep standby oscillation stabilizing clock select register dscnt r/w h'00 h'ffff1906 8 deep standby cancel source flag register dsfr r/w h'0000 h'ffff1904 16
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 988 of 1164 rej09b0321-0200 25.2.1 standby control register (stbcr) stbcr is an 8-bit readable/writable register that specifies the state of th e power-down mode. this register is initialized to h'00 by a power-on reset or in deep standby mode but retains its previous value by a manual reset or in software standby mode. only byte access is valid. note: when writing to this register, see section 25.4, usage note. 7654321 0 000000 r/w rrrr r bit: initial value: r/w: stby 0 r/w deep 0 r/w mstp1 ???? ? bit bit name initial value r/w description 7 6 stby deep 0 0 r/w r/w software standby, deep standby specifies transition to software standby mode or deep standby mode. 0x: executing sleep instruction puts chip into sleep mode. 10: executing sleep instruction puts chip into software standby mode. 11: executing sleep instruction puts chip into deep standby mode. 5 to 2 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 1 mstp1 0 r/w module stop 1 setting the mstp1 bit to 1 stops supplying clock to rtc 0: rtc runs 1: stops supplying clock to rtc 0 ? 0 r reserved this bit is always read as 0. the write value should always be 0. [legend] x: don't care
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 989 of 1164 rej09b0321-0200 25.2.2 standby control register 2 (stbcr2) stbcr2 is an 8-bit readable/writable register that controls the operation of modules in power- down modes. stbcr2 is initialized to h'1e by a power-on reset or in deep standby mode but retains its previous value by a manu al reset or in software standby mode. only byte access is valid. note: when writing to this register, see section 25.4, usage note. 7654321 0 000 r/w r/w r/w bit: initial value: r/w: mstp 10 mstp 9 mstp 8 11 r/w r/w mstp 6 mstp 5 0 r/w mstp 3 1 r ? 1 r ? bit bit name initial value r/w description 7 mstp10 0 r/w module stop 10 when the mstp10 bit is set to 1, the supply of the clock to the h-udi is halted. 0: h-udi runs. 1: clock supply to h-udi halted. 6 mstp9 0 r/w module stop 9 when the mstp9 bit is set to 1, the supply of the clock to the ubc is halted. 0: ubc runs. 1: clock supply to ubc halted. 5 mstp8 0 r/w module stop 8 when the mstp8 bit is set to 1, the supply of the clock to the dmac is halted. 0: dmac runs. 1: clock supply to dmac halted. 4 ? 1 r reserved this bit is always read as 1. the write value should always be 1.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 990 of 1164 rej09b0321-0200 bit bit name initial value r/w description 3 mstp6 1 r/w module stop 6 when the mstp6 bit is set to 1, the supply of the clock to the rcan-et0 is halted. 0: rcan-et0 runs. 1: clock supply to rcan-et0 halted. 2 mstp5 1 r/w module stop 5 when the mstp5 bit is set to 1, the supply of the clock to the rcan-et1 is halted. 0: rcan-et1 runs. 1: clock supply to rcan-et1 halted. 1 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 0 mstp3 0 r/w module stop 3 when the mstp3 bit is set to 1, the supply of the clock to the aud-ii is halted. 0: aud-ii runs. 1: clock supply to aud-ii halted.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 991 of 1164 rej09b0321-0200 25.2.3 standby control register 3 (stbcr3) stbcr3 is an 8-bit readable/writable register that controls the operation of modules in power- down modes. stbcr3 is initialized to h'3f by a power-on reset or in deep standby mode but retains its previous value by a manual reset or in software standby mode. only byte access is valid. note: when writing to this register, see section 25.4, usage note. 7654321 0 00111111 r/w r/w r/w r/w r bit: initial value: r/w: mstp 35 mstp 33 mstp 32 mstp 31 ? r ? r ? r ? bit bit name initial value r/w description 7, 6 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 5 mstp35 1 r/w module stop 35 when the mstp35 bit is set to 1, the supply of the clock to the mtu2 is halted. 0: mtu2 runs. 1: clock supply to mtu2 halted. 4 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 3 mstp33 1 r/w module stop 33 when the mstp33 bit is set to 1, the supply of the clock to the tmr is halted. 0: tmr runs. 1: clock supply to tmr halted. 2 mstp32 1 r/w module stop 32 when the mstp32 bit is set to 1, the supply of the clock to the adc is halted. 0: adc runs. 1: clock supply to adc halted.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 992 of 1164 rej09b0321-0200 bit bit name initial value r/w description 1 mstp31 1 r/w module stop 31 when the mstp31 bit is set to 1, the supply of the clock to the dac is halted. 0: dac runs. 1: clock supply to dac halted. 0 ? 1 r reserved this bit is always read as 1. the write value should always be 1. 25.2.4 standby control register 4 (stbcr4) stbcr4 is an 8-bit readable/writable register that controls the operation of modules in power- down modes. stbcr4 is initialized to h'ff by a power-on reset or in deep standby mode but retains its previous value by a manual reset or in software standby mode. only byte access is valid. note: when writing to this register, see section 25.4, usage note. 7654321 0 1111 1 r/w r/w r/w r/w r/w bit: initial value: r/w: mstp 46 mstp 47 mstp 45 mstp 44 1 r/w mstp 43 mstp 42 1 r/w mstp 41 1 r/w mstp 40 bit bit name initial value r/w description 7 mstp47 1 r/w module stop 47 when the mstp47 bit is set to 1, the supply of the clock to the scif0 is halted. 0: scif0 runs. 1: clock supply to scif0 halted. 6 mstp46 1 r/w module stop 46 when the mstp46 bit is set to 1, the supply of the clock to the scif1 is halted. 0: scif1 runs. 1: clock supply to scif1 halted.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 993 of 1164 rej09b0321-0200 bit bit name initial value r/w description 5 mstp45 1 r/w module stop 45 when the mstp45 bit is set to 1, the supply of the clock to the scif2 is halted. 0: scif2 runs. 1: clock supply to scif2 halted. 4 mstp44 1 r/w module stop 44 when the mstp44 bit is set to 1, the supply of the clock to the scif3 is halted. 0: scif3 runs. 1: clock supply to scif3 halted. 3 mstp43 1 r/w module stop 43 when the mstp43 bit is set to 1, the supply of the clock to the scif4 is halted. 0: scif4 runs. 1: clock supply to scif4 halted. 2 mstp42 1 r/w module stop 42 when the mstp42 bit is set to 1, the supply of the clock to the scif5 is halted. 0: scif5 runs. 1: clock supply to scif5 halted. 1 mstp41 1 r/w module stop 41 when the mstp41 bit is set to 1, the supply of the clock to the scif6 is halted. 0: scif6 runs. 1: clock supply to scif6 halted. 0 mstp40 1 r/w module stop 40 when the mstp40 bit is set to 1, the supply of the clock to the scif7 is halted. 0: scif7 runs. 1: clock supply to scif7 halted.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 994 of 1164 rej09b0321-0200 25.2.5 standby control register 5 (stbcr5) stbcr5 is an 8-bit readable/writable register that controls the operation of modules in power- down modes. stbcr5 is initialized to h'ff by a power-on reset or in deep standby mode but retains its previous value by a manual reset or in software standby mode. only byte access is valid. note: when writing to this register, see section 25.4, usage note. 7654321 0 1111 1 1 1 r/w r/w r/w r/w r/w rr bit: initial value: r/w: mstp 56 mstp 57 mstp 55 ckdv 3 1 r/w mstp 53 mstp 52 ?? bit bit name initial value r/w description 7 mstp57 1 r/w module stop 57 when the mstp57 bit is set to 1, the supply of the clock to the iic30 is halted. 0: iic30 runs. 1: clock supply to iic30 halted. 6 mstp56 1 r/w module stop 56 when the mstp56 bit is set to 1, the supply of the clock to the iic31 is halted. 0: iic31 runs. 1: clock supply to iic31 halted. 5 mstp55 1 r/w module stop 55 when the mstp55 bit is set to 1, the supply of the clock to the iic32 is halted. 0: iic32 runs. 1: clock supply to iic32 halted. 4 ? 1 r reserved this bit is always read as 1. the write value should always be 0. 3 mstp53 1 r/w module stop 53 when the mstp53 bit is set to 1, the supply of the clock to the ssi0 is halted. 0: ssi0 runs. 1: clock supply to ssi0 halted.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 995 of 1164 rej09b0321-0200 bit bit name initial value r/w description 2 mstp52 1 r/w module stop 52 when the mstp52 bit is set to 1, the supply of the clock to the ssi1 is halted. 0: ssi1 runs. 1: clock supply to ssi1 halted. 1 ? 1 r reserved this bit is always read as 1. the write value should always be 0. 0 ckdv3 1 r/w ssi clock select selects division ratio for oversample clock input to ssi 0: 1/4 times 1: 1 time
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 996 of 1164 rej09b0321-0200 25.2.6 system control register 1 (syscr1) syscr1 is an 8-bit readable/writable register that enables or disables access to the on-chip ram. syscr1 is initialized to h'ff by a power-on reset or in deep standby mode but retains its previous value by a manual reset or in software standby mode. only byte access is valid. when an rame bit is set to 1, the corresponding on-chip ram area is enabled. when an rame bit is cleared to 0, the corresponding on-chip ram area cannot be accessed. in this case, an undefined value is returned when reading data or fetching an instruction from the on-chip ram, and writing to the on-chip ram is ignored. the initial value of an rame bit is 1. note that when clearing the rame bit to 0 to di sable the on-chip ram, be sure to execute an instruction to read from or write to the same arbitrary address in each page before setting the rame bit. if such an instruction is not executed, the data last written to each page may not be written to the on-chip ram. furthermore, an instruction to access the on-chip ram should not be located immediately after the instruction to write to syscr1. if an on-chip ram access instruction is set, normal access is not guaranteed. note: when writing to this register, see section 25.4, usage note. 7654321 0 11111111 r r r r r/w r/w bit: initial value: r/w: ???? rr ?? rame1 rame0 bit bit name initial value r/w description 7 to 2 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. 1 rame1 1 r/w ram enable 1 (corresponding ram addresses: h'fff84000 to h'fff87fff) 0: on-chip ram disabled 1: on-chip ram enabled 0 rame0 1 r/w ram enable 0 (corresponding ram addresses: h'fff80000 to h'fff83fff) 0: on-chip ram disabled 1: on-chip ram enabled
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 997 of 1164 rej09b0321-0200 25.2.7 system control register 2 (syscr2) syscr2 is an 8-bit readable/writable register that enables or disables write to the on-chip ram. syscr2 is initialized to h'ff by a power-on reset or in deep standby mode but retains its previous value by a manual reset or in software standby mode. only byte access is valid. when an ramwe bit is set to 1, the corresp onding on-chip ram area is enabled. when an ramwe bit is cleared to 0, the corresponding on-chip ram area cannot be written to. in this case, writing to the on-chip ram is ignored. the initial value of an ramwe bit is 1. note that when clearing the ramwe bit to 0 to disable the on-chip ram, be sure to execute an instruction to read from or write to the same arbitrary address in each page before setting the ramwe bit. if such an in struction is not executed, the data la st written to each page may not be written to the on-chip ram. furthermore, an instruction to access the on-chip ram should not be placed immediately after the instruction to write to syscr2. if an on-chip ram access instruction is set, normal access is not guaranteed. note: when writing to this register, see section 25.4, usage note. 7654321 0 11111111 r r r r r r/w r/w bit: initial value: r/w: ???? r ?? ram we1 ram we0 bit bit name initial value r/w description 7 to 2 ? all 1 r reserved these bits are always read as 1. the write value should always be 1. 1 ramwe1 1 r/w ram write enable 1 (corresponding ram addresses: h'fff84000 to h'fff87fff) 0: on-chip ram write disabled 1: on-chip ram write enabled 0 ramwe0 1 r/w ram write enable 0 (corresponding ram addresses: h'fff80000 to h'fff83fff) 0: on-chip ram write disabled 1: on-chip ram write enabled
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 998 of 1164 rej09b0321-0200 25.2.8 ram retaining area specifying register (ramkp) ramkp is an 8-bit readable/writable register that specifies whether or not to retain data in the corresponding on-chip ram area in deep standby mode. ramkp is initialized to h'00 by a power-on reset or in deep standby mode but retains its previous value by a manual reset or in software standby mode. only byte access is valid. when an ramkp bit is set to 1, data in the corresponding on-chip ram area is retained in deep standby mode. when an ramwe bit is cleared to 0, data in the corresponding on-chip ram is not retained in deep standby mode. deep standby mode is canceled by an interrupt (n mi or irq) or a reset (manual reset or power-on reset). however, when deep standby mode is cancel ed by a power-on reset, the contents in the corresponding on-chip ram area are not retained even with the ramkp bit set to 1. 7654321 0 00000000 r r r r r/w r/w bit: initial value: r/w: ???? ram kp1 ram kp0 r/w r/w ram kp3 ram kp2 bit bit name initial value r/w description 7 to 4 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. 3 ramkp3 0 r/w ram retaining area 3 (corresponding ram addresses: h'fff86000 to h'fff87fff) 0: data in ram is not retained in deep standby mode 1: data in ram is retained in deep standby mode 2 ramkp2 0 r/w ram retaining area 2 (corresponding ram addresses: h'fff84000 to h'fff85fff) 0: data in ram is not retained in deep standby mode 1: data in ram is retained in deep standby mode 1 ramkp1 0 r/w ram retaining area 1 (corresponding ram addresses: h'fff82000 to h'fff83fff) 0: data in ram is not retained in deep standby mode 1: data in ram is retained in deep standby mode 0 ramkp0 0 r/w ram retaining area 0 (corresponding ram addresses: h'fff80000 to h'fff81fff) 0: data in ram is not retained in deep standby mode 1: data in ram is retained in deep standby mode
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 999 of 1164 rej09b0321-0200 25.2.9 deep standby oscillation settl ing clock select register (dscnt) dscnt is an 8-bit readable/writable register that selects the clock used to count the oscillation settling time when the system returns from deep st andby mode. dscnt is initialized to h'00 by a power-on reset or in deep standby mode but retains its previous value by a manual reset or in software standby mode. only byte access is valid. since the frequency control register for the cpg (f rqcr) is initialized in deep standby mode, the frequency of the peripheral clock (p ) specified by the cks[2:0] bits in dscnt is determined by the frqcr's initial value. 7654321 0 0 r 0 r 0 r 0 r 0000 r r/w r/w bit: initial value: r/w: ????? cks[2:0] r/w bit bit name initial value r/w description 7 to 3 ? all 0 r reserved these bits are always read as 0. the write value should always be 0. clock select selects the clock used to count the oscillation settling time from among eight types clocks derived by dividing the peripheral clock (p ). the oscillation settling time is calculated as follows: oscillation settling time = 1/p division ratio specified by cks[2:0] 255 [ s] the following are the oscillation settling times when the peripheral clock (p ) is running at 5, 10, and 15 mhz. oscillation settling time (ms) setting value clock select 5 mhz 10 mhz 15 mhz 000: 1 p * 1 0.05 0.03 0.02 001: 1/64 p * 1 3.26 1.63 1.09 010: 1/128 p * 1 6.53 3.26 2.18 011: 1/256 p * 2 13.06 6.53 4.35 100: 1/512 p * 2 26.11 13.06 8.70 101: 1/1024 p 52.22 26.11 17.41 110: 1/4096 p 208.90 104.45 69.63 2 to 0 cks[2:0] 000 r/w 111: 1/16384 p 835.58 417.79 278.53 notes: 1. do not use this setting. 2. set the clock so that it is equal to or l onger than the oscillation settling time 2 on return from standby (t osc3 ).
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1000 of 1164 rej09b0321-0200 25.2.10 deep standby cancel source flag register (dsfr) dsfr is a 16-bit readable/writable register compos ed of two types of bits. one is the flag that confirms which interrupt canceled deep standby mode. the other is the bit that releases the retaining state of pins after canceling the deep standby mode. dsfr is initialized to h'0000 by a power-on reset by the res pin but retains its previous value through a power-on reset caused by a wdt overflow, a manual reset, or a period in software standby mode. when deep standby mode is canceled by interrupts (nmi or irq) and a manual reset, this register retains the previous data although power-on reset exception handlin g is executed. only word access is valid. since interrupt inputs for the nmi and irq pins sp ecified by the interrupt controller (intc) and the pin function controller (pfc) are always detected , these interrupts set fl ags even during normal operation. therefore, all flags mu st be cleared immediately before the transition to deep standby mode. if an interrupt occurred immediately before execu ting the sleep instructi on after the flag clear, the system enters deep standby m ode with the flag set again. to prevent this, clear the flag in dsfr even in interrupt exception handling routine. 7654321 0 bit: initial value: r/w: irq0f irq1f irq2f irq3f irq4f irq5f irq6f irq7f nmif mresf iokeep 15 14 13 12 11 10 9 8 0000000000000000 r r r r r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * ??? r ?? note: * only 0 can be written after reading 1 to clear the flag. even when irq is input after a manual reset has been accepted as a source canceling deep standby, the irq flag is not set. bit bit name initial value r/w description 15 iokeep 0 r/(w) * pin state retention releases the retaining state of pins after canceling the deep standby mode 0: pin state not retained [clearing condition] ? writing 0 after reading 1 1: retains pin state [setting condition] ? when transits to deep standby mode 14 to 10 ? all 0 r reserved these bits are always read as 0. the write value should always be 0.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1001 of 1164 rej09b0321-0200 bit bit name initial value r/w description 9 mresf 0 r/(w) * mres flag 0: no interrupt on mres pin 1: interrupt on mres pin 8 nmif 0 r/(w) * nmi flag 0: no interrupt on nmi pin 1: interrupt on nmi pin 7 irq7f 0 r/(w) * irq7 flag 0: no interrupt on irq7 pin 1: interrupt on irq7 pin 6 irq6f 0 r/(w) * irq6 flag 0: no interrupt on irq6 pin 1: interrupt on irq6 pin 5 irq5f 0 r/(w) * irq5 flag 0: no interrupt on irq5 pin 1: interrupt on irq5 pin 4 irq4f 0 r/(w) * irq4 flag 0: no interrupt on irq4 pin 1: interrupt on irq4 pin 3 irq3f 0 r/(w) * irq3 flag 0: no interrupt on irq3 pin 1: interrupt on irq3 pin 2 irq2f 0 r/(w) * irq2 flag 0: no interrupt on irq2 pin 1: interrupt on irq2 pin 1 irq1f 0 r/(w) * irq1 flag 0: no interrupt on irq1 pin 1: interrupt on irq1 pin 0 irq0f 0 r/(w) * irq0 flag 0: no interrupt on irq0 pin 1: interrupt on irq0 pin note: * only 0 can be written after reading 1 to clear the flag. even when irq is input after a manual reset has been accepted as a source canceling deep standby, the irq flag is not set.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1002 of 1164 rej09b0321-0200 25.3 operation 25.3.1 sleep mode (1) transition to sleep mode executing the sleep inst ruction when the stby bit in stbcr is 0 causes a transition from the program execution state to sleep mode. although the cpu halts immediately after executing the sleep instruction, the contents of its internal registers remain unchanged. the on-chip modules continue to run in sleep mode. clock pulses continue to be output on the ckio pin. (2) canceling sleep mode sleep mode is canceled by an interrupt (nmi, h-udi, irq, pint, and on-chip peripheral module), a bus error, or a reset (manual reset or power-on reset). ? canceling with an interrupt when an nmi, h-udi, irq, pint, or on-chip peripheral module interrupt occurs, sleep mode is canceled and interrupt exception handling is executed. when the pr iority level of the generated interrupt is equal to or lower than the interrupt mask level that is set in the status register (sr) of the cpu, or the interrupt by the on-chip peripheral module is disabled on the module side, the interrupt request is not accepted and sleep mode is not canceled. ? canceling with a bus error when a bus error occurs, sleep mode is cancel ed and bus error exceptio n handling is executed. ? canceling with a reset sleep mode is canceled by a powe r-on reset or a manual reset.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1003 of 1164 rej09b0321-0200 25.3.2 software standby mode (1) transition to software standby mode the lsi switches from a program execution state to software standby mode by executing the sleep instruction when the stby bit and deep bit in stbcr are 1 and 0 respectively. in software standby mode, not only the cpu but also the clock and on-chip peripheral modules halt. the clock output from the ckio pin also halts in clock mode 0 or 2. the contents of the cpu and cache registers remain unchanged. some registers of on-chip peripheral modules are, however, initialized. as for the states of on-chip peripheral module registers in software standby mode, see section 28.3, register states in each operating mode. the cpu takes one cycle to finish writing to stbcr, and then executes processing for the next instruction. however, it takes one or more cycles to actually write. therefore, execute a sleep instruction after reading stbcr to have the values written to stbcr by the cpu to be definitely reflected in the sleep instruction. the procedure for switching to software standby mode is as follows: 1. clear the tme bit in the wdt's timer contro l register (wtcsr) to 0 to stop the wdt. 2. set the wdt's timer counter (wtcnt) to 0 an d the cks[2:0] bits in wtcsr to appropriate values to secure the specified oscillation settling time. 3. after setting the stby and deep bits in stbcr to 1 and 0 respectively, read stbcr. then, execute a sleep instruction. (2) canceling software standby mode software standby mode is canceled by interrupts (nmi or irq) or a reset (manual reset or power- on reset). in clock modes 0 and 2, a clock signal starts to be output from the ckio pin. ? canceling with an interrupt when the falling edge or rising edge of the nmi pin (selected by the nmi edge select bit (nmie) in interrupt control register 0 (icr0) of the interrupt controller (intc)) or the falling edge or rising edge of an irq pin (irq7 to irq0) (selected by the irqn sense select bits (irqn1s and irqn0s) in interrupt control regist er 1 (icr1) of the interrupt controller (intc)) is detected, clock oscillation is started. this clock pulse is supplied only to the oscillation settling counter (wdt) used to count the oscillation settling time.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1004 of 1164 rej09b0321-0200 after the elapse of the time set in the clock select bits (cks[2:0]) in the watchdog timer control/status register (wtcsr) of the wdt befo re the transition to software standby mode, the wdt overflow occurs. since th is overflow indicates that the clock has been stabilized, the clock pulse will be supplied to the entire chip after this overflow. software standby mode is thus cleared and nmi interrupt exception handling (irq interrupt exception handling in case of irq) is started. however, when the irq interrupt priority level is lower than the interrupt mask level set in the status register (sr) of the cpu, the interrupt request is not accepted and software standby mode is not canceled. when canceling software standby mode by the nmi interrupt or irq interrupt, set the cks[2:0] bits so that the wdt overflow period will be equal to or longer than the oscillation settling time. the clock output phase of the ckio pin may be unstable immediately after detecting an interrupt and until software standby mode is canceled. when software standby mode is canceled by the falling edge of the nmi pin, the nmi pin should be high when the cpu enters software standby mode (when the clock pulse stops) and should be low when the cpu returns from software standby mode (when the clock is initiated after the oscillation settling). when software standby mode is canceled by the rising edge of the nmi pin, the nmi pin should be low when the cpu enters software standby mode (when the clock pulse stops) and should be high when the cpu returns from software standby mode (when the clock is initiated after the oscillation settling) (this is the same with the irq pin.) ? canceling with a reset when the res pin is driven low, software standby mode is canceled and the lsi enters the power-on reset state. after that, if the res pin is driven high, the power-on reset exception handling is started. when the mres pin is driven low, software standby mode is canceled and the lsi enters the manual reset state. after that, if the mres pin is driven high, the manual reset exception handling is started. keep the res or mres pin low until the clock oscillation settles. the internal clock will continue to be output to the ckio pin in clock mode 0 or 2. (3) note on making a transition to software standby mode if the sleep instruction is executed to make a tran sition to software standby mode during transfer by the dmac, the dmac stops its operation without waiting for the completion of the transfer. thus, the dma transfer is not guaranteed. ther efore, when making a transition to software standby mode, wait for the completion of the dma transfer or stop the dma transfer to execute the sleep instruction.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1005 of 1164 rej09b0321-0200 25.3.3 software standby mode application example this example describes a transition to software standby mode on the falling edge of the nmi signal, and cancellation on the rising edge of the nmi signal. the timing is shown in figure 25.1. when the nmi pin is changed from high to low level while the nmi edge select bit (nmie) in icr is set to 0 (falling edge detection), the nmi in terrupt is accepted. when the nmie bit is set to 1 (rising edge detection) by the nmi exception service routine, the stby and deep bits in stbcr are set to 1 and 0 respectively, and a sleep instruction is executed, software standby mode is entered. thereafter, software standby mode is canceled when the nmi pin is changed from low to high level. ck nmi pin nmie bit stby bit lsi state oscillator program execution nmi exception handling nmi exception handling exception service routine software standby mode oscillation settling time figure 25.1 nmi timing in softwa re standby mode (application example)
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1006 of 1164 rej09b0321-0200 25.3.4 deep standby mode (1) transition to deep standby mode the lsi switches from a program execution state to deep standby mode by executing the sleep instruction when the stby bit and deep bit in stbcr are set to 1. in deep standby mode, not only the cpu, clocks, and on-chip peripheral modules but also power supply is turned off excluding the on-chip ram retaining area specifi ed by the ramkp3 to ramkp0 bits in the ramkp register and rtc. this can significantly reduce power consumption. therefore, data in the registers of the cpu, cache, and on-chip peripheral modules are not retained. pin state values immediately before the transition to deep standby mode can be retained. the cpu takes one cycle to finish writing to d sfr, and then executes processing for the next instruction. however, it actually takes one or more cycles to write. therefore, execute a sleep instruction after reading dsfr to have the values written to dsfr by the cpu to be definitely reflected in the sleep instruction. the procedure for switching to deep standby mode is as follows. figure 25.2 also shows its flowchart. 1. set the ramkp3 to ramkp0 bits in the ramkp register for the corresponding on-chip ram retaining area. 2. execute read and write of an arbitrary but the same address for each page in the retaining ram area. when this is not executed, data last written may not be stored in the on-chip ram. if there is a write to the on-chip ram after this time, execute this pro cessing after the last write to the on-chip ram. 3. set the cks[2:0] bits in the dscnt register so that the initial value of frqcr in the cpg becomes larger than the oscillation settling time. 4. set the stby and deep bits in the stbcr register to 1. 5. read out the dsfr register after clearing the flag in the ds fr register. then execute the sleep instruction.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1007 of 1164 rej09b0321-0200 execute read and write of an arbitrary but the same address for each page in the retaining ram area. read stbcr set the stby and deep bits in stbcr to 1. set the bits cks2 to cks0 in dscnt so that the initial value of frqcr in the cpg become larger than the oscillation settling time. set ramkp bit in ramkp as needed clear the flag in dsfr program executing state execute sleep instruction transition to deep standby mode interrupt processing routine clear the flag in dsfr execute rte instruction set intc register as needed figure 25.2 flowchart of transition to deep standby mode
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1008 of 1164 rej09b0321-0200 (2) canceling deep standby mode deep standby mode is canceled by interrupts (nmi or irq) or a reset (manual reset or power-on reset). however, irq is canceled only by pe7 to pe4 and pc25 to pc22. to cancel deep standby mode by interrupt nmi or irq, a power-on reset exception handling instead of an interrupt exception handling is executed. in the same way, a power-on reset exception handling is executed by a power-on reset. figure 25.3 shows the flowchart of canceling deep standby mode. ye s no oscillation settling time count by dscnt interrupt detection (nmi, irq) deep standby mode reset detection ( mres , res ) keep reset pins ( mres , res ) low during oscillation settling time power-on reset exception handling routine dsfr flag check power-on reset? to power-on reset exception handling reconfiguration of peripheral functions * clear iokeep bit in dsfr back to previous state before deep standby mode note: * peripheral functions include every function such as cpg, intc, bsc, i/o ports, pfc, and peripheral modules figure 25.3 flowchart of canceling deep standby mode
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1009 of 1164 rej09b0321-0200 ? canceling with an interrupt when the falling edge or rising edge of the nmi pin (selected by the nmi edge select bit (nmie) in interrupt control register 0 (icr0) of the interrupt controller (intc)) or the falling edge or rising edge of an irq pin (irq7 to irq0: pe7 to pe4 and pc25 to pc22) (selected by the irqn sense select bits (irqn1s and irqn0s) in interrupt control register 1 (icr1) of the interrupt controller (intc)) is detected, clock oscillation is started after the wait time for the oscillation settling time. this clock pulse is supplied only to the oscillation settling counter (dscnt) used to count the oscillation settling time. after the elapse of the time set in the clock select bits (cks[2:0]) in dscnt before the transition to deep standby mode, an overflow occurs. since this overflow indicates that the clock has been stabilized, the clock pulse will be supplied to the entire chip after this overflow. deep standby mode is thus cleared and reset exceptio n handling is started. when canceling deep standby mode by the nmi interrupt or irq interrupt, set the cks[2:0] bits so that the overflow period will be equal to or longer than the oscillation settling time. the clock output phase of the ckio pin may be unstable immediately after detecting an interrupt and until deep standby mode is canceled . when deep standby mode is canceled by the falling edge of the nmi pin, the nmi pin should be high when the cpu enters deep standby mode (when the clock pulse stops) and should be low when the cpu returns from deep standby mode (when the clock is initiated after the oscillation settling). when deep standby mode is canceled by the rising edge of the nm i pin, the nmi pin should be low when the cpu enters deep standby mode (when the clock pulse stops) and should be high when the cpu returns from deep standby mode (when the clock is initiated after the oscillation settling). (this is the same with the irq pin.) ? canceling with a reset when the res or mres pin is driven low, this lsi enters the power-on reset state and deep standby mode is canceled. keep the res or mres pin low until the clock oscillation settles. when deep standby mode is canceled by the res pin, the contents in the on -chip ram area are not retained.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1010 of 1164 rej09b0321-0200 (3) operation after cancel ing deep standby mode when deep standby mode is canceled by interrupt s (nmi or irq) or a ma nual reset, the deep standby cancel source flag regi ster (dsfr) can be used to conf irm which interrupt has canceled the mode. pins retain the state immediately before the transition to deep standby mode. however, in canceling deep standby mode, only the pins in buses listed in the table 25.3 can fetch programs while canceling pin states. pins other than those retain the pin states af ter canceling deep standby mode, in which dsfr can confirm which interrupt has triggered returning to deep standby mode. reconfiguration of peripheral functions is required to return to the previous state of deep standby mode. peripheral functions include every function such as cpg, intc, bsc, i/o ports, pfc, and peripheral modules. after the reconfiguration, pin-retaining state can be canceled by reading 1 in the iokeep bit of dsfr then writing 0 to it. table 25.3 pin states in different modes operation mode (1) (external 8_bit bus initiated) operation mode (2) (external 16_bit bus initiated) operation mode (3) (external 32_bit bus initiated) pa[23:0] pb[7:0] pc[9:8], pc[0] ckio pa[23:0] pb[15:0] pc[10:8], pc[0] ckio pa[23:0] pb[31:0] pc[12:8], pc[0] ckio (4) note on making a transi tion to deep standby mode if the sleep instruction is executed to make a tran sition to deep standby mo de during transfer by the dmac, the dmac stops its operation without waiting for the completion of the transfer. thus, the dma transfer is not guaranteed. therefore, when making a transition to deep standby mode, wait for the completion of the dma transfer or stop the dma transfer to execute the sleep instruction.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1011 of 1164 rej09b0321-0200 25.3.5 module standby function (1) transition to module standby function setting the standby control register mstp bits to 1 halts the supply of clocks to the corresponding on-chip peripheral modules. this function can be used to reduce the power consumption in normal mode and sleep mode. disable a module before placing it in the module standby mode. in addition, do not access the module's registers while it is in the module standby state. the register states are the same as those in so ftware standby mode. for details, see table 25.4. however, the state of dac registers are exceptional. in the dac, all registers retain their previous values in software standby mode, but are initialized in module standby mode. (2) canceling module standby function the module standby function can be canceled by clearing the mstp bits to 0, or by a power-on reset (only possible for rtc, h-udi, ubc, dmac, and aud-ii). when taking a module out of the module standby state by clearing the corresponding mstp bit to 0, read the mstp bit to confirm that it has been cleared to 0. 25.4 usage note 25.4.1 note on setting registers when writing to the registers related to power-down modes, note the following. when writing to the register related to power-down modes, the cpu, after executing a write instruction, executes the next instruction without waiting for the write operation to complete. therefore, to reflect the change specified by writing to the register while the next instruction is executed, insert a dummy read of the same regist er between the register write instruction and the next instruction. 25.4.2 note on canceling standby mode when an external clock is being input when release from standby mode is initiated by an interrupt (nmi or irq) while an external clock from the extal pin or ckio pin is in use, make sure that the external clock is being input before input of the interrupt. if this is not the case, corr ect counting of the oscillation settling time will not be possible.
section 25 power-down modes rev. 2.00 sep. 07, 2007 page 1012 of 1164 rej09b0321-0200
section 26 user debugging interface (h-udi) rev. 2.00 sep. 07, 2007 page 1013 of 1164 rej09b0321-0200 section 26 user debu gging interface (h-udi) this lsi incorporates a user debugging interface (h-udi) for emulator support. 26.1 features the user debugging interface (h-udi) has reset and interrupt request functions. the h-udi in this lsi is used for emulator co nnection. refer to the emulator manual for the method of connecting the emulator. figure 26.1 shows a block diagram of the h-udi. sdbpr: sdir: sdir udtck udtdo udtdi udtms u dtrst sdbpr mux shift register tap control circuit decoder local bus [legend] bypass register instruction register figure 26.1 block diagram of h-udi
section 26 user debugging interface (h-udi) rev. 2.00 sep. 07, 2007 page 1014 of 1164 rej09b0321-0200 26.2 input/output pins table 26.1 pin configuration pin name symbol i/o function h-udi serial data input/output clock pin udtck * input data is serially suppl ied to the h-udi from the data input pin (udtdi), and out put from the data output pin (udtdo), in synchroniza tion with this clock. fix high when not used. mode select input pin udtms * input the state of the tap control circuit is determined by changing this signal in synchronization with udtck. for the protocol, see figure 26.2. fix high when not used. h-udi reset input pin udtrst * input input is accepted asynchronously with respect to udtck, and when low, the h-udi is reset. udtrst must be low for oscillation settling time when power is turned on. see section 26.4.2, reset types, for more information. h-udi serial data input pin udtdi * input data transfer to the h-udi is executed by changing this signal in synchronization with udtck. fix high when not used. h-udi serial data output pin udtdo output data read from t he h-udi is executed by reading this pin in synchronization with udtck. the initial value of the data output timing is the udtck falling edge. this can be changed to the udtck rising edge by inputting the udtdo change timing switch command to sdir. see section 26.4.3, udtdo output timing, for more information. ase mode select pin asemd input fix high. note: * the pin with the pull-up function.
section 26 user debugging interface (h-udi) rev. 2.00 sep. 07, 2007 page 1015 of 1164 rej09b0321-0200 26.3 register descriptions the h-udi has the following registers. table 26.2 register configuration register name abbreviation r/w initial value address access size bypass register sdbpr ? ? ? ? instruction register sdir r h'effd h'fffd9000 16 26.3.1 bypass register (sdbpr) sdbpr is a 1-bit register that cannot be accesse d by the cpu. when sd ir is set to bypass mode, sdbpr is connected betw een h-udi pins udtdi and udtdo. the initial value is undefined.
section 26 user debugging interface (h-udi) rev. 2.00 sep. 07, 2007 page 1016 of 1164 rej09b0321-0200 26.3.2 instruction register (sdir) sdir is a 16-bit read-only register. it is initialized by udtrst assertion, in the tap test-logic- reset state or in deep standby mode, and can be written to by the h-udi irrespective of the cpu mode. operation is not guaranteed if a reserved comma nd is set in this register. the initial value is h'effd. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 note: * the initial value of the ti[7:0] bits is a reserved value. when setting a command, the ti[7:0] bits must be set to another value. 1 * 1 * 1 * 0 * 1 * 1 * 1 * 1 * 11111101 rrrrrrrrrrrrrrrr bit: initial value: r/w: ti[7:0] ???????? bit bit name initial value r/w description 15 to 8 ti[7:0] 11101111 * r test instruction the h-udi instruction is transferred to sdir by a serial input from udtdi. for commands, see table 26.3. 7 to 2 ? all 1 r reserved these bits are always read as 1. 1 ? 0 r reserved this bit is always read as 0. 0 ? 1 r reserved this bit is always read as 1. note: * the initial value of the ti[7:0] bits is a reserved value. when setting a command, the ti[7:0] bits must be set to another value. table 26.3 h-udi commands bits 15 to 8 ti7 ti6 ti5 ti4 ti3 ti 2 ti1 ti0 description 0 1 1 0 ? ? ? ? h-udi reset negate 0 1 1 1 ? ? ? ? h-udi reset assert 1 0 0 1 1 1 0 0 udtdo change timing switch 1 0 1 1 ? ? ? ? h-udi interrupt 1 1 1 1 ? ? ? ? bypass mode other than above reserved
section 26 user debugging interface (h-udi) rev. 2.00 sep. 07, 2007 page 1017 of 1164 rej09b0321-0200 26.4 operation 26.4.1 tap controller figure 26.2 shows the internal states of the tap controller. test -logic-reset capture-dr shift-dr exit1-dr pause-dr exit2-dr update-dr select-dr run-test/idle 1 0 0 0 0 11 1 1 0 0 0 1 11 0 1 1 10 capture-ir shift-ir exit1-ir pause-ir exit2-ir update-ir select-ir 0 0 1 0 0 0 1 0 1 1 1 0 figure 26.2 tap controller state transitions note: the transition condition is the udtms value at the rising edge of udtck. the udtdi value is sampled at the rising edge of udtck; shifting occurs at the falling edge of udtck. for details on change timing of the udtdo value, see section 26.4.3, udtdo output timing. the udtdo is at high impedance, except with shift-dr and shift-ir states. there is a transition to test-l ogic-reset asynchronously with udtck by udtrst assertion or deep standby mode.
section 26 user debugging interface (h-udi) rev. 2.00 sep. 07, 2007 page 1018 of 1164 rej09b0321-0200 26.4.2 reset types table 26.4 reset types asemd * res udtrst chip state h l l power-on reset and h-udi reset h power-on reset h l h-udi reset only h normal operation note: * fix asemd to high. 26.4.3 udtdo output timing the initial value of the udtdo change timing is to perform data output from the udtdo pin on the udtck falling edge. however, setting a udtdo change timing switch command in sdir via the h-udi pin and passing the update-ir state synchronizes the udtdo change timing to the udtck rising edge. hereafter, to synchroni ze the udtdo change timing with the udtck falling edge, the udtrst pin must be asserted simultaneously with a power-on reset or deep standby mode must be entered. in the case of a power-on reset by the res pin, the lsi falls in reset state for a certain period after the res pin negation. therefore, when the udtrst pin is asserted immediately after the res pin negation, a udtdo change timing switch command is cleared and the udtdo change timing becomes synchronous with the output of udtck falling edge. to prevent this, at least 20 tcyc must be set between the change timings of the res pin and udtrst pin. udtdo (initial value) udtck udtdo (after execution of udtdo change timing switch command) t tdod t tdod figure 26.3 h-udi data transfer timing
section 26 user debugging interface (h-udi) rev. 2.00 sep. 07, 2007 page 1019 of 1164 rej09b0321-0200 26.4.4 h-udi reset an h-udi reset is executed by setting an h-udi reset assert command in sdir. an h-udi reset is of the same kind as a power-on reset. an h- udi reset is released by setting an h-udi reset negate command. the required time between th e h-udi reset assert command and h-udi reset negate command is the same as time for keeping the res pin low to apply a power-on reset. h-udi reset assert h-udi reset negate sdir chip internal reset cpu state fetch the initial values of pc and sr from the exception handling vector table figure 26.4 h-udi reset 26.4.5 h-udi interrupt the h-udi interrupt function generates an interrupt by setting a command from the h-udi in sdir. an h-udi interrupt is a general exception/interrupt operation, resulting in fetching the exception service routine start ad dress from the exception handling v ector table, jumping to that address, and starting program execution from that address. this interrupt request has a fixed priority level of 15. h-udi interrupts are accepted in sleep mode, but not in software standby or deep standby mode.
section 26 user debugging interface (h-udi) rev. 2.00 sep. 07, 2007 page 1020 of 1164 rej09b0321-0200 26.5 usage notes 1. an h-udi command, once set, will not be modified as long as another command is not set again from the h-udi. if the same command is to be set continuously, the command must be set after a command (byp ass mode, etc.) that do es not affect chip operations is once set. 2. in software standby mode or h-udi module standby state, all of the functions in the h-udi cannot be used. to retain the tap status before and after software standby mode or h-udi module standby state, keep udtck high before entering software standby mode or h-udi module standby state. 3. in deep standby mode, all of the functions in the h-udi cannot be used. h-udi is initialized in deep standby mode. 4. make sure to allow 20 tcyc or more between the signal change timing of the res and udtrst pins. 5. when starting the tap controller after the negation of the udtrst pin, make sure to allow 200 ms or more after the negation.
section 27 advanced user debugger ii (aud-ii) rev. 2.00 sep. 07, 2007 page 1021 of 1164 rej09b0321-0200 section 27 advanced user debugger ii (aud-ii) the aud-ii offers functions that support user program debugging with the lsi mounted and operated in actual performance. use of the aud-ii simplifies the construction of a simple emulator, with functions such as monitoring/tuning of on-chip ram data. 27.1 features the aud-ii can be used in ram monitor mode by setting audmd. ram monitor mode: ? functions to read/write modu les connected to internal/ext ernal buses (except cache and h-udi) ? outputs data corresponding to an address that is externally written to audata ? transmits data to the address in audata to which address and data are written 27.2 input/output pins table 27.1 pin configuration pin name symbol function aud reset audrst aud reset input aud sync signal audsync data start position identification signal input aud clock audck external clock input aud mode audmd mode select input (h) aud data audata[3:0] monitor addr ess input and data input/output
section 27 advanced user debugger ii (aud-ii) rev. 2.00 sep. 07, 2007 page 1022 of 1164 rej09b0321-0200 (1) description of pins table 27.2 description of pins pin function audmd the mode is selected by changi ng the input level at this pin. low: setting prohibited high: ram monitor mode the input at this pin should be changed when audrst is low. audrst when this pin is driven low, the a ud enters the reset state and the aud's internal buffers and logic are reset. when audrst goes high again after the audmd level settles, the aud starts operating in the selected mode. audck this pin is for external clock input. input the clock to be used for debugging. note that the available frequency is up to b /2. audsync aud bus command valid signal 1: read data is output 0: inputs write address, data, dir command note: do not assert this pin until commands are input to audata from outside and necessary data is prepared. for details, see the protocol as described later. audata[3:0] the following data is output in time-sharing mode. ? aud bus command ? address ? data when a command is input from outside, data is output after ready is transmitted. the output starts after audsync is negated. for details, see the protocol as described later.
section 27 advanced user debugger ii (aud-ii) rev. 2.00 sep. 07, 2007 page 1023 of 1164 rej09b0321-0200 27.3 ram monitor mode in this mode, all the modules connected to this lsi's internal or external bus can be read and written to (except cache and h-udi), allowing ra m monitoring and tuning to be carried out. 27.3.1 communication protocol the aud-ii latches the audata input when audsync is asserted. the following audata input format should be used. 0000 dir a3 to a0 a31 to a28 d3 to d0 dn to dn-3 spare bits (4 bits): b'0000 command fixed at 1 0: read 1: write 00: byte 01: word 10: longword bit 3 bit 2 bit 1 bit 0 address data (in case of write only) b write: n = 7 w write: n = 15 l write: n = 31 figure 27.1 audata input format
section 27 advanced user debugger ii (aud-ii) rev. 2.00 sep. 07, 2007 page 1024 of 1164 rej09b0321-0200 27.3.2 operation operation starts in ram monitor mode when audrst is asserted, audmd is driven high, and then audrst is negated. figure 27.2 shows an example of a read operatio n, and figure 27.3 shows an example of a write operation. when audsync is asserted, input from the audata pins begins. when a command, address, or data (writing only) is input in the format show n in figure 27.1, execution of read/write access to the specified address is started. during internal execution, th e aud returns not ready (b'0000). when execution is completed, the ready flag (b'0001) is returned (figures 27. 2 and 27. 3). table 27.3 shows the ready flag format. in a read, data of the specified size is output when audsync is negated following detection of this flag (figure 27. 2). if a command other than the above is input in di r, the aud-ii treats this as a command error, disables processing, and sets bit 1 in the ready flag to 1. if a read/write operation initiated by the command specified in dir causes a bus error, the aud-ii disables processing and sets bit 2 in the ready flag to 1 (figure 27. 4). bus error conditions are shown below. 1. word access to ad dress 4n+1 or 4n+3 2. longword access to address 4n+1, 4n+2, or 4n+3 table 27.3 ready flag format bit 3 bit 2 bit 1 bit 0 fixed at 0 0: normal status 1: bus error 0: normal status 1: command error 0: not ready 1: ready
section 27 advanced user debugger ii (aud-ii) rev. 2.00 sep. 07, 2007 page 1025 of 1164 rej09b0321-0200 0000 a3 to a0 audck audsync audata[3:0] 1000 0001 0001 0000 0001 a31 to a28 d3 to d0 d7 to d4 dir not ready ready ready ready input output input/output changeover figure 27.2 example of read operation (byte read) 0000 a3 to a0 audck audsync audata[3:0] 1110 0001 0001 0000 0001 d31 to d28 a31 to a28 d3 to d0 dir not ready ready ready ready input output input/output changeover figure 27.3 example of writ e operation (longword write) 0000 a3 to a0 audck audsync audata[3:0] 1010 0101 0101 0000 0101 a31 to a28 dir not ready ready (bus error) ready (bus error) ready (bus error) input output input/output changeover figure 27.4 example of e rror occurrence (longword read)
section 27 advanced user debugger ii (aud-ii) rev. 2.00 sep. 07, 2007 page 1026 of 1164 rej09b0321-0200 27.3.3 usage notes (ram monitor mode) (1) guidelines for initializat ion of the ram monitor mode the buffers in this debugger and the processing status are initialized under the following conditions. ? power-on reset ? when the audrst pin is driven low ? module standby ? deep standby mode (2) guidelines for audck ? audck is for inputting the external clock. input the clock to satisfy b /2 audck. (3) other limitations ? do not negate audsync until the command is input to audata and the ready is returned. ? the ram monitor functions in sleep mode but is not available in software standby or deep standby mode.
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1027 of 1164 rej09b0321-0200 section 28 list of registers the address map gives information on the on-chip i/o registers and is configured as described below. 1. register addresses (address order) ? registers are described by functional module, in order of the corresponding section numbers. ? access to reserved addresses that are not describe d in this register address list is prohibited. ? when addresses consist of 16 or 32 bits, the addresses of the msbs are given when big-endian mode is selected. 2. register bits ? bit configurations of the registers are describe d in the same order as the register addresses (address order). ? reserved bits are indicated by - in the bit name. ? no entry in the bit-name column indicates that the whole register is al located as a counter or for holding data. ? when registers consist of 16 or 32 bits, the bits are given from the msb side. the listing order of bytes is based on big-endian mode. 3. register states in each operating mode ? register states are described in the same orde r as the register addresses (address order). ? for the initial state of each bit, refer to the de scription of the register in the corresponding section. ? the register states described are for the basic operating modes. if there is a specific reset for an on-chip peripheral module, refer to the section on that on-chip peripheral module.
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1028 of 1164 rej09b0321-0200 28.1 register addresses (address order) entries under access size in dicate numbers of bits. note: access to undefined or reserved addresses is prohibited. since operation or continued operation is not guaranteed when these regist ers are accessed, do not attempt such access. register name abbreviation number of bits address module access size bus monitor enable register sycbeen 32 h'ff400000 bus monitor 8, 16, 32 bus monitor status register 1 sycbests1 32 h'ff400004 8, 16, 32 bus monitor status register 2 sycbests2 32 h'ff400008 8, 16, 32 bus error control register syc besw 32 h'ff40000c 8, 16, 32 cs0 control register cs0cnt 32 h'ff420000 bsc 8, 16, 32 cs0 recovery cycle setting register cs0rec 32 h'ff420008 8, 16, 32 cs1 control register cs1cnt 32 h'ff420010 8, 16, 32 cs1 recovery cycle setting register cs1rec 32 h'ff420018 8, 16, 32 cs2 control register cs2cnt 32 h'ff420020 8, 16, 32 cs2 recovery cycle setting register cs2rec 32 h'ff420028 8, 16, 32 cs3 control register cs3cnt 32 h'ff420030 8, 16, 32 cs3 recovery cycle setting register cs3rec 32 h'ff420038 8, 16, 32 cs4 control register cs4cnt 32 h'ff420040 8, 16, 32 cs4 recovery cycle setting register cs4rec 32 h'ff420048 8, 16, 32 cs5 control register cs5cnt 32 h'ff420050 8, 16, 32 cs5 recovery cycle setting register cs5rec 32 h'ff420058 8, 16, 32 cs6 control register cs6cnt 32 h'ff420060 8, 16, 32 cs6 recovery cycle setting register cs6rec 32 h'ff420068 8, 16, 32 sdramc0 control register sdc0 cnt 32 h'ff420100 8, 16, 32 sdramc1 control register sdc1 cnt 32 h'ff420110 8, 16, 32 cs0 mode register csmod0 32 h'ff421000 8, 16, 32 cs0 wait control register 1 cs 1wcnt0 32 h'ff421004 8, 16, 32 cs0 wait control register 2 cs 2wcnt0 32 h'ff421008 8, 16, 32 cs1 mode register csmod1 32 h'ff421010 8, 16, 32 cs1 wait control register 1 cs 1wcnt1 32 h'ff421014 8, 16, 32 cs1 wait control register 2 cs 2wcnt1 32 h'ff421018 8, 16, 32 cs2 mode register csmod2 32 h'ff421020 8, 16, 32 cs2 wait control register 1 cs 1wcnt2 32 h'ff421024 8, 16, 32 cs2 wait control register 2 cs 2wcnt2 32 h'ff421028 8, 16, 32
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1029 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size cs3 mode register csmod3 32 h'ff421030 bsc 8, 16, 32 cs3 wait control register 1 cs1wcnt3 32 h'ff421034 8, 16, 32 cs3 wait control register 2 cs2wcnt3 32 h'ff421038 8, 16, 32 cs4 mode register csmod4 32 h'ff421040 8, 16, 32 cs4 wait control register 1 cs1wcnt4 32 h'ff421044 8, 16, 32 cs4 wait control register 2 cs2wcnt4 32 h'ff421048 8, 16, 32 cs5 mode register csmod5 32 h'ff421050 8, 16, 32 cs5 wait control register 1 cs1wcnt5 32 h'ff421054 8, 16, 32 cs5 wait control register 2 cs2wcnt5 32 h'ff421058 8, 16, 32 cs6 mode register csmod6 32 h'ff421060 8, 16, 32 cs6 wait control register 1 cs1wcnt6 32 h'ff421064 8, 16, 32 cs6 wait control register 2 cs2wcnt6 32 h'ff421068 8, 16, 32 sdram refresh control register 0 sdrfcnt0 32 h'ff422000 8, 16, 32 sdram refresh control register 1 sdrfcnt1 32 h'ff422004 16, 32 sdram initialized register 0 sdir0 32 h'ff422008 8, 16, 32 sdram initialized register 1 sdir1 32 h'ff42200c 8, 16, 32 sdram power down control register sdpwdcnt 32 h'ff422010 8, 16, 32 sdram deep power down control register sddpwdcnt 32 h'ff422014 8, 16, 32 sdram0 address register sd0adr 32 h'ff422020 8, 16, 32 sdram0 timing register sd0tr 32 h'ff422024 8, 16, 32 sdram0 mode register sd0mod 32 h'ff422028 16, 32 sdram1 address register sd1adr 32 h'ff422040 8, 16, 32 sdram1 timing register sd1tr 32 h'ff422044 8, 16, 32 sdram1 mode register sd1mod 32 h'ff422048 16, 32 sdram status register sd str 32 h'ff4220e4 8, 16, 32 sdram clock stop control signal setting r egister sdckscnt 32 h'ff4220e8 8, 16, 32 dma current source address regist er 0 dmcsadr0 32 h'ff460000 dmac 32 dma current destination address r egister 0 dmcdadr0 32 h'ff460004 32 dma current byte count regi ster 0 dmcbct0 32 h'ff460008 32 dma mode register 0 dmmod0 32 h'ff46000c 32 dma current source address regi ster 1 dmcsadr1 32 h'ff460010 32 dma current destination address r egister 1 dmcdadr1 32 h'ff460014 32 dma current byte count regi ster 1 dmcbct1 32 h'ff460018 32 dma mode register 1 dmmod1 32 h'ff46001c 32 dma current source address regi ster 2 dmcsadr2 32 h'ff460020 32 dma current destination address r egister 2 dmcdadr2 32 h'ff460024 32
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1030 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size dma current byte count register 2 dmcbct2 32 h'ff460028 dmac 32 dma mode register 2 dmmod2 32 h'ff46002c 32 dma current source address register 3 dmcsadr3 32 h'ff460030 32 dma current destination address register 3 dmcdadr3 32 h'ff460034 32 dma current byte count regist er 3 dmcbct3 32 h'ff460038 32 dma mode register 3 dmmod3 32 h'ff46003c 32 dma current source address register 4 dmcsadr4 32 h'ff460040 32 dma current destination address register 4 dmcdadr4 32 h'ff460044 32 dma current byte count regist er 4 dmcbct4 32 h'ff460048 32 dma mode register 4 dmmod4 32 h'ff46004c 32 dma current source address register 5 dmcsadr5 32 h'ff460050 32 dma current destination address register 5 dmcdadr5 32 h'ff460054 32 dma current byte count regist er 5 dmcbct5 32 h'ff460058 32 dma mode register 5 dmmod5 32 h'ff46005c 32 dma current source address register 6 dmcsadr6 32 h'ff460060 32 dma current destination address register 6 dmcdadr6 32 h'ff460064 32 dma current byte count regist er 6 dmcbct6 32 h'ff460068 32 dma mode register 6 dmmod6 32 h'ff46006c 32 dma current source address register 7 dmcsadr7 32 h'ff460070 32 dma current destination address register 7 dmcdadr7 32 h'ff460074 32 dma current byte count regist er 7 dmcbct7 32 h'ff460078 32 dma mode register 7 dmmod7 32 h'ff46007c 32 dma reload source address register 0 dmrsadr0 32 h'ff460200 32 dma reload destination address register 0 dmrdadr0 32 h'ff460204 32 dma reload byte count regist er 0 dmrbct0 32 h'ff460208 32 dma reload source address register 1 dmrsadr1 32 h'ff460210 32 dma reload destination address register 1 dmrdadr1 32 h'ff460214 32 dma reload byte count regist er 1 dmrbct1 32 h'ff460218 32 dma reload source address register 2 dmrsadr2 32 h'ff460220 32 dma reload destination address register 2 dmrdadr2 32 h'ff460224 32 dma reload byte count regist er 2 dmrbct2 32 h'ff460228 32 dma reload source address register 3 dmrsadr3 32 h'ff460230 32 dma reload destination address register 3 dmrdadr3 32 h'ff460234 32 dma reload byte count regist er 3 dmrbct3 32 h'ff460238 32 dma reload source address register 4 dmrsadr4 32 h'ff460240 32 dma reload destination address register 4 dmrdadr4 32 h'ff460244 32
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1031 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size dma reload byte count regist er 4 dmrbct4 32 h'ff460248 dmac 32 dma reload source address register 5 dmrsadr5 32 h'ff460250 32 dma reload destination address r egister 5 dmrdadr5 32 h'ff460254 32 dma reload byte count regi ster 5 dmrbct5 32 h'ff460258 32 dma reload source address register 6 dmrsadr6 32 h'ff460260 32 dma reload destination address r egister 6 dmrdadr6 32 h'ff460264 32 dma reload byte count regi ster 6 dmrbct6 32 h'ff460268 32 dma reload source address register 7 dmrsadr7 32 h'ff460270 32 dma reload destination address r egister 7 dmrdadr7 32 h'ff460274 32 dma reload byte count regi ster 7 dmrbct7 32 h'ff460278 32 dma control register a0 dmcnta0 32 h'ff460400 8, 16, 32 dma control register b0 dmcntb0 32 h'ff460404 8, 16, 32 dma control register a1 dmcnta1 32 h'ff460408 8, 16, 32 dma control register b1 dmcntb1 32 h'ff46040c 8, 16, 32 dma control register a2 dmcnta2 32 h'ff460410 8, 16, 32 dma control register b2 dmcntb2 32 h'ff460414 8, 16, 32 dma control register a3 dmcnta3 32 h'ff460418 8, 16, 32 dma control register b3 dmcntb3 32 h'ff46041c 8, 16, 32 dma control register a4 dmcnta4 32 h'ff460420 8, 16, 32 dma control register b4 dmcntb4 32 h'ff460424 8, 16, 32 dma control register a5 dmcnta5 32 h'ff460428 8, 16, 32 dma control register b5 dmcntb5 32 h'ff46042c 8, 16, 32 dma control register a6 dmcnta6 32 h'ff460430 8, 16, 32 dma control register b6 dmcntb6 32 h'ff460434 8, 16, 32 dma control register a7 dmcnta7 32 h'ff460438 8, 16, 32 dma control register b7 dmcntb7 32 h'ff46043c 8, 16, 32 dma activation control register dmscnt 32 h'ff460500 8, 16, 32 dma interrupt control register dmicnt 32 h'ff460508 8, 16, 32 dma common interrupt control regist er dmicnta 32 h'ff46050c 8, 16, 32 dma interrupt status register dmists 32 h'ff460510 8, 16, 32 dma transfer end detection register dmedet 32 h'ff460514 8, 16, 32 dma arbitration status register dmasts 32 h'ff460518 8, 16, 32 break address register_0 bar_0 32 h'fffc0400 ubc 32 break address mask register_0 bamr_0 32 h'fffc0404 32 break data register_0 bdr_0 32 h'fffc0408 32 break data mask register_0 bdmr_0 32 h'fffc040c 32
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1032 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size break address register_1 bar_1 32 h'fffc0410 ubc 32 break address mask register_1 bamr_1 32 h'fffc0414 32 break data register_1 bdr_1 32 h'fffc0418 32 break data mask register_1 bdmr_1 32 h'fffc041c 32 break bus cycle register_0 bbr_0 16 h'fffc04a0 16 break bus cycle register_1 bbr_1 16 h'fffc04b0 16 break control register brcr 32 h'fffc04c0 32 cache control register 1 ccr1 32 h'fffc1000 cache 32 cache control register 2 ccr2 32 h'fffc1004 32 ac characteristics switching regist er acswr 32 h'fffd8808 bsc 8, 16, 32 instruction register sdir 16 h'fffd9000 h-udi 16 interrupt control register 0 icr0 16 h'fffd9400 intc 16, 32 interrupt control register 1 icr1 16 h'fffd9402 16, 32 interrupt control register 2 icr2 16 h'fffd9404 16, 32 irq interrupt request register irqrr 16 h'fffd9406 16, 32 pint interrupt enable register pinter 16 h'fffd9408 16, 32 pint interrupt request register pirr 16 h'fffd940a 16, 32 bank control register ib cr 16 h'fffd940c 16, 32 bank number register ibnr 16 h'fffd940e 16, 32 interrupt priority register 01 ipr01 16 h'fffd9418 16, 32 interrupt priority register 02 ipr02 16 h'fffd941a 16, 32 interrupt priority register 05 ipr05 16 h'fffd9420 16, 32 interrupt priority register 06 ipr06 16 h'fffd9800 16, 32 interrupt priority register 07 ipr07 16 h'fffd9802 16, 32 interrupt priority register 08 ipr08 16 h'fffd9804 16, 32 interrupt priority register 09 ipr09 16 h'fffd9806 16, 32 interrupt priority register 10 ipr10 16 h'fffd9808 16, 32 interrupt priority register 11 ipr11 16 h'fffd980a 16, 32 interrupt priority register 12 ipr12 16 h'fffd980c 16, 32 interrupt priority register 13 ipr13 16 h'fffd980e 16, 32 interrupt priority register 14 ipr14 16 h'fffd9810 16, 32 interrupt priority register 15 ipr15 16 h'fffd9812 16, 32 interrupt priority register 16 ipr16 16 h'fffd9814 16, 32 watchdog timer control/status register wtcsr 16 h'fffe0000 wdt 16 watchdog timer counter wtcnt 16 h'fffe0002 16 watchdog reset control/status register wrcsr 16 h'fffe0004 16
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1033 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size frequency control register frqcr 16 h'fffe0010 cpg 16 standby control register stbcr 8 h'fffe0014 system 8 standby control register 2 stbcr2 8 h'fffe0018 8 system control register 1 syscr1 8 h'fffe0402 8 system control register 2 syscr2 8 h'fffe0404 8 standby control register 3 stbcr3 8 h'fffe0408 8 standby control register 4 stbcr4 8 h'fffe040c 8 standby control register 5 stbcr5 8 h'fffe0410 8 64-hz counter r64cnt 8 h'fffe0800 rtc 8 second counter rseccnt 8 h'fffe0802 8 minute counter rmincnt 8 h'fffe0804 8 hour counter rhrcnt 8 h'fffe0806 8 day of week counter rwkcnt 8 h'fffe0808 8 date counter rdaycnt 8 h'fffe080a 8 month counter rmoncnt 8 h'fffe080c 8 year counter ryrcnt 16 h'fffe080e 16 second alarm register rsecar 8 h'fffe0810 8 minute alarm register rminar 8 h'fffe0812 8 hour alarm register rhrar 8 h'fffe0814 8 day of week alarm register rwkar 8 h'fffe0816 8 date alarm register rdayar 8 h'fffe0818 8 month alarm register rmonar 8 h'fffe081a 8 rtc control register 1 rcr1 8 h'fffe081c 8 rtc control register 2 rcr2 8 h'fffe081e 8 year alarm register ryrar 16 h'fffe0820 16 rtc control register 3 rcr3 8 h'fffe0824 8 port a data register h padrh 16 h'fffe3800 i/o ports 8, 16, 32 port a data register l padrl 16 h'fffe3802 8, 16 port a port register h paprh 16 h'fffe3804 8, 16, 32 port a port register l paprl 16 h'fffe3806 8, 16 port b data register h pbdrh 16 h'fffe3808 8, 16, 32 port b data register l pbdrl 16 h'fffe380a 8, 16 port b port register h pbprh 16 h'fffe380c 8, 16, 32 port b port register l pbprl 16 h'fffe380e 8, 16 port c data register h pcdrh 16 h'fffe3810 8, 16, 32 port c data register l pcdrl 16 h'fffe3812 8, 16, 32
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1034 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size port c port register h pcprh 16 h'fffe3814 i/o ports 8, 16 port c port register l pcprl 16 h'fffe3816 8, 16 port d data register pddr 16 h'fffe381a 8, 16 port d port register h pdprh 16 h'fffe381c 8, 16, 32 port d port register l pdprl 16 h'fffe381e 8, 16 port e port register pepr 16 h'fffe3826 8, 16 port f data register pfdr 16 h'fffe382a 8, 16 port f port register pfpr 16 h'fffe382e 8, 16 port a i/o register h paiorh 16 h'fffe3880 pfc 8, 16, 32 port a i/o register l paiorl 16 h'fffe3882 8, 16 port a control register 8 pacr8 16 h'fffe3884 8, 16, 32 port a control register 7 pacr7 16 h'fffe3886 8, 16 port a control register 6 pacr6 16 h'fffe3888 8, 16, 32 port a control register 5 pacr5 16 h'fffe388a 8, 16 port a control register 4 pacr4 16 h'fffe388c 8, 16, 32 port a control register 3 pacr3 16 h'fffe388e 8, 16 port a control register 2 pacr2 16 h'fffe3890 8, 16, 32 port a control register 1 pacr1 16 h'fffe3892 8, 16 port b i/o register h pbiorh 16 h'fffe3898 8, 16, 32 port b i/o register l pbiorl 16 h'fffe389a 8, 16 port b control register 8 pbcr8 16 h'fffe389c 8, 16, 32 port b control register 7 pbcr7 16 h'fffe389e 8, 16 port b control register 6 pb cr6 16 h'fffe38a0 8, 16, 32 port b control register 5 pbcr5 16 h'fffe38a2 8, 16 port b control register 4 pb cr4 16 h'fffe38a4 8, 16, 32 port b control register 3 pbcr3 16 h'fffe38a6 8, 16 port b control register 2 pb cr2 16 h'fffe38a8 8, 16, 32 port b control register 1 pbcr1 16 h'fffe38aa 8, 16 port c i/o register h pciorh 16 h'fffe38b0 8, 16, 32 port c i/o register l pciorl 16 h'fffe38b2 8, 16 port c control register 7 pccr7 16 h'fffe38b6 8, 16 port c control register 6 pccr6 16 h'fffe38b8 8, 16, 32 port c control register 5 pccr5 16 h'fffe38ba 8, 16 port c control register 4 pccr4 16 h'fffe38bc 8, 16, 32 port c control register 3 pccr3 16 h'fffe38be 8, 16 port c control register 2 pccr2 16 h'fffe38c0 8, 16, 32
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1035 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size port c control register 1 pccr1 16 h'fffe38c2 pfc 8, 16 port d i/o register pdior 16 h'fffe38ca 8, 16 port d control register 5 pdcr5 16 h'fffe38d2 8, 16 port d control register 4 pdcr4 16 h'fffe38d4 8, 16, 32 port d control register 3 pdcr3 16 h'fffe38d6 8, 16 port d control register 2 pdcr2 16 h'fffe38d8 8, 16, 32 port d control register 1 pdcr1 16 h'fffe38da 8, 16 port e control register 2 pecr2 16 h'fffe38f0 8, 16, 32 port e control register 1 pecr1 16 h'fffe38f2 8, 16 port f i/o register pfior 16 h'fffe38fa 8, 16 port f control register 2 pfcr2 16 h'fffe3908 8, 16, 32 port f control register 1 pfcr1 16 h'fffe390a 8, 16 timer control register_3 tcr_3 8 h'fffe4200 mtu2 8 timer control register_4 tcr_4 8 h'fffe4201 8 timer mode register_3 tmdr_3 8 h'fffe4202 8 timer mode register_4 tmdr_4 8 h'fffe4203 8 timer i/o control register h_3 tiorh_3 8 h'fffe4204 8 timer i/o control register l_3 tiorl_3 8 h'fffe4205 8 timer i/o control register h_4 tiorh_4 8 h'fffe4206 8 timer i/o control register l_4 tiorl_4 8 h'fffe4207 8 timer interrupt enable register_3 tier_3 8 h'fffe4208 8 timer interrupt enable register_4 tier_4 8 h'fffe4209 8 timer output master enable register toer 8 h'fffe420a 8 timer gate control register tgcr 8 h'fffe420d 8 timer output control register 1 tocr1 8 h'fffe420e 8 timer output control register 2 tocr2 8 h'fffe420f 8 timer counter_3 tcnt_3 16 h'fffe4210 16 timer counter_4 tcnt_4 16 h'fffe4212 16 timer cycle data register tcdr 16 h'fffe4214 16 timer dead time data register tddr 16 h'fffe4216 16 timer general register a_3 tgra_3 16 h'fffe4218 16 timer general register b_3 tgrb_3 16 h'fffe421a 16 timer general register a_4 tgra_4 16 h'fffe421c 16 timer general register b_4 tgrb_4 16 h'fffe421e 16 timer subcounter tcnts 16 h'fffe4220 16 timer cycle buffer register tcbr 16 h'fffe4222 16
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1036 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size timer general register c_3 tgrc_3 16 h'fffe4224 mtu2 16 timer general register d_3 tgrd_3 16 h'fffe4226 16 timer general register c_4 tgrc_4 16 h'fffe4228 16 timer general register d_4 tgrd_4 16 h'fffe422a 16 timer status register_3 tsr_3 8 h'fffe422c 8 timer status register_4 tsr_4 8 h'fffe422d 8 timer interrupt skipping set register titcr 8 h'fffe4230 8 timer interrupt skipping counter titcnt 8 h'fffe4231 8 timer buffer transfer set register tbter 8 h'fffe4232 8 timer dead time enable register tder 8 h'fffe4234 8 timer output level buffer register tolbr 8 h'fffe4236 8 timer buffer operation transfer mode register_3 tbtm_3 8 h'fffe4238 8 timer buffer operation transfer mode register_4 tbtm_4 8 h'fffe4239 8 timer a/d converter start request control register tadcr 16 h'fffe4240 16 timer a/d converter start request cycle set register a_4 tadcora_4 16 h'fffe4244 16 timer a/d converter start request cycle set register b_4 tadcorb_4 16 h'fffe4246 16 timer a/d converter start request cycle set buffer register a_4 tadcobra_4 16 h'fffe4248 16 timer a/d converter start request cycle set buffer register b_4 tadcobrb_4 16 h'fffe424a 16 timer waveform control register twcr 8 h'fffe4260 8 timer start register tstr 8 h'fffe4280 8 timer synchronous register tsyr 8 h'fffe4281 8 timer counter synchronous start register tcsystr 8 h'fffe4282 8 timer read/write enable register trwer 8 h'fffe4284 8 timer control register_0 tcr_0 8 h'fffe4300 8 timer mode register_0 tmdr_0 8 h'fffe4301 8 timer i/o control register h_0 tiorh_0 8 h'fffe4302 8 timer i/o control register l_0 tiorl_0 8 h'fffe4303 8 timer interrupt enable register_0 tier_0 8 h'fffe4304 8 timer status register_0 tsr_0 8 h'fffe4305 8 timer counter_0 tcnt_0 16 h'fffe4306 16 timer general register a_0 tgra_0 16 h'fffe4308 16 timer general register b_0 tgrb_0 16 h'fffe430a 16 timer general register c_0 tgrc_0 16 h'fffe430c 16
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1037 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size timer general register d_0 tgrd_0 16 h'fffe430e mtu2 16 timer general register e_0 tgre_0 16 h'fffe4320 16 timer general register f_0 tgrf_0 16 h'fffe4322 16 timer interrupt enable register 2_0 tier2_0 8 h'fffe4324 8 timer status register 2_0 tsr2_0 8 h'fffe4325 8 timer buffer operation transfer mode register_0 tbtm_0 8 h'fffe4326 8 timer control register_1 tcr_1 8 h'fffe4380 8 timer mode register_1 tmdr_1 8 h'fffe4381 8 timer i/o control register_1 tior_1 8 h'fffe4382 8 timer interrupt enable register_1 tier_1 8 h'fffe4384 8 timer status register_1 tsr_1 8 h'fffe4385 8 timer counter_1 tcnt_1 16 h'fffe4386 16 timer general register a_1 tgra_1 16 h'fffe4388 16 timer general register b_1 tgrb_1 16 h'fffe438a 16 timer input capture control register ticcr 8 h'fffe4390 8 timer control register_2 tcr_2 8 h'fffe4000 8 timer mode register_2 tmdr_2 8 h'fffe4001 8 timer i/o control register_2 tior_2 8 h'fffe4002 8 timer interrupt enable register_2 tier_2 8 h'fffe4004 8 timer status register_2 tsr_2 8 h'fffe4005 8 timer counter_2 tcnt_2 16 h'fffe4006 16 timer general register a_2 tgra_2 16 h'fffe4008 16 timer general register b_2 tgrb_2 16 h'fffe400a 16 timer counter u_5 tcntu_5 16 h'fffe4080 16 timer general register u_5 tgru_5 16 h'fffe4082 16 timer control register u_5 tcru_5 8 h'fffe4084 8 timer i/o control register u_5 tioru_5 8 h'fffe4086 8 timer counter v_5 tcntv_5 16 h'fffe4090 16 timer general register v_5 tgrv_5 16 h'fffe4092 16 timer control register v_5 tcrv_5 8 h'fffe4094 8 timer i/o control register v_5 tiorv_5 8 h'fffe4096 8 timer counter w_5 tcntw_5 8 h'fffe40a0 8 timer general register w_5 tgrw_5 16 h'fffe40a2 16 timer control register w_5 tcrw_5 8 h'fffe40a4 8 timer i/o control register w_5 tiorw_5 8 h'fffe40a6 8 timer status register_5 tsr_5 8 h'fffe40b0 8
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1038 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size timer interrupt enab le register_5 tier_5 8 h'fffe40b2 mtu2 8 timer start register_5 tstr_5 8 h'fffe40b4 8 timer compare match clear regist er tcntcmpclr 8 h'fffe40b6 8 timer control register_0 t8tcr_0 8 h'fffe5400 tmr 8 timer control register_1 t8tcr_1 8 h'fffe5401 8 timer control/status register_0 t8tcsr_0 8 h'fffe5402 8 timer control/status register_1 t8tcsr_1 8 h'fffe5403 8 time constant register a_0 t8tcora_0 8 h'fffe5404 8 time constant register a_1 t8tcora_1 8 h'fffe5405 8 time constant register b_0 t8tcorb_0 8 h'fffe5406 8 time constant register b_1 t8tcorb_1 8 h'fffe5407 8 timer counter_0 t8tcnt_0 8 h'fffe5408 8 timer counter_1 t8tcnt_1 8 h'fffe5409 8 timer counter control register_0 t8tccr_0 8 h'fffe540a 8 timer counter control register_1 t8tccr_1 8 h'fffe540b 8 a/d data register a_0 addra 16 h'fffe5800 adc 16 a/d data register b_0 addrb 16 h'fffe5802 16 a/d data register c_0 addrc 16 h'fffe5804 16 a/d data register d_0 addrd 16 h'fffe5806 16 a/d data register e_0 addre 16 h'fffe5808 16 a/d data register f_0 addrf 16 h'fffe580a 16 a/d data register g_0 addrg 16 h'fffe580c 16 a/d data register h_0 addrh 16 h'fffe580e 16 a/d control/status register adcsr 16 h'fffe5820 16 d/a data register 0 dadr0 8 h'fffe6800 dac 8, 16 d/a data register 1 dadr1 8 h'fffe6801 8, 16 d/a control register dacr 8 h'fffe6802 8, 16 serial mode register_0 scsmr_0 16 h'fffe8000 scif 16 bit rate register_0 scbrr_0 8 h'fffe8004 8 serial control register_0 scscr_0 16 h'fffe8008 16 transmit fifo data register_0 scftdr_0 8 h'fffe800c 8 serial status register scfsr_0 16 h'fffe8010 16 receive fifo data register_0 scfrdr_0 8 h'fffe8014 8 fifo control register_0 scfcr_0 16 h'fffe8018 16 fifo data count register_0 scfdr_0 16 h'fffe801c 16 serial port register_0 scsptr_0 16 h'fffe8020 16
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1039 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size line status register_0 sclsr_0 16 h'fffe8024 scif 16 serial mode register_1 scsmr_1 16 h'fffe8800 16 bit rate register_1 scbrr_1 8 h'fffe8804 8 serial control register_1 scscr_1 16 h'fffe8808 16 transmit fifo data register_1 scftdr_1 8 h'fffe880c 8 serial status register_1 scfsr_1 16 h'fffe8810 16 receive fifo data register_1 scfrdr_1 8 h'fffe8814 8 fifo control register_1 scfcr_1 16 h'fffe8818 16 fifo data count register_1 scfdr_1 16 h'fffe881c 16 serial port register_1 scsptr_1 16 h'fffe8820 16 line status register_1 sclsr_1 16 h'fffe8824 16 serial mode register_2 scsmr_2 16 h'fffe9000 16 bit rate register_2 scbrr_2 8 h'fffe9004 8 serial control register_2 scscr_2 16 h'fffe9008 16 transmit fifo data register_2 scftdr_2 8 h'fffe900c 8 serial status register_2 scfsr_2 16 h'fffe9010 16 receive fifo data register_2 scfrdr_2 8 h'fffe9014 8 fifo control register_2 scfcr_2 16 h'fffe9018 16 fifo data count register_2 scfdr_2 16 h'fffe901c 16 serial port register_2 scsptr_2 16 h'fffe9020 16 line status register_2 sclsr_2 16 h'fffe9024 16 serial mode register_3 scsmr_3 16 h'fffe9800 16 bit rate register_3 scbrr_3 8 h'fffe9804 8 serial control register_3 scscr_3 16 h'fffe9808 16 transmit fifo data register_3 scftdr_3 8 h'fffe980c 8 serial status register_3 scfsr_3 16 h'fffe9810 16 receive fifo data register_3 scfrdr_3 8 h'fffe9814 8 fifo control register_3 scfcr_3 16 h'fffe9818 16 fifo data count register_3 scfdr_3 16 h'fffe981c 16 serial port register_3 scsptr_3 16 h'fffe9820 16 line status register_3 sclsr_3 16 h'fffe9824 16 serial mode register_4 scsmr_4 16 h'fffea000 16 bit rate register_4 scbrr_4 8 h'fffea004 8 serial control register_4 scscr_4 16 h'fffea008 16 transmit fifo data register _4 scftdr_4 8 h'fffea00c 8 serial status register_4 scfsr_4 16 h'fffea010 16
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1040 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size receive fifo data register _4 scfrdr_4 8 h'fffea014 scif 8 fifo control register_4 scfcr_4 16 h'fffea018 16 fifo data count register _4 scfdr_4 16 h'fffea01c 16 serial port register_4 scsptr_4 16 h'fffea020 16 line status register_4 sclsr_4 16 h'fffea024 16 serial mode register_5 scsmr_5 16 h'fffea800 16 bit rate register_5 scbrr_5 8 h'fffea804 8 serial control register_5 scscr_5 16 h'fffea808 16 transmit fifo data register _5 scftdr_5 8 h'fffea80c 8 serial status register_5 scfsr_5 16 h'fffea810 16 receive fifo data register_5 scfrdr_5 8 h'fffea814 8 fifo control register_5 scfcr_5 16 h'fffea818 16 fifo data count register _5 scfdr_5 16 h'fffea81c 16 serial port register_5 scsptr_5 16 h'fffea820 16 line status register_5 sclsr_5 16 h'fffea824 16 serial mode register_6 scsmr_6 16 h'fffeb000 16 bit rate register_6 scbrr_6 8 h'fffeb004 8 serial control register_6 scscr_6 16 h'fffeb008 16 transmit fifo data register _6 scftdr_6 8 h'fffeb00c 8 serial status register_6 scfsr_6 16 h'fffeb010 16 receive fifo data register_6 scfrdr_6 8 h'fffeb014 8 fifo control register_6 scfcr_6 16 h'fffeb018 16 fifo data count register _6 scfdr_6 16 h'fffeb01c 16 serial port register_6 scsptr_6 16 h'fffeb020 16 line status register_6 sclsr_6 16 h'fffeb024 16 serial mode register_7 scsmr_7 16 h'fffeb800 16 bit rate register_7 scbrr_7 8 h'fffeb804 8 serial control register_7 scscr_7 16 h'fffeb808 16 transmit fifo data register _7 scftdr_7 8 h'fffeb80c 8 serial status register_7 scfsr_7 16 h'fffeb810 16 receive fifo data register_7 scfrdr_7 8 h'fffeb814 8 fifo control register_7 scfcr_7 16 h'fffeb818 16 fifo data count register _7 scfdr_7 16 h'fffeb81c 16 serial port register_7 scsptr_7 16 h'fffeb820 16 line status register_7 sclsr_7 16 h'fffeb824 16
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1041 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size control register_0 ssicr_0 32 h'fffed000 ssi 32 status register_0 ssisr_0 32 h'fffed004 32 transmit data register_0 ssitdr_0 32 h'fffed008 32 receive data register_0 ssirdr_0 32 h'fffed00c 32 control register_1 ssicr_1 32 h'fffed080 32 status register_1 ssisr_1 32 h'fffed084 32 transmit data register_1 ssitdr_1 32 h'fffed088 32 receive data register_1 ssirdr_1 32 h'fffed08c 32 i 2 c bus control register 1_0 iccr1_0 8 h'fffee000 iic3 8 i 2 c bus control register 2_0 iccr2_0 8 h'fffee001 8 i 2 c bus mode register_0 icmr_0 8 h'fffee002 8 i 2 c bus interrupt enable regist er_0 icier_0 8 h'fffee003 8 i 2 c bus status register_0 icsr_0 8 h'fffee004 8 slave address register_0 sar_0 8 h'fffee005 8 i 2 c bus transmit data regist er_0 icdrt_0 8 h'fffee006 8 i 2 c bus receive data register _0 icdrr_0 8 h'fffee007 8 nf2cyc register_0 nf 2cyc_0 8 h'fffee008 8 i 2 c bus control register 1_1 iccr1_1 8 h'fffee080 8 i 2 c bus control register 2_1 iccr2_1 8 h'fffee081 8 i 2 c bus mode register_1 icmr_1 8 h'fffee082 8 i 2 c bus interrupt enable regist er_1 icier_1 8 h'fffee083 8 i 2 c bus status register_1 icsr_1 8 h'fffee084 8 slave address register_1 sar_1 8 h'fffee085 8 i 2 c bus transmit dataregister_1 icdrt_1 8 h'fffee086 8 i 2 c bus receive data register _1 icdrr_1 8 h'fffee087 8 nf2cyc register_1 nf 2cyc_1 8 h'fffee088 8 i 2 c bus control register 1_2 iccr1_2 8 h'fffee100 8 i 2 c bus control register 2_2 iccr2_2 8 h'fffee101 8 i 2 c bus mode register_2 icmr_2 8 h'fffee102 8 i 2 c bus interrupt enable regist er_2 icier_2 8 h'fffee103 8 i 2 c bus status register_2 icsr_2 8 h'fffee104 8 slave address register_2 sar_2 8 h'fffee105 8 i 2 c bus transmit data regist er_2 icdrt_2 8 h'fffee106 8 i 2 c bus receive data register _2 icdrr_2 8 h'fffee107 8 nf2cyc register_2 nf 2cyc_2 8 h'fffee108 8
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1042 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size master control register_0 mcr_0 16 h'ffff0000 rcan-et 16 general status register_0 gsr_0 16 h'ffff0002 16 bit configuration register 1_0 bcr1_0 16 h'ffff0004 16 bit configuration register 0_0 bcr0_0 16 h'ffff0006 16 interrupt request register_0 irr_0 16 h'ffff0008 16 interrupt mask register_0 imr_0 16 h'ffff000a 16 transmit error counter_0/ receive error counter_0 tec_0/ rec_0 16 h'ffff000c 16 transmit pending register 1_0 txpr1_0 16 h'ffff0020 32 transmit pending register 0_0 txpr0_0 16 h'ffff0022 transmit cancel register 0_0 txcr0_0 16 h'ffff002a 16 transmit acknowledge register 0_0 txack0_0 16 h'ffff0032 16 abort acknowledge register 0_0 aback0_0 16 h'ffff003a 16 data frame receive pending register 0_0 rxpr0_0 16 h'ffff0042 16 remote frame receive pending register 0_0 rfpr0_0 16 h'ffff004a 16 mailbox interrupt mask register0_0 mbimr0_0 16 h'ffff0052 16 unread message status register 0_0 umsr0_0 16 h'ffff005a 16 mailbox 0 control 0 contro l0h 16 h'ffff0100 16, 32 control0l 16 h'ffff0102 16 lafm lafmh 16 h'ffff0104 16, 32 lafml 16 h'ffff0106 16 data msg_data[0] 8 h'ffff0108 8, 16, 32 msg_data[1] 8 h'ffff0109 8 msg_data[2] 8 h'ffff010a 8, 16 msg_data[3] 8 h'ffff010b 8 msg_data[4] 8 h'ffff010c 8, 16, 32 msg_data[5] 8 h'ffff010d 8 msg_data[6] 8 h'ffff010e 8, 16 msg_data[7] 8 h'ffff010f 8 control 1 control1h 8 h'ffff0110 8, 16 control1l 8 h'ffff0111 8
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1043 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size mailbox n (n = 1 to 15) control 0 control0h 16 h'ffff0100 + n 32 rcan-et 16, 32 control0l 16 h'ffff0102 + n 32 16 lafm lafmh 16 h'ffff0104 + n 32 16, 32 lafml 16 h'ffff0106 + n 32 16 data msg_data[0] 8 h'ffff0108 + n 32 8, 16, 32 msg_data[1] 8 h'ffff0109 + n 32 8 msg_data[2] 8 h'ffff010a + n 32 8, 16 mailbox n (n = 1 to 15) data msg_data[3] 8 h'ffff010b + n 32 8 msg_data[4] 8 h'ffff010c + n 32 8, 16, 32 msg_data[5] 8 h'ffff010d + n 32 8 msg_data[6] 8 h'ffff010e + n 32 8, 16 msg_data[7] 8 h'ffff010f + n 32 8 control 1 control1h 8 h'ffff0110 + n 32 8, 16 control1l 8 h'ffff0111 + n 32 8 master control register _1 mcr_1 16 h'ffff0800 16 general status register_1 gsr_1 16 h'ffff0802 16 bit configuration register1_1 bcr1_1 16 h'ffff0804 16 bit configuration register0_1 bcr0_1 16 h'ffff0806 16 interrupt request register_1 irr_1 16 h'ffff0808 16 interrupt mask register_1 imr_1 16 h'ffff080a 16 transmit error counter_1/ receive error counter_1 tec_1/ rec_1 16 h'ffff080c 16 transmit pending register 1_1 txpr1_1 16 h'ffff0820 32 transmit pending register 0_1 txpr0_1 16 h'ffff0822 transmit cancel register 0_1 txcr0_1 16 h'ffff082a 16 transmit acknowledge register 0_1 txack0_1 16 h'ffff0832 16
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1044 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size abort acknowledge register 0_ 1 aback0_1 16 h'ffff083a rcan-et 16 data frame receive pending register 0_1 rxpr0_1 16 h'ffff0842 16 remote frame receive pending register 0_1 rfpr0_1 16 h'ffff084a 16 mailbox interrupt mask register0_1 mbimr0_1 16 h'ffff0852 16 unread message status register 0_1 umsr0_1 16 h'ffff085a 16 mailbox 0 control 0 contro l0h 16 h'ffff0900 16, 32 control0l 16 h'ffff0902 16 lafm lafmh 16 h'ffff0904 16, 32 lafml 16 h'ffff0906 16 data msg_data[0] 8 h'ffff0908 8, 16, 32 msg_data[1] 8 h'ffff0909 8 msg_data[2] 8 h'ffff090a 8, 16 msg_data[3] 8 h'ffff090b 8 msg_data[4] 8 h'ffff090c 8, 16, 32 msg_data[5] 8 h'ffff090d 8 msg_data[6] 8 h'ffff090e 8, 16 msg_data[7] 8 h'ffff090f 8 control 1 control1h 8 h'ffff0910 8, 16 control1l 8 h'ffff0911 8 mailbox n (n = 1 to 15) control 0 control0h 16 h'ffff0900 + n 32 16, 32 control0l 16 h'ffff0902 + n 32 16 lafm lafmh 16 h'ffff0904 + n 32 16, 32 lafml 16 h'ffff0906 + n 32 16 data msg_data[0] 8 h'ffff0908?n 32 8, 16, 32 msg_data[1] 8 h'ffff0909n 32 8 msg_data[2] 8 h'ffff090a + n 32 8, 16 msg_data[3] 8 h'ffff090b + n 32 8 msg_data[4] 8 h'ffff090c + n 32 8, 16, 32
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1045 of 1164 rej09b0321-0200 register name abbreviation number of bits address module access size mailbox n (n = 1 to 15) data msg_data[5] 8 h'ffff090d + n 32 rcan-et 8 msg_data[6] 8 h'ffff090e + n 32 8, 16 msg_data[7] 8 h'ffff090f + n 32 8 control 1 control1h 8 h'ffff0910 + n 32 8, 16 control1l 8 h'ffff0911 + n 32 8 dma transfer enable register 0 dreqer0 8 h'ffff1600 intc 8, 16, 32 dma transfer enable register 1 dreqer1 8 h'ffff1601 8 dma transfer enable register 2 dreqer2 8 h'ffff1602 8, 16 dma transfer enable register 3 dreqer3 8 h'ffff1603 8 deep standby cancel source flag register dsfr 16 h'ffff1904 system 16 deep standby oscillation st abilization clock select register dscnt 8 h'ffff1906 8 ram retained area specification register ramkp 8 h'ffff1907 8
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1046 of 1164 rej09b0321-0200 28.2 register bits register addresses and bit names of the on-chip peripheral modules are described below. each line covers eight bits, and 16-bit and 32-bit registers are shown as 2 or 4 lines, respectively. register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module sycbeen stsclr ? ? ? ? ? ? ? bus monitor ? ? ? ? ? toen igaen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sycbests1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pto per ? ? ? pmst1 pmst0 ? ? ? ? ? ? ? ? sycbests2 ? eto eer ? ? ? emst1 emst0 ? ? ? ? ? ? ? ? ? ? oer ? ? ? omst1 omst0 ? ? sher ? ? ? shmst1 shmst0 sycbesw 00cpen ? 10cpen 11cpen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs0cnt ? ? ? ? ? ? ? ? bsc ? ? bsize1 bsize0 ? ? ? exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs0rec ? ? ? ? wrcv3 wrcv2 wrcv1 wrcv0 ? ? ? ? rrcv3 rrcv2 rrcv1 rrcv0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs1cnt ? ? ? ? ? ? ? ? ? ? bsize1 bsize0 ? ? ? exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs1rec ? ? ? ? wrcv3 wrcv2 wrcv1 wrcv0 ? ? ? ? rrcv3 rrcv2 rrcv1 rrcv0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1047 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module cs2cnt ? ? ? ? ? ? ? ? bsc ? ? bsize1 bsize0 ? ? ? exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs2rec ? ? ? ? wrcv3 wrcv2 wrcv1 wrcv0 ? ? ? ? rrcv3 rrcv2 rrcv1 rrcv0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs3cnt ? ? ? ? ? ? ? ? ? ? bsize1 bsize0 ? ? ? exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs3rec ? ? ? ? wrcv3 wrcv2 wrcv1 wrcv0 ? ? ? ? rrcv3 rrcv2 rrcv1 rrcv0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs4cnt ? ? ? ? ? ? ? ? ? ? bsize1 bsize0 ? ? ? exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs4rec ? ? ? ? wrcv3 wrcv2 wrcv1 wrcv0 ? ? ? ? rrcv3 rrcv2 rrcv1 rrcv0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs5cnt ? ? ? ? ? ? ? ? ? ? bsize1 bsize0 ? ? ? exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs5rec ? ? ? ? wrcv3 wrcv2 wrcv1 wrcv0 ? ? ? ? rrcv3 rrcv2 rrcv1 rrcv0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs6cnt ? ? ? ? ? ? ? ? ? ? bsize1 bsize0 ? ? ? exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1048 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module cs6rec ? ? ? ? wrcv3 wrcv2 wrcv1 wrcv0 bsc ? ? ? ? rrcv3 rrcv2 rrcv1 rrcv0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sdc0cnt ? ? ? ? ? ? ? ? ? ? bsize1 bsize0 ? ? ? exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sdc1cnt ? ? ? ? ? ? ? ? ? ? bsize1 bsize0 ? ? ? exenb ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? csmod0 prmod ? pbcnt1 pbcnt0 ? ? pwenb prenb ? ? ? ? ewenb ? ? wrmod ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs1wcnt0 ? ? ? csrwait4 csrwait3 csrwait2 csrwait1 csrwait0 ? ? ? cswwait4 cswwait3 cswwait2 cswwait1 cswwait0 ? ? ? ? ? csprwait2 csprwait1 csprwait0 ? ? ? ? ? cspwwait2 cspwwait1 cspwwait0 cs2wcnt0 ? cson2 cson1 cson0 ? wdon2 wdon1 wdon0 ? wron2 wron1 wron0 ? rdon2 rdon1 rdon0 ? ? ? ? ? wdoff2 wdoff1 wdoff0 ? cswoff2 cswoff1 cswoff0 ? csroff2 csroff1 csroff0 csmod1 prmod ? pbcnt1 pbcnt0 ? ? pwenb prenb ? ? ? ? ewenb ? ? wrmod ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs1wcnt1 ? ? ? csrwait4 csrwait3 csrwait2 csrwait1 csrwait0 ? ? ? cswwait4 cswwait3 cswwait2 cswwait1 cswwait0 ? ? ? ? ? csprwait2 csprwait1 csprwait0 ? ? ? ? ? cspwwait2 cspwwait1 cspwwait0 cs2wcnt1 ? cson2 cson1 cson0 ? wdon2 wdon1 wdon0 ? wron2 wron1 wron0 ? rdon2 rdon1 rdon0 ? ? ? ? ? wdoff2 wdoff1 wdoff0 ? cswoff2 cswoff1 cswoff0 ? csroff2 csroff1 csroff0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1049 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module csmod2 prmod ? pbcnt1 pbcnt0 ? ? pwenb prenb bsc ? ? ? ? ewenb ? ? wrmod ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs1wcnt2 ? ? ? csrwait4 csrwait3 csrwait2 csrwait1 csrwait0 ? ? ? cswwait4 cswwait3 cswwait2 cswwait1 cswwait0 ? ? ? ? ? csprwait2 csprwait1 csprwait0 ? ? ? ? ? cspwwait2 cspwwait1 cspwwait0 cs2wcnt2 ? cson2 cson1 cson0 ? wdon2 wdon1 wdon0 ? wron2 wron1 wron0 ? rdon2 rdon1 rdon0 ? ? ? ? ? wdoff2 wdoff1 wdoff0 ? cswoff2 cswoff1 cswoff0 ? csroff2 csroff1 csroff0 csmod3 prmod ? pbcnt1 pbcnt0 ? ? pwenb prenb ? ? ? ? ewenb ? ? wrmod ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs1wcnt3 ? ? ? csrwait4 csrwait3 csrwait2 csrwait1 csrwait0 ? ? ? cswwait4 cswwait3 cswwait2 cswwait1 cswwait0 ? ? ? ? ? csprwait2 csprwait1 csprwait0 ? ? ? ? ? cspwwait2 cspwwait1 cspwwait0 cs2wcnt3 ? cson2 cson1 cson0 ? wdon2 wdon1 wdon0 ? wron2 wron1 wron0 ? rdon2 rdon1 rdon0 ? ? ? ? ? wdoff2 wdoff1 wdoff0 ? cswoff2 cswoff1 cswoff0 ? csroff2 csroff1 csroff0 csmod4 prmod ? pbcnt1 pbcnt0 ? ? pwenb prenb ? ? ? ? ewenb ? ? wrmod ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs1wcnt4 ? ? ? csrwait4 csrwait3 csrwait2 csrwait1 csrwait0 ? ? ? cswwait4 cswwait3 cswwait2 cswwait1 cswwait0 ? ? ? ? ? csprwait2 csprwait1 csprwait0 ? ? ? ? ? cspwwait2 cspwwait1 cspwwait0 cs2wcnt4 ? cson2 cson1 cson0 ? wdon2 wdon1 wdon0 ? wron2 wron1 wron0 ? rdon2 rdon1 rdon0 ? ? ? ? ? wdoff2 wdoff1 wdoff0 ? cswoff2 cswoff1 cswoff0 ? csroff2 csroff1 csroff0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1050 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module csmod5 prmod ? pbcnt1 pbcnt0 ? ? pwenb prenb bsc ? ? ? ? ewenb ? ? wrmod ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs1wcnt5 ? ? ? csrwait4 csrwait3 csrwait2 csrwait1 csrwait0 ? ? ? cswwait4 cswwait3 cswwait2 cswwait1 cswwait0 ? ? ? ? ? csprwait2 csprwait1 csprwait0 ? ? ? ? ? cspwwait2 cspwwait1 cspwwait0 cs2wcnt5 ? cson2 cson1 cson0 ? wdon2 wdon1 wdon0 ? wron2 wron1 wron0 ? rdon2 rdon1 rdon0 ? ? ? ? ? wdoff2 wdoff1 wdoff0 ? cswoff2 cswoff1 cswoff0 ? csroff2 csroff1 csroff0 csmod6 prmod ? pbcnt1 pbcnt0 ? ? pwenb prenb ? ? ? ? ewenb ? ? wrmod ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cs1wcnt6 ? ? ? csrwait4 csrwait3 csrwait2 csrwait1 csrwait0 ? ? ? cswwait4 cswwait3 cswwait2 cswwait1 cswwait0 ? ? ? ? ? csprwait2 csprwait1 csprwait0 ? ? ? ? ? cspwwait2 cspwwait1 cspwwait0 cs2wcnt6 ? cson2 cson1 cson0 ? wdon2 wdon1 wdon0 ? wron2 wron1 wron0 ? rdon2 rdon1 rdon0 ? ? ? ? ? wdoff2 wdoff1 wdoff0 ? cswoff2 cswoff1 cswoff0 ? csroff2 csroff1 csroff0 sdrfcnt0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dsfen sdrfcnt1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? drfen drefw3 drefw2 drefw1 drefw0 drfc11 drfc10 drfc9 drfc8 drfc7 drfc6 drfc5 drfc4 drfc3 drfc2 drfc1 drfc0 sdir0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dpc2 dpc1 dpc0 darfc3 darfc2 darfc1 darfc0 darfi3 darfi2 darfi1 darfi0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1051 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module sdir1 ? ? ? ? ? ? ? ? bsc ? ? ? ? ? ? ? dinist ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dinirq sdpwdcnt ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dpwd sddpwdcnt ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ddpd sd0adr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ddbw1 ddbw0 ? ? ? ? ? dsz2 dsz1 dsz0 sd0tr ? ? ? ? ? ? ? ? ? ? ? ? ? dras2 dras1 dras0 ? ? drcd1 drcd0 dpcg2 dpcg1 dpcg0 dwr ? ? ? ? ? dcl2 dcl1 dcl0 sd0mod ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmr14 dmr13 dmr12 dmr11 dmr10 dmr9 dmr8 dmr7 dmr6 dmr5 dmr4 dmr3 dmr2 dmr1 dmr0 sd1adr ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ddbw1 ddbw0 ? ? ? ? ? dsz2 dsz1 dsz0 sd1tr ? ? ? ? ? ? ? ? ? ? ? ? ? dras2 dras1 dras0 ? ? drcd1 drcd0 dpcg2 dpcg1 dpcg0 dwr ? ? ? ? ? dcl2 dcl1 dcl0 sd1mod ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmr14 dmr13 dmr12 dmr11 dmr10 dmr9 dmr8 dmr7 dmr6 dmr5 dmr4 dmr3 dmr2 dmr1 dmr0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1052 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module sdstr ? ? ? ? ? ? ? ? bsc ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dsrfst dinist dpwdst ddpdst dmrsst sdckscnt ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dcksen ? ? ? ? ? ? ? ? dcksc7 dcksc6 dcksc5 dcksc4 dcksc3 dcksc2 dcksc1 dcksc0 dmcsadr0 csa31 csa30 csa29 csa28 csa27 csa26 csa25 csa24 dmac csa23 csa22 csa21 csa20 csa19 csa18 csa17 csa16 csa15 csa14 csa13 csa12 csa11 csa10 csa9 csa8 csa7 csa6 csa5 csa4 csa3 csa2 csa1 csa0 dmcdadr0 cda31 cda30 cda29 cda28 cda27 cda26 cda25 cda24 cda23 cda22 cda21 cda20 cda19 cda18 cda17 cda16 cda15 cda14 cda13 cda12 cda11 cda10 cda9 cda8 cda7 cda6 cda5 cda4 cda3 cda2 cda1 cda0 dmcbct0 ? ? ? ? ? ? cbc25 cbc24 cbc23 cbc22 cbc21 cbc20 cbc19 cbc18 cbc17 cbc16 cbc15 cbc14 cbc13 cbc12 cbc11 cbc10 cbc9 cbc8 cbc7 cbc6 cbc5 cbc4 cbc3 cbc2 cbc1 cbc0 dmmod0 ? ? ? ? opsel3 opsel2 opsel1 opsel0 ? ? ? ? ? szsel2 szsel1 szsel0 ? samod2 samod1 samod0 ? damod2 damod1 damod0 ? ? ? ? sact dact dtcm1 dtcm0 dmcsadr1 csa31 csa30 csa29 csa28 csa27 csa26 csa25 csa24 csa23 csa22 csa21 csa20 csa19 csa18 csa17 csa16 csa15 csa14 csa13 csa12 csa11 csa10 csa9 csa8 csa7 csa6 csa5 csa4 csa3 csa2 csa1 csa0 dmcdadr1 cda31 cda30 cda29 cda28 cda27 cda26 cda25 cda24 cda23 cda22 cda21 cda20 cda19 cda18 cda17 cda16 cda15 cda14 cda13 cda12 cda11 cda10 cda9 cda8 cda7 cda6 cda5 cda4 cda3 cda2 cda1 cda0 dmcbct1 ? ? ? ? ? ? cbc25 cbc24 cbc23 cbc22 cbc21 cbc20 cbc19 cbc18 cbc17 cbc16 cbc15 cbc14 cbc13 cbc12 cbc11 cbc10 cbc9 cbc8 cbc7 cbc6 cbc5 cbc4 cbc3 cbc2 cbc1 cbc0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1053 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module dmmod1 ? ? ? ? opsel3 opsel2 opsel1 opsel0 dmac ? ? ? ? ? szsel2 szsel1 szsel0 ? samod2 samod1 samod0 ? damod2 damod1 damod0 ? ? ? ? sact dact dtcm1 dtcm0 dmcsadr2 csa31 csa30 csa29 csa28 csa27 csa26 csa25 csa24 csa23 csa22 csa21 csa20 csa19 csa18 csa17 csa16 csa15 csa14 csa13 csa12 csa11 csa10 csa9 csa8 csa7 csa6 csa5 csa4 csa3 csa2 csa1 csa0 dmcdadr2 cda31 cda30 cda29 cda28 cda27 cda26 cda25 cda24 cda23 cda22 cda21 cda20 cda19 cda18 cda17 cda16 cda15 cda14 cda13 cda12 cda11 cda10 cda9 cda8 cda7 cda6 cda5 cda4 cda3 cda2 cda1 cda0 dmcbct2 ? ? ? ? ? ? cbc25 cbc24 cbc23 cbc22 cbc21 cbc20 cbc19 cbc18 cbc17 cbc16 cbc15 cbc14 cbc13 cbc12 cbc11 cbc10 cbc9 cbc8 cbc7 cbc6 cbc5 cbc4 cbc3 cbc2 cbc1 cbc0 dmmod2 ? ? ? ? opsel3 opsel2 opsel1 opsel0 ? ? ? ? ? szsel2 szsel1 szsel0 ? samod2 samod1 samod0 ? damod2 damod1 damod0 ? ? ? ? sact dact dtcm1 dtcm0 dmcsadr3 csa31 csa30 csa29 csa28 csa27 csa26 csa25 csa24 csa23 csa22 csa21 csa20 csa19 csa18 csa17 csa16 csa15 csa14 csa13 csa12 csa11 csa10 csa9 csa8 csa7 csa6 csa5 csa4 csa3 csa2 csa1 csa0 dmcdadr3 cda31 cda30 cda29 cda28 cda27 cda26 cda25 cda24 cda23 cda22 cda21 cda20 cda19 cda18 cda17 cda16 cda15 cda14 cda13 cda12 cda11 cda10 cda9 cda8 cda7 cda6 cda5 cda4 cda3 cda2 cda1 cda0 dmcbct3 ? ? ? ? ? ? cbc25 cbc24 cbc23 cbc22 cbc21 cbc20 cbc19 cbc18 cbc17 cbc16 cbc15 cbc14 cbc13 cbc12 cbc11 cbc10 cbc9 cbc8 cbc7 cbc6 cbc5 cbc4 cbc3 cbc2 cbc1 cbc0 dmmod3 ? ? ? ? opsel3 opsel2 opsel1 opsel0 ? ? ? ? ? szsel2 szsel1 szsel0 ? samod2 samod1 samod0 ? damod2 damod1 damod0 ? ? ? ? sact dact dtcm1 dtcm0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1054 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module dmcsadr4 csa31 csa30 csa29 csa28 csa27 csa26 csa25 csa24 dmac csa23 csa22 csa21 csa20 csa19 csa18 csa17 csa16 csa15 csa14 csa13 csa12 csa11 csa10 csa9 csa8 csa7 csa6 csa5 csa4 csa3 csa2 csa1 csa0 dmcdadr4 cda31 cda30 cda29 cda28 cda27 cda26 cda25 cda24 cda23 cda22 cda21 cda20 cda19 cda18 cda17 cda16 cda15 cda14 cda13 cda12 cda11 cda10 cda9 cda8 cda7 cda6 cda5 cda4 cda3 cda2 cda1 cda0 dmcbct4 ? ? ? ? ? ? cbc25 cbc24 cbc23 cbc22 cbc21 cbc20 cbc19 cbc18 cbc17 cbc16 cbc15 cbc14 cbc13 cbc12 cbc11 cbc10 cbc9 cbc8 cbc7 cbc6 cbc5 cbc4 cbc3 cbc2 cbc1 cbc0 dmmod4 ? ? ? ? opsel3 opsel2 opsel1 opsel0 ? ? ? ? ? szsel2 szsel1 szsel0 ? samod2 samod1 samod0 ? damod2 damod1 damod0 ? ? ? ? sact dact dtcm1 dtcm0 dmcsadr5 csa31 csa30 csa29 csa28 csa27 csa26 csa25 csa24 csa23 csa22 csa21 csa20 csa19 csa18 csa17 csa16 csa15 csa14 csa13 csa12 csa11 csa10 csa9 csa8 csa7 csa6 csa5 csa4 csa3 csa2 csa1 csa0 dmcdadr5 cda31 cda30 cda29 cda28 cda27 cda26 cda25 cda24 cda23 cda22 cda21 cda20 cda19 cda18 cda17 cda16 cda15 cda14 cda13 cda12 cda11 cda10 cda9 cda8 cda7 cda6 cda5 cda4 cda3 cda2 cda1 cda0 dmcbct5 ? ? ? ? ? ? cbc25 cbc24 cbc23 cbc22 cbc21 cbc20 cbc19 cbc18 cbc17 cbc16 cbc15 cbc14 cbc13 cbc12 cbc11 cbc10 cbc9 cbc8 cbc7 cbc6 cbc5 cbc4 cbc3 cbc2 cbc1 cbc0 dmmod5 ? ? ? ? opsel3 opsel2 opsel1 opsel0 ? ? ? ? ? szsel2 szsel1 szsel0 ? samod2 samod1 samod0 ? damod2 damod1 damod0 ? ? ? ? sact dact dtcm1 dtcm0 dmcsadr6 csa31 csa30 csa29 csa28 csa27 csa26 csa25 csa24 csa23 csa22 csa21 csa20 csa19 csa18 csa17 csa16 csa15 csa14 csa13 csa12 csa11 csa10 csa9 csa8 csa7 csa6 csa5 csa4 csa3 csa2 csa1 csa0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1055 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module dmcdadr6 cda31 cda30 cda29 cda28 cda27 cda26 cda25 cda24 dmac cda23 cda22 cda21 cda20 cda19 cda18 cda17 cda16 cda15 cda14 cda13 cda12 cda11 cda10 cda9 cda8 cda7 cda6 cda5 cda4 cda3 cda2 cda1 cda0 dmcbct6 ? ? ? ? ? ? cbc25 cbc24 cbc23 cbc22 cbc21 cbc20 cbc19 cbc18 cbc17 cbc16 cbc15 cbc14 cbc13 cbc12 cbc11 cbc10 cbc9 cbc8 cbc7 cbc6 cbc5 cbc4 cbc3 cbc2 cbc1 cbc0 dmmod6 ? ? ? ? opsel3 opsel2 opsel1 opsel0 ? ? ? ? ? szsel2 szsel1 szsel0 ? samod2 samod1 samod0 ? damod2 damod1 damod0 ? ? ? ? sact dact dtcm1 dtcm0 dmcsadr7 csa31 csa30 csa29 csa28 csa27 csa26 csa25 csa24 csa23 csa22 csa21 csa20 csa19 csa18 csa17 csa16 csa15 csa14 csa13 csa12 csa11 csa10 csa9 csa8 csa7 csa6 csa5 csa4 csa3 csa2 csa1 csa0 dmcdadr7 cda31 cda30 cda29 cda28 cda27 cda26 cda25 cda24 cda23 cda22 cda21 cda20 cda19 cda18 cda17 cda16 cda15 cda14 cda13 cda12 cda11 cda10 cda9 cda8 cda7 cda6 cda5 cda4 cda3 cda2 cda1 cda0 dmcbct7 ? ? ? ? ? ? cbc25 cbc24 cbc23 cbc22 cbc21 cbc20 cbc19 cbc18 cbc17 cbc16 cbc15 cbc14 cbc13 cbc12 cbc11 cbc10 cbc9 cbc8 cbc7 cbc6 cbc5 cbc4 cbc3 cbc2 cbc1 cbc0 dmmod7 ? ? ? ? opsel3 opsel2 opsel1 opsel0 ? ? ? ? ? szsel2 szsel1 szsel0 ? samod2 samod1 samod0 ? damod2 damod1 damod0 ? ? ? ? sact dact dtcm1 dtcm0 dmrsadr0 rsa31 rsa30 rsa29 rsa28 rsa27 rsa26 rsa25 rsa24 rsa23 rsa22 rsa21 rsa20 rsa19 rsa18 rsa17 rsa16 rsa15 rsa14 rsa13 rsa12 rsa11 rsa10 rsa9 rsa8 rsa7 rsa6 rsa5 rsa4 rsa3 rsa2 rsa1 rsa0 dmrdadr0 rda31 rda30 rda29 rda28 rda27 rda26 rda25 rda24 rda23 rda22 rda21 rda20 rda19 rda18 rda17 rda16 rda15 rda14 rda13 rda12 rda11 rda10 rda9 rda8 rda7 rda6 rda5 rda4 rda3 rda2 rda1 rda0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1056 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module dmrbct0 ? ? ? ? ? ? rbc25 rbc24 dmac rbc23 rbc22 rbc21 rbc20 rbc19 rbc18 rbc17 rbc16 rbc15 rbc14 rbc13 rbc12 rbc11 rbc10 rbc9 rbc8 rbc7 rbc6 rbc5 rbc4 rbc3 rbc2 rbc1 rbc0 dmrsadr1 rsa31 rsa30 rsa29 rsa28 rsa27 rsa26 rsa25 rsa24 rsa23 rsa22 rsa21 rsa20 rsa19 rsa18 rsa17 rsa16 rsa15 rsa14 rsa13 rsa12 rsa11 rsa10 rsa9 rsa8 rsa7 rsa6 rsa5 rsa4 rsa3 rsa2 rsa1 rsa0 dmrdadr1 rda31 rda30 rda29 rda28 rda27 rda26 rda25 rda24 rda23 rda22 rda21 rda20 rda19 rda18 rda17 rda16 rda15 rda14 rda13 rda12 rda11 rda10 rda9 rda8 rda7 rda6 rda5 rda4 rda3 rda2 rda1 rda0 dmrbct1 ? ? ? ? ? ? rbc25 rbc24 rbc23 rbc22 rbc21 rbc20 rbc19 rbc18 rbc17 rbc16 rbc15 rbc14 rbc13 rbc12 rbc11 rbc10 rbc9 rbc8 rbc7 rbc6 rbc5 rbc4 rbc3 rbc2 rbc1 rbc0 dmrsadr2 rsa31 rsa30 rsa29 rsa28 rsa27 rsa26 rsa25 rsa24 rsa23 rsa22 rsa21 rsa20 rsa19 rsa18 rsa17 rsa16 rsa15 rsa14 rsa13 rsa12 rsa11 rsa10 rsa9 rsa8 rsa7 rsa6 rsa5 rsa4 rsa3 rsa2 rsa1 rsa0 dmrdadr2 rda31 rda30 rda29 rda28 rda27 rda26 rda25 rda24 rda23 rda22 rda21 rda20 rda19 rda18 rda17 rda16 rda15 rda14 rda13 rda12 rda11 rda10 rda9 rda8 rda7 rda6 rda5 rda4 rda3 rda2 rda1 rda0 dmrbct2 ? ? ? ? ? ? rbc25 rbc24 rbc23 rbc22 rbc21 rbc20 rbc19 rbc18 rbc17 rbc16 rbc15 rbc14 rbc13 rbc12 rbc11 rbc10 rbc9 rbc8 rbc7 rbc6 rbc5 rbc4 rbc3 rbc2 rbc1 rbc0 dmrsadr3 rsa31 rsa30 rsa29 rsa28 rsa27 rsa26 rsa25 rsa24 rsa23 rsa22 rsa21 rsa20 rsa19 rsa18 rsa17 rsa16 rsa15 rsa14 rsa13 rsa12 rsa11 rsa10 rsa9 rsa8 rsa7 rsa6 rsa5 rsa4 rsa3 rsa2 rsa1 rsa0 dmrdadr3 rda31 rda30 rda29 rda28 rda27 rda26 rda25 rda24 rda23 rda22 rda21 rda20 rda19 rda18 rda17 rda16 rda15 rda14 rda13 rda12 rda11 rda10 rda9 rda8 rda7 rda6 rda5 rda4 rda3 rda2 rda1 rda0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1057 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module dmrbct3 ? ? ? ? ? ? rbc25 rbc24 dmac rbc23 rbc22 rbc21 rbc20 rbc19 rbc18 rbc17 rbc16 rbc15 rbc14 rbc13 rbc12 rbc11 rbc10 rbc9 rbc8 rbc7 rbc6 rbc5 rbc4 rbc3 rbc2 rbc1 rbc0 dmrsadr4 rsa31 rsa30 rsa29 rsa28 rsa27 rsa26 rsa25 rsa24 rsa23 rsa22 rsa21 rsa20 rsa19 rsa18 rsa17 rsa16 rsa15 rsa14 rsa13 rsa12 rsa11 rsa10 rsa9 rsa8 rsa7 rsa6 rsa5 rsa4 rsa3 rsa2 rsa1 rsa0 dmrdadr4 rda31 rda30 rda29 rda28 rda27 rda26 rda25 rda24 rda23 rda22 rda21 rda20 rda19 rda18 rda17 rda16 rda15 rda14 rda13 rda12 rda11 rda10 rda9 rda8 rda7 rda6 rda5 rda4 rda3 rda2 rda1 rda0 dmrbct4 ? ? ? ? ? ? rbc25 rbc24 rbc23 rbc22 rbc21 rbc20 rbc19 rbc18 rbc17 rbc16 rbc15 rbc14 rbc13 rbc12 rbc11 rbc10 rbc9 rbc8 rbc7 rbc6 rbc5 rbc4 rbc3 rbc2 rbc1 rbc0 dmrsadr5 rsa31 rsa30 rsa29 rsa28 rsa27 rsa26 rsa25 rsa24 rsa23 rsa22 rsa21 rsa20 rsa19 rsa18 rsa17 rsa16 rsa15 rsa14 rsa13 rsa12 rsa11 rsa10 rsa9 rsa8 rsa7 rsa6 rsa5 rsa4 rsa3 rsa2 rsa1 rsa0 dmrdadr5 rda31 rda30 rda29 rda28 rda27 rda26 rda25 rda24 rda23 rda22 rda21 rda20 rda19 rda18 rda17 rda16 rda15 rda14 rda13 rda12 rda11 rda10 rda9 rda8 rda7 rda6 rda5 rda4 rda3 rda2 rda1 rda0 dmrbct5 ? ? ? ? ? ? rbc25 rbc24 rbc23 rbc22 rbc21 rbc20 rbc19 rbc18 rbc17 rbc16 rbc15 rbc14 rbc13 rbc12 rbc11 rbc10 rbc9 rbc8 rbc7 rbc6 rbc5 rbc4 rbc3 rbc2 rbc1 rbc0 dmrsadr6 rsa31 rsa30 rsa29 rsa28 rsa27 rsa26 rsa25 rsa24 rsa23 rsa22 rsa21 rsa20 rsa19 rsa18 rsa17 rsa16 rsa15 rsa14 rsa13 rsa12 rsa11 rsa10 rsa9 rsa8 rsa7 rsa6 rsa5 rsa4 rsa3 rsa2 rsa1 rsa0 dmrdadr6 rda31 rda30 rda29 rda28 rda27 rda26 rda25 rda24 rda23 rda22 rda21 rda20 rda19 rda18 rda17 rda16 rda15 rda14 rda13 rda12 rda11 rda10 rda9 rda8 rda7 rda6 rda5 rda4 rda3 rda2 rda1 rda0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1058 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module dmrbct6 ? ? ? ? ? ? rbc25 rbc24 dmac rbc23 rbc22 rbc21 rbc20 rbc19 rbc18 rbc17 rbc16 rbc15 rbc14 rbc13 rbc12 rbc11 rbc10 rbc9 rbc8 rbc7 rbc6 rbc5 rbc4 rbc3 rbc2 rbc1 rbc0 dmrsadr7 rsa31 rsa30 rsa29 rsa28 rsa27 rsa26 rsa25 rsa24 rsa23 rsa22 rsa21 rsa20 rsa19 rsa18 rsa17 rsa16 rsa15 rsa14 rsa13 rsa12 rsa11 rsa10 rsa9 rsa8 rsa7 rsa6 rsa5 rsa4 rsa3 rsa2 rsa1 rsa0 dmrdadr7 rda31 rda30 rda29 rda28 rda27 rda26 rda25 rda24 rda23 rda22 rda21 rda20 rda19 rda18 rda17 rda16 rda15 rda14 rda13 rda12 rda11 rda10 rda9 rda8 rda7 rda6 rda5 rda4 rda3 rda2 rda1 rda0 dmrbct7 ? ? ? ? ? ? rbc25 rbc24 rbc23 rbc22 rbc21 rbc20 rbc19 rbc18 rbc17 rbc16 rbc15 rbc14 rbc13 rbc12 rbc11 rbc10 rbc9 rbc8 rbc7 rbc6 rbc5 rbc4 rbc3 rbc2 rbc1 rbc0 dmcnta0 ? ? mdsel1 mdsel0 ? ? dsel1 dsel0 ? ? ? ? ? ? strg1 strg0 ? ? ? ? ? brlod srlod drlod ? ? dctg5 dctg4 dctg3 dctg2 dctg1 dctg0 dmcntb0 ? ? ? ? ? ? ? den ? ? ? ? ? ? ? dreq ? ? ? ? ? ? ? eclr ? ? ? ? ? ? ? dsclr dmcnta1 ? ? mdsel1 mdsel0 ? ? dsel1 dsel0 ? ? ? ? ? ? strg1 strg0 ? ? ? ? ? brlod srlod drlod ? ? dctg5 dctg4 dctg3 dctg2 dctg1 dctg0 dmcntb1 ? ? ? ? ? ? ? den ? ? ? ? ? ? ? dreq ? ? ? ? ? ? ? eclr ? ? ? ? ? ? ? dsclr dmcnta2 ? ? mdsel1 mdsel0 ? ? dsel1 dsel0 ? ? ? ? ? ? strg1 strg0 ? ? ? ? ? brlod srlod drlod ? ? dctg5 dctg4 dctg3 dctg2 dctg1 dctg0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1059 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module dmcntb2 ? ? ? ? ? ? ? den dmac ? ? ? ? ? ? ? dreq ? ? ? ? ? ? ? eclr ? ? ? ? ? ? ? dsclr dmcnta3 ? ? mdsel1 mdsel0 ? ? dsel1 dsel0 ? ? ? ? ? ? strg1 strg0 ? ? ? ? ? brlod srlod drlod ? ? dctg5 dctg4 dctg3 dctg2 dctg1 dctg0 dmcntb3 ? ? ? ? ? ? ? den ? ? ? ? ? ? ? dreq ? ? ? ? ? ? ? eclr ? ? ? ? ? ? ? dsclr dmcnta4 ? ? mdsel1 mdsel0 ? ? dsel1 dsel0 ? ? ? ? ? ? strg1 strg0 ? ? ? ? ? brlod srlod drlod ? ? dctg5 dctg4 dctg3 dctg2 dctg1 dctg0 dmcntb4 ? ? ? ? ? ? ? den ? ? ? ? ? ? ? dreq ? ? ? ? ? ? ? eclr ? ? ? ? ? ? ? dsclr dmcnta5 ? ? mdsel1 mdsel0 ? ? dsel1 dsel0 ? ? ? ? ? ? strg1 strg0 ? ? ? ? ? brlod srlod drlod ? ? dctg5 dctg4 dctg3 dctg2 dctg1 dctg0 dmcntb5 ? ? ? ? ? ? ? den ? ? ? ? ? ? ? dreq ? ? ? ? ? ? ? eclr ? ? ? ? ? ? ? dsclr dmcnta6 ? ? mdsel1 mdsel0 ? ? dsel1 dsel0 ? ? ? ? ? ? strg1 strg0 ? ? ? ? ? brlod srlod drlod ? ? dctg5 dctg4 dctg3 dctg2 dctg1 dctg0 dmcntb6 ? ? ? ? ? ? ? den ? ? ? ? ? ? ? dreq ? ? ? ? ? ? ? eclr ? ? ? ? ? ? ? dsclr
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1060 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module dmcnta7 ? ? mdsel1 mdsel0 ? ? dsel1 dsel0 dmac ? ? ? ? ? ? strg1 strg0 ? ? ? ? ? brlod srlod drlod ? ? dctg5 dctg4 dctg3 dctg2 dctg1 dctg0 dmcntb7 ? ? ? ? ? ? ? den ? ? ? ? ? ? ? dreq ? ? ? ? ? ? ? eclr ? ? ? ? ? ? ? dsclr dmscnt ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmst ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmicnt dintm_ch0 dintm_ch1 dintm_ch2 dintm_ch3 dintm_ch4 dintm_ch5 dintm_ch6 dintm_ch7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmicnta dinta_ch0 dinta_ch1 dinta_ch2 dinta_ch3 dinta_ch4 dinta_ch5 dinta_ch6 dinta_ch7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmists dists_ch0 dists_ch1 dists_ch2 dists_ch3 dists_ch4 dists_ch5 dists_ch6 dists_ch7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmedet dedet_ch0 dedet_ch1 dedet_ch2 dedet_ch3 dedet_ch4 dedet_ch5 dedet_ch6 dedet_ch7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? dmasts dasts_ch0 dasts_ch1 dasts_ch2 dasts_ch3 dasts_ch4 dasts_ch5 dasts_ch6 dasts_ch7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bar_0 ba0_31 ba0_30 ba0_29 ba0_28 ba0_27 ba0_26 ba0_25 ba0_24 ubc ba0_23 ba0_22 ba0_21 ba0_20 ba0_19 ba0_18 ba0_17 ba0_16 ba0_15 ba0_14 ba0_13 ba0_12 ba0_11 ba0_10 ba0_9 ba0_8 ba0_7 ba0_6 ba0_5 ba0_4 ba0_3 ba0_2 ba0_1 ba0_0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1061 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module bamr_0 bam0_31 bam0_30 bam0_29 bam0_28 bam0_27 bam0_26 bam0_25 bam0_24 ubc bam0_23 bam0_22 bam0_21 bam0_20 bam0_19 bam0_18 bam0_17 bam0_16 bam0_15 bam0_14 bam0_13 bam0_12 bam0_11 bam0_10 bam0_9 bam0_8 bam0_7 bam0_6 bam0_5 bam0_4 bam0_3 bam0_2 bam0_1 bam0_0 bdr_0 bd0_31 bd0_30 bd0_29 bd0_28 bd0_27 bd0_26 bd0_25 bd0_24 bd0_23 bd0_22 bd0_21 bd0_20 bd0_19 bd0_18 bd0_17 bd0_16 bd0_15 bd0_14 bd0_13 bd0_12 bd0_11 bd0_10 bd0_9 bd0_8 bd0_7 bd0_6 bd0_5 bd0_4 bd0_3 bd0_2 bd0_1 bd0_0 bdmr_0 bdm0_31 bdm0_30 bdm0_29 bdm0_28 bdm0_27 bdm0_26 bdm0_25 bdm0_24 bdm0_23 bdm0_22 bdm0_21 bdm0_20 bdm0_19 bdm0_18 bdm0_17 bdm0_16 bdm0_15 bdm0_14 bdm0_13 bdm0_12 bdm0_11 bdm0_10 bdm0_9 bdm0_8 bdm0_7 bdm0_6 bdm0_5 bdm0_4 bdm0_3 bdm0_2 bdm0_1 bdm0_0 bar_1 ba0_31 ba0_30 ba0_29 ba0_28 ba0_27 ba0_26 ba0_25 ba0_24 ba0_23 ba0_22 ba0_21 ba0_20 ba0_19 ba0_18 ba0_17 ba0_16 ba0_15 ba0_14 ba0_13 ba0_12 ba0_11 ba0_10 ba0_9 ba0_8 ba0_7 ba0_6 ba0_5 ba0_4 ba0_3 ba0_2 ba0_1 ba0_0 bamr_1 bam0_31 bam0_30 bam0_29 bam0_28 bam0_27 bam0_26 bam0_25 bam0_24 bam0_23 bam0_22 bam0_21 bam0_20 bam0_19 bam0_18 bam0_17 bam0_16 bam0_15 bam0_14 bam0_13 bam0_12 bam0_11 bam0_10 bam0_9 bam0_8 bam0_7 bam0_6 bam0_5 bam0_4 bam0_3 bam0_2 bam0_1 bam0_0 bdr_1 bd0_31 bd0_30 bd0_29 bd0_28 bd0_27 bd0_26 bd0_25 bd0_24 bd0_23 bd0_22 bd0_21 bd0_20 bd0_19 bd0_18 bd0_17 bd0_16 bd0_15 bd0_14 bd0_13 bd0_12 bd0_11 bd0_10 bd0_9 bd0_8 bd0_7 bd0_6 bd0_5 bd0_4 bd0_3 bd0_2 bd0_1 bd0_0 bdmr_1 bdm0_31 bdm0_30 bdm0_29 bdm0_28 bdm0_27 bdm0_26 bdm0_25 bdm0_24 bdm0_23 bdm0_22 bdm0_21 bdm0_20 bdm0_19 bdm0_18 bdm0_17 bdm0_16 bdm0_15 bdm0_14 bdm0_13 bdm0_12 bdm0_11 bdm0_10 bdm0_9 bdm0_8 bdm0_7 bdm0_6 bdm0_5 bdm0_4 bdm0_3 bdm0_2 bdm0_1 bdm0_0 bbr_0 ? ? ubid0 dbe0 ? ? cp0_1 cp0_0 cd0_1 cd0_0 id0_1 id0_0 rw0_1 rw0_0 sz0_1 sz0_0 bbr_1 ? ? ubid1 dbe1 ? ? cp1_1 cp1_0 cd1_1 cd1_0 id1_1 id1_0 rw1_1 rw1_0 sz1_1 sz1_0 brcr ? ? ? ? ? ? ? ? ? ? ? ? ? ? cks1 cks2 scmfc0 scmfc1 scmfd0 scmfd1 ? ? ? bdi ? pcb1 pcb0 ? ? ? ? ?
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1062 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module ccr1 ? ? ? ? ? ? ? ? cache ? ? ? ? ? ? ? ? ? ? ? ? icf ? ? ice ? ? ? ? ocf ? wt oce ccr2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? le ? ? ? ? ? ? w3load w3lock ? ? ? ? ? ? w2load w2lock acswr ? ? ? ? ? ? ? ? bsc ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? acosw3 acosw2 acosw1 acosw0 sdir ti7 ti6 ti5 ti4 ti3 ti2 ti1 ti0 h-udi ? ? ? ? ? ? ? ? icr0 nmil ? ? ? ? ? ? nmie intc ? ? ? ? ? ? ? ? icr1 irq71s irq70s irq61s irq60s irq51s irq50s irq41s irq40s irq31s irq30s irq21s irq20s irq11s irq10s irq01s irq00s icr2 ? ? ? ? ? ? ? ? pint7s pint6s pint5s pint4s pint3s pint2s pint1s pint0s irqrr ? ? ? ? ? ? ? ? irq7f irq6f irq5f irq4f irq3f irq2f irq1f irq0f pinter ? ? ? ? ? ? ? ? pint7e pint6e pint5e pint4e pint3e pint2e pint1e pint0e pirr ? ? ? ? ? ? ? ? pint7r pint6r pint5r pint4r pint3r pint2r pint1r pint0r ibcr e15 e14 e13 e12 e11 e10 e9 e8 e7 e6 e5 e4 e3 e2 e1 ? ibnr be1 be0 bove ? ? ? ? ? ? ? ? ? bn3 bn2 bn1 bn0 ipr01 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr02 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr05 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1063 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module ipr06 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 intc ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr07 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr08 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr09 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr10 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr11 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr12 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr13 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr14 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr15 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 ipr16 ip33 ip32 ip31 ip30 ip23 ip22 ip21 ip20 ip13 ip12 ip11 ip10 ip03 ip02 ip01 ip00 wtcsr iovf wtit tme ? ? cks2 cks1 cks0 wdt ? ? ? ? ? ? ? ? wtcnt tcnt7 tcnt6 tcnt5 tcnt4 tcnt3 tcnt2 tcnt1 tcnt0 ? ? ? ? ? ? ? ? wrcsr wovf rste rsts ? ? ? ? ? ? ? ? ? ? ? ? ? frqcr ? ? ? ckoen ? stc2 stc1 stc0 cpg ? ifc2 ifc1 ifc0 rngs pfc2 pfc1 pfc0 stbcr stby deep ? ? ? ? mstp1 ? system stbcr2 mstp10 mstp9 mstp8 mstp7 mstp6 mstp5 mstp4 mstp3 syscr1 ? ? ? ? ? ? rame1 rame0 syscr2 ? ? ? ? ? ? ramwe1 ramwe0 stbcr3 ? ? mstp35 ? mstp33 mstp32 mstp31 ? stbcr4 mstp47 mstp46 mstp45 mstp44 mstp43 mstp42 mstp41 mstp40 stbcr5 mstp57 mstp56 mstp55 ? mstp53 mstp52 ? ckdv3
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1064 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module r64cnt ? 1hz 2hz 4hz 8hz 16hz 32hz 64hz rtc rseccnt ? 10 seconds 1second rmincnt ? 10 minutes 1 minute rhrcnt ? ? 10 hours 1 hour rwkcnt ? ? ? ? ? day rdaycnt ? ? 10 days 1 day rmoncnt ? ? ? 10 months 1 month ryrcnt 1000 years 100 years 10 years 1 year rsecar enb 10 seconds 1 second rminar enb 10 minutes 1 minute rhrar enb ? 10 hours 1 hour rwkar enb ? ? ? ? day rdayar enb ? 10 days 1 day rmonar enb ? ? 10 months 1 month rcr1 cf ? ? cie aie ? ? af rcr2 pef pes2 pes1 pes0 rtcen adj reset start ryrar 1000 years 100 years 10 years 1 year rcr3 enb ? ? ? ? ? ? ? padrh pa31dr pa30dr pa29dr pa28dr pa27dr pa26dr pa25dr pa24dr i/o ports pa23dr pa22dr pa21dr pa20dr pa19dr pa18dr pa17dr pa16dr padrl pa15dr pa14dr pa13dr pa12dr pa11dr pa10dr pa9dr pa8dr pa7dr pa6dr pa5dr pa4dr pa3dr pa2dr pa1dr pa0dr paprh pa31pr pa30pr pa29pr pa28pr pa27pr pa26pr pa25pr pa24pr pa23pr pa22pr pa21pr pa20pr pa19pr pa18pr pa17pr pa16pr paprl pa15pr pa14pr pa13pr pa12pr pa11pr pa10pr pa9pr pa8pr pa7pr pa6pr pa5pr pa4pr pa3pr pa2pr pa1pr pa0pr pbdrh pb31dr pb30dr pb29dr pb28dr pb27dr pb26dr pb25dr pb24dr pb23dr pb22dr pb21dr pb20dr pb19dr pb18dr pb17dr pb16dr pbdrl pb15dr pb14dr pb13dr pb12dr pb11dr pb10dr pb9dr pb8dr pb7dr pb6dr pb5dr pb4dr pb3dr pb2dr pb1dr pb0dr pbprh pb31pr pb30pr pb29pr pb28pr pb27pr pb26pr pb25pr pb24pr pb23pr pb22pr pb21pr pb20pr pb19pr pb18pr pb17pr pb16pr pbprl pb15pr pb14pr pb13pr pb12pr pb11pr pb10pr pb9pr pb8pr pb7pr pb6pr pb5pr pb4pr pb3pr pb2pr pb1pr pb0pr
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1065 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module pcdrh ? ? ? ? ? ? ? ? i/o ports ? ? pc21dr pc20dr pc19dr pc18dr pc17dr pc16dr pcdrl pc15dr pc14dr pc13dr pc12dr pc11dr pc10dr pc9dr pc8dr pc7dr pc6dr pc5dr pc4dr pc3dr pc2dr pc1dr pc0dr pcprh ? ? ? ? ? ? pc25pr pc24pr pc23pr pc22pr pc21pr pc20pr pc19pr pc18pr pc17pr pc16pr pcprl pc15pr pc14pr pc13pr pc12pr pc11pr pc10pr pc9pr pc8pr pc7pr pc6pr pc5pr pc4pr pc3pr pc2pr pc1pr pc0pr pddr ? pd14dr pd13dr pd12dr pd11dr pd10dr pd9dr pd8dr pd7dr pd6dr pd5dr pd4dr pd3dr pd2dr pd1dr pd0dr pdprh ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pd16pr pdprl pd15pr pd14pr pd13pr pd12pr pd11pr pd10pr pd9pr pd8pr pd7pr pd6pr pd5pr pd4pr pd3pr pd2pr pd1pr pd0pr pepr ? ? ? ? ? ? ? ? pe7pr pe6pr pe5pr pe4pr pe3pr pe2pr pe1pr pe0pr pfdr ? ? ? ? ? ? ? ? pf7dr pf6dr pf5dr pf4dr pf3dr pf2dr pf1dr pf0dr pfpr ? ? ? ? ? ? ? ? pf7pr pf6pr pf5pr pf4pr pf3pr pf2pr pf1pr pf0pr paiorh pa31ior pa30ior pa29ior pa28ior pa27ior pa26ior pa25ior pa24ior pfc pa23ior pa22ior pa21ior pa20ior pa19ior pa18ior pa17ior pa16ior paiorl pa15ior pa14ior pa13ior pa12ior pa11ior pa10ior pa9ior pa8ior pa7ior pa6ior pa5ior pa4ior pa3ior pa2ior pa1ior pa0ior pacr8 ? ? pa31md1 pa31md0 ? ? pa30md1 pa30md0 ? ? pa29md1 pa29md0 ? ? pa28md1 pa28md0 pacr7 ? pa27md2 pa27md1 pa27md0 ? pa26md2 pa26md1 pa26md0 ? pa25md2 pa25md1 pa25md0 ? ? pa24md1 pa24md0 pacr6 ? ? ? pa23md0 ? ? ? pa22md0 ? ? ? pa21md0 ? ? ? pa20md0 pacr5 ? ? ? pa19md0 ? ? ? pa18md0 ? ? ? pa17md0 ? ? ? pa16md0 pacr4 ? ? ? pa15md0 ? ? ? pa14md0 ? ? ? pa13md0 ? ? ? pa12md0 pacr3 ? ? ? pa11md0 ? ? ? pa10md0 ? ? ? pa9md0 ? ? ? pa8md0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1066 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module pacr2 ? ? ? pa7md0 ? ? ? pa6md0 pfc ? ? ? pa5md0 ? ? ? pa4md0 pacr1 ? ? ? pa3md0 ? ? ? pa2md0 ? ? ? pa1md0 ? ? ? pa0md0 pbiorh pb31ior pb30ior pb29ior pb28ior pb27ior pb26ior pb25ior pb24ior pb23ior pb22ior pb21ior pb20ior pb19ior pb18ior pb17ior pb16ior pbiorl pb15ior pb14ior pb13ior pb12ior pb11ior pb10ior pb9ior pb8ior pb7ior pb6ior pb5ior pb4ior pb3ior pb2ior pb1ior pb0ior pbcr8 ? ? pb31md1 pb31md0 ? pb30md2 pb30md1 pb30md0 ? pb29md2 pb29md1 pb29md0 ? pb28md2 pb28md1 pb28md0 pbcr7 ? ? pb27md1 pb27md0 ? pb26md2 pb26md1 pb26md0 ? pb25md2 pb25md1 pb25md0 ? pb24md2 pb24md1 pb24md0 pbcr6 ? ? pb23md1 pb23md0 ? pb22md2 pb22md1 pb22md0 ? pb21md2 pb21md1 pb21md0 ? pb20md2 pb20md1 pb20md0 pbcr5 ? ? pb19md1 pb19md0 ? ? pb18md1 pb18md0 ? ? pb17md1 pb17md0 ? ? pb16md1 pb16md0 pbcr4 ? ? ? pb15md0 ? ? ? pb14md0 ? ? ? pb13md0 ? ? ? pb12md0 pbcr3 ? ? ? pb11md0 ? ? ? pb10md0 ? ? ? pb9md0 ? ? ? pb8md0 pbcr2 ? ? ? pb7md0 ? ? ? pb6md0 ? ? ? pb5md0 ? ? ? pb4md0 pbcr1 ? ? ? pb3md0 ? ? ? pb2md0 ? ? ? pb1md0 ? ? ? pb0md0 pciorh ? ? ? ? ? ? ? ? ? ? pc21ior pc20ior pc19ior pc18ior pc17ior pc16ior pciorl pc15ior pc14ior pc13ior pc12ior pc11ior pc10ior pc9ior pc8ior pc7ior pc6ior pc5ior pc4ior pc3ior pc2ior pc1ior pc0ior pccr7 ? ? ? ? ? ? ? ? ? ? pc25md1 pc25md0 ? ? pc24md1 pc24md0 pccr6 ? ? pc23md1 pc23md0 ? ? pc22md1 pc22md0 ? ? pc21md1 pc21md0 ? ? pc20md1 pc20md0 pccr5 ? ? ? pc19md0 ? ? ? pc18md0 ? ? ? pc17md0 ? ? ? pc16md0 pccr4 ? ? ? pc15md0 ? ? ? pc14md0 ? ? ? pc13md0 ? ? pc12md1 pc12md0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1067 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module pccr3 ? ? pc11md1 pc11md0 ? ? ? pc10md0 pfc ? ? ? pc9md0 ? ? ? pc8md0 pccr2 ? ? ? pc7md0 ? ? pc6md1 pc6md0 ? ? pc5md1 pc5md0 ? ? pc4md1 pc4md0 pccr1 ? ? pc3md1 pc3md0 ? ? pc2md1 pc2md0 ? ? ? pc1md0 ? ? ? pc0md0 pdior ? pd14ior pd13ior pd12ior pd11ior pd10ior pd9ior pd8ior pd7ior pd6ior pd5ior pd4ior pd3ior pd2ior pd1ior pd0ior pdcr5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? pd16md1 pd16md0 pdcr4 ? ? pd15md1 pd15md0 ? ? pd14md1 pd14md0 ? ? pd13md1 pd13md0 ? ? pd12md1 pd12md0 pdcr3 ? ? pd11md1 pd11md0 ? ? pd10md1 pd10md0 ? ? pd9md1 pd9md0 ? ? pd8md1 pd8md0 pdcr2 ? ? pd7md1 pd7md0 ? ? pd6md1 pd6md0 ? ? pd5md1 pd5md0 ? ? pd4md1 pd4md0 pdcr1 ? ? ? pd3md0 ? ? ? pd2md0 ? ? ? pd1md0 ? ? ? pd0md0 pecr2 ? ? ? pe7md0 ? ? ? pe6md0 ? ? ? pe5md0 ? ? ? pe4md0 pecr1 ? ? ? pe3md0 ? ? ? pe2md0 ? ? ? pe1md0 ? ? ? pe0md0 pfior ? ? ? ? ? ? ? ? pf7ior pf6ior pf5ior pf4ior pf3ior pf2ior pf1ior pf0ior pfcr2 ? ? ? pf7md0 ? ? pf6md1 pf6md0 ? ? pf5md1 pf5md0 ? ? pf4md1 pf4md0 pfcr1 ? ? ? pf3md0 ? ? pf2md1 pf2md0 ? ? pf1md1 pf1md0 ? ? pf0md1 pf0md0 tcr_3 cclr2 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 mtu2 tcr_4 cclr2 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tmdr_3 ? bfe bfb bfa md3 md2 md1 md0 tmdr_4 ? bfe bfb bfa md3 md2 md1 md0 tiorh_3 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tiorl_3 iod3 iod2 iod1 iod0 ioc3 ioc2 ioc1 ioc0 tiorh_4 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tiorl_4 iod3 iod2 iod1 iod0 ioc3 ioc2 ioc1 ioc0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1068 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module tier_3 ttge ? ? tciev tgied tgiec tgieb tgiea mtu2 tier_4 ttge ttge2 ? tciev tgied tgiec tgieb tgiea toer ? ? oe4d oe4c oe3d oe4b oe4a oe3b tgcr ? bdc n p fb wf vf uf tocr1 ? psye ? ? tocl tocs olsn plsp tocr2 bf1 bf0 ols3n ols3p ols2n ols2p ols1n ols1p tcnt_3 tcnt_4 tcdr tddr tgra_3 tgrb_3 tgra_4 tgrb_4 tcnts tcbr tgrc_3 tgrd_3 tgrc_4 tgrd_4 tsr_3 tcfd ? ? tcfv tgfd tgfc tgfb tgfa tsr_4 tcfd ? ? tcfv tgfd tgfc tgfb tgfa
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1069 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module titcr t3aen 3acor2 3acor1 3acor0 t4ven 4vcor2 4vcor1 4vcor0 mtu2 titcnt ? 3acnt2 3acnt1 3acnt0 ? 4vcnt2 4vcnt1 4vcnt0 tbtcr ? ? ? ? ? ? bte1 bte0 tder ? ? ? ? ? ? ? tder tolbr ? ? ols3n ols3p ols2n ols2p ols1n ols1p tbtm_3 ? ? ? ? ? ? ttsb ttsa tbtm_4 ? ? ? ? ? ? ttsb ttsa tadcr bf1 bf0 ? ? ? ? ? ? ut4ae dt4ae ut4be dt4be ita3ae ita4ve itb3ae itb4ve tadcora_4 tadcorb_4 tadcobra_4 tadcobrb_4 twcr cce ? ? ? ? ? ? wre tstr cst4 cst3 ? ? ? cst2 cst1 cst0 tsyr sync4 sync3 ? ? ? sync2 sync1 sync0 tcsystr sch0 sch1 sch2 sch3 sch4 ? sch3s sch4s trwer ? ? ? ? ? ? ? rwe tcr_0 cclr2 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tmdr_0 ? bfe bfb bfa md3 md2 md1 md0 tiorh_0 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tiorl_0 iod3 iod2 iod1 iod0 ioc3 ioc2 ioc1 ioc0 tier_0 ttge ? ? tciev tgied tgiec tgieb tgiea tsr_0 tcfd ? ? tcfv tgfd tgfc tgfb tgfa tcnt_0 tgra_0 tgrb_0 tgrc_0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1070 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module tgrd_0 mtu2 tgre_0 tgrf_0 tier2_0 ttge2 ? ? ? ? ? tgief tgiee tsr2_0 ? ? ? ? ? ? tgff tgfe tbtm ? ? ? ? ? ttse ttsb ttsa tcr_1 cclr2 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tmdr_1 ? bfe bfb bfa md3 md2 md1 md0 tior_1 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tier_1 ttge ? tcieu tciev ? ? tgieb tgiea tsr_1 tcfd ? tcfu tcfv tgfd tgfc tgfb tgfa tcnt_1 tgra_1 tgrb_1 ticcr ? ? ? ? i2be i2ae i1be i1ae tcr_2 cclr2 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 tmdr_2 ? bfe bfb bfa md3 md2 md1 md0 tior_2 iob3 iob2 iob1 iob0 ioa3 ioa2 ioa1 ioa0 tier_2 ttge ? tcieu tciev ? ? tgieb tgiea tsr_2 tcfd ? tcfu tcfv tgfd tgfc tgfb tgfa tcnt_2 tgra_2 tgrb_2 tcntu_5 tgru_5
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1071 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module tcru_5 ? ? ? ? ? ? tpsc1 tpsc0 mtu2 tioru_5 ? ? ? ioc4 ioc3 ioc2 ioc1 ioc0 tcntv_5 tgrv_5 tcrv_5 ? ? ? ? ? ? tpsc1 tpsc0 tiorv_5 ? ? ? ioc4 ioc3 ioc2 ioc1 ioc0 tcntw_5 tgrw_5 tcrw_5 ? ? ? ? ? ? tpsc1 tpsc0 tiorw_5 ? ? ? ioc4 ioc3 ioc2 ioc1 ioc0 tsr_5 ? ? ? ? ? cmfu5 cmfv5 cmfw5 tier_5 ? ? ? ? ? tgie5u tgie5v tgie5w tstr_5 ? ? ? ? ? cstu5 cstv5 cstw5 tcntcmpclr ? ? ? ? ? cmpclr5u cmpclr5v cmpclr5w t8tcr_0 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 tmr t8tcr_1 cmieb cmiea ovie cclr1 cclr0 cks2 cks1 cks0 t8tcsr_0 cmfb cmfa ovf adte os3 os2 os1 os0 t8tcsr_1 cmfb cmfa ovf adte os3 os2 os1 os0 t8tcora_0 t8tcora_1 t8tcorb_0 t8tcorb_1 t8tcnt_0 t8tcnt_1 t8tccr_0 ? ? ? ? tmris ? icks1 icks0 t8tccr_1 ? ? ? ? tmris ? icks1 icks0 addra adc ? ? ? ? ? addrb ? ? ? ? ? addrc ? ? ? ? ?
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1072 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module addrd adc ? ? ? ? ? addre ? ? ? ? ? addrf ? ? ? ? ? addrg ? ? ? ? ? addrh ? ? ? ? ? adcsr adf adie adst ? trgs1 trgs0 ? ? cks1 cks0 mds2 mds1 mds0 ch2 ch1 ch0 dadr0 dac dadr1 dacr daoe1 daoe0 dae ? ? ? ? ? scsmr_0 ? ? ? ? ? ? ? ? scif c/ a chr pe o/ e stop ? cks1 cks0 scbrr_0 scscr_0 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_0 scfsr_0 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_0 scfcr_0 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_0 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0 scsptr_0 ? ? ? ? ? ? ? ? rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer scsmr_1 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_1 scscr_1 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1073 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module scftdr_1 scif scfsr_1 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_1 scfcr_1 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_1 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0 scsptr_1 ? ? ? ? ? ? ? ? rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer scsmr_2 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_2 scscr_2 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_2 scfsr_2 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_2 scfcr_2 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_2 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0 scsptr_2 ? ? ? ? ? ? ? ? rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer scsmr_3 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_3 scscr_3 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_3 scfsr_3 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1074 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module scfrdr_3 scif scfcr_3 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_3 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0 scsptr_3 ? ? ? ? ? ? ? ? rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer scsmr_4 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_4 scscr_4 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_4 scfsr_4 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_4 scfcr_4 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_4 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0 scsptr_4 ? ? ? ? ? ? ? ? rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer scsmr_5 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_5 scscr_5 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_5 scfsr_5 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_5 scfcr_5 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1075 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module scfdr_5 ? ? ? t4 t3 t2 t1 t0 scif ? ? ? r4 r3 r2 r1 r0 scsptr_5 ? ? ? ? ? ? ? ? rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt rtsdt sclsr_5 orer scsmr_6 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_6 scscr_6 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_6 scfsr_6 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_6 scfcr_6 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_6 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0 scsptr_6 ? ? ? ? ? ? ? ? rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer scsmr_7 ? ? ? ? ? ? ? ? c/ a chr pe o/ e stop ? cks1 cks0 scbrr_7 scscr_7 ? ? ? ? ? ? ? ? tie rie te re reie ? cke1 cke0 scftdr_7 scfsr_7 per3 per2 per1 per0 fer3 fer2 fer1 fer0 er tend tdfe brk fer per rdf dr scfrdr_7 scfcr_7 ? ? ? ? ? rstrg2 rstrg1 rstrg0 rtrg1 rtrg0 ttrg1 ttrg0 mce tfrst rfrst loop scfdr_7 ? ? ? t4 t3 t2 t1 t0 ? ? ? r4 r3 r2 r1 r0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1076 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module scsptr_7 ? ? ? ? ? ? ? ? scif rtsio rtsdt ctsio ctsdt sckio sckdt spb2io spb2dt sclsr_7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? orer ssicr_0 ? ? ? dmen uien oien iien dien ssi chnl1 chnl0 dwl2 dwl1 dwl0 swl2 swl1 swl0 sckd swsd sckp swsp spdp sdta pdta del ? ckdv2 ckdv1 ckdv0 muen ? trmd en ssisr_0 ? ? ? dmrq uirq oien iirq dirq ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? chno1 chno0 swno idst ssitdr_0 ssirdr_0 ssicr_1 ? ? ? dmen uien oien iien dien chnl1 chnl0 dwl2 dwl1 dwl0 swl2 swl1 swl0 sckd swsd sckp swsp spdp sdta pdta del ? ckdv2 ckdv1 ckdv0 muen ? trmd en ssisr_1 ? ? ? dmrq uirq oien iirq dirq ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? chno1 chno0 swno idst ssitdr_1 ssirdr_1
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1077 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module iccr1_0 ice rcvd mst trs cks3 cks2 cks1 cks0 iic3 iccr2_0 bbsy scp sdao sdaop scl ? iicrst ? icmr_0 mls wait ? ? bcwp bs2 bc1 bc0 icier_0 tie teie rie nakie stie acke ackbr ackbt icsr_0 tdre tend rdrf nackf stop al_ove aas adz sar_0 sva6 sva5 sva4 sva3 sva2 sva1 sva0 fs icdrt_0 icdrr_0 nf2cyc_0 ? ? ? ? ? ? ? nf2cyc iccr1_1 ice rcvd mst trs cks3 cks2 cks1 cks0 iccr2_1 bbsy scp sdao sdaop scl ? iicrst ? icmr_1 mls wait ? ? bcwp bs2 bc1 bc0 icier_1 tie teie rie nakie stie acke ackbr ackbt icsr_1 tdre tend rdrf nackf stop al_ove aas adz sar_1 sva6 sva5 sva4 sva3 sva2 sva1 sva0 fs icdrt_1 icdrr_1 nf2cyc_1 ? ? ? ? ? ? ? nf2cyc iccr1_2 ice rcvd mst trs cks3 cks2 cks1 cks0 iccr2_2 bbsy scp sdao sdaop scl ? iicrst ? icmr_2 mls wait ? ? bcwp bs2 bc1 bc0 icier_2 tie teie rie nakie stie acke ackbr ackbt icsr_2 tdre tend rdrf nackf stop al_ove aas adz sar_2 sva6 sva5 sva4 sva3 sva2 sva1 sva0 fs icdrt_2 icdrr_2 nf2cyc_2 ? ? ? ? ? ? ? nf2cyc mcr_0 mcr15 mcr14 ? ? ? tst2 tst1 tst0 rcan-et mcr7 mcr6 mcr5 ? ? mcr2 mcr1 mcr0 gsr_0 ? ? ? ? ? ? ? ? ? ? gsr5 gsr4 gsr3 gsr2 gsr1 gsr0 bcr1_0 tgs1_3 tgs1_2 tgs1_1 tgs1_0 ? tgs2_2 tgs2_1 tgs2_0 ? ? sjw1 sjw0 ? ? ? bsp bcr0_0 ? ? ? ? ? ? ? ? brp7 brp6 brp5 brp4 brp3 brp2 brp1 brp0 irr_0 ? ? irr13 irr12 ? ? irr9 irr8 irr7 irr6 irr5 irr4 irr3 irr2 irr1 irr0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1078 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module imr_0 imr15 imr14 imr13 imr12 imr11 imr10 imr9 imr8 rcan-et imr7 imr6 imr5 imr4 imr3 imr2 imr1 imr0 tec_0/rec_0 tec7 tec6 tec5 tec4 tec3 tec2 tec1 tec0 rec7 rec6 rec5 rec4 rec3 rec2 rec1 rec0 txpr1_0 txpr1_15 txpr1_14 txpr1_13 txpr1_12 txpr1_11 txpr1_10 txpr1_9 txpr1_8 txpr1_7 txpr1_6 txpr1_5 txpr1_4 txpr1_3 txpr1_2 txpr1_1 txpr1_0 txpr0_0 txpr0_15 txpr0_14 txpr0_13 txpr0_12 txpr0_11 txpr0_10 txpr0_9 txpr0_8 txpr0_7 txpr0_6 txpr0_5 txpr0_4 txpr0_3 txpr0_2 txpr0_1 ? txcr0_0 txcr0_15 txcr0_14 txcr0_13 txcr0_12 txcr0_11 txcr0_10 txcr0_9 txcr0_8 txcr0_7 txcr0_6 txcr0_5 txcr0_4 txcr0_3 txcr0_2 txcr0_1 ? txack0_0 txack0_15 txack0_14 txack0_13 txack0_12 txack0_11 txack0_10 txack0_9 txack0_8 txack0_7 txack0_6 txack0_5 txack0_4 txack0_3 txack0_2 txack0_1 ? aback0_0 aback0_15 aback0_14 aback0_13 aback0_12 aback0_11 aback0_10 aback0_9 aback0_8 aback0_7 aback0_6 aback0_5 aback0_4 aback0_3 aback0_2 aback0_1 ? rxpr0_0 rxpr0_15 rxpr0_14 rxpr0_13 rxpr0_12 rxpr0_11 rxpr0_10 rxpr0_9 rxpr0_8 rxpr0_7 rxpr0_6 rxpr0_5 rxpr0_4 rxpr0_3 rxpr0_2 rxpr0_1 rxpr0_0 rfpr0_0 rfpr0_15 rfpr0_14 rfpr0_13 rfpr0_12 rfpr0_11 rfpr0_10 rfpr0_9 rfpr0_8 rfpr0_7 rfpr0_6 rfpr0_5 rfpr0_4 rfpr0_3 rfpr0_2 rfpr0_1 rfpr0_0 mbimr0_0 mbimr0_15 mbimr0_14 mbimr0_13 mbimr0_12 mbimr0_11 mbimr0_10 mbimr0_9 mbimr0_8 mbimr0_7 mbimr0_6 mbimr0_5 mbimr0_4 mbimr0_3 mbimr0_2 mbimr0_1 mbimr0_0 umsr0_0 umsr0_15 umsr0_14 umsr0_13 umsr0_12 umsr0_11 umsr0_10 umsr0_9 umsr0_8 umsr0_7 umsr0_6 umsr0_5 umsr0_4 umsr0_3 umsr0_2 umsr0_1 umsr0_0 ide rtr ? stdid10 stdid9 stdid8 stdid7 stdid6 mb[0]. control0h (mcr15 = 1) stdid5 stdid4 stdid3 stdid2 stdid1 stdid0 extid17 extid16 ? stdid10 stdid9 stdid8 stdid7 stdid6 stdid5 stdid4 mb[0]. control0h (mcr15 = 0) stdid3 stdid2 stdid1 stdid0 rtr ide extid17 extid16 extid15 extid14 extid13 extid12 extid11 extid10 extid9 extid8 mb[0]. control0l extid7 extid6 extid5 extid4 extid3 extid2 extid1 extid:0 ide_lafm ? ? stdid_ lafm10 stdid_ lafm9 stdid_ lafm8 stdid_ lafm7 stdid_ lafm6 mb[0]. lafmh (mcr15 = 1) stdid_ lafm5 stdid_ lafm4 stdid_ lafm3 stdid_ lafm2 stdid_ lafm1 stdid_ lafm0 extid_ lafm17 extid_ lafm16 ? stdid_ lafm10 stdid_ lafm9 stdid_ lafm8 stdid_ lafm7 stdid_ lafm6 stdid_ lafm5 stdid_ lafm4 mb[0]. lafmh (mcr15 = 0) stdid_ lafm3 stdid_ lafm2 stdid_ lafm1 stdid_ lafm0 ? ide_ lafm extid_ lafm17 extid_ lafm16
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1079 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module extid_ lafm15 extid_ lafm14 extid_ lafm13 extid_ lafm12 extid_ lafm11 extid_ lafm10 extid_ lafm9 extid_ lafm8 rcan-et mb[0]. lafml extid_ lafm7 extid_ lafm6 extid_ lafm5 extid_ lafm4 extid_ lafm3 extid_ lafm2 extid_ lafm1 extid_ lafm0 mb[0]. msg_data[0] msg_data_0 mb[0]. msg_data[1] msg_data_1 mb[0]. msg_data[2] msg_data_2 mb[0]. msg_data[3] msg_data_3 mb[0]. msg_data[4] msg_data_4 mb[0]. msg_data[5] msg_data_5 mb[0]. msg_data[6] msg_data_6 mb[0]. msg_data[7] msg_data_7 mb[0]. control1h ? ? nmc ? ? mbc2 mbc1 mbc0 mb[0]. control1l ? ? ? ? dlc3 dlc2 dlc1 dlc0 ide rtr ? stdid10 stdid9 stdid8 stdid7 stdid6 mb[1 to 15] control0h (mcr15 = 1) stdid5 stdid4 stdid3 stdid2 stdid1 stdid0 extid17 extid16 ? stdid10 stdid9 stdid8 stdid7 stdid6 stdid5 stdid4 mb[1 to 15]. control0h (mcr15 = 0) stdid3 stdid2 stdid1 stdid0 rtr ide extid17 extid16 extid15 extid14 extid13 extid12 extid11 extid10 extid9 extid8 mb[1 to 15]. control0l extid7 extid6 extid5 extid4 extid3 extid2 extid1 extid:0 ide_lafm ? ? stdid_ lafm10 stdid_ lafm9 stdid_ lafm8 stdid_ lafm7 stdid_ lafm6 mb[1 to 15]. lafmh (mcr15 = 1) stdid_ lafm5 stdid_ lafm4 stdid_ lafm3 stdid_ lafm2 stdid_ lafm1 stdid_ lafm0 extid_ lafm17 extid_ lafm16 ? stdid_ lafm10 stdid_ lafm9 stdid_ lafm8 stdid_ lafm7 stdid_ lafm6 stdid_ lafm5 stdid_ lafm4 mb[1 to 15]. lafmh (mcr15 = 0) stdid_ lafm3 stdid_ lafm2 stdid_ lafm1 stdid_ lafm0 ? ide_ lafm extid_ lafm17 extid_ lafm16
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1080 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module extid_ lafm15 extid_ lafm14 extid_ lafm13 extid_ lafm12 extid_ lafm11 extid_ lafm10 extid_ lafm9 extid_ lafm8 rcan-et mb[1 to 15]. lafml extid_ lafm7 extid_ lafm6 extid_ lafm5 extid_ lafm4 extid_ lafm3 extid_ lafm2 extid_ lafm1 extid_ lafm0 mb[1 to 15]. msg_data[0] msg_data_0 mb[1 to 15]. msg_data[1] msg_data_1 mb[1 to 15]. msg_data[2] msg_data_2 mb[1 to 15]. msg_data[3] msg_data_3 mb[1 to 15]. msg_data[4] msg_data_4 mb[1 to 15]. msg_data[5] msg_data_5 mb[1 to 15]. msg_data[6] msg_data_6 mb[1 to 15]. msg_data[7] msg_data_7 mb[1 to 15]. control1h ? ? nmc atx dart mbc2 mbc1 mbc0 mb[1 to 15]. control1l ? ? ? ? dlc3 dlc2 dlc1 dlc0 mcr_1 mcr15 mcr14 ? ? ? tst2 tst1 tst0 mcr7 mcr6 mcr5 ? ? mcr2 mcr1 mcr0 gsr_1 ? ? ? ? ? ? ? ? ? ? gsr5 gsr4 gsr3 gsr2 gsr1 gsr0 bcr1_1 tgs1_3 tgs1_2 tgs1_1 tgs1_0 ? tgs2_2 tgs2_1 tgs2_0 ? ? sjw1 sjw0 ? ? ? bsp bcr0_1 ? ? ? ? ? ? ? ? brp7 brp6 brp5 brp4 brp3 brp2 brp1 brp0 irr_1 ? ? irr13 irr12 ? ? irr9 irr8 irr7 irr6 irr5 irr4 irr3 irr2 irr1 irr0 imr_1 imr15 imr14 imr13 imr12 imr11 imr10 imr9 imr8 imr7 imr6 imr5 imr4 imr3 imr2 imr1 imr0 tec_1/rec_1 tec7 tec6 tec5 te c4 tec3 tec2 tec1 tec0 rec7 rec6 rec5 rec4 rec3 rec2 rec1 rec0 txpr1_1 txpr1_15 txpr1_14 txpr1_13 txpr1_12 txpr1_11 txpr1_10 txpr1_9 txpr1_8 txpr1_7 txpr1_6 txpr1_5 txpr1_4 txpr1_3 txpr1_2 txpr1_1 txpr1_0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1081 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module txpr0_1 txpr0_15 txpr0_14 txpr0_13 txpr0_12 txpr0_11 txpr0_10 txpr0_9 txpr0_8 rcan-et txpr0_7 txpr0_6 txpr0_5 txpr0_4 txpr0_3 txpr0_2 txpr0_1 ? txcr0_1 txcr0_15 txcr0_14 txcr0_13 txcr0_12 txcr0_11 txcr0_10 txcr0_9 txcr0_8 txcr0_7 txcr0_6 txcr0_5 txcr0_4 txcr0_3 txcr0_2 txcr0_1 ? txack0_1 txack0_15 txack0_14 txack0_13 txack0_12 txack0_11 txack0_10 txack0_9 txack0_8 txack0_7 txack0_6 txack0_5 txack0_4 txack0_3 txack0_2 txack0_1 ? aback0_1 aback0_15 aback0_14 aback0_13 aback0_12 aback0_11 aback0_10 aback0_9 aback0_8 aback0_7 aback0_6 aback0_5 aback0_4 aback0_3 aback0_2 aback0_1 ? rxpr0_1 rxpr0_15 rxpr0_14 rxpr0_13 rxpr0_12 rxpr0_11 rxpr0_10 rxpr0_9 rxpr0_8 rxpr0_7 rxpr0_6 rxpr0_5 rxpr0_4 rxpr0_3 rxpr0_2 rxpr0_1 rxpr0_0 rfpr0_1 rfpr0_15 rfpr0_14 rfpr0_13 rfpr0_12 rfpr0_11 rfpr0_10 rfpr0_9 rfpr0_8 rfpr0_7 rfpr0_6 rfpr0_5 rfpr0_4 rfpr0_3 rfpr0_2 rfpr0_1 rfpr0_0 mbimr0_1 mbimr0_15 mbimr0_14 mbimr0_13 mbimr0_12 mbimr0_11 mbimr0_10 mbimr0_9 mbimr0_8 mbimr0_7 mbimr0_6 mbimr0_5 mbimr0_4 mbimr0_3 mbimr0_2 mbimr0_1 mbimr0_0 umsr0_1 umsr0_15 umsr0_14 umsr0_13 umsr0_12 umsr0_11 umsr0_10 umsr0_9 umsr0_8 umsr0_7 umsr0_6 umsr0_5 umsr0_4 umsr0_3 umsr0_2 umsr0_1 umsr0_0 ide rtr ? stdid10 stdid9 stdid8 stdid7 stdid6 mb[0]. control0h (mcr15 = 1) stdid5 stdid4 stdid3 stdid2 stdid1 stdid0 extid17 extid16 ? stdid10 stdid9 stdid8 stdid7 stdid6 stdid5 stdid4 mb[0]. control0h (mcr15 = 0) stdid3 stdid2 stdid1 stdid0 rtr ide extid17 extid16 extid15 extid14 extid13 extid12 extid11 extid10 extid9 extid8 mb[0]. control0l extid7 extid6 extid5 extid4 extid3 extid2 extid1 extid:0 ide_lafm ? ? stdid_ lafm10 stdid_ lafm9 stdid_ lafm8 stdid_ lafm7 stdid_ lafm6 mb[0]. lafmh (mcr15 = 1) stdid_ lafm5 stdid_ lafm4 stdid_ lafm3 stdid_ lafm2 stdid_ lafm1 stdid_ lafm0 extid_ lafm17 extid_ lafm16 ? stdid_ lafm10 stdid_ lafm9 stdid_ lafm8 stdid_ lafm7 stdid_ lafm6 stdid_ lafm5 stdid_ lafm4 mb[0]. lafmh (mcr15 = 0) stdid_ lafm3 stdid_ lafm2 stdid_ lafm1 stdid_ lafm0 ? ide_ lafm extid_ lafm17 extid_ lafm16 extid_ lafm15 extid_ lafm14 extid_ lafm13 extid_ lafm12 extid_ lafm11 extid_ lafm10 extid_ lafm9 extid_ lafm8 mb[0]. lafml extid_ lafm7 extid_ lafm6 extid_ lafm5 extid_ lafm4 extid_ lafm3 extid_ lafm2 extid_ lafm1 extid_ lafm0 mb[0]. msg_data[0] msg_data_0 mb[0]. msg_data[1] msg_data_1
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1082 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module mb[0]. msg_data[2] msg_data_2 rcan-et mb[0]. msg_data[3] msg_data_3 mb[0]. msg_data[4] msg_data_4 mb[0]. msg_data[5] msg_data_5 mb[0]. msg_data[6] msg_data_6 mb[0]. msg_data[7] msg_data_7 mb[0]. control1h ? ? nmc ? ? mbc2 mbc1 mbc0 mb[0]. control1l ? ? ? ? dlc3 dlc2 dlc1 dlc0 ide rtr ? stdid10 stdid9 stdid8 stdid7 stdid6 mb[1 to 15]. control0h (mcr15 = 1) stdid5 stdid4 stdid3 stdid2 stdid1 stdid0 extid17 extid16 ? stdid10 stdid9 stdid8 stdid7 stdid6 stdid5 stdid4 mb[1 to 15]. control0h (mcr15 = 0) stdid3 stdid2 stdid1 stdid0 rtr ide extid17 extid16 extid15 extid14 extid13 extid12 extid11 extid10 extid9 extid8 mb[1 to 15]. control0l extid7 extid6 extid5 extid4 extid3 extid2 extid1 extid:0 ide_lafm ? ? stdid_ lafm10 stdid_ lafm9 stdid_ lafm8 stdid_ lafm7 stdid_ lafm6 mb[1 to 15]. lafmh (mcr15 = 1) stdid_ lafm5 stdid_ lafm4 stdid_ lafm3 stdid_ lafm2 stdid_ lafm1 stdid_ lafm0 extid_ lafm17 extid_ lafm16 ? stdid_ lafm10 stdid_ lafm9 stdid_ lafm8 stdid_ lafm7 stdid_ lafm6 stdid_ lafm5 stdid_ lafm4 mb[1 to 15]. lafmh (mcr15 = 0) stdid_ lafm3 stdid_ lafm2 stdid_ lafm1 stdid_ lafm0 ? ide_ lafm extid_ lafm17 extid_ lafm16 extid_ lafm15 extid_ lafm14 extid_ lafm13 extid_ lafm12 extid_ lafm11 extid_ lafm10 extid_ lafm9 extid_ lafm8 mb[1 to 15]. lafml extid_ lafm7 extid_ lafm6 extid_ lafm5 extid_ lafm4 extid_ lafm3 extid_ lafm2 extid_ lafm1 extid_ lafm0 mb[1 to 15]. msg_data[0] msg_data_0 mb[1 to 15]. msg_data[1] msg_data_1 mb[1 to 15]. msg_data[2] msg_data_2
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1083 of 1164 rej09b0321-0200 register abbreviation bits 31/ 23/15/7 bits30/ 22/14/6 bits 29/ 21/13/5 bits28/ 20/12/4 bits 27/ 19/11/3 bits26/ 18/10/2 bits 25/ 17/9/1 bits24/ 16/8/0 module mb[1 to 15]. msg_data[3] msg_data_3 rcan-et mb[1 to 15]. msg_data[4] msg_data_4 mb[1 to 15]. msg_data[5] msg_data_5 mb[1 to 15]. msg_data[6] msg_data_6 mb[1 to 15]. msg_data[7] msg_data_7 mb[1 to 15]. control1h ? ? nmc atx dart mbc2 mbc1 mbc0 mb[1 to 15]. control1l ? ? ? ? dlc3 dlc2 dlc1 dlc0 dreqer0 ? ? iic2tx iic2rx iic1tx iic 1rx iic0tx iic0rx intc dreqer1 scif3tx scif3rx scif2tx scif2rx scif1tx scif1rx scif0tx scif0rx dreqer2 scif7tx scif7rx scif6tx scif6rx scif5tx scif5rx scif4tx scif4rx dreqer3 adc mtu4 mtu3 mtu2 mtu1 mtu0 rcan1 rcan0 dsfr iokeep ? ? ? ? ? mresf nmif system irq7f irq6f irq5f irq4f irq3f irq2f irq1f irq0f dscnt ? ? ? ? ? cks2 cks1 cks0 ramkp ? ? ? ? ramkp3 ramkp2 ramkp1 ramkp0
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1084 of 1164 rej09b0321-0200 28.3 register states in each operating mode register abbreviation power-on reset manual reset software standby deep standby module standby sleep module sycbeen initialized retained retained initialized * 1 ? retained bus monitor sycbests1 initialized retained retained initialized * 1 ? retained sycbests2 initialized retained retained initialized * 1 ? retained sycbesw initialized retained retained initialized * 1 ? retained cs0cnt initialized retained retained initialized * 1 ? retained bsc cs0rec initialized retained retained initialized * 1 ? retained cs1cnt initialized retained retained initialized * 1 ? retained cs1rec initialized retained retained initialized * 1 ? retained cs2cnt initialized retained retained initialized * 1 ? retained cs2rec initialized retained retained initialized * 1 ? retained cs3cnt initialized retained retained initialized * 1 ? retained cs3rec initialized retained retained initialized * 1 ? retained cs4cnt initialized retained retained initialized * 1 ? retained cs4rec initialized retained retained initialized * 1 ? retained cs5cnt initialized retained retained initialized * 1 ? retained cs5rec initialized retained retained initialized * 1 ? retained cs6cnt initialized retained retained initialized * 1 ? retained cs6rec initialized retained retained initialized * 1 ? retained sdc0cnt initialized retained retained initialized * 1 ? retained sdc1cnt initialized retained retained initialized * 1 ? retained csmod0 initialized retained retained initialized * 1 ? retained cs1wcnt0 initialized retained retained initialized * 1 ? retained cs2wcnt0 initialized retained retained initialized * 1 ? retained csmod1 initialized retained retained initialized * 1 ? retained cs1wcnt1 initialized retained retained initialized * 1 ? retained cs2wcnt1 initialized retained retained initialized * 1 ? retained csmod2 initialized retained retained initialized * 1 ? retained cs1wcnt2 initialized retained retained initialized * 1 ? retained cs2wcnt2 initialized retained retained initialized * 1 ? retained csmod3 initialized retained retained initialized * 1 ? retained cs1wcnt3 initialized retained retained initialized * 1 ? retained cs2wcnt3 initialized retained retained initialized * 1 ? retained csmod4 initialized retained retained initialized * 1 ? retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1085 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module cs1wcnt4 initialized retained retained initialized * 1 ? retained bsc cs2wcnt4 initialized retained retained initialized * 1 ? retained csmod5 initialized retained retained initialized * 1 ? retained cs1wcnt5 initialized retained retained initialized * 1 ? retained cs2wcnt5 initialized retained retained initialized * 1 ? retained csmod6 initialized retained retained initialized * 1 ? retained cs1wcnt6 initialized retained retained initialized * 1 ? retained cs2wcnt6 initialized retained retained initialized * 1 ? retained sdrfcnt0 initialized retained retained initialized * 1 ? retained sdrfcnt1 initialized retained retained initialized * 1 ? retained sdir0 initialized retained retained initialized * 1 ? retained sdir1 initialized retained retained initialized * 1 ? retained sdpwdcnt initialized retained retained initialized * 1 ? retained sddpwdcnt initialized retained retained initialized * 1 ? retained sd0adr initialized retained retained initialized * 1 ? retained sd0tr initialized retained retained initialized * 1 ? retained sd0mod initialized retained retained initialized * 1 ? retained sd1adr initialized retained retained initialized * 1 ? retained sd1tr initialized retained retained initialized * 1 ? retained sd1mod initialized retained retained initialized * 1 ? retained sdstr initialized retained retained initialized * 1 ? retained sdckscnt initialized retained retained initialized * 1 ? retained dmcsadr0 initialized retained retained initialized * 1 retained retained dmac dmcdadr0 initialized retained retained initialized * 1 retained retained dmcbct0 initialized retained retained initialized * 1 retained retained dmmod0 initialized retained retained initialized * 1 retained retained dmcsadr1 initialized retained retained initialized * 1 retained retained dmcdadr1 initialized retained retained initialized * 1 retained retained dmcbct1 initialized retained retained initialized * 1 retained retained dmmod1 initialized retained retained initialized * 1 retained retained dmcsadr2 initialized retained retained initialized * 1 retained retained dmcdadr2 initialized retained retained initialized * 1 retained retained dmcbct2 initialized retained retained initialized * 1 retained retained dmmod2 initialized retained retained initialized * 1 retained retained dmcsadr3 initialized retained retained initialized * 1 retained retained dmcdadr3 initialized retained retained initialized * 1 retained retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1086 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module dmcbct3 initialized retained retained initialized * 1 retained retained dmac dmmod3 initialized retained retained initialized * 1 retained retained dmcsadr4 initialized retained retained initialized * 1 retained retained dmcdadr4 initialized retained retained initialized * 1 retained retained dmcbct4 initialized retained retained initialized * 1 retained retained dmmod4 initialized retained retained initialized * 1 retained retained dmcsadr5 initialized retained retained initialized * 1 retained retained dmcdadr5 initialized retained retained initialized * 1 retained retained dmcbct5 initialized retained retained initialized * 1 retained retained dmmod5 initialized retained retained initialized * 1 retained retained dmcsadr6 initialized retained retained initialized * 1 retained retained dmcdadr6 initialized retained retained initialized * 1 retained retained dmcbct6 initialized retained retained initialized * 1 retained retained dmmod6 initialized retained retained initialized * 1 retained retained dmcsadr7 initialized retained retained initialized * 1 retained retained dmcdadr7 initialized retained retained initialized * 1 retained retained dmcbct7 initialized retained retained initialized * 1 retained retained dmmod7 initialized retained retained initialized * 1 retained retained dmrsadr0 initialized retained retained initialized * 1 retained retained dmrdadr0 initialized retained retained initialized * 1 retained retained dmrbct0 initialized retained retained initialized * 1 retained retained dmrsadr1 initialized retained retained initialized * 1 retained retained dmrdadr1 initialized retained retained initialized * 1 retained retained dmrbct1 initialized retained retained initialized * 1 retained retained dmrsadr2 initialized retained retained initialized * 1 retained retained dmrdadr2 initialized retained retained initialized * 1 retained retained dmrbct2 initialized retained retained initialized * 1 retained retained dmrsadr3 initialized retained retained initialized * 1 retained retained dmrdadr3 initialized retained retained initialized * 1 retained retained dmrbct3 initialized retained retained initialized * 1 retained retained dmrsadr4 initialized retained retained initialized * 1 retained retained dmrdadr4 initialized retained retained initialized * 1 retained retained dmrbct4 initialized retained retained initialized * 1 retained retained dmrsadr5 initialized retained retained initialized * 1 retained retained dmrdadr5 initialized retained retained initialized * 1 retained retained dmrbct5 initialized retained retained initialized * 1 retained retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1087 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module dmrsadr6 initialized retained retained initialized * 1 retained retained dmac dmrdadr6 initialized retained retained initialized * 1 retained retained dmrbct6 initialized retained retained initialized * 1 retained retained dmrsadr7 initialized retained retained initialized * 1 retained retained dmrdadr7 initialized retained retained initialized * 1 retained retained dmrbct7 initialized retained retained initialized * 1 retained retained dmcnta0 initialized retained retained initialized * 1 retained retained dmcntb0 initialized retained retained initialized * 1 retained retained dmcnta1 initialized retained retained initialized * 1 retained retained dmcntb1 initialized retained retained initialized * 1 retained retained dmcnta2 initialized retained retained initialized * 1 retained retained dmcntb2 initialized retained retained initialized * 1 retained retained dmcnta3 initialized retained retained initialized * 1 retained retained dmcntb3 initialized retained retained initialized * 1 retained retained dmcnta4 initialized retained retained initialized * 1 retained retained dmcntb4 initialized retained retained initialized * 1 retained retained dmcnta5 initialized retained retained initialized * 1 retained retained dmcntb5 initialized retained retained initialized * 1 retained retained dmcnta6 initialized retained retained initialized * 1 retained retained dmcntb6 initialized retained retained initialized * 1 retained retained dmcnta7 initialized retained retained initialized * 1 retained retained dmcntb7 initialized retained retained initialized * 1 retained retained dmscnt initialized retained retained initialized * 1 retained retained dmicnt initialized retained retained initialized * 1 retained retained dmicnta initialized retained retained initialized * 1 retained retained dmists initialized retained retained initialized * 1 retained retained dmedet initialized retained retained initialized * 1 retained retained dmasts initialized retained retained initialized * 1 retained retained bar0 initialized retained retained initialized * 1 retained retained ubc bamr0 initialized retained retained initialized * 1 retained retained bdr0 initialized retained retained initialized * 1 retained retained bdmr0 initialized retained retained initialized * 1 retained retained bar1 initialized retained retained initialized * 1 retained retained bamr1 initialized retained retained initialized * 1 retained retained bdr1 initialized retained retained initialized * 1 retained retained bdmr1 initialized retained retained initialized * 1 retained retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1088 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module bbr0 initialized retained retained initialized * 1 retained retained ubc bbr1 initialized retained retained initialized * 1 retained retained brcr initialized retained retained initialized * 1 retained retained ccr1 initialized retained retained initialized * 1 retained retained cache ccr2 initialized retained retained initialized * 1 retained retained acswr initialized retained retained initialized * 1 ? retained bsc sdir * 2 initialized retained retained initialized * 1 ? retained h-udi icr0 initialized retained retained initialized * 1 ? retained intc icr1 initialized retained retained initialized * 1 ? retained icr2 initialized retained retained initialized * 1 ? retained irqrr initialized retained retained initialized * 1 ? retained pinter initialized retained retained initialized * 1 ? retained pirr initialized retained retained initialized * 1 ? retained ibcr initialized retained retained initialized * 1 ? retained ibnr initialized retained * 3 retained initialized * 1 ? retained ipr01 initialized retained retained initialized * 1 ? retained ipr02 initialized retained retained initialized * 1 ? retained ipr05 initialized retained retained initialized * 1 ? retained ipr06 initialized retained retained initialized * 1 ? retained ipr07 initialized retained retained initialized * 1 ? retained ipr08 initialized retained retained initialized * 1 ? retained ipr09 initialized retained retained initialized * 1 ? retained ipr10 initialized retained retained initialized * 1 ? retained ipr11 initialized retained retained initialized * 1 ? retained ipr12 initialized retained retained initialized * 1 ? retained ipr13 initialized retained retained initialized * 1 ? retained ipr14 initialized retained retained initialized * 1 ? retained ipr15 initialized retained retained initialized * 1 ? retained ipr16 initialized retained retained initialized * 1 ? retained wtcsr initialized retained initialized initialized * 1 ? retained wdt wtcnt initialized retained initialized initialized * 1 ? retained wrcsr initialized * 4 retained initialized initialized * 1 ? retained frqcr initialized * 4 retained retained initialized * 1 ? retained cpg stbcr initialized retained retained initialized * 1 ? retained system stbcr2 initialized retained retained initialized * 1 ? retained syscr1 initialized retained retained initialized * 1 ? retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1089 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module syscr2 initialized retained retained initialized * 1 ? retained system stbcr3 initialized retained retained initialized * 1 ? retained stbcr4 initialized retained retained initialized * 1 ? retained stbcr5 initialized retained retained initialized * 1 ? retained r64cnt retained * 5 retained * 5 retained * 5 retained * 5 retained retained * 5 rtc rseccnt retained * 5 retained * 5 retained * 5 retained * 5 retained retained * 5 rmincnt retained * 5 retained * 5 retained * 5 retained * 5 retained retained * 5 rhrcnt retained * 5 retained * 5 retained * 5 retained * 5 retained retained * 5 rwkcnt retained * 5 retained * 5 retained * 5 retained * 5 retained retained * 5 rdaycnt retained * 5 retained * 5 retained * 5 retained * 5 retained retained * 5 rmoncnt retained * 5 retained * 5 retained * 5 retained * 5 retained retained * 5 ryrcnt retained * 5 retained * 5 retained * 5 retained * 5 retained retained * 5 rsecar retained retained retained retained retained retained rminar retained retained retained retained retained retained rhrar retained retained retained retained retained retained rwkar retained retained retained retained retained retained rdayar retained retained retained retained retained retained rmonar retained retained retained retained retained retained rcr1 initialized initialized retained retained retained retained rcr2 initialized initialized * 6 retained retained retained retained ryrar retained retained retained retained retained retained rcr3 initialized retained retained retained retained retained padrh initialized retained retained initialized * 1 ? retained i/o ports padrl initialized retained retained initialized * 1 ? retained paprh undefined retained retained initialized * 1 ? retained paprl undefined retained retained initialized * 1 ? retained pbdrh initialized retained retained initialized * 1 ? retained pbdrl initialized retained retained initialized * 1 ? retained pbprh undefined retained retained initialized * 1 ? retained pbprl undefined retained retained initialized * 1 ? retained pcdrh initialized retained retained initialized * 1 ? retained pcdrl initialized retained retained initialized * 1 ? retained pcprh undefined retained retained initialized * 1 ? retained pcprl undefined retained retained initialized * 1 ? retained pddrh initialized retained retained initialized * 1 ? retained pddrl initialized retained retained initialized * 1 ? retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1090 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module pdprh undefined retained retained initialized * 1 ? retained i/o ports pdprl undefined retained retained initialized * 1 ? retained peprl undefined retained retained initialized * 1 ? retained pfdr undefined retained retained initialized * 1 ? retained pfpr undefined retained retained initialized * 1 ? retained paiorh initialized retained retained initialized * 1 ? retained pfc paiorl initialized retained retained initialized * 1 ? retained pacr8 initialized retained retained initialized * 1 ? retained pacr7 initialized retained retained initialized * 1 ? retained pacr6 initialized retained retained initialized * 1 ? retained pacr5 initialized retained retained initialized * 1 ? retained pacr4 initialized retained retained initialized * 1 ? retained pacr3 initialized retained retained initialized * 1 ? retained pacr2 initialized retained retained initialized * 1 ? retained pacr1 initialized retained retained initialized * 1 ? retained pbiorh initialized retained retained initialized * 1 ? retained pbiorl initialized retained retained initialized * 1 ? retained pbcr8 initialized retained retained initialized * 1 ? retained pbcr7 initialized retained retained initialized * 1 ? retained pbcr6 initialized retained retained initialized * 1 ? retained pbcr5 initialized retained retained initialized * 1 ? retained pbcr4 initialized retained retained initialized * 1 ? retained pbcr3 initialized retained retained initialized * 1 ? retained pbcr2 initialized retained retained initialized * 1 ? retained pbcr1 initialized retained retained initialized * 1 ? retained pciorh initialized retained retained initialized * 1 ? retained pciorl initialized retained retained initialized * 1 ? retained pccr7 initialized retained retained initialized * 1 ? retained pccr6 initialized retained retained initialized * 1 ? retained pccr5 initialized retained retained initialized * 1 ? retained pccr4 initialized retained retained initialized * 1 ? retained pccr3 initialized retained retained initialized * 1 ? retained pccr2 initialized retained retained initialized * 1 ? retained pccr1 initialized retained retained initialized * 1 ? retained pdiorh initialized retained retained initialized * 1 ? retained pdiorl initialized retained retained initialized * 1 ? retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1091 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module pdcr5 initialized retained retained initialized * 1 ? retained pfc pdcr4 initialized retained retained initialized * 1 ? retained pdcr3 initialized retained retained initialized * 1 ? retained pdcr2 initialized retained retained initialized * 1 ? retained pdcr1 initialized retained retained initialized * 1 ? retained pecr2 initialized retained retained initialized * 1 ? retained pecr1 initialized retained retained initialized * 1 ? retained pfior initialized retained retained initialized * 1 ? retained pfcr2 initialized retained retained initialized * 1 ? retained pfcr1 initialized retained retained initialized * 1 ? retained tcr_3 initialized retained initialized initialized * 1 initialized retained mtu2 tcr_4 initialized retained initialized initialized * 1 initialized retained tmdr_3 initialized retained initialized initialized * 1 initialized retained tmdr_4 initialized retained initialized initialized * 1 initialized retained tiorh_3 initialized retained initialized initialized * 1 initialized retained tiorl_3 initialized retained initialized initialized * 1 initialized retained tiorh_4 initialized retained initialized initialized * 1 initialized retained tiorl_4 initialized retained initialized initialized * 1 initialized retained tier_3 initialized retained initialized initialized * 1 initialized retained tier_4 initialized retained initialized initialized * 1 initialized retained toer initialized retained initialized initialized * 1 initialized retained tgcr initialized retained initialized initialized * 1 initialized retained tocr1 initialized retained initialized initialized * 1 initialized retained tocr2 initialized retained initialized initialized * 1 initialized retained tcnt_3 initialized retained initialized initialized * 1 initialized retained tcnt_4 initialized retained initialized initialized * 1 initialized retained tcdr initialized retained initialized initialized * 1 initialized retained tddr initialized retained initialized initialized * 1 initialized retained tgra_3 initialized retained initialized initialized * 1 initialized retained tgrb_3 initialized retained initialized initialized * 1 initialized retained tgra_4 initialized retained initialized initialized * 1 initialized retained tgrb_4 initialized retained initialized initialized * 1 initialized retained tcnts initialized retained initialized initialized * 1 initialized retained tcbr initialized retained initialized initialized * 1 initialized retained tgrc_3 initialized retained initialized initialized * 1 initialized retained tgrd_3 initialized retained initialized initialized * 1 initialized retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1092 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module tgrc_4 initialized retained initialized initialized * 1 initialized retained mtu2 tgrd_4 initialized retained initialized initialized * 1 initialized retained tsr_3 initialized retained initialized initialized * 1 initialized retained tsr_4 initialized retained initialized initialized * 1 initialized retained titcr initialized retained initialized initialized * 1 initialized retained titcnt initialized retained initialized initialized * 1 initialized retained tbtcr initialized retained initialized initialized * 1 initialized retained tder initialized retained initialized initialized * 1 initialized retained tolbr initialized retained initialized initialized * 1 initialized retained tbtm_3 initialized retained initialized initialized * 1 initialized retained tbtm_4 initialized retained initialized initialized * 1 initialized retained tadcr initialized retained initialized initialized * 1 initialized retained tadcora_4 initialized retained initialized initialized * 1 initialized retained tadcorb_4 initialized retained initialized initialized * 1 initialized retained tadcobra_4 initialized retained initialized initialized * 1 initialized retained tadcobrb_4 initialized retained initialized initialized * 1 initialized retained tsycr initialized retained initialized initialized * 1 initialized retained twcr initialized retained initialized initialized * 1 initialized retained tstr initialized retained initialized initialized * 1 initialized retained tsyr initialized retained initialized initialized * 1 initialized retained tcsystr initialized retained initialized initialized * 1 initialized retained trwer initialized retained initialized initialized * 1 initialized retained tcr_0 initialized retained initialized initialized * 1 initialized retained tmdr_0 initialized retained initialized initialized * 1 initialized retained tiorh_0 initialized retained initialized initialized * 1 initialized retained tiorl_0 initialized retained initialized initialized * 1 initialized retained tier_0 initialized retained initialized initialized * 1 initialized retained tsr_0 initialized retained initialized initialized * 1 initialized retained tcnt_0 initialized retained initialized initialized * 1 initialized retained tgra_0 initialized retained initialized initialized * 1 initialized retained tgrb_0 initialized retained initialized initialized * 1 initialized retained tgrc_0 initialized retained initialized initialized * 1 initialized retained tgrd_0 initialized retained initialized initialized * 1 initialized retained tgre_0 initialized retained initialized initialized * 1 initialized retained tgrf_0 initialized retained initialized initialized * 1 initialized retained tier2_0 initialized retained initialized initialized * 1 initialized retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1093 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module tsr2_0 initialized retained initialized initialized * 1 initialized retained mtu2 tbtm initialized retained initialized initialized * 1 initialized retained tcr_1 initialized retained initialized initialized * 1 initialized retained tmdr_1 initialized retained initialized initialized * 1 initialized retained tior_1 initialized retained initialized initialized * 1 initialized retained tier_1 initialized retained initialized initialized * 1 initialized retained tsr_1 initialized retained initialized initialized * 1 initialized retained tcnt_1 initialized retained initialized initialized * 1 initialized retained tgra_1 initialized retained initialized initialized * 1 initialized retained tgrb_1 initialized retained initialized initialized * 1 initialized retained ticcr initialized retained initialized initialized * 1 initialized retained tcr_2 initialized retained initialized initialized * 1 initialized retained tmdr_2 initialized retained initialized initialized * 1 initialized retained tior_2 initialized retained initialized initialized * 1 initialized retained tier_2 initialized retained initialized initialized * 1 initialized retained tsr_2 initialized retained initialized initialized * 1 initialized retained tcnt_2 initialized retained initialized initialized * 1 initialized retained tgra_2 initialized retained initialized initialized * 1 initialized retained tgrb_2 initialized retained initialized initialized * 1 initialized retained tcntu_5 initialized retained initialized initialized * 1 initialized retained tgru_5 initialized retained initialized initialized * 1 initialized retained tcru_5 initialized retained initialized initialized * 1 initialized retained tioru_5 initialized retained initialized initialized * 1 initialized retained tcntv_5 initialized retained initialized initialized * 1 initialized retained tgrv_5 initialized retained initialized initialized * 1 initialized retained tcrv_5 initialized retained initialized initialized * 1 initialized retained tiorv_5 initialized retained initialized initialized * 1 initialized retained tcntw_5 initialized retained initialized initialized * 1 initialized retained tgrw_5 initialized retained initialized initialized * 1 initialized retained tcrw_5 initialized retained initialized initialized * 1 initialized retained tiorw_5 initialized retained initialized initialized * 1 initialized retained tsr_5 initialized retained initialized initialized * 1 initialized retained tier_5 initialized retained initialized initialized * 1 initialized retained tstr_5 initialized retained initialized initialized * 1 initialized retained tcntcmpclr initialized retained initialized initialized * 1 initialized retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1094 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module t8tcr_0 initialized retained retained initialized * 1 retained retained tmr t8tcr_1 initialized retained retained initialized * 1 retained retained t8tcsr_0 initialized retained retained initialized * 1 retained retained t8tcsr_1 initialized retained retained initialized * 1 retained retained t8tcora_0 initialized retained retained initialized * 1 retained retained t8tcora_1 initialized retained retained initialized * 1 retained retained t8tcorb_0 initialized retained retained initialized * 1 retained retained t8tcorb_1 initialized retained retained initialized * 1 retained retained t8tcnt_0 initialized retained retained initialized * 1 retained retained t8tcnt_1 initialized retained retained initialized * 1 retained retained t8tccr_0 initialized retained retained initialized * 1 retained retained t8tccr_1 initialized retained retained initialized * 1 retained retained addra initialized retained initialized initialized * 1 initialized retained adc addrb initialized retained initialized initialized * 1 initialized retained addrc initialized retained initialized initialized * 1 initialized retained addrd initialized retained initialized initialized * 1 initialized retained addre initialized retained initialized initialized * 1 initialized retained addrf initialized retained initialized initialized * 1 initialized retained addrg initialized retained initialized initialized * 1 initialized retained addrh initialized retained initialized initialized * 1 initialized retained adcsr initialized retained initialized initialized * 1 initialized retained dadr0 initialized retained retained initialized * 1 initialized retained dac dadr1 initialized retained retained initialized * 1 initialized retained dacr initialized retained retained initialized * 1 initialized retained scsmr_0 initialized retained retained initialized * 1 retained retained scif scbrr_0 initialized retained retained initialized * 1 retained retained scscr_0 initialized retained retained initialized * 1 retained retained scftdr_0 undefined retained retained initialized * 1 retained retained scfsr_0 initialized retained retained initialized * 1 retained retained scfrdr_0 undefined retained retained initialized * 1 retained retained scfcr_0 initialized retained retained initialized * 1 retained retained scfdr_0 initialized retained retained initialized * 1 retained retained scsptr_0 initialized retained retained initialized * 1 retained retained sclsr_0 initialized retained retained initialized * 1 retained retained scsmr_1 initialized retained retained initialized * 1 retained retained scbrr_1 initialized retained retained initialized * 1 retained retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1095 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module scscr_1 initialized retained retained initialized * 1 retained retained scif scftdr_1 undefined retained retained initialized * 1 retained retained scfsr_1 initialized retained retained initialized * 1 retained retained scfrdr_1 undefined retained retained initialized * 1 retained retained scfcr_1 initialized retained retained initialized * 1 retained retained scfdr_1 initialized retained retained initialized * 1 retained retained scsptr_1 initialized retained retained initialized * 1 retained retained sclsr_1 initialized retained retained initialized * 1 retained retained scsmr_2 initialized retained retained initialized * 1 retained retained scbrr_2 initialized retained retained initialized * 1 retained retained scscr_2 initialized retained retained initialized * 1 retained retained scftdr_2 undefined retained retained initialized * 1 retained retained scfsr_2 initialized retained retained initialized * 1 retained retained scfrdr_2 undefined retained retained initialized * 1 retained retained scfcr_2 initialized retained retained initialized * 1 retained retained scfdr_2 initialized retained retained initialized * 1 retained retained scsptr_2 initialized retained retained initialized * 1 retained retained sclsr_2 initialized retained retained initialized * 1 retained retained scsmr_3 initialized retained retained initialized * 1 retained retained scbrr_3 initialized retained retained initialized * 1 retained retained scscr_3 initialized retained retained initialized * 1 retained retained scftdr_3 undefined retained retained initialized * 1 retained retained scfsr_3 initialized retained retained initialized * 1 retained retained scfrdr_3 undefined retained retained initialized * 1 retained retained scfcr_3 initialized retained retained initialized * 1 retained retained scfdr_3 initialized retained retained initialized * 1 retained retained scsptr_3 initialized retained retained initialized * 1 retained retained sclsr_3 initialized retained retained initialized * 1 retained retained scsmr_4 initialized retained retained initialized * 1 retained retained scbrr_4 initialized retained retained initialized * 1 retained retained scscr_4 initialized retained retained initialized * 1 retained retained scftdr_4 undefined retained retained initialized * 1 retained retained scfsr_4 initialized retained retained initialized * 1 retained retained scfrdr_4 undefined retained retained initialized * 1 retained retained scfcr_4 initialized retained retained initialized * 1 retained retained scfdr_4 initialized retained retained initialized * 1 retained retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1096 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module scsptr_4 initialized retained retained initialized * 1 retained retained scif sclsr_4 initialized retained retained initialized * 1 retained retained scsmr_5 initialized retained retained initialized * 1 retained retained scbrr_5 initialized retained retained initialized * 1 retained retained scscr_5 initialized retained retained initialized * 1 retained retained scftdr_5 undefined retained retained initialized * 1 retained retained scfsr_5 initialized retained retained initialized * 1 retained retained scfrdr_5 undefined retained retained initialized * 1 retained retained scfcr_5 initialized retained retained initialized * 1 retained retained scfdr_5 initialized retained retained initialized * 1 retained retained scsptr_5 initialized retained retained initialized * 1 retained retained sclsr_5 initialized retained retained initialized * 1 retained retained scsmr_6 initialized retained retained initialized * 1 retained retained scbrr_6 initialized retained retained initialized * 1 retained retained scscr_6 initialized retained retained initialized * 1 retained retained scftdr_6 undefined retained retained initialized * 1 retained retained scfsr_6 initialized retained retained initialized * 1 retained retained scfrdr_6 undefined retained retained initialized * 1 retained retained scfcr_6 initialized retained retained initialized * 1 retained retained scfdr_6 initialized retained retained initialized * 1 retained retained scsptr_6 initialized retained retained initialized * 1 retained retained sclsr_6 initialized retained retained initialized * 1 retained retained scsmr_7 initialized retained retained initialized * 1 retained retained scbrr_7 initialized retained retained initialized * 1 retained retained scscr_7 initialized retained retained initialized * 1 retained retained scftdr_7 undefined retained retained initialized * 1 retained retained scfsr_7 initialized retained retained initialized * 1 retained retained scfrdr_7 undefined retained retained initialized * 1 retained retained scfcr_7 initialized retained retained initialized * 1 retained retained scfdr_7 initialized retained retained initialized * 1 retained retained scsptr_7 initialized retained retained initialized * 1 retained retained sclsr_7 initialized retained retained initialized * 1 retained retained ssicr_0 initialized retained retained initialized * 1 retained retained ssi ssisr_0 initialized retained retained initialized * 1 retained retained ssitdr_0 initialized retained retained initialized * 1 retained retained ssirdr_0 initialized retained retained initialized * 1 retained retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1097 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module ssicr_1 initialized retained retained initialized * 1 retained retained ssi ssisr_1 initialized retained retained initialized * 1 retained retained ssitdr_1 initialized retained retained initialized * 1 retained retained ssirdr_1 initialized retained retained initialized * 1 retained retained iccr1_0 initialized retained retained initialized * 1 retained retained iic3 iccr2_0 initialized retained retained initialized * 1 retained retained icmr_0 initialized retained retained * 7 initialized * 1 retained * 7 retained icier_0 initialized retained retained initialized * 1 retained retained icsr_0 initialized retained retained initialized * 1 retained retained sar_0 initialized retained retained initialized * 1 retained retained icdrt_0 initialized retained retained initialized * 1 retained retained icdrr_0 initialized retained retained initialized * 1 retained retained nf2cyc_0 initialized retained retained initialized * 1 retained retained iccr1_1 initialized retained retained initialized * 1 retained retained iccr2_1 initialized retained retained initialized * 1 retained retained icmr_1 initialized retained retained * 7 initialized * 1 retained * 7 retained icier_1 initialized retained retained initialized * 1 retained retained icsr_1 initialized retained retained initialized * 1 retained retained sar_1 initialized retained retained initialized * 1 retained retained icdrt_1 initialized retained retained initialized * 1 retained retained icdrr_1 initialized retained retained initialized * 1 retained retained nf2cyc_1 initialized retained retained initialized * 1 retained retained iccr1_2 initialized retained retained initialized * 1 retained retained iccr2_2 initialized retained retained initialized * 1 retained retained icmr_2 initialized retained retained * 7 initialized * 1 retained * 7 retained icier_2 initialized retained retained initialized * 1 retained retained icsr_2 initialized retained retained initialized * 1 retained retained sar_2 initialized retained retained initialized * 1 retained retained icdrt_2 initialized retained retained initialized * 1 retained retained icdrr_2 initialized retained retained initialized * 1 retained retained nf2cyc_2 initialized retained retained initialized * 1 retained retained mcr_0 initialized retained initialized initialized * 1 retained retained rcan-et gsr_0 initialized retained initialized initialized * 1 retained retained bcr1_0 initialized retained initialized initialized * 1 retained retained bcr0_0 initialized retained initialized initialized * 1 retained retained irr_0 initialized retained initialized initialized * 1 retained retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1098 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module imr_0 initialized retained initialized initialized * 1 retained retained rcan-et tec_0/rec_0 initialized retained initialized initialized * 1 retained retained txpr1_0 initialized retained initialized initialized * 1 retained retained txpr0_0 initialized retained initialized initialized * 1 retained retained txcr0_0 initialized retained initialized initialized * 1 retained retained txack0_0 initialized retained initialized initialized * 1 retained retained aback0_0 initialized retained initialized initialized * 1 retained retained rxpr0_0 initialized retained initialized initialized * 1 retained retained rfpr0_0 initialized retained initialized initialized * 1 retained retained mbimr0_0 initialized retained initialized initialized * 1 retained retained umsr0_0 initialized retained initialized initialized * 1 retained retained mb[0 to 15]. control0h initialized retained initialized initialized * 1 retained retained mb[0 to 15]. control0l initialized retained initialized initialized * 1 retained retained mb[0 to 15]. lafmh initialized retained initialized initialized * 1 retained retained mb[0 to 15]. lafml initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[0] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[1] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[2] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[3] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[4] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[5] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[6] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[7] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. control1h initialized retained initialized initialized * 1 retained retained mb[0 to 15]. control1l initialized retained initialized initialized * 1 retained retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1099 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module mcr_1 initialized retained initialized initialized * 1 retained retained rcan-et gsr_1 initialized retained initialized initialized * 1 retained retained bcr1_1 initialized retained initialized initialized * 1 retained retained bcr0_1 initialized retained initialized initialized * 1 retained retained irr_1 initialized retained initialized initialized * 1 retained retained imr_1 initialized retained initialized initialized * 1 retained retained tec_1/rec_1 initialized retained initialized initialized * 1 retained retained txpr1_1 initialized retained initialized initialized * 1 retained retained txpr0_1 initialized retained initialized initialized * 1 retained retained txcr0_1 initialized retained initialized initialized * 1 retained retained txack0_1 initialized retained initialized initialized * 1 retained retained aback0_1 initialized retained initialized initialized * 1 retained retained rxpr0_1 initialized retained initialized initialized * 1 retained retained rfpr0_1 initialized retained initialized initialized * 1 retained retained mbimr0_1 initialized retained initialized initialized * 1 retained retained umsr0_1 initialized retained initialized initialized * 1 retained retained mb[0 to 15]. control0h initialized retained initialized initialized * 1 retained retained mb[0 to 15]. control0l initialized retained initialized initialized * 1 retained retained mb[0 to 15]. lafmh initialized retained initialized initialized * 1 retained retained mb[0 to 15]. lafml initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[0] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[1] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[2] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[3] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[4] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[5] initialized retained initialized initialized * 1 retained retained mb[0 to 15]. msg_data[6] initialized retained initialized initialized * 1 retained retained
section 28 list of registers rev. 2.00 sep. 07, 2007 page 1100 of 1164 rej09b0321-0200 register abbreviation power-on reset manual reset software standby deep standby module standby sleep module mb[0 to 15]. msg_data[7] initialized retained initialized initialized * 1 retained retained rcan-et mb[0 to 15]. control1h initialized retained initialized initialized * 1 retained retained mb[0 to 15]. control1l initialized retained initialized initialized * 1 retained retained dreqer0 initialized retained retained initialized * 1 ? retained intc dreqer1 initialized retained retained initialized * 1 ? retained dreqer2 initialized retained retained initialized * 1 ? retained dreqer3 initialized retained retained initialized * 1 ? retained dsfr initialized retained retained retained ? retained system dscnt initialized retained retained initialized * 1 ? retained ramkp initialized retained retained initialized * 1 ? retained notes: 1. not initialized in deep standby m ode. but initialized after deep standby mode is released because a power-on reset exception handling is executed. 2. initialized by udtrst assertion or in the test-logic-re set state of the tap controller. 3. bits bn[3:0] are initialized. 4. retains the previous value after an internal power-on reset by means of the wdt. 5. counting up continues. 6. bits rtcen and start are retained. 7. bits bc[3:0] are initialized.
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1101 of 1164 rej09b0321-0200 section 29 electrical characteristics 29.1 absolute maximum ratings table 29.1 lists the absolute maximum ratings. table 29.1 absolute maximum ratings item symbol value unit power supply voltage (i/o) pv cc power supply voltage (internal) v cc r power supply voltage (pll) pllv cc ? 0.3 to 4.6 v analog power supply voltage av cc ? 0.3 to 4.6 v analog reference voltage av ref ? 0.3 to av cc + 0.3 v input voltage analog input pin v an ? 0.3 to av cc + 0.3 v pc22 to pc25, pd15, pd16 v in ? 0.3 to 5.5 v other pins v in ? 0.3 to pv cc + 0.3 v operating temperature t opr ? 20 to + 70 (regular specifications) c ? 20 to + 85 (wide-range specifications) storage temperature t stg ? 55 to + 125 c caution: permanent damage to the lsi may resu lt if absolute maximum ratings are exceeded.
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1102 of 1164 rej09b0321-0200 29.2 dc characteristics tables 29.2 and 29.3 list dc characteristics. table 29.2 dc characteristics (1) [common items] [regular specifications] conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. typ. max. unit test conditions ? 120 180 ma i = 120 mhz ? 100 160 ma i = 100 mhz normal operation i cc ? 80 140 ma i = 80 mhz ? 60 140 ma i = 120 mhz ? 50 130 ma i = 100 mhz sleep mode i sleep ? 45 125 ma i = 80 mhz ? 5 30 ma t a > 50 c supply current * software standby mode i stby ? 1.5 20 ma t a 50 c ? 80 100 a t a > 50 c ram: 0 kbyte retained ? 300 750 a t a > 50 c ram: 8 kbytes retained ? 500 1500 a t a > 50 c ram: 16 kbytes retained ? 750 2250 a t a > 50 c ram: 24 kbytes retained ? 1000 3000 a t a > 50 c ram: 32 kbytes retained ? 50 75 a t a 50 c ram: 0 kbyte retained ? 70 300 a t a 50 c ram: 8 kbytes retained ? 80 500 a t a 50 c ram: 16 kbytes retained ? 90 750 a t a 50 c ram: 24 kbytes retained deep standby mode i dstby ? 100 1000 a t a 50 c ram: 32 kbytes retained
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1103 of 1164 rej09b0321-0200 item symbol min. typ. max. unit test conditions all input pins (except pc22 to pc25, pd15, pd16, pe0 to pe7, extal, audio_x1, and rtc_x1) ? ? 1.0 a input leakage current pc22 to pc25, pd15, pd16 |i in | ? ? 20 a v in = 0.5 to pv cc ? 0.5 v three-state leakage current all input/output pins, output pins (off state) |it si | ? ? 1.0 a v in = 0.5 to pv cc ? 0.5 v input pull-up mos current udtrst , udtms, udtdi, udtck, asebrk / asebrkak -lp 10 ? 150 a v in = 0 v input capacitance all pins c in ? ? 20 pf during a/d or d/a conversion ? 1 2 ma analog power supply current waiting for a/d or d/a conversion ai cc ? 1 2 a analog reference voltage current al ref ? 2 3 ma caution: when the a/d converter or d/ a converter is not in use, the av cc and av ss pins should not be open. note: * supply current values are values when a ll of the output pins and pins with the pull-up function ( udtrst , udtms, udtdi, udtck, asebrk / asebrkak ) are unloaded and represent the total current supplied to the pv cc , v cc r, and pllv cc systems. reference values are given under ?typ.?
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1104 of 1164 rej09b0321-0200 table 29.2 dc characteristics (2) [co mmon items] [wide-ra nge specifications] conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. typ. max. unit test conditions ? 100 160 ma i = 100 mhz normal operation i cc ? 80 140 ma i = 80 mhz ? 50 130 ma i = 100 mhz sleep mode i sleep ? 45 125 ma i = 80 mhz ? 5 40 ma t a > 50 c supply current * software standby mode i stby ? 1.5 20 ma t a 50 c ? 80 100 a t a > 50 c ram: 0 kbyte retained ? 300 1000 a t a > 50 c ram: 8 kbytes retained ? 500 2000 a t a > 50 c ram: 16 kbytes retained ? 750 3000 a t a > 50 c ram: 24 kbytes retained ? 1000 4000 a t a > 50 c ram: 32 kbytes retained ? 50 75 a t a 50 c ram: 0 kbyte retained ? 70 300 a t a 50 c ram: 8 kbytes retained ? 80 500 a t a 50 c ram: 16 kbytes retained ? 90 750 a t a 50 c ram: 24 kbytes retained deep standby mode i dstby ? 100 1000 a t a 50 c ram: 32 kbytes retained
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1105 of 1164 rej09b0321-0200 item symbol min. typ. max. unit test conditions all input pins (except pc22 to pc25, pd15, pd16, pe0 to pe7, extal, audio_x1, and rtc_x1) ? ? 1.0 a input leakage current pc22 to pc25, pd15, pd16 |i in | ? ? 20 a v in = 0.5 to pv cc ? 0.5 v three-state leakage current all input/output pins, output pins (off state) |it si | ? ? 1.0 a v in = 0.5 to pv cc ? 0.5 v input pull-up mos current udtrst , udtms, udtdi, udtck, and asebrk / asebrkak -lp 10 ? 150 a v in = 0 v input capacitance all pins c in ? ? 20 pf during a/d or d/a conversion ? 1 2 ma analog power supply current waiting for a/d or d/a conversion ai cc ? 1 2 a analog reference voltage current al ref ? 2 3 ma caution: when the a/d converter or d/ a converter is not in use, the av cc and av ss pins should not be open. note: * supply current values are values when a ll of the output pins and pins with the pull-up function ( udtrst , udtms, udtdi, udtck, asebrk / asebrkak ) are unloaded and represent the total current supplied to the pv cc , v cc r, and pllv cc systems. reference values are given under ?typ.?
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1106 of 1164 rej09b0321-0200 table 29.2 dc characteristics (3) [except for i 2 c-related pins * 1 ] conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. typ. max. unit test conditions res , mres , nmi, md1, md0, md_clk1, md_clk0, asemd , udtrst , asebrk / asebrkak , extal, ckio, audio_x1, rtc_x1 pv cc ? 0.5 ? pv cc + 0.3 pf7 to pf0 2.2 ? av cc + 0.3 input high voltage input pins other than above (excluding schmitt pins) v ih 2.2 ? pv cc + 0.3 v res , mres , nmi, md1, md0, md_clk1, md_clk0, asemd , udtrst , asebrk / asebrkak , extal, ckio, audio_x1, rtc_x1 ? 0.3 ? 0.5 input low voltage input pins other than above (excluding schmitt pins) v il ? 0.3 ? 0.8 v
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1107 of 1164 rej09b0321-0200 item symbol min. typ. max. unit test conditions v t + (v ih ) pv cc ? 0.5 ? ? v v t ? (v il ) ? ? 0.5 v schmitt trigger input characteristics tioc0a to tioc0d, tioc1a, tioc1b, tioc2a, tioc2b, tioc3a to tioc3d, tioc4a to tioc4d, tic5u to tic5w, tclka to tclkd, sck7 to sck0, rxd7 to rxd0, irq7 to irq0 * 2 , pint7 to pint0 v t + ? v t ? 0.2 ? ? v output high voltage all output pins v oh pv cc ? 0.5 ? ? v i oh = ?200 a output low voltage all output pins v ol ? ? 0.4 v i ol = 1.6 ma ram standby voltage v ram 3.0 ? ? v power-supply start voltage vcc start ? 0 0.8 v power-supply rising gradient svcc ? ? 20 ms/v notes: 1. pins (open-drain pins): pc22/irq0/scl0/dreq2, pc23/irq1/sda0, pc24/irq2/scl1, pc25/irq3/sda1, pd15/sda2, and pd16/scl2 2. except (pc22/)irq0, (pc23/)i rq1, (pc24/)irq2, and (pc25/)irq3
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1108 of 1164 rej09b0321-0200 table 29.2 dc characteristics (4) [i 2 c-related pins * ] conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. typ. max. unit test conditions input high voltage v ih 2.2 ? pv cc + 0.3 v input low voltage pc22/dreq2, pc23, pc24, pc25, pd15, pd16 v il ? 0.3 ? 0.8 v v t + (v ih ) pv cc 0.7 ? 5.5 v v t ? (v il ) ? 0.3 ? pv cc 0.3 v schmitt trigger input characteristics irq0/scl0, irq1/sda0, irq2/scl1, irq3/sda1, sda2, ascl2 v t + ? v t ? pv cc 0.05 ? ? v output low voltage scl0 to scl2, sda0 to sda2 v ol ? ? 0.4 v i ol = 3.0 ma note: * pins (open-drain pins): pc22/irq0/scl0/dreq2, pc23/irq1/sda0, pc24/irq2/scl1, pc25/irq3/sda1, pd15/sda2, and pd16/scl2 table 29.3 permissible output currents (1) [common items] conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. typ. max. unit scl0 to scl2, sda0 to sda2 i ol ? ? 10 ma permissible output low current (per pin) other than above 2 permissible output low current (total) i ol ? ? 150 ma permissible output high current (per pin) ? i oh ? ? 2 ma permissible output high current (total) ? i oh ? ? 50 ma caution: to protect the lsi's re liability, do not exceed the output current values in the table above.
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1109 of 1164 rej09b0321-0200 table 29.3 permissible output curre nts (2) [wide-rang e specifications] conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v, i 80 mhz item symbol min. typ. max. unit scl0 to scl2, sda0 to sda2 i ol ? ? 10 ma permissible output low current (per pin) other than above 2 permissible output low current (total) i ol ? ? 150 ma permissible output high current (per pin) ? i oh ? ? 2 ma permissible output high current (total) ? i oh ? ? 50 ma caution: to protect the lsi's re liability, do not exceed the output current values in the table above. table 29.3 permissible output curre nts (3) [wide-rang e specifications] conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v, 80 mhz < i 100 mhz item symbol min. typ. max. unit scl0 to scl2, sda0 to sda2 i ol ? ? 10 ma permissible output low current (per pin) other than above 2 permissible output low current (total) i ol ? ? 50 ma permissible output high current (per pin) ? i oh ? ? 2 ma permissible output high current (total) ? i oh ? ? 50 ma caution: to protect the lsi's re liability, do not exceed the output current values in the table above.
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1110 of 1164 rej09b0321-0200 29.3 ac characteristics signals input to this lsi are basically handled as signals in synchronization with a clock. the setup and hold times for input pins must be followed. table 29.4 maximum operating frequency conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. ty p. max. unit remarks 120 regular specifications cpu (i ) 20 ? 100 wide-range specifications internal bus, external bus (b ) 20 ? 60 operating frequency peripheral module (p ) f 5 ? 40 mhz 29.3.1 clock timing table 29.5 clock timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure extal, xtal crystal oscillator frequency (clock mode 0) ? 10 15 mhz extal, xtal crystal oscillator frequency (clock mode 2) ? 10 20 mhz audio_x1, audio_x2 crystal oscillator frequency ? 10 25 mhz extal clock input frequency (clock mode 0) f ex 10 15 mhz extal clock input frequency (clock mode 2) f ex 10 30 mhz figure 29.1
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1111 of 1164 rej09b0321-0200 item symbol min. max. unit figure extal clock input cycle time (clock mode 0) f excyc 66.67 100 ns extal clock input cycle time (clock mode 2) f excyc 33.33 100 ns audio_x1, audio_clk clock input frequency f ex 1 40 mhz audio_x1, audio_clk clock input cycle time t excyc 25 1000 ns extal, audio_x1, audio_clk clock input pulse low width t exl 0.4 0.6 t cyc extal, audio_x1, audio_clk clock input pulse high width t exh 0.4 0.6 t cyc extal, audio_x1, audio_clk clock input rise time t exr ? 4 ns extal, audio_x1, audio_clk clock input fall time t exf ? 4 ns figure 29.1 ckio clock input frequency f ck 20 60 mhz ckio clock input cycle time t ckicyc 16.67 50 ns ckio clock input pulse low width t ckil 0.4 0.6 t cyc ckio clock input pulse high width t ckih 0.4 0.6 t cyc ckio clock input rise time t ckir ? 3 ns ckio clock input fall time t ckif ? 3 ns figure 29.2 ckio clock output frequency f op 20 60 mhz ckio clock output cycle time t cyc 16.67 50 ns ckio clock output pulse low width t ckol 0.4 0.6 t cyc ckio clock output pulse high width t ckoh 0.4 0.6 t cyc ckio clock output rise time t ckor ? 3 ns ckio clock output fall time t ckof ? 3 ns figure 29.3 power-on oscillation settling time t osc1 10 ? ms figure 29.4 oscillation settling time on return from standby 1 t osc2 10 ? ms figure 29.5 oscillation settling time on return from standby 2 t osc3 10 ? ms figure 29.6 rtc clock oscillation settling time t rosc 3 ? s figure 29.7
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1112 of 1164 rej09b0321-0200 t exh t exf t exr t exl t excyc v ih v ih v ih 1/2 pvcc 1/2 pvcc v il v il extal, audio_x1, audio_clk * (input) note: * when the clock is input on the extal, audio_x1, or audio_clk pin. figure 29.1 extal, audio_x1, and audio_clk clock input timing t ckih t ckif t ckir t ckil t ckicyc v ih v ih v ih 1/2 pvcc 1/2 pvcc v il v il ckio (input) figure 29.2 ckio clock input timing t cyc t ckol t ckoh v oh 1/2 pvcc 1/2 pvcc ckio (output) t ckor t ckof v oh v ol v ol v oh figure 29.3 ckio clock output timing vcc min. t resw /t mresw t osc1 vcc res mres note: oscillation settling time when the internal oscillator is used. oscillation settling time ckio, internal clock figure 29.4 power-on oscillation settling time
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1113 of 1164 rej09b0321-0200 t osc2 t resw / t mresw res mres standby period note: oscillation settling time when the internal oscillator is used. oscillation settling time ckio, internal clock figure 29.5 oscillation settling time on return from standby (return by reset) standby period note: oscillation settling time when the internal oscillator is used. oscillation settling time ckio, internal clock t osc3 nmi, irq figure 29.6 oscillation settling time on re turn from standby (return by nmi or irq) pv cc pv ccmin t rosc oscillation settling time rtc clock (internal) figure 29.7 rtc clock oscillation settling time
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1114 of 1164 rej09b0321-0200 29.3.2 control signal timing table 29.6 control signal timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v b = 60 mhz item symbol min. max. unit figure res pulse width t resw 20 * 2 ? t cyc res setup time * 1 t ress 200 ? ns mres pulse width t mresw 20 * 3 ? t cyc mres setup time * 1 t mress 200 ? ns figures 29.4, 29.5, and 29.8 nmi pulse width t nmiw 20 * 4 ? t cyc nmi setup time * 1 t nmis 150 ? ns nmi hold time t nmih 10 ? ns irq7 to irq0 pulse width t irqw 20 * 4 ? t cyc irq7 to irq0 setup time * 1 t irqs 150 ? ns irq7 to irq0 hold time t irqh 10 ? ns pint7 to pint0 setup time * 1 t pints 150 ? ns figures 29.6, 29.9 notes: 1. the res , mres , nmi, irq7 to irq0 and pint7 to pint0 signals are asynchronous signals. when the setup time is satisfied, cha nge of signal level is detected at the rising edge of the clock. if not, the detection can be delayed until the rising edge of the next clock. 2. in software standby mode, deep standby mo de or when the clock multiplication ratio is changed, t resw = t osc2 (min). 3. in software standby mode or deep standby mode, t mresw = t osc2 (min). 4. in software standby mode or deep standby mode, t nmiw /t irqw = t osc3 (min).
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1115 of 1164 rej09b0321-0200 ckio t ress / t mress t ress / t mress res mres t resw / t mresw figure 29.8 reset input timing ckio t irqs t irqh t nmis t nmih t i rqs nmi t pints t nmiw t irqw irq level input pint7 to pint0 irq7 to irq0 irq7 to irq0 edge input figure 29.9 interrupt signal input timing
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1116 of 1164 rej09b0321-0200 29.3.3 bus timing table 29.7 bus timing * 1 conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v b = 60 mhz * 2 item symbol min. max. unit figure address delay time 1 (external space) t ad1 ? 13 ns figures 29.10 to 29.14 address delay time 2 (sdram space) t ad2 1 13 ns figures 29.15 to 29.21 byte control delay time t bcd ? 13 ns figures 29.10 to 29.14 chip select delay time 1 (external space) t csd1 ? 13 ns figures 29.10 to 29.14 chip select delay time 2 (sdram space) t csd2 1 13 ns figures 29.15 to 29.21 read strobe delay time t rsd ? 13 ns figures 29.10 to 29.14 read data setup time 1 (external space) t rds1 13 ? ns figures 29.10 to 29.14 read data setup time 2 (sdram space) t rds2 8 ? ns figures 29.15 to 29.21 read data hold time 1 (external space) t rdh1 0 ? ns figures 29.10 to 29.14 read data hold time 2 (sdram space) t rdh2 2 ? ns figures 29.15 to 29.21 write enable delay time 1 (external space) t wed1 ? 13 ns figures 29.10 to 29.14 write enable delay time 2 (sdram space) t wed2 1 13 ns figures 29.15 to 29.21 write data delay time 1 (external space) t wdd1 ? 13 ns figures 29.10 to 29.14 write data delay time 2 (sdram space) t wdd2 ? 13 ns figures 29.15 to 29.21 write data hold time 1 (external space) t wdh1 1 ? ns figures 29.10 to 29.14 write data hold time 2 (sdram space) t wdh2 1 ? ns figures 29.15 to 29.21
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1117 of 1164 rej09b0321-0200 b = 60 mhz * 2 item symbol min. max. unit figure external wait setup time t wts 8 ? ns figure 29.14 external wait hold time t wth 5 ? ns figure 29.14 sdras delay time t rasd 1 13 ns figures 29.15 to 29.21 sdcas delay time t casd 1 13 ns figures 29.15 to 29.21 dqm delay time t dqmd 1 13 ns figures 29.15 to 29.21 cke delay time t cked 1 13 ns figure 29.21 notes: 1. when writing to the external addre ss space or making sdram settings in power-on reset exception handling or cancellation of deep standby mode, be sure to set bits acosw[3:0] in acswr to b'0011 beforehand. 2. the maximum value (f max ) of b (external bus clock) depends on the number of wait cycles and the system config uration of your board. tn1 t ad1 t csd1 ts tw 1 tw 2 tw 2 tend (trd) t ad1 t csd1 t rds1 t wdd1 ckio a27 to a0 bc3 to bc0 csn rd d31 to d0 wr3 to wr0 d31 to d0 t rsd t rsd t rdh1 t wed1 t wed1 t bcd t bcd t wdh1 write read figure 29.10 basic bus timing for external address space (normal access, cycle wait co ntrol, cs exte nded cycle)
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1118 of 1164 rej09b0321-0200 t ad1 t ad1 t ad1 t ad1 t ad1 t bcd t csd1 t rsd tcsd1 t bcd t bcd t bcd t bcd t rds1 t rdh1 t rds1 t rdh1 t rds1 t rdh1 t rds1 t rdh1 t rsd t rsd t rsd t rsd t rsd t rsd t rsd ckio a27 to a0 bc3 to bc0 csn rd d31 to d0 tn1 ts tw1 tw2 tpw1 tpw2 tpw1 tpw2 tpw1 tpw2 tend (trd) tend (trd) tend (trd) tend (trd) figure 29.11 basic bus timing for external address space (page read access, normal access compatible mode) tn1 tw1 tw2 tpw1 tpw1 tpw1 tend (trd) tend (trd) tend (trd) tend (trd) t ad1 t ad1 t ad1 t ad1 t ad1 t bcd t csd1 t rsd t csd1 t bcd t bcd t bcd t bcd t ad1 t bcd t rsd t rds1 t rdh1 t rds1 t rdh1 t rds1 t rdh1 t rds1 t rdh1 ckio a27 to a0 bc3 to bc0 csn rd d31 to d0 figure 29.12 basic bus timing for external address space (page read access, external read data sequential assert mode)
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1119 of 1164 rej09b0321-0200 t ad1 t ad1 t ad1 t ad1 t ad1 t bcd t csd1 t wed1 t wed1 t wed1 t wed1 t wed1 t wed1 t wed1 t wed1 t csd1 t bcd t bcd t bcd t bcd t wdd1 t wdd1 t wdh1 t wdh1 t wdd1 t wdh1 t wdd1 t wdh1 ckio a27 to a0 bc3 to bc0 csn wr3 to wr0 d31 to d0 ts tw1 tw2 tdw1 tpw1 tdw1 tpw1 tdw1 tpw1 tpw1 (tn1) tend tend tend tend figure 29.13 basic bus timing for exte rnal address space (page write access) tw1 tw2 tw3 tend (tend) (tend) tend tpw1 tpw2 tpw3 t ad1 t ad1 t ad1 t bcd t csd1 t csd1 t bcd t bcd t rs d t rsd t rds1 t rdh1 t rds1 t rdh1 ckio a27 to a0 bc3 to bc0 csn rd t wth t wth t wts t wts wait d31 to d0 figure 29.14 external wait timi ng for external address space (page read access for 16-bit channel width, external read data sequential assert mode)
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1120 of 1164 rej09b0321-0200 t2 t1 t3 t4 t5 t6 (rd command) (pra command) (act command) row address ckio a16 to a2 a12 * sdcsn sdras sdcas sdwe sdcke dqmn d31 to d0 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 pra command column address (high) t dqmd t dqmd t rdh2 t rds2 t csd2 t csd2 t csd2 t csd2 t csd2 t csd2 t casd t casd t rasd t rasd t rasd t rasd t wed2 t wed2 t ad2 t csd2 t rasd note: * address pin connected to a10 in sdram. figure 29.15 single read bus timing for sdram space (dlc = 2 (two cycles), drcd = 1 (two cycles), dpcg = 1 (two cycles))
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1121 of 1164 rej09b0321-0200 note: * address pin connected to a10 in sdram. t2 t1 t3 t4 t5 t6 (wr command) (pra command) (act command) row address row address ckio a16 to a2 a12 * sdcsn sdras sdcas sdwe sdcke dqmn d31 to d0 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 pra command column address (high) t dqmd t wdh2 t wdd2 t csd2 t csd2 t csd2 t csd2 t csd2 t csd2 t wed2 t wed2 t wed2 t wed2 t casd t casd t csd2 t dqmd t ad2 t ad2 t csd2 t rasd t rasd t rasd t rasd t rasd t rasd t ad2 figure 29.16 single write bus timing for sdram space (dlc = 2 (two cycles), drcd = 1 (two cycles), dpcg = 1 (two cycles))
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1122 of 1164 rej09b0321-0200 t2 t1 (act) t3 (rd) t4 (rd) t5 (rd) t6 (rd) t7 (pra) row address ckio a16 to a2 a12 * sdcsn sdras sdcas sdwe sdcke dqmn d31 to d0 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 pra command c0 (column address 0) (high) t dqmd t rdh2 t rds2 t csd2 t csd2 t csd2 t csd2 t csd2 t wed2 t wed2 t casd t casd t casd t dqmd t rdh2 t rds2 t ad2 t rasd t rasd t rasd t rasd t rasd t ad2 t ad2 t ad2 c1 c3 c2 note: * address pin connected to a10 in sdram. figure 29.17 multiple read bus timing for sdram space (four data access, dlc = 2 (two cycles), drcd = 1 (two cycles), dpcg = 1 (two cycles))
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1123 of 1164 rej09b0321-0200 t2 t1 (act) t3 (wr) t4 (wr) t5 (wr) t6 (wr) t7 (pra) row address ckio a16 to a2 a12 * sdcsn sdras sdcas sdwe sdcke dqmn d31 to d0 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 pra command c0 (column address 0) (high) t dqmd t csd2 t csd2 t csd2 t csd2 t csd2 t wed2 t wed2 t casd t casd t casd t dqmd t ad2 t rasd t rasd t rasd t rasd t rasd t ad2 t ad2 t ad2 t ad2 c1 c3 c2 t wdd2 t wdh2 t wdd2 t wdh2 t wdh2 t wdd2 t wdd2 t wdd2 note: * address pin connected to a10 in sdram. figure 29.18 multiple write bus timing for sdram space (four data access, dlc = 2 (two cycles), drcd = 1 (two cycles), dpcg = 1 (two cycles))
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1124 of 1164 rej09b0321-0200 note: * address pin connected to a10 in sdram. t2 t3 (rd) t4 (rd) t5 (rd) t6 (rd) t7 (pra) row address ckio a16 to a2 a12 * sdcsn sdras sdcas sdwe sdcke dqmn d31 to d0 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 t ad2 pra command c0 (column address 0) (high) t dqmd t rdh2 t rds2 t10 t8 t9 (act) t1 (act) t11 (rd) t12 (rd) t13 (rd) t14 (rd) t15 (pra) t csd2 t csd2 t csd2 t csd2 t csd2 t csd2 t csd2 t csd2 t wed2 t wed2 t wed2 t wed2 t casd t casd t casd t casd t rdh2 t rds2 t rdh2 t rds2 t rdh2 t rds2 t ad2 t ad2 t ad2 t ad2 pra command t rasd t rasd t rasd t rasd t rasd t rasd t rasd t rasd t ad2 t ad2 t ad2 c1 c3 c2 t ad2 t ad2 t ad2 t ad2 t ad2 c4 r1 c6 c7 c5 figure 29.19 multiple read row span bus timing for sdram space (eight data access, dlc = 2 (two cycles), drcd = 1 (two cycles), dpcg = 1 (two cycles))
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1125 of 1164 rej09b0321-0200 note: * address pin connected to a10 in sdram. t1 (mrs command) ckio a16 to a2 a12 * sdcsn sdras sdcas sdwe sdcke dqmn d31 to d0 t ad2 t ad2 (high) (hi-z) t csd2 t csd2 t rasd t rasd t casd t casd t wed2 t wed2 t ad2 t ad2 figure 29.20 bus timing for s dram space mode register setting
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1126 of 1164 rej09b0321-0200 note: * address pin connected to a10 in sdram. (rfa) (rfs) (rfx) (rfa) ckio a16 to a2 a12 * sdcsn sdras sdcas sdwe sdcke dqmn d31 to d0 t ad2 t ad2 (high) (hi-z) t dqmd t csd2 t csd2 t csd2 t csd2 t csd2 t cked t cked t casd t casd tcasd t casd t casd t casd t casd t csd2 t csd2 t dqmd t rasd t rasd t rasd t rasd t rasd t rasd t rasd t ad2 t ad2 figure 29.21 bus timing for sdram space self refresh
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1127 of 1164 rej09b0321-0200 29.3.4 dmac module timing table 29.8 dmac module timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure dreq setup time t drqs 15 ? dreq hold time t drqh 15 ? figure 29.22 dack, dact, dtend delay time t dacd ? 15 ns figure 29.23 t drqs t drqh ckio dreqn note: n = 0 to 3 figure 29.22 dreq input timing ckio dackn dactn dtendn t dacd t dacd note: n = 0 to 3 figure 29.23 dack, dact, dtend output timing
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1128 of 1164 rej09b0321-0200 29.3.5 ubc trigger timing table 29.9 ubc trigger timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure ubctrg delay time t ubctgd ? 14 ns figure 29.24 ckio ubctrg t ubctgd figure 29.24 ubc trigger timing
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1129 of 1164 rej09b0321-0200 29.3.6 mtu2 module timing table 29.10 mtu2 module timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure output compare output delay time t tocd ? 100 ns input capture input setup time t tics (n ? 1) t cyc /2 + 20 ? ns figure 29.25 timer input setup time t tcks (n ? 1) t cyc + 20 ? ns timer clock pulse width (single edge) t tckwh/l 1.5 ? t pcyc timer clock pulse width (both edges) t tckwh/l 2.5 ? t pcyc timer clock pulse width (phase counting mode) t tckwh/l 2.5 ? t pcyc figure 29.26 note: above is the case in which the clock rati o b:p = n:1 (n = 1, 2, 3, 4, 6, 8, or 12) t pcyc indicates peripheral clock (p ) cycle. ckio t tocd t tics input capture input output compare output figure 29.25 mtu2 input/output timing ckio tclka to tclkd t tcks t tcks t tckwh t tckwl figure 29.26 mtu2 clock input timing
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1130 of 1164 rej09b0321-0200 29.3.7 8-bit timer timing table 29.11 8-bit timer timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure timer output delay time t tmod ? 40 ns figure 29.27 timer reset input setup time t tmrs (n ? 1) t cyc + 25 ? ns figure 29.28 timer clock input setup time t tmcs (n ? 1) t cyc + 25 ? ns single edge t tmcwh 1.5 ? t pcyc timer clock pulse width both edges t tmcwl 2.5 ? t pcyc figure 29.29 note: above is the case in which the clock rati o b:p = n:1 (n = 1, 2, 3, 4, 6, 8, or 12) t pcyc indicates peripheral clock (p ) cycle. ckio tmo0, tmo1 t tmod figure 29.27 8-bit timer output timing ckio tmri0, tmri1 t tmrs figure 29.28 8-bit timer reset input timing
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1131 of 1164 rej09b0321-0200 ckio tmci0, tmci1 t tmcwl t tmcwh t tmcs t tmcs figure 29.29 8-bit timer clock input timing 29.3.8 watchdog timer timing table 29.12 shows the timing of the watchdog timer. table 29.12 watchdog timer timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure wdtovf delay time t wovd ? 100 ns figure 29.30 t wovd ckio wdtovf t wovd figure 29.30 watchdog timer timing
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1132 of 1164 rej09b0321-0200 29.3.9 scif module timing table 29.13 scif module timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure (clocked synchronous) 12 ? t pcyc input clock cycle (asynchronous) t scyc 4 ? t pcyc input clock rise time t sckr ? 1.5 t pcyc input clock fall time t sckf ? 1.5 t pcyc input clock width t sckw 0.4 0.6 t scyc figure 29.31 transmit data delay time (clocked synchronous) t txd ? 3 t pcyc + 15 ns receive data setup time (clocked synchronous) t rxs 4 t pcyc + 15 ? ns receive data hold time (clocked synchronous) t rxh 1 t pcyc + 15 ? ns figure 29.32 note: t pcyc indicates a peripheral clock (p ) cycle. t sckw t sckr t sckf t scyc sck figure 29.31 sck input clock timing t scyc t txd sck txd (data transmit) rxd (data receive) t rxh t rxs figure 29.32 scif input/output timing in clocked synchronous mode
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1133 of 1164 rej09b0321-0200 29.3.10 iic3 module timing table 29.14 i 2 c bus interface 3 timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v specifications item symbol test conditions min. typ. max. unit figure scl input cycle time t scl 12 t pcyc * 1 + 600 ? ? ns figure 29.33 scl input high pulse width t sclh 3 t pcyc * 1 + 300 ? ? ns scl input low pulse width t scll 5 t pcyc * 1 + 300 ? ? ns scl, sda input rise time t sr ? ? 300 ns scl, sda input fall time t sf ? ? 300 ns scl, sda input spike pulse removal time * 2 t sp ? ? 1.2 t pcyc * 1 sda input bus free time t buf 5 ? ? t pcyc * 1 start condition input hold time t stah 3 ? ? t pcyc * 1 retransmit start condition input setup time t stas 3 ? ? t pcyc * 1 stop condition input setup time t stos 3 ? ? t pcyc * 1 data input setup time t sdas 1 t pcyc * 1 + 20 ? ? ns data input hold time t sdah 0 ? ? ns scl, sda capacitive load cb 0 ? 400 pf scl, sda output fall time * 3 t of pv cc = 3.0 to 3.6 v ? ? 250 ns notes: 1. t pcyc indicates the peripheral clock (p ) cycle. 2. depends on the value of nf2cyc. 3. indicates the i/o buffer characteristics.
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1134 of 1164 rej09b0321-0200 scl v ih v il t stah t buf p * s * t sf t sr t scl t sdah t sclh t scll sda sr * t stas t sp t stos t sdas p * [legend] s: start condition p: stop condition sr: start condition for retransmission figure 29.33 i 2 c bus interface 3 input/output timing 29.3.11 ssi module timing table 29.15 ssi module timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. typ. max. unit remarks figure output clock cycle t o 80 ? 64000 ns output figure 29.34 input clock cycle t i 80 ? 64000 ns input clock high t hc 32 ? ? ns bidirectional clock low t lc 32 ? ? ns clock rise time t rc ? ? 20 ns output (100 pf) delay t dtr ? ? 50 ns transmit figures 29.35 and 29.36 setup time t sr 15 ? ? ns receive figures 29.37 and 29.38 hold time t htr 5 ? ? ns receive figures 29.37 and 29.38 audio_clk input frequency f audio 1 ? 40 mhz figure 29.39
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1135 of 1164 rej09b0321-0200 t i ,t o t hc ssisckn t lc t rc figure 29.34 clock input/output timing t dtr ssisckn ssiwsn, ssidatan figure 29.35 ssi transmit timing (1) t dtr ssisckn ssiwsn, ssidatan figure 29.36 ssi transmit timing (2) t sr t htr ssisckn ssiwsn, ssidatan figure 29.37 ssi receive timing (1)
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1136 of 1164 rej09b0321-0200 t sr t htr ssisckn ssiwsn, ssidatan figure 29.38 ssi receive timing (2) f audio audio_clk figure 29.39 audio_clk input timing 29.3.12 rcan-et module timing table 29.16 rcan-et module timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure transmit data delay time t ctxd ? 100 ns figure 29.40 receive data setup time t crxs 100 ? receive data hold time t crxh 100 ? t crxs ckio crx (receive data) ctx (transmit data) t crxh t ctxd figure 29.40 rcan- et input/output timing
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1137 of 1164 rej09b0321-0200 29.3.13 a/d trigger input timing table 29.17 a/d trigger input timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v module item symbol min. max. unit figure a/d converter trigger input setup time t trgs (n ? 1) t cyc + 17 ? ns figure 29.41 note: above is the case in which the clock rati o b:p = n:1 (n = 1, 2, 3, 4, 6, 8, or 12) ckio adtrg t trgs figure 29.41 a/d converter external trigger input timing 29.3.14 i/o port timing table 29.18 i/o port timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure output data delay time t portd ? 100 ns figure 29.42 input data setup time t ports 100 ? input data hold time t porth 100 ?
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1138 of 1164 rej09b0321-0200 t ports ckio t porth t portd port (read) port (write) figure 29.42 i/o port timing 29.3.15 h-udi-related pin timing table 29.19 h-udi-rel ated pin timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure udtck cycle time t tckcyc 50 * ? ns udtck high pulse width t tckh 0.4 0.6 t tckcyc udtck low pulse width t tckl 0.4 0.6 t tckcyc figure 29.43 udtrst pulse width t trsw 20 ? t tckcyc udtrst setup time t trss 200 ? ns figure 29.44 udtdi setup time t tdis 10 ? ns udtdi hold time t tdih 10 ? ns udtms setup time t tmss 10 ? ns udtms hold time t tmsh 10 ? ns udtdo delay time t tdod ? 16 ns figure 29.45 note: * should be greater than the peripheral clock (p ) cycle time.
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1139 of 1164 rej09b0321-0200 t tckcyc v ih 1/2 pvcc udtck (input) 1/2 pvcc v ih v il v il v ih t tckl t tckh figure 29.43 udtck input timing udtck (input) udtrst t trss t trss t trsw figure 29.44 udtrst input timing udtck (input) udtms udtdi udtdo t tdis t tdih t tckcyc t tmss t tmsh t tdod t tdod udtdo change timing after switching command setting initial value figure 29.45 h-udi data transfer timing
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1140 of 1164 rej09b0321-0200 29.3.16 aud-ii timing table 29.20 aud-ii timing conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item symbol min. max. unit figure audrst pulse width t audrstw 5 ? t rmcyc figure 29.46 audmd setup time t audmds 5 ? t rmcyc ram monitor clock cycle t rmcyc 33.33 ? ns figure 29.47 ram monitor clock low pulse width t rmckwl 0.4 0.6 t rmcyc ram monitor clock high pulse width t rmckwh 0.4 0.6 t rmcyc ram monitor output data delay time t rmdd 2 14 ns ram monitor input data setup time t rmds 15 ? ns ram monitor input data hold time t rmdh 5 ? ns ram monitor sync setup time t rmss 15 ? ns ram monitor sync hold time t rmsh 5 ? ns audrst audmd t rmcyc t audrstw t audmds audck (input) figure 29.46 aud reset timing
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1141 of 1164 rej09b0321-0200 t rmcyc t rmckwh t rmckwl t rmdd t rmdh t rmds t rmss t rmsh audck (input) 1/2 pv cc audata3 to audata0 (output) audsync (input) audata3 to audata0 (input) v ih v ih v il v il figure 29.47 ram monitor timing 29.3.17 ac characteristics measurement conditions ? input signal reference levels: high level = v ih min, low level = v il max ? output signal reference level: pvcc/2 (pvcc = 3.0 to 3.6 v) ? input pulse level: pvss to 3.0 v (where res, mres, nmi, md1, md0, md_clk1, md_clk0, asemd, udtrst, and schmitt trigger input pins are within pvss to pvcc) ? input rise and fall times: 1 ns note: c l is the total value that includes the capacitance of measurement tools. each pin is set as follows: 30 pf: ckio, sdras , sdcas , cs0 to cs6 , sdcs0 , sdcs1 , sdcke, sdwe , dqm0 to dqm3 50 pf: all other pins c l lsi output pin measurement point cmos output figure 29.48 measurement circuit
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1142 of 1164 rej09b0321-0200 29.4 a/d converter characteristics table 29.21 lists the a/d converter characteristics. table 29.21 a/d converter characteristics conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item min. typ. max. unit resolution 10 10 10 bits conversion time 3.9 * 2 ? ? s analog input capacitance ? ? 20 pf permissible signal-source impedance ? ? 5 k ? nonlinearity error ? ? 3.0 * 1 lsb offset error ? ? 2.0 * 1 lsb full-scale error ? ? 2.0 * 1 lsb quantization error ? ? 0.5 * 1 lsb absolute accuracy ? ? 4.0 lsb notes: 1. reference values 2. to satisfy the absolute accura cy, the conversion time should be 3.9 s or longer.
section 29 electrical characteristics rev. 2.00 sep. 07, 2007 page 1143 of 1164 rej09b0321-0200 29.5 d/a converter characteristics table 29.22 lists the d/a converter characteristics. table 29.22 d/a converter characteristics conditions: pv cc = v cc r = pllv cc = 3.0 v to 3.6 v, av cc = 3.0 v to 3.6 v, pv cc ? 0.3 v av cc pv cc , av ref = 3.0 v to av cc , pv ss = v ss r = pllv ss = av ss = 0 v item min. typ. max. unit test conditions resolution 8 8 8 bits conversion time ? ? 10 s load capacitance 20 pf ? 2.0 * 3.0 lsb load resistance 2 m ? absolute accuracy ? ? 2.5 lsb load resistance 4 m ? note: * reference values
section 29 electric al characteristics rev. 2.00 sep. 07, 2007 page 1144 of 1164 rej09b0321-0200 29.6 usage note mount a multilayer ceramic capacitor between a pa ir of pins pvcc and pvss, vccr and vssr, or pllvcc and pllvss as a bypass capacitor. these ca pacitors must be placed as close as the power supply pins of the lsi. also, a capacitor must be connected between the vcl and vss pins to stabilize the power supply voltage that is internally lowered. figure 29.49 is an example of externally allocated capacitors. 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 asebrk / asebrkak udtck udtdi udtdo udtms pvcc udtrst pvss audio_x1 audio_x2 pvss pd0/audio_clk pd1/ssidata0 pd2/ssisck0 pd3/ssiws0 pd4/txd4/ssidata1 pd5/rxd4/ssisck1 pd6/sck4/ssiws1 pd7/tioc0a/txd0/dact1 pd8/tioc0b/rxd0/dtend1 pd9/tioc0c/sck0 pd10/tmo1/tioc0d/txd1 pd11/tmri1/rxd1 pd12/tmci1/sck1 pd13/dreq1 pd14/dack1 pd15/sda2 pd16/scl2 pf7/audata3 pvss pf6/audata2 pvcc pf5/audata1 pf4/audata0 pf3/ audsync pf2/tclkd/sck7/audck pf1/rxd7/audmd pf0/txd7/ audrst avss pe7/irq7/an7/da1 pe6/irq6/an6/da0 pe5/irq5/an5 pe4/irq4/an4 pe3/pint7/an3 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 vssr res pllvcc nmi pllvss rtc_x1 rtc_x2 pvss xtal extal pvss ckio/sdclk pvcc md_clk0 md_clk1 pvss pa0/a0 pvcc pa1/a1 pa2/a2 pa3/a3 pa4/a4 pa5/a5 pa6/a6 pa7/a7 pa8/a8 pa9/a9 pa10/a10 pa11/a11 pa12/a12 pa13/a13 pa14/a14 pa15/a15 pa16/a16 pa17/a17 pa18/a18 pa19/a19 pvss pa20/a20 pvcc pa21/a21 pa22/a22 pa23/a23 vcl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 pe2/pint6/an2 pe1/pint5/an1 pe0/pint4/an0 avref avcc pc0/ cs0 pc1/ cs1 pc2/ cs2 / sdcs1 / adtrg pc3/ cs3 / ubctrg pc4/ cs4 /tioc1a/txd5 pc5/ cs5 /tioc1b/rxd5 pc6/ cs6 /tclka/sck5 pvcc pc7/ sdcs0 pvss pc8/ rd pc9/ wr0 pc10/ wr1 pc11/ wr2 /tioc2a/dact2 pc12/ wr3 /tioc2b/dtend2 pc13/ wait pc14/sdcke pc15/ sdras pc16/ sdcas pc17/ sdwe pc18/bc0/dqm0 pc19/bc1/dqm1 pc20/bc2/dqm2/tclkb pc21/bc3/dqm3/tclkc/dack2 pc22/irq0/scl0/dreq2 pc23/irq1/sda0 pc24/irq2/scl1 pc25/irq3/sda1 pvss pa31/crx1/dtend0 pvcc pa30/ctx1/dact0 pa29/crx0/dack0 pa28/ctx0/dreq0 pa27/a27/pint3/dtend3 pa26/a26/pint2/dact3 pa25/a25/pint1/dack3 pa24/a24/pint0/dreq3 vss asemd md1 md0 wdtovf pvss pb0/d0 pvcc pb1/d1 pb2/d2 pb3/d3 pb4/d4 pb5/d5 pb6/d6 pb7/d7 pb8/d8 pb9/d9 pb10/d10 pb11/d11 pb12/d12 pb13/d13 pb14/d14 pb15/d15 pvss pb16/d16/irq0/tioc3a pvcc pb17/d17/irq1/tioc3b pb18/d18/irq2/tioc3c pb19/d19/irq3/tioc3d pb20/d20/irq4/tioc4a/txd2 pb21/d21/irq5/tioc4b/rxd2 pb22/d22/irq6/tioc4c/sck2 pb23/d23/irq7/tioc4d pb24/d24/pint0/tic5u/txd6 pb25/d25/pint1/tic5v/rxd6 pvcc pb26/d26/pint2/tic5w/sck6 pvss pb27/d27/pint3 pb28/d28/pint4/tmo0/txd3 pb29/d29/pint5/tmri0/rxd3 pb30/d30/pint6/tmci0/sck3 pb31/d31/pint7 vccr mres lqfp2424-176cu (fp-176ev) top view cin, cout cl1, cl2 0.1 f pvcc power supply pvcc power supply pvcc power supply pvcc power supply pvcc power supply pvcc power supply pvcc power supply pvcc power supply pvcc power supply pvcc power supply pvcc power supply pvcc power supply figure 29.49 example of exte rnally allocated capacitors
appendix rev. 2.00 sep. 07, 2007 page 1145 of 1164 rej09b0321-0200 appendix a. pin states table a.1 pin states pin function pin state reset state power-down state power-on * 2 area 0 data bus width type pin name 8 bits 16 bits 32 bits manual sleep software standby deep standby ckio (clock modes 0 and 2) o o o o o l/z * 5 l/z * 5 ckio (clock mode 3) i i i i i i i xtal (clock modes 0 and 2) o o o o o l l xtal (clock mode 3) * 1 o o o o o l l extal (clock modes 0 and 2) i i i i i i i clock extal (clock mode 3) * 1 z z z z z z z res i i i i i i i mres ? ? ? i i i i wdtovf o o o o o k k system control asebrk / asebrkak h h h o o i k md1, md0 i i i i i i i md_clk1, md_clk0 i i i i i i i mode asemd i i i i i i i nmi i i i i i i i irq7 to irq0 ? ? ? i i i i * 3 interrupt pint7 to pint0 ? ? ? i i i ?
appendix rev. 2.00 sep. 07, 2007 page 1146 of 1164 rej09b0321-0200 pin function pin state reset state power-down state power-on * 2 area 0 data bus width type pin name 8 bits 16 bits 32 bits manual sleep software standby deep standby a27 to a24 z z z o o k k a23 to a0 l l l o o k k d31 to d16 ? ? z i/o i/o z k d15 to d8 ? z z i/o i/o z k address data d7 to d0 z z z i/o i/o z k wait ? ? ? i i z z cs0 h h h o o k k cs6 to cs1 ? ? ? o o k k rd h h h o o k k wr3 ? ? h o o k k wr2 ? ? h o o k k wr1 ? h h o o k k wr0 h h h o o k k bc3 to bc0 ? ? ? o o k k sdcs1 , sdcs0 ? ? ? o o k k sdras ? ? ? o o k k sdcas ? ? ? o o k k sdwe ? ? ? o o k k dqm3 to dqm0 ? ? ? o o k k bus control sdcke ? ? ? o o k k dreq3 to dreq0 ? ? ? i i z z dack3 to dack0 ? ? ? o o k k dact3 to dact0 ? ? ? o o k k dmac dtend3 to dtend0 ? ? ? o o k k
appendix rev. 2.00 sep. 07, 2007 page 1147 of 1164 rej09b0321-0200 pin function pin state reset state power-down state power-on * 2 area 0 data bus width type pin name 8 bits 16 bits 32 bits manual sleep software standby deep standby tclka to tclkd ? ? ? i i z z tioc0a to tioc0d ? ? ? i/o i/o k k tioc1a, tioc1b ? ? ? i/o i/o k k tioc2a, tioc2b ? ? ? i/o i/o k k tioc3a to tioc3d ? ? ? i/o i/o k k tioc4a to tioc4d ? ? ? i/o i/o k k mtu2 tic5u, tic5v, tic5w ? ? ? i i z z tmo1, tmo0 ? ? ? o o k k tmci1, tmci0 ? ? ? i i z z tmr tmri1, tmri0 ? ? ? i i z z sck7 to sck0 ? ? ? i/o i/o k k rxd7 to rxd0 ? ? ? i i z z scif txd7 to txd0 ? ? ? o o k k scl2 to scl0 ? ? ? i/o i/o z z iic3 sda2 to sda0 ? ? ? i/o i/o z z ssi ssidata1, ssidata0 ? ? ? i/o i/o k k ssisck1, ssisck0 ? ? ? i/o i/o k k ssiws1, ssiws0 ? ? ? i/o i/o k k audio_clk ? ? ? i i z z audio_x1 * 1 i i i i i i i audio_x2 * 1 o o o o o o o rcan_et crx1, crx0 ? ? ? i i z z ctx1, ctx0 ? ? ? o o k k
appendix rev. 2.00 sep. 07, 2007 page 1148 of 1164 rej09b0321-0200 pin function pin state reset state power-down state power-on * 2 area 0 data bus width type pin name 8 bits 16 bits 32 bits manual sleep software standby deep standby an7 to an0 ? ? ? i i z z a/d converter adtrg ? ? ? i i z z d/a converter da1, da0 ? ? ? o o o z rtc_x1 * 1 i i i i i i i rtc rtc_x2 * 1 o o o o o o o audrst ? ? ? i i i z audmd ? ? ? i i i z audsync ? ? ? i/o i/o i/o k audck ? ? ? i/o i/o i/o k aud-ii audata3 to audata0 ? ? ? i/o i/o i/o k h-udi udtck i i i i i i i udtms i i i i i i i udtdi i i i i i i i udtdo o/z * 4 o/z * 4 o/z * 4 o/z * 4 o/z * 4 o/z * 4 k udtrst i i i i i i i ubc ubctrg ? ? ? o o o k pa31 to pa28 i i i i/o i/o k k pa27 to pa0 l l l i/o i/o k k pb31 to pb16 i i z i/o i/o k k pb15 to pb8 i z z i/o i/o k k i/o ports pb7 to pb0 z z z i/o i/o k k
appendix rev. 2.00 sep. 07, 2007 page 1149 of 1164 rej09b0321-0200 pin function pin state reset state power-down state power-on * 2 area 0 data bus width type pin name 8 bits 16 bits 32 bits manual sleep software standby deep standby pc25 to pc22 i i i i i z z pc21 to pc13 i i i i/o i/o k k pc12, pc11 i i h i/o i/o k k pc10 i h h i/o i/o k k pc9 h h h i/o i/o k k pc8 h h h i/o i/o k k pc7 to pc1 i i i i/o i/o k k pc0 h h h i/o i/o k k pd16, pd15 i i i i i z z pd14 to pd0 i i i i/o i/o k k pe7 to pe0 i i i i i z z i/o ports pf7 to pf0 i i i i/o i/o k k [legend] i: input o: output h: high-level output l: low-level output z: high-impedance k: input pins become high-impedance, and output pins retain their state. notes: 1. when pins for the connection with a crystal resonator are not used, the extal and audio_x1 pins must be pulled up and the xtal and audio_x2 pins must be open. the rtc_x1 pin must be connected to gnd and the rtc_x2 must be open. 2. power-on reset by low-level input to the res pin. the pin states after a power-on reset by the h-udi reset assert command or wdt ov erflow are the same as the initial pin states at normal operation (see section 23, pin function controller (pfc)). 3. irq pins that can release deep standby mode are limited to pe7 to pe4 and pc25 to pc22. 4. z when the tap controller of the h-udi is neither the sh ift-dr nor shift-ir state. 5. l when the ckio output is specified and z when the ckio output is stopped with the setting of ckiocr.
appendix rev. 2.00 sep. 07, 2007 page 1150 of 1164 rej09b0321-0200 b. package dimensions include trim offset. dimension " * 3" does not note) do not include mold flash. dimensions " * 1" and " * 2" 1. 2. y index mark * 2 * 3 * 1 f 176 133 132 89 88 45 44 1 x b p h e h d d e z d z e terminal cross section b 1 c 1 b p c detail f c a l a 1 a 2 l 1 p-lqfp176-24x24-0.50 1.8g mass[typ.] 176p6q-a / fp-176e / fp-176ev plqp0176kb-a renesas code jeita package code previous code l 1 z e z d c 1 b 1 b p a 1 h e h d y0.10 e0.5 c 0 8 x l 0.35 0.5 0.65 0.05 0.1 0.15 a1.7 25.8 26.0 26.2 25.8 26.0 26.2 a 2 1.4 e 23.9 24.0 24.1 d 23.9 24.0 24.1 reference symbol dimension in millimeters min nom max 0.15 0.20 0.25 0.09 0.145 0.20 0.08 1.25 1.25 0.18 0.125 1.0 e figure b.1 package dimensions
main revisions and additions in this edition rev. 2.00 sep. 07, 2007 page 1151 of 1164 rej09b0321-0200 main revisions and add itions in this edition item page revision (see manual for details) table 1.2 product lineup 8 modified abbreviation product code R5S72011rb120fp R5S72011 R5S72011rw100fp 4.4.2 ckio control register (ckiocr) 86 modified when this lsi is started in cloc k operating mode 3, ckiocr is initialized to h'00 by a power-on reset caused by the res pin or in deep standby mode. when this lsi is started in clock operating mode 0 or 2, ckiocr is initialized to h'01 by a power-on reset caused by the res pin or in deep standby mode. this register is not in itialized by an internal reset triggered by an overflow of the wdt, a manual reset, in sleep mode, or in software standby mode. 9.5.2 sdram interface (9) read/write access (c) byte access control by dqm 260 added figure 9.26 sdramc setting procedure 264 figure modified 9.6.2 write buffer 9.6.3 note on transition to software standby mode or deep standby mode 285 added
main revisions and additions in this edition rev. 2.00 sep. 07, 2007 page 1152 of 1164 rej09b0321-0200 item page revision (see manual for details) 11.1 features 302 modified 1. single data transfer: transfer in one read cycle and one write cycle by the dmac (in the case of dual address transfer), and one read cycle or one write cycle transfer by the dmac (at single address transfer) 2. single operand transfer: continuous data transfer by the dmac on one channel (amount of data to be transferred is set in a register) : 6. biu: bus interface unit (peripheral module). one of the following four kinds according to the source or destination of transfer. biu_e: external space (normal space and sdram space) biu_p: peripheral bus (1) (see figure 1.1) biu_sh: peripheral bus (2) (see figure 1.1), on-chip ram space biu_c: peripheral bus (3) (see figure 1.1) 15.3.15 year alarm register (ryrar) 652 added ryrar is an alarm register corresponding to the year counter ryrcnt. the assignable range is from 0000 through 9999 (practically in bcd), otherwise operation errors occur. ryrar is not initialized by a power-on reset, a manual reset, or in deep standby mode or software standby mode. 15.5.1 register writing during rtc count 661 modified do not write to the count registers (rseccnt, rmincnt, rhrcnt, rdaycnt, rwkcnt, rmoncnt, and ryrcnt) du ring the rtc counting (while the start bit in rcr2 is 1). if any of the count registers is written to dur ing the rtc counting, the count register may not be read correctly immediately after the execution of a wr ite instruction. the rtc counting must be stopped before writing to any of the count registers.
main revisions and additions in this edition rev. 2.00 sep. 07, 2007 page 1153 of 1164 rej09b0321-0200 item page revision (see manual for details) figure 16.11 sample flowchart for transmitting serial data 716 modified all data transmitted? yes no [1] [1] scif status check and transmit data write: read scfsr and check that the tdfe flag is set to 1, then write transmit data to scftdr, and read 1 from the tdfe and tend flags, then clear these flags to 0. write transmit data to scftdr and read 1 from tdfe and tend flags in scfsr, then clear these flags to 0 figure 16.16 sample flowchart for transmitting/receiving serial data 720 modified yes [1] write transmit data to scftdr, and read 1 from tdfe and tend flags in scftdr, then clear these flags to 0 [1] scif status check and transmit data write: read scfsr and check that the tdfe flag is set to 1, then write transmit data to scftdr, and read 1 from the tdfe and tend flags, then clear these flags to 0. the transition of the tdfe flag from figure 17.22 bit synchronous circuit timing 764 figure modified table 17.5 time for monitoring scl 765 table modified cks3 cks2 time for monitoring scl * 1 1 0 33 tpcyc * 2 1 81 tpcyc * 2 17.7.1 issuance of stop condition and start condition (retransmission) 766 title added 17.7.2 settings for multi-master operation 17.7.3 reading icdrr in master receive mode 766 added 18.3.1 control regist er (ssicr) 774 added bit bit name description 11 spdp serial padding polarity 0: padding bits are low. 1: padding bits are high. note: when muen = 1, padding bits are low. (the mute function is given priority.)
main revisions and additions in this edition rev. 2.00 sep. 07, 2007 page 1154 of 1164 rej09b0321-0200 item page revision (see manual for details) 18.3.2 status register (ssisr) 781 modified bit bit name description 0 idst : ? ssi = master transmitter (swsd = 1 and trmd = 1) this bit is set to 1 if the en bit is cleared and the data written to ssitdr is completely output from the serial data input/output pin (ssidata), that is, the output of the system word length is completed. 18.4.1 bus format 783 modified the bus format can be select ed from one of the four major modes shown in table 18.3. 787 modified the ssi module supports t he transfer of 2, 3 and 4 channels by using the chnl, swl and dwl bits only when the system word length (swl) is greater than or equal to the data word length (dwl) multiplied by channels (chnl). 18.4.2 non-compressed modes (6) multi-channel formats 789 modified figures 18.7 to 18.9 show how 2, 3 and 4 channels are transferred to figure 18.7 multichannel format (2 channels without padding) 789 modified sckp = 0, swsp = 0, del = 1, chnl = 01, spdp = don't care, sdta = don't care system word length = data word length 2 figure 18.8 multichannel format (3 channels with high padding) 789 modified sckp = 0, swsp = 0, del = 1, chnl = 10, spdp = 1, sdta = 0 system word length = data word length 3 figure 18.9 multichannel format (4 channels; transmitting and receiving in the order of padding bits and serial data; with padding) 790 modified sckp = 0, swsp = 0, del = 1, chnl = 11, spdp = 0, sdta = 1 system word length = data word length 4
main revisions and additions in this edition rev. 2.00 sep. 07, 2007 page 1155 of 1164 rej09b0321-0200 item page revision (see manual for details) 19.6.1 configuration of rcan-et (4) can sleep mode 856 modified ? don't set mcr5 (sleep mode) without entering halt mode. ? after setting mcr1, make sure that gsr4 is set and the rcan-et has entered halt mode before clearing mcr1. 20.7.7 usage note when shifting to single mode during a/d conversion 896 added 25.2.9 deep standby oscillation settling clock select register (dscnt) 999 notes added bit bit name description 2 to 0 cks[2:0] clock select : setting value clock select 000: 1 p * 1 001: 1/64 p * 1 010: 1/128 p * 1 011: 1/256 p * 2 100: 1/512 p * 2 notes: 1. do not use this setting. 2. set the clock so that it is equal to or longer than the oscillation settling time 2 on return from standby (t osc3 ). 25.2.10 deep standby cancel source flag register (dsfr) 1000, 1001 added note: * only 0 can be written after reading 1 to clear the flag. even when irq is input after a manual reset has been accepted as a source canceling deep standby, the irq flag is not set. 25.4.1 note on setting registers 1011 title added 25.4.2 note on canceling standby mode when an external clock is being input 1011 added
main revisions and additions in this edition rev. 2.00 sep. 07, 2007 page 1156 of 1164 rej09b0321-0200 item page revision (see manual for details) table a.1 pin states 1146 modified pin state power-down state type pin name software standby cs0 k cs6 to cs1 k rd k wr3 k wr2 k wr1 k wr0 k bc3 to bc0 k sdcs1 , sdcs0 k sdras k sdcas k sdwe k bus control dqm3 to dqm0 k
rev. 2.00 sep. 07, 2007 page 1157 of 1164 rej09b0321-0200 index numerics 16-bit counter mode................................ 614 16-bit/32-bit displacement ........................ 29 8-bit timers (tmr) ................................. 597 a a/d conversion time (multi mode and scan mode)................... 890 a/d conversion time (s ingle mode)........ 889 a/d conversion timing ........................... 889 a/d converter (adc) ............................. 871 a/d converter activation......................... 535 a/d converter characteristics................ 1142 a/d converter start request delaying function .................................... 525 a/d trigger input timing ....................... 1137 absolute address....................................... 29 absolute address accessing....................... 29 absolute maximum ratings................... 1101 ac characteris tics................................. 1110 ac characteristics measurement conditions ............................................. 1141 address array.................................. 184, 196 address array read .................................. 196 address errors......................................... 101 address map ........................................... 205 address map for each mailbox ............... 811 address-array write (associative ope ration) ............................ 197 address-array write (non-associative operation)..................... 197 addressing modes..................................... 30 advanced user debugger ii (aud-ii)............................................... 1021 analog input pi n ratings ......................... 895 arithmetic operation instructions ............. 48 b bit manipulation instructions .................... 59 bit synchronous circuit ........................... 763 block diagram............................................. 9 branch instructions ................................... 53 break detection and processing............... 723 break on data access cycle...................... 175 break on instruction fetch cycle.............. 174 bus state controller (bsc) ...................... 201 bus timing............................................. 1116 c cache ...................................................... 183 calculating exception handling vector table addresses ............................... 96 can interface ......................................... 809 can sleep mode ..................................... 855 canceling software standby mode .......... 629 cascaded conn ection............................... 614 changing the di vision ratio ....................... 88 changing the freq uency .................... 87, 629 changing the multiplication rate............... 87 clock frequency control circuit................. 75 clock operating modes ............................. 77 clock pulse generator (cpg) .................... 73 clock timin g ......................................... 1110 clocked synchronous serial format......... 753 coherency of cache and external memory ..................................... 196 compare match count mode ................... 615 compare match signal............................. 612 complementary pwm mode .................. 489 control signal timing ............................ 1114 controller area network (rcan-et)...... 805 cpu........................................................... 19
rev. 2.00 sep. 07, 2007 page 1158 of 1164 rej09b0321-0200 crystal oscillator....................................... 75 csc interface.......................................... 238 d d/a converter (dac) ............................. 897 d/a converter characteristics ............... 1143 d/a output hold function in software standby mode ........................... 902 data array ....................................... 184, 197 data array read ....................................... 198 data array write ...................................... 198 data format in registers ............................ 24 data formats in memory ........................... 24 data transfer instructions.......................... 44 dc characteris tics................................. 1102 dead time compensation ........................ 530 definitions of a/d conversion accuracy.................................................. 891 delayed branch instructions ..................... 27 denormalized numbers............................. 66 direct memory access controller (dmac) ................................................. 301 displacement accessing............................ 29 divider...................................................... 75 e effective address calculation .................... 30 electrical charact eristics ....................... 1101 equation for getting scbrr value......... 688 exception handling ................................... 91 exception hand ling state........................... 61 exception handling vector table ............... 95 exception source generation immediately after delayed branch instruction.............. 110 exceptions triggered by instructions ...... 107 external pulse width measurement......... 529 external trigger input timing .................. 890 f floating point operation instructions ........ 56 floating-point ranges ................................ 65 floating-point registers ............................. 67 format of double-precision floating-point number ............................... 64 format of single-precision floating-point number ............................... 63 fpu exception........................................... 71 fpu-related cpu instructions................... 58 full-scale error........................................ 892 g general illegal in structions ..................... 108 general registers ....................................... 19 global base register (gbr)....................... 22 h halt mode................................................ 854 h-udi commands................................. 1016 h-udi interrupt ............................ 133, 1019 h-udi reset .......................................... 1019 h-udi-related pin timing ..................... 1138 i i/o port timing ...................................... 1137 i/o ports .................................................. 903 i 2 c bus format......................................... 744 i 2 c bus interface 3 (iic3)........................ 725 i 2 c bus interface 3 (iic3) usage note ...... 766 id reorder .............................................. 820 iic3 module timing............................... 1133 immediate data.......................................... 28 immediate data accessing ......................... 28 immediate data format .............................. 25 initial values of general registers .............. 23 instruction features ................................... 26
rev. 2.00 sep. 07, 2007 page 1159 of 1164 rej09b0321-0200 instruction format ..................................... 34 instruction set ........................................... 38 integer division instructions ................... 109 interrupt excepti on handling................... 106 interrupt exception handling vectors and prior ities ........................................... 137 interrupt priority level............................. 105 interrupt response time ........................... 149 irq interrupts ......................................... 134 j jump table base register (tbr) ................ 22 l list of registers ..................................... 1027 load-store architecture ............................. 27 local acceptance filter mask (lafm).... 817 logic operation instructions ..................... 51 lru ........................................................ 185 m mailbox................................................... 808 mailbox cont rol ...................................... 809 mailbox structure.................................... 812 manual reset ........................................... 100 master receive operation......................... 747 master transmit operation ....................... 745 measurement ci rcuit ............................. 1141 memory-mapped cache .......................... 196 message control field.............................. 813 message data fields................................. 818 message receive sequence ...................... 861 message transmission sequence.............. 859 micro processor interface (mpi)............. 808 module standby fu nction ...................... 1011 mtu2 functions ..................................... 370 mtu2 interr upts ..................................... 533 mtu2 module timing ........................... 1129 mtu2 output pin initialization ............... 564 multi mode.............................................. 883 multi-function timer pulse unit 2 (mtu2)................................................... 369 multiplexed pin table (port a) ................ 921 multiplexed pin table (port b) ................ 923 multiplexed pin table (port c) ................ 925 multiplexed pin table (port d) ................ 927 multiplexed pin table (port e) ................ 928 multiplexed pin table (port f)................. 928 multiply and accumulate register high (mach)............................................ 22 multiply and accumulate register low (macl) ............................................. 22 multiply/multiply-and- accumulate operations............................... 27 n nan........................................................... 66 nmi interrupt.......................................... 133 noise filter .............................................. 757 nonlinearity error.................................... 892 non-numbers (nan) ................................. 65 note on making a transition to deep standby mode................................ 1010 note on using a pll oscillation circuit..... 90 note on using crystal resonator................. 89 o offset error.............................................. 892 on-chip peripheral module interrupts ........... 135 on-chip ram ......................................... 983 operation in asynch ronous mode............ 704 operation in clocked synchronous mode 713
rev. 2.00 sep. 07, 2007 page 1160 of 1164 rej09b0321-0200 p package dimensions.............................. 1150 page conflict ........................................... 984 permissible signal source impedance ..... 895 pin assignments ........................................ 10 pin function contro ller (pfc) ................. 921 pint interrupts....................................... 135 pll circuit................................................ 75 power-down modes ................................ 985 power-down state ..................................... 61 power-on reset .......................................... 98 prefetch operation (only for oper and cache)......................... 193 procedure register (pr) ............................ 23 processing of analog input pins .............. 894 program counter (pc)............................... 23 program execution state............................ 61 q quantization error................................... 892 r rcan-et bit rate calculation ................ 831 rcan-et interrupt sources ................... 865 rcan-et memory map......................... 810 realtime cloc k (rtc)............................. 635 receive data sampling timing and receive margin (async hronous mode) ..... 724 reconfiguration of mailbox.................... 863 register bank error exception handling.......................... 103, 158 register bank errors................................ 103 register bank exception.......................... 158 register banks .................................. 23, 154 register banks and bank control registers ...................................... 155 registers aback0 ............................................ 847 acswr .............................................. 237 adcsr ............................................... 876 addr ................................................. 874 bamr................................................. 165 bar .................................................... 164 bbr .................................................... 168 bcr .................................................... 828 bdmr................................................. 167 bdr .................................................... 166 brcr.................................................. 170 ccr .................................................... 186 ckiocr ............................................... 86 cs1wcntn........................................ 217 cs2wcntn........................................ 219 csmodn ............................................ 214 csncnt ............................................. 209 csnrec.............................................. 211 dacr ................................................. 899 dadr0 ............................................... 899 dadr1 ............................................... 899 dmasts ............................................ 340 dmcbct ........................................... 310 dmcdadr........................................ 309 dmcnta ........................................... 320 dmcntb ........................................... 328 dmcsadr......................................... 308 dmedet............................................ 338 dmicnt............................................. 335 dmicnta.......................................... 336 dmists.............................................. 337 dmmod............................................. 314 dmrbct ........................................... 313 dmrdadr........................................ 312 dmrsadr......................................... 311 dmscnt............................................ 334 dreqer ............................................ 129 dscnt ............................................... 999 dsfr ................................................ 1000 fpscr .................................................. 68 fpul..................................................... 69
rev. 2.00 sep. 07, 2007 page 1161 of 1164 rej09b0321-0200 frqcr ................................................. 83 gsr .................................................... 825 ibcr................................................... 127 ibnr................................................... 128 iccr................................................... 729 icdrr................................................ 742 icdrs ................................................ 742 icdrt ................................................ 742 icier.................................................. 736 icmr.................................................. 734 icr ..................................................... 121 icsr ................................................... 738 imr..................................................... 839 ipr...................................................... 119 irqrr................................................ 123 irr ..................................................... 833 mbimr0 ............................................ 850 mcr ................................................... 819 nf2cyc............................................. 743 pacr.................................................. 932 padr ................................................. 904 paior ................................................ 931 papr .................................................. 906 pbcr.................................................. 943 pbdr.................................................. 908 pbior ................................................ 942 pbpr .................................................. 910 pccr.................................................. 957 pcdr.................................................. 912 pcior ................................................ 956 pcpr .................................................. 913 pdcr.................................................. 968 pddr ................................................. 915 pdior ................................................ 967 pdpr .................................................. 916 pecr .................................................. 975 pepr................................................... 917 pfcr .................................................. 979 pfdr .................................................. 919 pfior................................................. 978 pfpr ................................................... 920 pinter .............................................. 125 pirr.................................................... 126 r64cnt.............................................. 638 ramkp .............................................. 998 rcr .................................................... 653 rdayar............................................ 650 rdaycnt ......................................... 643 rec..................................................... 840 rfpr0................................................. 849 rhrar............................................... 648 rhrcnt ............................................ 641 rminar ............................................ 647 rmincnt .......................................... 640 rmonar........................................... 651 rmoncnt ........................................ 644 rsecar............................................. 646 rseccnt .......................................... 639 rwkar.............................................. 649 rwkcnt ........................................... 642 rxpr0 ................................................ 848 ryrar............................................... 652 ryrcnt ............................................ 645 sar (iic3).......................................... 741 scbrr................................................ 688 scfcr ................................................ 696 scfdr................................................ 698 scfrdr ............................................. 671 scfsr ................................................ 680 scftdr ............................................. 672 sclsr ................................................ 701 scrsr ................................................ 671 scscr ................................................ 676 scsmr ............................................... 673 scsptr .............................................. 699 sctsr ................................................ 672 sdbpr.............................................. 1015 sdckscnt........................................ 236 sdcmcnt.......................................... 213 sddpwdcnt.................................... 229
rev. 2.00 sep. 07, 2007 page 1162 of 1164 rej09b0321-0200 sdir......................................... 225, 1016 sdmadr ........................................... 230 sdmmod........................................... 233 sdmtr............................................... 231 sdpwdcnt ...................................... 228 sdrfcnt0 ........................................ 222 sdrfcnt1 ........................................ 223 sdstr................................................ 234 ssicr................................................. 771 ssirdr .............................................. 782 ssisr ................................................. 777 ssitdr .............................................. 782 stbcr ............................................... 988 sycbeen.......................................... 288 sycbests1 ...................................... 289 sycbests2 ...................................... 291 sycbesw ......................................... 294 syscr ............................................... 996 tadcobra_4 .................................. 427 tadcobrb_4 .................................. 427 tadcora_4..................................... 426 tadcorb_4 ..................................... 426 tadcr .............................................. 423 tbter ............................................... 451 tbtm................................................. 421 tcbr.................................................. 448 tccr.................................................. 603 tcdr ................................................. 447 tcnt.......................................... 427, 600 tcntcmpclr ................................. 408 tcnts ............................................... 446 tcora .............................................. 600 tcorb............................................... 601 tcr ............................................ 382, 601 tcsr .................................................. 605 tcsystr........................................... 433 tddr ................................................. 447 tder.................................................. 453 tec .................................................... 840 tgcr ................................................. 444 tgr .................................................... 428 ticcr................................................. 422 tier ................................................... 409 tior ................................................... 389 titcnt .............................................. 450 titcr................................................. 448 tmdr................................................. 386 tocr.................................................. 437 toer.................................................. 436 tolbr ............................................... 443 trwer .............................................. 435 tsr ..................................................... 414 tstr................................................... 429 tsyr .................................................. 431 twcr................................................. 454 txack0............................................. 846 txcr0................................................ 845 txpr0 ................................................ 842 txpr1 ................................................ 842 umsr ................................................. 851 wrcsr .............................................. 626 wtcnt .............................................. 623 wtcsr............................................... 624 relationship between clock operating mode and frequency range ........................ 78 reset state ................................................. 61 reset-synchronized pwm mode............. 486 restoration fro m bank............................. 156 restoration from stack ............................ 157 restriction on dm ac usage................... 723 risc-type instruction set.......................... 26 rounding................................................... 70 rtc crystal oscillator circuit .................. 662 s saving to bank ........................................ 155 saving to stack ........................................ 157 scan mode............................................... 885 scif interrupt sources ............................ 721
rev. 2.00 sep. 07, 2007 page 1163 of 1164 rej09b0321-0200 scif module timing ............................. 1132 searching cache ...................................... 191 sending a break signal ............................ 723 serial communication interface with fifo (scif) ................................... 665 serial sound inte rface (ssi) .................... 767 setting analog input voltage ........... 893, 902 shift instructions....................................... 52 sign extension of word data ..................... 26 single mode ............................................ 880 slave receive op eration........................... 752 slave transmit operation ......................... 749 sleep mode ........................................... 1002 slot illegal inst ructions ........................... 108 software standby mode......................... 1003 stack after interrupt exception handling.................................. 148 stack status after exception handling ends.......................................... 111 standby control circuit.............................. 75 status register (sr)................................... 20 system control instructions....................... 54 t t bit .......................................................... 28 tap controller ...................................... 1017 test mode settings .................................. 857 time quanta is defined............................ 828 timing to clear an interrupt source ......... 160 transfer rate............................................ 731 trap instructions ..................................... 108 types of exception handling and priority order ............................................. 91 u ubc trigger tim ing ............................... 1128 udtdo output timing .......................... 1018 unconditional branch instructions with no delay slot ...................................... 27 user break controller (ubc)................... 161 user break interrupt ................................ 133 user debugging inte rface (h-udi) ....... 1013 using interval timer mode....................... 631 using watchdog timer mode ................... 630 v vector base register (vbr)....................... 22 w watchdog timer (wdt) .......................... 621 watchdog timer timing ......................... 1131 write-back buffer (only for oper and cache) ......................... 194
rev. 2.00 sep. 07, 2007 page 1164 of 1164 rej09b0321-0200
renesas 32-bit risc microcomputer hardware manual sh7201 group publication date: rev.1.00, jul. 31, 2006 rev.2.00, sep. 07, 2007 published by: sales strategic planning div. renesas technology corp. edited by: customer support department global strategic communication div. renesas solutions corp. ? 2007. renesas technology corp., all rights reserved. printed in japan.
sales strategic planning div. nippon bldg., 2-6-2, ohte-machi, chiyoda-ku, tokyo 100-0004, japan http://www.renesas.com refer to " http://www.renesas.com/en/network " for the latest and detailed information. renesas technology america, inc. 450 holger way, san jose, ca 95134-1368, u.s.a tel: <1> (408) 382-7500, fax: <1> (408) 382-7501 renesas technology europe limited dukes meadow, millboard road, bourne end, buckinghamshire, sl8 5fh, u.k. tel: <44> (1628) 585-100, fax: <44> (1628) 585-900 renesas technology (shanghai) co., ltd. unit 204, 205, aziacenter, no.1233 lujiazui ring rd, pudong district, shanghai, china 200120 tel: <86> (21) 5877-1818, fax: <86> (21) 6887-7898 renesas technology hong kong ltd. 7th floor, north tower, world finance centre, harbour city, 1 canton road, tsimshatsui, kowloon, hong kong tel: <852> 2265-6688, fax: <852> 2730-6071 renesas technology taiwan co., ltd. 10th floor, no.99, fushing north road, taipei, taiwan tel: <886> (2) 2715-2888, fax: <886> (2) 2713-2999 renesas technology singapore pte. ltd. 1 harbour front avenue, #06-10, keppel bay tower, singapore 098632 tel: <65> 6213-0200, fax: <65> 6278-8001 renesas technology korea co., ltd. kukje center bldg. 18th fl., 191, 2-ka, hangang-ro, yongsan-ku, seoul 140-702, korea tel: <82> (2) 796-3115, fax: <82> (2) 796-2145 renesas technology malaysia sdn. bhd unit 906, block b, menara amcorp, amcorp trade centre, no.18, jalan persiaran barat, 46050 petaling jaya, selangor darul ehsan, malaysia tel: <603> 7955-9390, fax: <603> 7955-9510 renesas sales offices colophon 6.0

sh7201 group hardware manual


▲Up To Search▲   

 
Price & Availability of R5S72011

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

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


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